[PATCH] D14368: [ValueTracking] Add a framework for encoding implication rules

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 20:25:16 PST 2015


sanjoy created this revision.
sanjoy added reviewers: reames, majnemer, hfinkel.
sanjoy added a subscriber: llvm-commits.

This change adds a framework for adding more smarts to
`isImpliedCondition` around inequalities.  Informally,
`isImpliedCondition` will now try to prove "A < B ==> C < D" by proving
"C <= A && B <= D", since then it follows "C <= A < B <= D".

While this change is in principle NFC, I could not think of a way to not
handle cases like "i +_nsw 1 < L ==> i < L +_nsw 1" (that ValueTracking
did not handle before) while keeping the change understandable.  I've
added tests for these cases.

http://reviews.llvm.org/D14368

Files:
  lib/Analysis/ValueTracking.cpp
  test/Transforms/InstSimplify/implies.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14368.39312.patch
Type: text/x-patch
Size: 4359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151105/25585097/attachment-0001.bin>


More information about the llvm-commits mailing list