[PATCH] D28485: [ValueTracking] recognize a 'not' of an assumed condition as false

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 15:14:31 PST 2017


majnemer requested changes to this revision.
majnemer added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Analysis/ValueTracking.cpp:550-551
       assert(BitWidth == 1 && "assume operand is not i1?");
-      KnownZero.clearAllBits();
-      KnownOne.setAllBits();
+      KnownZero = Arg == V ? 0 : -1;
+      KnownOne = Arg == V ? -1 : 0;
       return;
----------------
I don't think you want to use the uint64_t constructor here., you probably want to use clearAllBits and setAllBits on the two APInts as needed.


https://reviews.llvm.org/D28485





More information about the llvm-commits mailing list