[llvm] 31d8bdb - [Scalarizer] Fold -1 mask in shufflevector to poison instead of undef
Nuno Lopes via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 23 07:02:41 PDT 2023
Author: Nuno Lopes
Date: 2023-07-23T15:02:23+01:00
New Revision: 31d8bdbcad91c0b2547f0836406ce119fe0e11ea
URL: https://github.com/llvm/llvm-project/commit/31d8bdbcad91c0b2547f0836406ce119fe0e11ea
DIFF: https://github.com/llvm/llvm-project/commit/31d8bdbcad91c0b2547f0836406ce119fe0e11ea.diff
LOG: [Scalarizer] Fold -1 mask in shufflevector to poison instead of undef
Per latest LangRef
Added:
Modified:
llvm/lib/Transforms/Scalar/Scalarizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/Scalarizer.cpp b/llvm/lib/Transforms/Scalar/Scalarizer.cpp
index ec8e5c2eecc2e7..86b55dfd304a05 100644
--- a/llvm/lib/Transforms/Scalar/Scalarizer.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalarizer.cpp
@@ -1109,7 +1109,7 @@ bool ScalarizerVisitor::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
for (unsigned I = 0; I < VS->NumFragments; ++I) {
int Selector = SVI.getMaskValue(I);
if (Selector < 0)
- Res[I] = UndefValue::get(VS->VecTy->getElementType());
+ Res[I] = PoisonValue::get(VS->VecTy->getElementType());
else if (unsigned(Selector) < Op0.size())
Res[I] = Op0[Selector];
else
More information about the llvm-commits
mailing list