[llvm] 67fd4e3 - [InstCombine] Check for poison instead of undef in shuffle transform

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 04:01:22 PST 2023


Author: Nikita Popov
Date: 2023-12-19T12:56:52+01:00
New Revision: 67fd4e3408872c2ed84232293a7c621194e2a396

URL: https://github.com/llvm/llvm-project/commit/67fd4e3408872c2ed84232293a7c621194e2a396
DIFF: https://github.com/llvm/llvm-project/commit/67fd4e3408872c2ed84232293a7c621194e2a396.diff

LOG: [InstCombine] Check for poison instead of undef in shuffle transform

This one doesn't seem to make a practical difference because we'd
canonicalize undef -> poison in the relevant cases anywy.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 7a9a0950c2b6b8..735fff1f4bee95 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -777,10 +777,10 @@ static ShuffleOps collectShuffleElements(Value *V, SmallVectorImpl<int> &Mask,
   assert(V->getType()->isVectorTy() && "Invalid shuffle!");
   unsigned NumElts = cast<FixedVectorType>(V->getType())->getNumElements();
 
-  if (match(V, m_Undef())) {
+  if (match(V, m_Poison())) {
     Mask.assign(NumElts, -1);
     return std::make_pair(
-        PermittedRHS ? UndefValue::get(PermittedRHS->getType()) : V, nullptr);
+        PermittedRHS ? PoisonValue::get(PermittedRHS->getType()) : V, nullptr);
   }
 
   if (isa<ConstantAggregateZero>(V)) {


        


More information about the llvm-commits mailing list