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

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 13:30:11 PDT 2015

spatel marked an inline comment as done.

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,
sanjoy wrote:
> 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()`.
Ah - I didn't know about that function. Fixed.


More information about the llvm-commits mailing list