This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] CTRLoop pseudo instructions should not be duplicated
ClosedPublic

Authored by tingwang on Aug 26 2022, 6:26 AM.

Details

Summary

Add isNotDuplicable to CTRLoop pseudo instructions, to avoid other pass such as early-tailduplication break the loop structure by duplicating pseudo instructions.

Attached test case will be added before and removed by this fix.

Diff Detail

Event Timeline

tingwang created this revision.Aug 26 2022, 6:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2022, 6:26 AM
tingwang requested review of this revision.Aug 26 2022, 6:26 AM

Attached test case will be added before and removed by this fix.

Do you mean you plan to remove the test case? I think the test case should still be kept and check that a ctr-loop is generated after this fix.

llvm/lib/Target/PowerPC/PPCInstr64Bit.td
576–578

Maybe we can add some comments for this change, like MTCTR8loop must be inside a loop-preheader, duplicating the loop-preheader block will break this assumption?

tingwang updated this revision to Diff 456507.Aug 29 2022, 6:08 PM

(1) Add comment.
(2) Update test case.

tingwang marked an inline comment as done.Aug 29 2022, 6:09 PM

Attached test case will be added before and removed by this fix.

Do you mean you plan to remove the test case? I think the test case should still be kept and check that a ctr-loop is generated after this fix.

Sure. Test case updated.

shchenz accepted this revision as: shchenz.Aug 29 2022, 8:34 PM

Thanks for fixing. LGTM

This revision is now accepted and ready to land.Aug 29 2022, 8:34 PM
This revision was landed with ongoing or failed builds.Aug 30 2022, 1:33 AM
This revision was automatically updated to reflect the committed changes.