[llvm] [SelectionDAG][RISCV] (add (vscale * C0), (vscale * C1)) to (vscale * (C0 + C1)) in getNode. (PR #144565)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 17 10:11:27 PDT 2025
================
@@ -7377,6 +7377,12 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
if ((Opcode == ISD::ADD || Opcode == ISD::SUB) &&
VT.getScalarType() == MVT::i1)
return getNode(ISD::XOR, DL, VT, N1, N2);
+ if (Opcode == ISD::ADD && N1.getOpcode() == ISD::VSCALE &&
+ N2.getOpcode() == ISD::VSCALE) {
----------------
preames wrote:
What's the wrap behavior here? Do we need to check the nsw/nuw on the ADD?
https://github.com/llvm/llvm-project/pull/144565
More information about the llvm-commits
mailing list