[clang] [Clang] Freeze padded vectors before storing. (PR #164821)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 23 07:04:27 PDT 2025
================
@@ -2300,6 +2300,9 @@ void CodeGenFunction::EmitStoreOfScalar(llvm::Value *Value, Address Addr,
SmallVector<int, 16> Mask(NewVecTy->getNumElements(), -1);
std::iota(Mask.begin(), Mask.begin() + VecTy->getNumElements(), 0);
Value = Builder.CreateShuffleVector(Value, Mask, "extractVec");
+ // The extra lanes will be poison. Freeze the whole vector to make sure
+ // the padding memory is not poisoned, which may break coercion.
+ Value = Builder.CreateFreeze(Value);
----------------
nikic wrote:
Instead of freezing, can we shuffle in undef instead? Or does that end up being worse?
https://github.com/llvm/llvm-project/pull/164821
More information about the cfe-commits
mailing list