This is an archive of the discontinued LLVM Phabricator instance.

[JumpThreading] Avoid threadThroughTwoBasicBlocks when PredPred BB ends with indirectbranch
ClosedPublic

Authored by Ch1p on Jul 6 2022, 5:40 AM.

Details

Summary

Since we can't change the destination of indirectbr, so when encounter indirectbr as PredPredBB terminator, we should pass it.

Diff Detail

Event Timeline

Ch1p created this revision.Jul 6 2022, 5:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2022, 5:40 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Ch1p requested review of this revision.Jul 6 2022, 5:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2022, 5:40 AM
Ch1p edited the summary of this revision. (Show Details)Jul 6 2022, 6:08 AM
Ch1p added reviewers: dongAxis, nikic.
Ch1p removed a reviewer: dongAxis.Jul 6 2022, 6:20 AM
nikic accepted this revision.Jul 6 2022, 7:55 AM

LG

Currently, we should also be checking for callbr as well, but I hope that the need for that goes away with D129205 anyway.

llvm/test/Transforms/JumpThreading/indirectbr-in-predpred.ll
1

Please use update_test_checks.py

This revision is now accepted and ready to land.Jul 6 2022, 7:55 AM
Ch1p updated this revision to Diff 442764.Jul 6 2022, 8:22 PM

Use update_test_checks.py to generate testcase.

nikic added a comment.Jul 7 2022, 12:16 AM

Do you need me to commit this for you? If so, please provide the "Name <email>" to use as attribution for the commit.

Ch1p marked an inline comment as done.Jul 7 2022, 12:36 AM

Do you need me to commit this for you? If so, please provide the "Name <email>" to use as attribution for the commit.

That would be great if you could commit this for me! You could use "ChenYang Li <ch1p@foxmail.com>" as attribution for this commit. Thanks for your help!

This revision was landed with ongoing or failed builds.Jul 8 2022, 12:30 AM
This revision was automatically updated to reflect the committed changes.