forked from OSchip/llvm-project
AMDGPU: Fix a corner case crash in SIOptimizeExecMasking
Summary: See the new test case; this is really unlikely to happen with real code, but I ran into this while attempting to bugpoint-reduce a different issue. Change-Id: I9ade1dc1aa8fd9c4d9fc83661d7b80e310b5c4a6 Reviewers: arsenm, rampitec Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D45885 llvm-svn: 330585
This commit is contained in:
parent
5d53aed419
commit
5a995664f0
|
@ -76,7 +76,7 @@ static unsigned isCopyToExec(const MachineInstr &MI) {
|
|||
case AMDGPU::COPY:
|
||||
case AMDGPU::S_MOV_B64: {
|
||||
const MachineOperand &Dst = MI.getOperand(0);
|
||||
if (Dst.isReg() && Dst.getReg() == AMDGPU::EXEC)
|
||||
if (Dst.isReg() && Dst.getReg() == AMDGPU::EXEC && MI.getOperand(1).isReg())
|
||||
return MI.getOperand(1).getReg();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -74,6 +74,15 @@ main_body:
|
|||
ret float %f
|
||||
}
|
||||
|
||||
; GCN-LABEL: {{^}}init_unreachable:
|
||||
;
|
||||
; This used to crash.
|
||||
define amdgpu_ps void @init_unreachable() {
|
||||
main_body:
|
||||
call void @llvm.amdgcn.init.exec(i64 -1)
|
||||
unreachable
|
||||
}
|
||||
|
||||
declare void @llvm.amdgcn.init.exec(i64) #1
|
||||
declare void @llvm.amdgcn.init.exec.from.input(i32, i32) #1
|
||||
|
||||
|
|
Loading…
Reference in New Issue