[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 13:01:21 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, for fake16 mode and pre-gfx11 target, there are cases that trunc is from f64->f32.
If we guard this condition with useRealTrue16Insts, then we don't need to check for sizeinbit here
https://github.com/llvm/llvm-project/pull/124995
More information about the llvm-commits
mailing list