This is an archive of the discontinued LLVM Phabricator instance.

[llgo] Roll gofrontend forward
ClosedPublic

Authored by axw on Dec 3 2015, 6:17 AM.

Details

Reviewers
pcc
Summary

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.

Diff Detail

Event Timeline

axw updated this revision to Diff 41746.Dec 3 2015, 6:17 AM
axw retitled this revision from to [llgo] Roll gofrontend forward.
axw updated this object.
axw added a reviewer: pcc.
axw added a subscriber: llvm-commits.
axw planned changes to this revision.Jan 7 2016, 11:03 PM

I've just come back to this and found that it's broken. Unsure of what's changed in the interim, but I get "panic: panic during panic" caused by type descriptor comparisons. Will come back to this when I have time.

axw updated this revision to Diff 45463.Jan 20 2016, 4:35 PM

Revert removal of __go_runtime_error

No longer causing errors. Have not bisected
to find out what the issue is yet.

axw updated this object.Jan 26 2016, 12:16 AM
In D15188#331740, @axw wrote:

Revert removal of __go_runtime_error

No longer causing errors. Have not bisected
to find out what the issue is yet.

The failures stopped in r256202.

axw added a comment.Jan 26 2016, 12:18 AM

@pcc Ping. This is ready for review now.

pcc added inline comments.Feb 7 2016, 7:33 PM
irgen/typemap.go
1484–1498

I don't think you need to be able to call arbitrary closures in the algorithm implementations. Since the identity of the element type is statically known, you can just call the function directly. The only place where you should need to deal with closure descriptors is when building the type descriptor struct.

update_third_party.sh
74–76

Will this work now that autoconf support is removed from LLVM? We might need to make our own copies of the files in the llgo repo.

axw updated this revision to Diff 47306.Feb 9 2016, 5:06 AM
  • Fix autoconf file copying
  • Call hash/equal functions directly, not through descriptors.
axw added a comment.Feb 9 2016, 5:07 AM

@pcc Thanks, PTAL.

irgen/typemap.go
1484–1498

Yep, thanks, I'm storing functions and descriptors, so reverted the hash/equal calls.

update_third_party.sh
74–76

config.guess was relocated to cmake/config.guess, so I'll change it to copy from there.
config.sub was removed, so adding it as llgo/autoconf/config.sub.

axw added a comment.Feb 18 2016, 4:09 AM

Ping. Once this is in, I'll look at updating to 1.6.

In D15188#355493, @axw wrote:

Ping. Once this is in, I'll look at updating to 1.6.

I'm also keen to see this submitted and then seeing the update to 1.6.

pcc accepted this revision.Mar 13 2016, 9:02 PM
pcc edited edge metadata.

Sorry for the delay. LGTM, thanks!

This revision is now accepted and ready to land.Mar 13 2016, 9:02 PM
axw updated this revision to Diff 50694.Mar 14 2016, 9:59 PM
axw edited edge metadata.

TargetMachine.TargetData -> TargetMachine.CreateTargetData

pcc added inline comments.Mar 14 2016, 10:02 PM
cmd/gllgo/gllgo.go
490–492

Was this change intended?

pcc added a comment.Mar 14 2016, 10:07 PM

Ah, I see that LLVMAddTargetData is no more. LGTM then.

axw added inline comments.Mar 14 2016, 10:08 PM
cmd/gllgo/gllgo.go
489–493

Yes, sorry, should have commented. LLVMAddTargetData has been removed. AFAICT, PM now uses the data layout from the module.

axw closed this revision.Mar 14 2016, 10:59 PM

Closed by rL263536