[PATCH] D97092: [ValueTracking] Handle assumes on arguments with context instruction

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 14:39:21 PST 2021


nikic created this revision.
nikic added reviewers: jdoerfert, reames, gilr.
Herald added subscribers: javed.absar, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is an alternative to D93974 <https://reviews.llvm.org/D93974> and D97077 <https://reviews.llvm.org/D97077>. If `CtxI` is null, then we can still make use of any assumes that are guaranteed to be executed from the entry of the function. This allows us to handle assumes on arguments, for cases where no explicit context instruction is provided.

Relative to D93974 <https://reviews.llvm.org/D93974> the advantage here is that we only need to do the "guaranteed to execute" check if there are potentially relevant assumes, rather than always doing it. Relative to D97077 <https://reviews.llvm.org/D97077> the advantage is that this is not SCEV specific, and avoids issues with ephemeral values (i.e., we support assumes directly at the start of the function).

This change has no compile-time impact on CTMark, though that isn't exactly an assume heavy workload.

The unit tests are adopted from D93974 <https://reviews.llvm.org/D93974>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97092

Files:
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
  llvm/test/Analysis/ScalarEvolution/ranges.ll
  llvm/test/Transforms/SimplifyCFG/pr46638.ll
  llvm/unittests/Analysis/ValueTrackingTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97092.325090.patch
Type: text/x-patch
Size: 10460 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210219/864a0d3f/attachment.bin>


More information about the llvm-commits mailing list