summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2017-08-02 01:18:57 +0000
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2017-08-02 01:18:57 +0000
commitf23ae4fbe9287a824f93176afaddab08f07924a9 (patch)
tree47e2dc476c35bb591fc757055156b5a0b5b3106a /llvm/lib
parentc765035583487de0405f253962dbfd7338607e44 (diff)
downloadbcm5719-llvm-f23ae4fbe9287a824f93176afaddab08f07924a9.tar.gz
bcm5719-llvm-f23ae4fbe9287a824f93176afaddab08f07924a9.zip
[AMDGPU] Fix asan error after last commit
Previous change "Turn s_and_saveexec_b64 into s_and_b64 if result is unused" introduced asan use-after-poison error. Instruction was analyzed after eraseFromParent() calls. Move analysys higher than erase. llvm-svn: 309779
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp b/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
index 156c51fcc9e..d54bde49e65 100644
--- a/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
+++ b/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
@@ -138,6 +138,7 @@ bool SIOptimizeExecMaskingPreRA::runOnMachineFunction(MachineFunction &MF) {
DEBUG(dbgs() << "Redundant EXEC = S_OR_B64 found: " << *Lead << '\n');
+ auto SaveExec = getOrExecSource(*Lead, *TII, MRI);
unsigned SaveExecReg = getOrNonExecReg(*Lead, *TII);
LIS->RemoveMachineInstrFromMaps(*Lead);
Lead->eraseFromParent();
@@ -150,7 +151,6 @@ bool SIOptimizeExecMaskingPreRA::runOnMachineFunction(MachineFunction &MF) {
// If the only use of saved exec in the removed instruction is S_AND_B64
// fold the copy now.
- auto SaveExec = getOrExecSource(*Lead, *TII, MRI);
if (!SaveExec || !SaveExec->isFullCopy())
continue;
OpenPOWER on IntegriCloud