This is an archive of the discontinued LLVM Phabricator instance.

[VE] Support llvm.eh.sjlj.lsda
ClosedPublic

Authored by kaz7 on Dec 25 2020, 4:05 AM.

Details

Summary

In order to support SJLJ exception, implement llvm.eh.sjlj.lsda first.
Add regression test also.

Diff Detail

Event Timeline

kaz7 created this revision.Dec 25 2020, 4:05 AM
kaz7 requested review of this revision.Dec 25 2020, 4:05 AM
simoll added inline comments.Jan 4 2021, 1:18 AM
llvm/lib/Target/VE/VEISelLowering.cpp
1541

I suppose you could re-use the type of Op here

1545

typo Creat

1557

style: else after return

kaz7 added inline comments.Jan 4 2021, 1:33 AM
llvm/lib/Target/VE/VEISelLowering.cpp
1541

I'm not sure about it. Do you have any strategies to decide either Op.getValueType() or TLI.getPointerTy()? All other architectures use TLI.getPointerTy() to implement lsda. It's really difficult to decide it with certain reasons.

kaz7 updated this revision to Diff 314334.Jan 4 2021, 1:50 AM

Update following suggestions. Use TLI.getPoitnerTy() this time since
lsda expansion uses machine value type (MVT) instead of value type
structure (EVT) here. Using EVT may require some conversions later.

kaz7 marked 2 inline comments as done.Jan 4 2021, 3:34 AM
simoll added inline comments.Jan 4 2021, 5:26 AM
llvm/lib/Target/VE/VEISelLowering.cpp
1541

When isel calls LowerOperation, all types are MVTs because all EVTs have been legalized. Op.getValueType() should give you the exact same MVT as TLI.getPointerTy().
AFAIK only LowerOperationWrapper is where you have to be careful about operand EVTs but we are not using this in upstream (yet).

kaz7 updated this revision to Diff 314376.Jan 4 2021, 6:58 AM

Change to use Op.getSimpleValueType() as suggested.

kaz7 added inline comments.Jan 4 2021, 7:02 AM
llvm/lib/Target/VE/VEISelLowering.cpp
1541

I don't understand the point of this. If you say re-using Op's type is better, I think it may be true. Then, I watch other architectures using TLI.getPointerTy a lot, I think following others may be better. Do you know why other architectures use TLI.getPoitnerTy so often? For historical reason or something? Anyway, I change it as you suggested.

simoll accepted this revision.Jan 5 2021, 12:59 AM
simoll added inline comments.
llvm/lib/Target/VE/VEISelLowering.cpp
1541

Yeah, it really is more a bikeshedding discussion given how rarely this is called in practice.. the point of using Op.getValueType() is that it's non-virtual and the MVT object already exists. TLI.getPointerTy() is virtual and the default implementation constructs the MVT from scratch every time.

This revision is now accepted and ready to land.Jan 5 2021, 12:59 AM
kaz7 added inline comments.Jan 5 2021, 1:03 AM
llvm/lib/Target/VE/VEISelLowering.cpp
1541

virtual. That makes sense to not using it.

This revision was landed with ongoing or failed builds.Jan 5 2021, 1:06 AM
This revision was automatically updated to reflect the committed changes.