[llvm] [AMDGPU][SDAG] Handle ISD::PTRADD in VOP3 patterns (PR #143881)
Fabian Ritter via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 3 23:56:04 PDT 2025
================
@@ -908,19 +919,24 @@ multiclass IMAD32_Pats <VOP3_Pseudo inst> {
// Handle cases where amdgpu-codegenprepare-mul24 made a mul24 instead of a normal mul.
// We need to separate this because otherwise OtherPredicates would be overriden.
-class IMAD32_Mul24_Pat<VOP3_Pseudo inst>: GCNPat <
- (i64 (add (i64 (AMDGPUmul_u24 i32:$src0, i32:$src1)), i64:$src2)),
- (inst $src0, $src1, $src2, 0 /* clamp */)
- >;
+class IMAD32_Mul24_Pats_Impl<VOP3_Pseudo inst, SDPatternOperator AddOp, bit mulIsRight = 0> : GCNPat <
+ !if(mulIsRight, (i64 (AddOp i64:$src2, (i64 (AMDGPUmul_u24 i32:$src0, i32:$src1)))),
+ (i64 (AddOp (i64 (AMDGPUmul_u24 i32:$src0, i32:$src1)), i64:$src2))),
----------------
ritter-x2a wrote:
@arsenm, could you please check if the current version (with the `ptradd_commutative` `PatFrags`) or the previous version (with the `op1IsRight` parameter) works for you, or if one of the ways to extend the tablegen backend I described in the above comment is preferable?
https://github.com/llvm/llvm-project/pull/143881
More information about the llvm-commits
mailing list