This is an archive of the discontinued LLVM Phabricator instance.

Expand loop peeling phi computation to handle binary ops and casts
ClosedPublic

Authored by jamieschmeiser on Nov 25 2022, 7:34 AM.

Details

Summary

Expand the capabilities of the code for computing how many peels are
needed to make phis determined. A cast gets the peel count for the
value being casted while a binary op gets the maximum of the operands.

Diff Detail

Event Timeline

jamieschmeiser created this revision.Nov 25 2022, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2022, 7:34 AM
jamieschmeiser requested review of this revision.Nov 25 2022, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2022, 7:34 AM
syzaara added inline comments.
llvm/lib/Transforms/Utils/LoopPeel.cpp
237

I think these asserts are not needed since BinaryOp and CmpInst will always have 2 operands. Same for the assert below with the cast instruction.

Respond to review comments: remove unnecessary asserts

jamieschmeiser marked an inline comment as done.Dec 2 2022, 7:04 AM
mkazantsev accepted this revision as: mkazantsev.Dec 5 2022, 12:39 AM

Looks reasonable.

This revision is now accepted and ready to land.Dec 5 2022, 12:39 AM
This revision was landed with ongoing or failed builds.Dec 5 2022, 9:15 AM
This revision was automatically updated to reflect the committed changes.