[PATCH] D148420: [InstCombine] Enhance select icmp and folding

Peixin Qiao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 15 07:55:13 PDT 2023


peixin added a comment.

Address the comments.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:255
+
+  if (X != V)
+    return nullptr;
----------------
RKSimon wrote:
> Would using m_And(m_Specific(X), m_APInt(C)) avoid the need for this?
Thanks. Fixed.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:259
+  uint32_t BitWidth = V->getType()->getScalarSizeInBits();
+  if (C->countLeadingZeros() + C->countTrailingOnes() != BitWidth ||
+      (int64_t)C->countLeadingZeros() != K->getSExtValue())
----------------
RKSimon wrote:
> !C->isMask() ?
Good point. Fixed.


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

https://reviews.llvm.org/D148420



More information about the llvm-commits mailing list