[PATCH] D34184: [InstCombine] Teach foldSelectICmpAndOr to recognize (select (icmp slt (trunc (X)), 0), Y, (or Y, C2))

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 10:59:50 PDT 2017


spatel added a comment.

The enhancement looks right, but I'm worried that the existing transform can increase the instruction count if any of the pieces in the pattern have more than one use. Are we missing m_OneUse() in some/all of the matchers?



================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:365
+    // Insert the and instruction.
+    V = Builder->CreateAnd(X, ConstantInt::get(X->getType(), APInt::getOneBitSet(X->getType()->getScalarSizeInBits(), C1Log)));
+  } else {
----------------
Formatting.


https://reviews.llvm.org/D34184





More information about the llvm-commits mailing list