Skip to content

Commit 85b43c8

Browse files
committed
gisel support
1 parent 5d329fc commit 85b43c8

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,6 +3651,10 @@ bool AMDGPUDAGToDAGISel::SelectVOP3PMadMixModsImpl(SDValue In, SDValue &Src,
36513651
// TODO: Should we try to look for neg/abs here?
36523652
}
36533653

3654+
// Prevent unnecessary subreg COPY to VGPR_16
3655+
if (Subtarget->UseRealTrue16Insts() && Src.getOpcode() == ISD::TRUNCATE) {
3656+
Src = Src.getOperand(0);
3657+
}
36543658
return true;
36553659
}
36563660

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5836,6 +5836,15 @@ AMDGPUInstructionSelector::selectVOP3PMadMixModsImpl(MachineOperand &Root,
58365836
CheckAbsNeg();
58375837
}
58385838

5839+
// Since we looked through FPEXT and removed it, we must also remove
5840+
// G_TRUNC. G_TRUNC to 16-bits would have a destination in RC VGPR_16, which
5841+
// is not compatible with MadMix instructions
5842+
if (Subtarget->UseRealTrue16Insts() && MI->getOpcode() == AMDGPU::G_TRUNC) {
5843+
MO = &MI->getOperand(1);
5844+
Src = MO->getReg();
5845+
MI = getDefIgnoringCopies(Src, *MRI);
5846+
}
5847+
58395848
Matched = true;
58405849
}
58415850

0 commit comments

Comments
 (0)