[llvm] 618a399 - [InstCombine] Explicitly match poison operand. NFCI (#141744)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 28 05:16:58 PDT 2025


Author: Luke Lau
Date: 2025-05-28T13:16:55+01:00
New Revision: 618a399f862b68d3f4e3c2f39a1265dad8fd0e2f

URL: https://github.com/llvm/llvm-project/commit/618a399f862b68d3f4e3c2f39a1265dad8fd0e2f
DIFF: https://github.com/llvm/llvm-project/commit/618a399f862b68d3f4e3c2f39a1265dad8fd0e2f.diff

LOG: [InstCombine] Explicitly match poison operand. NFCI (#141744)

This is a follow up from
https://github.com/llvm/llvm-project/pull/141300#discussion_r2109109224

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index e01dafd36d30d..e101edf4a6208 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -1422,7 +1422,7 @@ InstCombinerImpl::foldShuffledIntrinsicOperands(IntrinsicInst *II) {
   ArrayRef<int> Mask;
   auto *NonConstArg = find_if_not(II->args(), IsaPred<Constant>);
   if (!NonConstArg ||
-      !match(NonConstArg, m_Shuffle(m_Value(X), m_Undef(), m_Mask(Mask))))
+      !match(NonConstArg, m_Shuffle(m_Value(X), m_Poison(), m_Mask(Mask))))
     return nullptr;
 
   // At least 1 operand must have 1 use because we are creating 2 instructions.
@@ -1433,7 +1433,7 @@ InstCombinerImpl::foldShuffledIntrinsicOperands(IntrinsicInst *II) {
   SmallVector<Value *, 4> NewArgs;
   Type *SrcTy = X->getType();
   for (Value *Arg : II->args()) {
-    if (match(Arg, m_Shuffle(m_Value(X), m_Undef(), m_SpecificMask(Mask))) &&
+    if (match(Arg, m_Shuffle(m_Value(X), m_Poison(), m_SpecificMask(Mask))) &&
         X->getType() == SrcTy)
       NewArgs.push_back(X);
     else if (match(Arg, m_ImmConstant(C))) {


        


More information about the llvm-commits mailing list