[llvm] [AMDGPU][True16][CodeGen] optimize codegen for mad-mix in true16 (PR #124995)

Brox Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 17 14:16:56 PDT 2025


================
@@ -3651,6 +3651,11 @@ bool AMDGPUDAGToDAGISel::SelectVOP3PMadMixModsImpl(SDValue In, SDValue &Src,
       // TODO: Should we try to look for neg/abs here?
     }
 
+    // Prevent unnecessary subreg COPY to VGPR_16
+    if (Src.getOpcode() == ISD::TRUNCATE &&
+        Src.getOperand(0).getValueType().getSizeInBits() == 32) {
----------------
broxigarchen wrote:

Hi Matt. It seems there are cases that the trunc is from i64 to i16.  i.e.  frem with v4f16 case in frem.ll. and thus this check is needed



https://github.com/llvm/llvm-project/pull/124995


More information about the llvm-commits mailing list