This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Add llvm.experimental.guard conditions to applyLoopGuards()
ClosedPublic

Authored by caojoshua on Jan 8 2023, 5:27 PM.

Details

Summary

Conditions for dominating branches and llvm.assumes are already
collected. This also adds conditions from guards.

Diff Detail

Event Timeline

caojoshua created this revision.Jan 8 2023, 5:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 8 2023, 5:27 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
caojoshua updated this revision to Diff 487251.Jan 8 2023, 5:29 PM
caojoshua edited the summary of this revision. (Show Details)
This comment was removed by caojoshua.
caojoshua published this revision for review.Jan 8 2023, 5:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 8 2023, 5:34 PM
nikic requested changes to this revision.Jan 9 2023, 3:37 AM
nikic added a subscriber: nikic.

We should add support for guard intrinsics to AssumptionCache instead. For all practical purposes, they need the same handling, and it makes little sense that we keep implementing separate handling for assumes and guards each time.

This revision now requires changes to proceed.Jan 9 2023, 3:37 AM

We should add support for guard intrinsics to AssumptionCache instead. For all practical purposes, they need the same handling, and it makes little sense that we keep implementing separate handling for assumes and guards each time.

I agree with this thought, but this adds a lot of discussion and investigation to a simple PR. I've created https://github.com/llvm/llvm-project/issues/59901 to discuss this issue (can you leave your thoughts in the thread?), and I would not mind personally working on it.

In my opinion, we can still land this review, and work on this as a separate issue. Does this make sense?

nikic accepted this revision.Jan 9 2023, 10:04 AM

We should add support for guard intrinsics to AssumptionCache instead. For all practical purposes, they need the same handling, and it makes little sense that we keep implementing separate handling for assumes and guards each time.

I agree with this thought, but this adds a lot of discussion and investigation to a simple PR. I've created https://github.com/llvm/llvm-project/issues/59901 to discuss this issue (can you leave your thoughts in the thread?), and I would not mind personally working on it.

In my opinion, we can still land this review, and work on this as a separate issue. Does this make sense?

Sure, as long as someone is working on fixing this properly, we can land this in the meantime. LGTM

llvm/lib/Analysis/ScalarEvolution.cpp
15024

const SCEV *

This revision is now accepted and ready to land.Jan 9 2023, 10:04 AM
This revision was landed with ongoing or failed builds.Jan 9 2023, 7:35 PM
This revision was automatically updated to reflect the committed changes.