Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
14846 | Please use clang-format | |
14850–14857 | Seems easier to write: unsigned VScaleMin = Attr.getVScaleRangeMin(); if (std::optional<unsigned> VScaleMax = Attr.getVScaleRangeMax()) if (*VScaleMax == VScaleMin) return DAG.getConstant(VScaleMin * N->getConstantOperandAPInt(0), SDLoc(N), N->getValueType(0)); return SDValue(); ? |
Comment Actions
Did you also try to see if there is additional value doing this transform at the LLVM IR layer? (I don't know if that could unlock other optimisations since ConstantFolding kicks in earlier)
Comment Actions
Not a strongly held view but is there value in restricting the combine to pre-operation legalisation? I ask because I wonder if they'll be a point during legalisation where somebody specifically wants the ISD::VSCALE node. Perhaps a different/better option is to move the logic into SelectionDAG::getVScale(), which can take a default false bool to disable the optimisation?
clang-format not found in user’s local PATH; not linting file.