[llvm] [LLVM][SelectionDAG] Ensure Constant[FP]SDnode only store references to scalar Constant{Int,FP}. (PR #111005)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 08:37:45 PDT 2024
================
@@ -1656,6 +1656,11 @@ SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
EVT EltVT = VT.getScalarType();
const ConstantInt *Elt = &Val;
+ // Vector splats are explicit within the DAG, with ConstantSDNode holding the
+ // to be splatted scalar ConstantInt.
+ if (isa<VectorType>(Elt->getType()))
----------------
paulwalker-arm wrote:
They don't have to match. In most cases `Val` will be the scalar you want to splat. The new use case is when SelectionDAGBuilder passes in the new style ConstantInt which can have a vector result type when `use-constant-int-for-scalable-vector-splat` is enabled.
https://github.com/llvm/llvm-project/pull/111005
More information about the llvm-commits
mailing list