[llvm] [DAGCombiner] Add support for scalarising extracts of a vector setcc (PR #116031)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 21 05:13:26 PST 2024
================
@@ -22743,14 +22743,20 @@ SDValue DAGCombiner::scalarizeExtractedVectorLoad(SDNode *EVE, EVT InVecVT,
/// Transform a vector binary operation into a scalar binary operation by moving
/// the math/logic after an extract element of a vector.
-static SDValue scalarizeExtractedBinop(SDNode *ExtElt, SelectionDAG &DAG,
- const SDLoc &DL, bool LegalOperations) {
+static SDValue scalarizeExtractedBinOp(SDNode *ExtElt, SelectionDAG &DAG,
+ const SDLoc &DL) {
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
SDValue Vec = ExtElt->getOperand(0);
SDValue Index = ExtElt->getOperand(1);
auto *IndexC = dyn_cast<ConstantSDNode>(Index);
- if (!IndexC || !TLI.isBinOp(Vec.getOpcode()) || !Vec.hasOneUse() ||
- Vec->getNumValues() != 1)
+ if (!IndexC ||
+ (!TLI.isBinOp(Vec.getOpcode()) && Vec.getOpcode() != ISD::SETCC) ||
----------------
paulwalker-arm wrote:
`Vec.getOpcode()` is used four times so perhaps worth pulling out?
https://github.com/llvm/llvm-project/pull/116031
More information about the llvm-commits
mailing list