This is an archive of the discontinued LLVM Phabricator instance.

[LoopPredication] Rework assumes of widened conditions
ClosedPublic

Authored by aleksandr.popov on Aug 9 2023, 6:57 AM.

Details

Summary

Currently after widening br(WC && (c1 && c2)) we insert assume of
(c1 && c2) which is joined to WC by And operation.
But we are going to support more flexible form of widenable branches
where WC could be placed arbitrary in the expression tree, e.g:
br(c1 && (c2 && WC)).
In that case we won't have (c1 && c2) in the IR. So we need to add
explicit (c1 && c2) and then create an assumption of it.

Diff Detail

Event Timeline

aleksandr.popov created this revision.Aug 9 2023, 6:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 6:57 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
aleksandr.popov requested review of this revision.Aug 9 2023, 6:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 6:57 AM
aleksandr.popov edited the summary of this revision. (Show Details)Aug 9 2023, 7:14 AM
anna accepted this revision.Aug 17 2023, 9:37 AM

LGTM w/ comments.

llvm/lib/Transforms/Scalar/LoopPredication.cpp
758
776
813
This revision is now accepted and ready to land.Aug 17 2023, 9:37 AM
aleksandr.popov marked 3 inline comments as done.
This revision was landed with ongoing or failed builds.Aug 18 2023, 5:37 AM
This revision was automatically updated to reflect the committed changes.