-
Notifications
You must be signed in to change notification settings - Fork 6
Update compiler to use latest LLVM version #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 121 commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
e9a396c
Start branch to rework LLVM generation
pschachte db7e36f
Remove all dependencies on llvm-hs and shim out all LLVM generation …
pschachte 0a4fcec
Compiler successfully builds, but doesn't generate LLVM
pschachte e0cccb2
A couple of minor code cleanups
pschachte 8dd1578
First version of prelude and set up for LLVM
pschachte 374d91d
Add generated .ll file as a sample.
pschachte 0b7f25d
Generate external declarations for resources.
pschachte aa201f3
Make resource globals undef instead of extern
pschachte 0b366b4
Clean up resource global declaration generation
pschachte 7d57433
Add code to write LPVM code into LPVM section
pschachte 213f4da
Don't add 1 to specified lengths of strings
pschachte 7b8dafd
Introduce LLVM state monad, currently just holding file handle
pschachte 4ee2df5
Generate LLVM function signatures: start of code generation
pschachte 4e108f5
Take signature info from ProcImpln (PrimProto instead of Proto)
pschachte c54ee49
pick lint
pschachte 20aba8d
First go at generating LLVM proc bodies; much is wrong.
pschachte eb806d8
Generate foreign LLVM instructions and simple branches. Will need t…
pschachte db51de2
Generate proper SSA; built and disassemble tuples for multi-argument…
pschachte 709ce50
Generate LLVM switches for LPVM forks with more than 2 branches.
pschachte 4a036d2
Generate C code to report sizes of C types. Start work on generatin…
pschachte c0078a7
Generate string constants and use them when generating code.
pschachte 8eebd76
Generate decimal integers as character constants in LLVM code.
pschachte c515ab3
Introduce new CPointer TypeRepresentation, used to represent opaque …
pschachte d0c9c27
Fix fencepost bug in switch generation.
pschachte 2279fa0
Implement LPVM cast, load, and store
pschachte 91d3e25
Now generates declarations of external called functions; generates g…
pschachte b6acab9
Define the size of a C pointer
pschachte a2aac0c
Generate correct form for Wybe strings; add code to generate constan…
pschachte 589d9ca
Handle lpvm access and mutate; improve logging
pschachte 509389c
Partially handle FlowOutByReference and FlowTakeReference
pschachte 9d77740
Add separate partitionArgsWithRefs function to handle by-ref arguments
pschachte 48598f7
Improve doc; start work on handling out-by-reference arguments.
pschachte 3700e77
Reformat description of LLVM output parts
pschachte bb87c90
regenerate src directory README
pschachte b0411d6
Improve LLVM module doc
pschachte f0c508e
Reorganise LLVM module
pschachte 3e34dce
More LLVM module reorg
pschachte 14de69b
Now handle FlowTakeReference and FlowOutByReference; untested.
pschachte 7fc2a89
Improve generated README.md
pschachte b89621f
fix duplicated types in type conversion exprs
pschachte 93f9754
Fix bugs in deferring calls; add more logging
pschachte cbaa7c4
Bug fixes, more logging
pschachte 0b57e4b
Slight cleanup
pschachte 4831253
avoid use of bitcast for var = var assignment
pschachte b211667
Use conversion instrs except for constants
pschachte bbe6200
bug fix: temp counter was messed up by expansion with fusion
pschachte 3e74e52
Properly set up LLVM monad for each proc
pschachte 3f1fda6
Eliminate unwanted args/parameters
pschachte ffd6056
Be more systematic with LLVM arguments; fix bug
pschachte 790711e
Generate HO calls
pschachte d9229b7
Supply new 'volatile' argument to memcpy intrinsic
pschachte 7d9d30e
Generate LLVM for proc specialisations, too
pschachte b6b916b
Systematially use LLVM names for instructions
pschachte 42b7269
typo
pschachte e705705
Fix type convertion during LLVM generation
pschachte 4097550
Support switching on signed integers.
pschachte db1a4e1
Add XXX comments
pschachte 1ac7ce4
Fix generation of switch defaults
pschachte 1d1576b
Ensure SSA form by renaming assigned variables
pschachte ed1afba
Fix generation of unboxed mutator
pschachte 036483f
Fix handling of load and store instructions
pschachte 5e12865
Log LLVM code; generate .s files on request
pschachte 52355e5
delete accidentally added file
pschachte 0c6d3dc
Improve compatibility with old LLVM generation
pschachte fd7ecd4
Fix empty variable name for main LLVM section
pschachte cfc9835
update version number to 0.2
pschachte 1abd35d
Fix problems with extern declarations
pschachte b3d8984
Write LLVM code for submodules along with parent
pschachte f23be39
Reduce change to logged LLVM code;
pschachte 5b15fea
Get most tests to pass
pschachte fbfdc76
Delete spurious directory
pschachte e7f1f2d
Distinguish between wybe strings and C strings
pschachte 0896ee1
filter out target triple when checking expected results.
pschachte ba8a12d
Bug fix: non-destructive lpvm mutate mutated wrong structure
pschachte 5975ec7
bug fix: declare wybe_malloc for non-destructive lpvm mutate
pschachte b28a0a9
Bug fix: lpvm cast fields of unboxed constructors while constructing.
pschachte e1802ee
Bug fix: support resources in submodules
pschachte af306fc
Track whether to prefix with 'tail' or 'musttail' based on alloca calls
pschachte f4c5c19
Finish omitted comment
pschachte 9f4d62c
some code reorganisation
pschachte 122c3c9
Fix handling of HO calls; drop mustinline in defs
pschachte 4cfbd87
Properly load outByRef value from the ref after the call, when it wa…
pschachte 25fa304
Insert date at top of ERRS file
pschachte f0e7e63
Allocate closures on the heap
pschachte 3db741c
Correct generation of HO trampoline
pschachte cb7efb8
Eliminate more unnecessary bitcasts
pschachte e7ec22d
more trivial bitcast removal test cases
pschachte fdff55d
XXX turn HO call to known closure into FO call
pschachte 429480d
refactor LLVM prescanning to be monadic
pschachte daebd55
Rename fns to generalise from strings to consts
pschachte d559fbf
Generate static constants for all-constant closures
pschachte 98bcfeb
Don't turn all HO arguments to i64
pschachte 150b7f7
Fix duplicated externs, building dynamic closures
pschachte d1a02c5
Add a log message
pschachte 8dcc68b
Store value through out-by-ref pointer as needed
pschachte a518123
Merge branch 'llvm-update' of https://github.com/pschachte/wybe into …
pschachte edb3516
Store floats in closures as floats, not ints
pschachte 4f6c32b
Fix handling of externs for mutually recursive modules
pschachte 26d43d9
No conversion needed for equivalent types + add doc
pschachte c7c6bb0
Handle conversions better
pschachte fa4a2a5
Ignore changes to source_filename and target triple in complex tests
pschachte 0aae332
Fix syntax error in last commit
pschachte b1e94e5
Fix bug in out-by-reference call argument
pschachte 1344ca7
Delete no-longer-used source files
pschachte c5bdc9a
Merge branch 'master' into llvm-update; fix compiler warning
pschachte fc3f575
Fix expected output for one test; fix test case to be more readable.
pschachte 9493353
Address most of Jame's review comments
pschachte 63ab5aa
Install llvm package for CI testing
pschachte b3956b2
Code cleanup, remove unused code, changesome XXX comments to TODO
pschachte 9db92bc
Update github CI runners to recent OSes; don't specify llvm 9
pschachte 84f9225
Try debugging CI workflow
pschachte 1ca0dd9
Another try to debug github CI
pschachte 6266c14
Heuristic for final-dump tests to show actual output for error cases …
pschachte 70f073e
Explicitly specify llvm version in ubuntu CI workflow
pschachte af66747
Also install llvm-18-dev for CI
pschachte 4acfc0a
Keep trying to get ubuntu workflow working
pschachte 777842a
attempt to fix ubuntu build; normalise spaced LLVM array type syntax …
jimbxb 2459b4f
Do LLVM type conversions (bitcasts) on call and return
pschachte 82fd896
Fix: delete .ll file after generating a .s file.
pschachte 8b44583
Fix generated trampolines
pschachte a77ac97
Delete accidental file; fix up documentation
pschachte 936c409
Some cleanups, mostly removing commented-out code
pschachte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,3 +58,5 @@ README.html | |
dist-newstyle | ||
stack.yaml.lock | ||
LOG* | ||
src/c_config | ||
src/CConfig.hs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" | ||
target triple = "arm64-apple-macosx14.0.0" | ||
|
||
; Declare the string constant as a global constant. | ||
@.1 = private unnamed_addr constant [17 x i8] c"hello from LLVM!\00" | ||
|
||
; External declaration of the puts function | ||
declare i32 @puts(ptr nocapture) nounwind | ||
|
||
; Definition of main function | ||
define i32 @main() { | ||
; Call puts function to write out the string to stdout. | ||
call i32 @puts(ptr @.1) | ||
ret i32 0 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.