aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorLuke Lau <luke@igalia.com>2025-05-29 15:01:28 +0100
committerGitHub <noreply@github.com>2025-05-29 15:01:28 +0100
commit64106581b9d4f68eb4911c402b12b154d77a9eb0 (patch)
tree7661578046ddd74353ed7fc4d3594001917f27ed /llvm/lib/Analysis/ConstantFolding.cpp
parenta5d97ebe8b65f5a94975c013df6dd5fe11e8c652 (diff)
downloadllvm-64106581b9d4f68eb4911c402b12b154d77a9eb0.zip
llvm-64106581b9d4f68eb4911c402b12b154d77a9eb0.tar.gz
llvm-64106581b9d4f68eb4911c402b12b154d77a9eb0.tar.bz2
[Constant] Make Constant::getSplatValue return poison on poison (#141870)
This is a follow up from #141845. TargetTransformInfo::getOperandInfo needs to be updated to check for undef values as otherwise a splat is considered a constant, and some RISC-V cost model tests will start adding a cost to materialize the constant.
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 40302fb..2476dc5 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -3794,11 +3794,6 @@ static Constant *ConstantFoldScalableVectorCall(
SplatOps.push_back(Op);
continue;
}
- // TODO: Should getSplatValue return a poison scalar for a poison vector?
- if (isa<PoisonValue>(Op)) {
- SplatOps.push_back(PoisonValue::get(Op->getType()->getScalarType()));
- continue;
- }
Constant *Splat = Op->getSplatValue();
if (!Splat)
return nullptr;