================ @@ -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))), ---------------- arsenm wrote:
Should really avoid this, commutable is supposed to be automatic. It may require a special case for ptradd in tablegen itself https://github.com/llvm/llvm-project/pull/143881 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits