Skip to content

Commit c18d58c

Browse files
committed
address PR
1 parent 51a5847 commit c18d58c

File tree

5 files changed

+1774
-3424
lines changed

5 files changed

+1774
-3424
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3667,7 +3667,7 @@ bool AMDGPUDAGToDAGISel::SelectVOP3PMadMixModsImpl(SDValue In, SDValue &Src,
36673667

36683668
// Prevent unnecessary subreg COPY to VGPR_16
36693669
if (Src.getOpcode() == ISD::TRUNCATE &&
3670-
Src.getOperand(0).getValueType().getSizeInBits() == 32) {
3670+
Src.getOperand(0).getValueType() == MVT::i32) {
36713671
Src = Src.getOperand(0);
36723672
}
36733673
return true;

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5882,8 +5882,8 @@ AMDGPUInstructionSelector::selectVOP3PMadMixModsImpl(MachineOperand &Root,
58825882
// G_TRUNC. G_TRUNC to 16-bits would have a destination in RC VGPR_16, which
58835883
// is not compatible with MadMix instructions
58845884
Register PeekSrc = Src;
5885-
if (Subtarget->useRealTrue16Insts() &&
5886-
mi_match(PeekSrc, *MRI, m_GTrunc(m_Reg(PeekSrc))))
5885+
if (mi_match(PeekSrc, *MRI, m_GTrunc(m_Reg(PeekSrc))) &&
5886+
MRI->getType(PeekSrc) == LLT::scalar(32))
58875887
Src = PeekSrc;
58885888

58895889
Matched = true;

0 commit comments

Comments
 (0)