From 64106581b9d4f68eb4911c402b12b154d77a9eb0 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Thu, 29 May 2025 15:01:28 +0100 Subject: [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. --- llvm/lib/Analysis/ConstantFolding.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'llvm/lib/Analysis/ConstantFolding.cpp') 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(Op)) { - SplatOps.push_back(PoisonValue::get(Op->getType()->getScalarType())); - continue; - } Constant *Splat = Op->getSplatValue(); if (!Splat) return nullptr; -- cgit v1.1