mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
R600/SI: Fix another case of illegal VGPR->SGPR copy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195025 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7c5498ee55
commit
bf9ddd5e8f
@ -181,14 +181,13 @@ bool SIFixSGPRCopies::isVGPRToSGPRCopy(const MachineInstr &Copy,
|
|||||||
unsigned SrcReg = Copy.getOperand(1).getReg();
|
unsigned SrcReg = Copy.getOperand(1).getReg();
|
||||||
unsigned SrcSubReg = Copy.getOperand(1).getSubReg();
|
unsigned SrcSubReg = Copy.getOperand(1).getSubReg();
|
||||||
const TargetRegisterClass *DstRC = MRI.getRegClass(DstReg);
|
const TargetRegisterClass *DstRC = MRI.getRegClass(DstReg);
|
||||||
|
const TargetRegisterClass *SrcRC;
|
||||||
|
|
||||||
if (!TargetRegisterInfo::isVirtualRegister(SrcReg) ||
|
if (!TargetRegisterInfo::isVirtualRegister(SrcReg) ||
|
||||||
DstRC == &AMDGPU::M0RegRegClass)
|
DstRC == &AMDGPU::M0RegRegClass)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const TargetRegisterClass *SrcRC = TRI->getSubRegClass(
|
SrcRC = inferRegClassFromDef(TRI, MRI, SrcReg, SrcSubReg);
|
||||||
MRI.getRegClass(SrcReg), SrcSubReg);
|
|
||||||
|
|
||||||
return TRI->isSGPRClass(DstRC) &&
|
return TRI->isSGPRClass(DstRC) &&
|
||||||
!TRI->getCommonSubClass(DstRC, SrcRC);
|
!TRI->getCommonSubClass(DstRC, SrcRC);
|
||||||
}
|
}
|
||||||
|
@ -268,3 +268,29 @@ endif:
|
|||||||
}
|
}
|
||||||
|
|
||||||
!2 = metadata !{metadata !"const", null, i32 1}
|
!2 = metadata !{metadata !"const", null, i32 1}
|
||||||
|
|
||||||
|
; CHECK-LABEL: @copy1
|
||||||
|
; CHECK: BUFFER_LOAD_DWORD
|
||||||
|
; CHECK: V_ADD
|
||||||
|
; CHECK: S_ENDPGM
|
||||||
|
define void @copy1(float addrspace(1)* %out, float addrspace(1)* %in0) {
|
||||||
|
entry:
|
||||||
|
%0 = load float addrspace(1)* %in0
|
||||||
|
%1 = fcmp oeq float %0, 0.0
|
||||||
|
br i1 %1, label %if0, label %endif
|
||||||
|
|
||||||
|
if0:
|
||||||
|
%2 = bitcast float %0 to i32
|
||||||
|
%3 = fcmp olt float %0, 0.0
|
||||||
|
br i1 %3, label %if1, label %endif
|
||||||
|
|
||||||
|
if1:
|
||||||
|
%4 = add i32 %2, 1
|
||||||
|
br label %endif
|
||||||
|
|
||||||
|
endif:
|
||||||
|
%5 = phi i32 [ 0, %entry ], [ %2, %if0 ], [ %4, %if1 ]
|
||||||
|
%6 = bitcast i32 %5 to float
|
||||||
|
store float %6, float addrspace(1)* %out
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user