[PATCH] D56355: [InstCombine] Simplify cttz/ctlz + icmp ugt/ult into mask check

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 5 10:27:13 PST 2019


lebedev.ri added a comment.

Hm, why does this modify the existing instruction, and manually adds it to worklist,
instead of simply creating a new instruction? This is rather unusual for instcombine i think.



================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:2771-2772
   case Intrinsic::bswap:
+    if (!Cmp.isEquality())
+      return nullptr;
+
----------------
lebedev.ri wrote:
> I wonder if it would be less ugly to split this into `foldICmpIntrinsicWithConstant()` and `foldICmpEQIntrinsicWithConstant()`?
Please do mark fixed comments as such.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56355/new/

https://reviews.llvm.org/D56355





More information about the llvm-commits mailing list