[llvm] [NVPTX] Improve folding to mad with immediate 1 (PR #93628)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Tue May 28 18:57:04 PDT 2024
================
@@ -5614,17 +5614,98 @@ static SDValue TryMULWIDECombine(SDNode *N,
return DCI.DAG.getNode(Opc, DL, MulType, TruncLHS, TruncRHS);
}
+static SDValue matchMADConstOnePattern(SDValue X, SDValue Add) {
+ if (Add->getOpcode() != ISD::ADD)
+ return SDValue();
+
+ SDValue Y = Add->getOperand(0);
+ ConstantSDNode *Const = dyn_cast<ConstantSDNode>(Add->getOperand(1));
----------------
Artem-B wrote:
Are we guaranteed to have const operand to be last? I think we normalize them, but I'm not 100% sure it's always the case.
https://github.com/llvm/llvm-project/pull/93628
More information about the llvm-commits
mailing list