[PATCH] D23134: Make cltz and cttz zero undef when the operand cannot be zero in InstCombine

Amaury SECHET via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 02:23:58 PDT 2016


deadalnix added inline comments.

================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:1141
@@ +1140,3 @@
+    if (!match(II.getArgOperand(1), m_One())) {
+      IC.Worklist.Add(&II);
+      II.setOperand(1, IC.Builder->getTrue());
----------------
spatel wrote:
> Shouldn't this return the updated instruction to signal to the callers that a change was made? If we do that, then we don't need to explicitly add to the worklist either, right?
No as we don't want to go though replacing the instruction by itself and we especially don't want to replace false by true in the program.


https://reviews.llvm.org/D23134





More information about the llvm-commits mailing list