summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-12-05 18:23:17 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-12-05 18:23:17 +0000
commit7f0a5273001e24b76baaf53e8d94df1e83180479 (patch)
treec8e40c7326927d7f840091e6573b7651950eebbe /llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
parentea0bafda8a873a1cff8b4e4b3e6a9d0c7326919b (diff)
downloadbcm5719-llvm-7f0a5273001e24b76baaf53e8d94df1e83180479.tar.gz
bcm5719-llvm-7f0a5273001e24b76baaf53e8d94df1e83180479.zip
AMDGPU: Fix infinite loop with dbg_value
Surprisingly SIOptimizeExecMaskingPreRA can infinite loop in some case with DBG_VALUE. Most tests using dbg_value are run at -O0, so don't run this pass. This seems to only happen when the value argument is undef. llvm-svn: 319808
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp b/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
index 6b2668fe052..647aafe4d2e 100644
--- a/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
+++ b/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
@@ -134,8 +134,11 @@ bool SIOptimizeExecMaskingPreRA::runOnMachineFunction(MachineFunction &MF) {
}
while (I != E) {
- if (I->isDebugValue())
+ if (I->isDebugValue()) {
+ I = std::next(I);
continue;
+ }
+
if (I->mayStore() || I->isBarrier() || I->isCall() ||
I->hasUnmodeledSideEffects() || I->hasOrderedMemoryRef())
break;
OpenPOWER on IntegriCloud