[llvm] DAG: Fix vector bin op scalarize defining a partially undef vector (PR #122459)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 16 04:18:32 PST 2025
================
@@ -27525,23 +27525,25 @@ static SDValue scalarizeBinOpOfSplats(SDNode *N, SelectionDAG &DAG,
if ((Opcode == ISD::MULHS || Opcode == ISD::MULHU) && !TLI.isTypeLegal(EltVT))
return SDValue();
- SDValue IndexC = DAG.getVectorIdxConstant(Index0, DL);
- SDValue X = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, EltVT, Src0, IndexC);
- SDValue Y = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, EltVT, Src1, IndexC);
- SDValue ScalarBO = DAG.getNode(Opcode, DL, EltVT, X, Y, N->getFlags());
-
// If all lanes but 1 are undefined, no need to splat the scalar result.
// TODO: Keep track of undefs and use that info in the general case.
----------------
RKSimon wrote:
We don't check for all-but-one undef lanes though anymore?
https://github.com/llvm/llvm-project/pull/122459
More information about the llvm-commits
mailing list