This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel][IRTranslator] Support PHI instructions in landingpad blocks
ClosedPublic

Authored by kschwarz on Aug 18 2020, 7:11 AM.

Details

Summary

The check for the landingpad instructions was overly restrictive. In optimimized builds PHI nodes can appear
before the landingpad instructions, resulting in a fallback to SelectionDAG.

This change relaxes the check to allow PHI nodes.

Diff Detail

Event Timeline

kschwarz created this revision.Aug 18 2020, 7:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2020, 7:11 AM
kschwarz requested review of this revision.Aug 18 2020, 7:11 AM
arsenm added inline comments.Aug 18 2020, 7:54 AM
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
2032

Is the fixme still relevant?

arsenm added inline comments.Aug 18 2020, 9:44 AM
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
128

Is it legal to have debug info before the landing pad? If so can you add a test with that in the way too?

kschwarz added inline comments.Aug 19 2020, 1:53 AM
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
2032

I think so. Windows uses catchswitch/catchpad instructions for exception handling AFAIK, which aren't handled yet.

llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
128

Seems its not legal. From LangRef:

[...] ‘exception’ label is required to have the “landingpad” instruction, which contains the information about the behavior of the program after unwinding happens, as its first non-PHI instruction.

arsenm accepted this revision.Aug 19 2020, 10:20 AM
This revision is now accepted and ready to land.Aug 19 2020, 10:20 AM