[PATCH] D12705: InstCombine: match De Morgan's Law hidden by zext ops (PR22723)

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 13:10:27 PDT 2015


sanjoy added inline comments.

================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1240
@@ +1239,3 @@
+    if (A->getType()->isIntegerTy(1) && B->getType()->isIntegerTy(1) &&
+        C1->getZExtValue() == 1) {
+      Value *LogicOp = Builder->CreateBinOp(Opcode, A, B,
----------------
Do you need to check if `C1` fits in an `uint64_t`?  Or is that checked earlier?

Actually, I think it'll be easier to just use `C1->isOne()`.


http://reviews.llvm.org/D12705





More information about the llvm-commits mailing list