summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2018-04-23 13:05:50 +0000
committerNicolai Haehnle <nhaehnle@gmail.com>2018-04-23 13:05:50 +0000
commit5a995664f07db36071a2584910c22b150a5370a3 (patch)
treed5c2a7ade61e7fbf0caef29cd15bf17e3a2c10f9 /llvm/lib
parent5d53aed419e1dc3fb6d5d26bd17417c7d0c78606 (diff)
downloadbcm5719-llvm-5a995664f07db36071a2584910c22b150a5370a3.tar.gz
bcm5719-llvm-5a995664f07db36071a2584910c22b150a5370a3.zip
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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp b/llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
index 2dc6f2702b3..ddf45bbccb9 100644
--- a/llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
+++ b/llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
@@ -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;
}
OpenPOWER on IntegriCloud