diff options
author | Pedro Lobo <pedro.lobo@tecnico.ulisboa.pt> | 2025-01-16 08:17:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-16 08:17:55 +0000 |
commit | c23f2417dc5f6dc371afb07af5627ec2a9d373a0 (patch) | |
tree | 8f6b911e3b83644d888efca54f3e73801740d221 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | f023da12d12635f5fba436e825cbfc999e28e623 (diff) | |
download | llvm-c23f2417dc5f6dc371afb07af5627ec2a9d373a0.zip llvm-c23f2417dc5f6dc371afb07af5627ec2a9d373a0.tar.gz llvm-c23f2417dc5f6dc371afb07af5627ec2a9d373a0.tar.bz2 |
[CodeGenPrepare] Replace `undef` use with `poison` [NFC] (#123111)
When generating a constant vector, if `UseSplat` is false, the indices
different from the index of the extract can be filled with `poison`
instead of `undef`.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index a3392b7..7106e53 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -7983,8 +7983,8 @@ class VectorPromoteHelper { /// \p UseSplat defines whether or not \p Val should be replicated /// across the whole vector. /// In other words, if UseSplat == true, we generate <Val, Val, ..., Val>, - /// otherwise we generate a vector with as many undef as possible: - /// <undef, ..., undef, Val, undef, ..., undef> where \p Val is only + /// otherwise we generate a vector with as many poison as possible: + /// <poison, ..., poison, Val, poison, ..., poison> where \p Val is only /// used at the index of the extract. Value *getConstantVector(Constant *Val, bool UseSplat) const { unsigned ExtractIdx = std::numeric_limits<unsigned>::max(); @@ -8004,12 +8004,12 @@ class VectorPromoteHelper { if (!EC.isScalable()) { SmallVector<Constant *, 4> ConstVec; - UndefValue *UndefVal = UndefValue::get(Val->getType()); + PoisonValue *PoisonVal = PoisonValue::get(Val->getType()); for (unsigned Idx = 0; Idx != EC.getKnownMinValue(); ++Idx) { if (Idx == ExtractIdx) ConstVec.push_back(Val); else - ConstVec.push_back(UndefVal); + ConstVec.push_back(PoisonVal); } return ConstantVector::get(ConstVec); } else |