This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Remove removeConditionalTailCalls
Needs ReviewPublic

Authored by yota9 on Jun 23 2022, 3:03 PM.

Details

Summary

We can treat conditional tail call both as call and false branch without CFG violations. Initially the BB containing CTC would always end with CTC instruction (as it is treated as tail call at this stage). The fall through FBB would also be added for this BB during CFG construction. The analyzeBranch would stop execution on finding isTailCall and initially would return nullptr for both CondBranch and UncondBranch. After BB reordering unconditional jump to FBB might be added by fixBranches (BB is treated normally as BB with one successor).

Diff Detail

Event Timeline

yota9 created this revision.Jun 23 2022, 3:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2022, 3:04 PM
yota9 requested review of this revision.Jun 23 2022, 3:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2022, 3:04 PM

FYI if you just want to test, I think you can publish this as "draft" using "arc diff --draft"

yota9 edited the summary of this revision. (Show Details)Jun 24 2022, 10:26 AM

@rafaelauler Thanks, I've decided to add proper description since currently I don't really see any examples when removeConditionalTailCalls would be necessary. We can discuss it in discord if it will be comfortable for you or @maksfb .