summaryrefslogtreecommitdiffstats
path: root/llgo/irgen
Commit message (Collapse)AuthorAgeFilesLines
* [llgo]: fix compilation under current llvmKristina Brooks2019-01-211-7/+3
| | | | | | | | | | | | | | Patch rL322965 changed how intrinsics for memset and memzero were defined. This causes a regression in LLGO making it no longer buidable. In addition to that one pass was renamed, so this also addresses the pass naming disparity. I removed all split stack related bits from this patch as as asked. Differential Revision: https://reviews.llvm.org/D56638 llvm-svn: 351722
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1925-100/+75
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* irgen: Create functions instead of global variables for builtin hash and ↵Peter Collingbourne2017-06-041-2/+2
| | | | | | | | | equal algorithms. These are in fact functions, and have function type, so it is invalid to represent them using global variables. llvm-svn: 304689
* [llgo] Remove support for LLVM attributesMeador Inge2016-12-061-32/+0
| | | | | | | | | | llgo supports the application of LLVM attributes to global objects and functions. This "feature" is undocumented and untested. As discusses in D27442, it should be removed. Differential Revision: https://reviews.llvm.org/D27474 llvm-svn: 288843
* [llgo] set debuglocs for calls in synthetic functionsAndrew Wilkins2016-12-061-1/+1
| | | | | | | | | | | | | | | | Synthesized functions do not have valid locations, and so we were not setting a debug location. Recent changes to DI require that function call instructions within a function having DI must have a location set. We just set the debug location to line=0, col=0. Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22905 llvm-svn: 288772
* [llgo] Update to use the latest IR attribute bindingsMeador Inge2016-12-066-34/+64
| | | | | | | | A recent commit (r286087) to the LLVM Go bindings that changed things over to use the new attribute API broke llgo. This commit updates llgo accordingly. llvm-svn: 288769
* [llgo] Roll gofrontend forwardAndrew Wilkins2016-03-155-160/+155
| | | | | | | | | | | | | | | | | Switch gofrontend to using go.googlesource.com, and update to 81eb6a3f425b2158c67ee32c0cc973a72ce9d6be. There are various changes required to update to the go 1.5 runtime: typemap.go is changed to accommodate the change in representation for equal/hash algorithms, and the removal of the zero value/type. CMakeLists.txt is updated to add the build tree to the package search path, so internal packages, which are not installed, are found. various files changes due to removal of __go_new_nopointers; the same change as in D11863, but with NoUnwindAttribute added to the added runtime functions which are called with "callOnly". minor cleanups in ssa.go while investigating issues with unwinding/panic handling. Differential Revisision: http://reviews.llvm.org/D15188 llvm-svn: 263536
* [llgo] irgen: always use TargetMachine's data layoutAndrew Wilkins2015-09-252-28/+0
| | | | | | | | | | | | | | | | | | | | | | | Summary: Another attempt at resolving the runtime assertion in llgoi due to data layout mismatch between module and execution engine. The X86 data layout constant appears to be unnecessary, and does not match what the execution engine picks. Using the registered Target, we pick the same data layout as the execution engine. While I was in the vicinity, I deleted the last remnants of PNaCl support. Reviewers: pcc Subscribers: jfb, llvm-commits, dschuff Differential Revision: http://reviews.llvm.org/D12630 llvm-svn: 248565
* [llgo] set function personality with SetPersonalityAndrew Wilkins2015-07-151-1/+2
| | | | | | | | | | | | | | | Summary: If a function requires a landing pad, set the personality function. Requires D11116. Reviewers: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11117 llvm-svn: 242290
* Roll gofrontend to 15a24202fa42.Peter Collingbourne2015-04-051-1/+1
| | | | | | | | Takes us to Go 1.4.2 plus a number of bug fixes. Differential Revision: http://reviews.llvm.org/D8830 llvm-svn: 234136
* Roll gofrontend to 07baa07598ea; roll libffi to r219477.Peter Collingbourne2015-04-055-28/+36
| | | | | | | | | Incorporates https://codereview.appspot.com/198770044, which causes us to start using the static chain register for closures instead of __go_{get,set}_closure. Differential Revision: http://reviews.llvm.org/D8829 llvm-svn: 234135
* Roll gofrontend to a6e10414311aPeter Collingbourne2015-04-052-3/+4
| | | | | | | | | | | | | | This takes us to Go 1.4. Also includes a couple of changes to the test suite, both in the runtime package: - Disable TestSetPanicOnFault. We cannot support this scenario at all, due to LLVM's lack of non-call exceptions. - Tweak TestFinalizerType. This test only passes with two GC runs. Differential Revision: http://reviews.llvm.org/D8828 llvm-svn: 234134
* Roll gotools to d4e70101.Peter Collingbourne2015-04-051-2/+3
| | | | | | | | | | | | Most importantly, this gives us https://go-review.googlesource.com/7533 which fixes a bug in go/ssa that caused test failures in the Go 1.4 standard library. Also remove the go1.4 tag workaround. We no longer need it now that we ship llgo-go. Differential Revision: http://reviews.llvm.org/D8827 llvm-svn: 234133
* llgoi: Fix type identity for imported binary packages.Peter Collingbourne2015-03-181-2/+6
| | | | | | | | | | | | go/loader creates a fresh package map for each source package it imports. In llgoi this caused binary imported packages to be imported anew for every input line, resulting in spurious type errors and panics in go/ssa when encountering previously imported types. Fix this by setting types.Config.Packages to our internal package map. Differential Revision: http://reviews.llvm.org/D8409 llvm-svn: 232617
* irgen: don't emit debug metadata for localsAndrew Wilkins2015-01-291-12/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: The debug metadata we generate is wrong, and is now causing build failures. This revision disables the only llvm.dbg.declare calls we make. (There is also a drive-by fix to CMakeLists.txt, adding in a missing .go dependency.) Fixes http://llvm.org/bugs/show_bug.cgi?id=22330 Reviewers: pcc Reviewed By: pcc Subscribers: dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D7222 llvm-svn: 227403
* irgen: expose DisableUnusedImportCheck flagPeter Collingbourne2015-01-141-0/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D6956 llvm-svn: 225946
* irgen: expose PackageCreated hookPeter Collingbourne2015-01-141-1/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D6955 llvm-svn: 225945
* Roll gotools to 47f2109c.Peter Collingbourne2015-01-1321-37/+37
| | | | | | | | | | | At the same time, perform a number of simplifications: - Rename go.tools directory to gotools. - Import only the go directory; all required Go analysis code and its dependencies have now been moved to this directory. llvm-svn: 225825
* [llgo] irgen: generate switch instructionsAndrew Wilkins2015-01-082-1/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With this patch, llgo uses ssautil.Switches to reconstitute (and synthesise) switches, which can then be lowered to lookup tables, trees, etc. We currently only handle integer const case switches. We erase the comparison blocks (other than the initial block), and generate a switch instruction at the end of the block starting the if-else-if chain. ssautil.Switches does not remove duplicate const cases (e.g. same operands for "||"), so we do this in llgo for now. Test Plan: lit test added Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6831 llvm-svn: 225433
* [llgo] Elide alloca for unused received values in selectAndrew Wilkins2014-12-312-29/+32
| | | | | | | | | | | | | | | | Summary: If a receive case in a select statement is not assigned to a named variable, then we can eliminate the alloca and copy at runtime. Test Plan: lit test added Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6785 llvm-svn: 225033
* irgen: modify the ABI to use init guards instead of priorityPeter Collingbourne2014-12-312-11/+71
| | | | | | | | | | | | | | | | | | | | | | | | The new ABI is simpler for use cases such as dynamically loaded packages. The calling convention for import functions is similar to what go/ssa would produce if BareInits were cleared. However, simply clearing this flag causes two additional issues: 1) We would need to special case the 'init$guard' variable (see discussion in https://codereview.appspot.com/78780043/). 2) The call to __go_register_gc_roots needs to appear in the right place, i.e. after the guard check. Making this check appear in the right place with non-bare inits seems unreliable at best. So we keep BareInits set and generate the necessary code manually. It is still possible to get the old ABI by specifying a path to a gccgo installation. Differential Revision: http://reviews.llvm.org/D6804 llvm-svn: 225030
* irgen: make it possible to use a custom importerPeter Collingbourne2014-12-311-22/+41
| | | | | | Differential Revision: http://reviews.llvm.org/D6803 llvm-svn: 225029
* irgen: return a types.Package to the compiler clientPeter Collingbourne2014-12-311-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D6802 llvm-svn: 225028
* irgen: introduce ManglePackagePath functionPeter Collingbourne2014-12-311-7/+7
| | | | | | | | | This is useful for clients that need to use llgo's mangling of the package path to look up a specific function within a given package. Differential Revision: http://reviews.llvm.org/D6801 llvm-svn: 225027
* irgen, driver: modify Compiler.Compile to take a FileSet and FilesPeter Collingbourne2014-12-312-52/+5
| | | | | | | | | | | This change allows clients to generate IR using "files" received from locations other than the file system. The regular file parser is moved to a new library, "driver", which is intended to eventually contain much of the logic from the existing driver. Differential Revision: http://reviews.llvm.org/D6794 llvm-svn: 225026
* irgen: remove unused compiler.runtimetypespkg field.Peter Collingbourne2014-12-291-4/+0
| | | | llvm-svn: 224931
* irgen: do not emit an extra terminator for panic thunksPeter Collingbourne2014-12-282-4/+6
| | | | | | | | Found with GoSmith. Differential Revision: http://reviews.llvm.org/D6714 llvm-svn: 224904
* Test commitAndrew Wilkins2014-12-191-0/+1
| | | | | | Just changing whitespace to test commit access... llvm-svn: 224565
* irgen: fix canAvoid*Peter Collingbourne2014-12-171-10/+20
| | | | | | | | | | | | | | | | Patch by Andrew Wilkins! canAvoidElementLoad and canAvoidLoad were incorrectly eliding loads when an index expression is used as an another array index expression. This led to a panic. See comments on https://github.com/go-llvm/llgo/issues/175 Test Plan: lit test added Differential Revision: http://reviews.llvm.org/D6676 llvm-svn: 224420
* Use the object's package to mangle method names, rather than the receiver's ↵Peter Collingbourne2014-12-161-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | package If we use the receiver's package, we can end up with identical manglings for different functions. Consider: package p type U struct{} func (U) f() package q import "p" type T struct { p.U } func (T) f() The method set of *T has two synthetic methods named (*T).f(); one forwards to (T).f(), and the other to (U).f(). Previously, we were distinguishing them by the receiver's package, and in this case because both methods have the same receiver, they received the same name. The methods are correctly distinguished by the package owning the identifier "f", which is available via f.Object().Pkg(). Differential Revision: http://reviews.llvm.org/D6673 llvm-svn: 224357
* Update to new bindings.Peter Collingbourne2014-12-131-4/+4
| | | | llvm-svn: 224180
* Optimize comparisons to empty string.Peter Collingbourne2014-12-091-0/+16
| | | | | | | | Geo-mean performance improvement of 0.2% (-0.3% - 0.9% @ 95% CI). Differential Revision: http://reviews.llvm.org/D6569 llvm-svn: 223728
* Initial commit of llgo.Peter Collingbourne2014-11-2725-0/+7324
llvm-svn: 222857
OpenPOWER on IntegriCloud