summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2016-03-21 22:54:02 +0000
committerNicolai Haehnle <nhaehnle@gmail.com>2016-03-21 22:54:02 +0000
commit0a33abdfd215336ed0bd1c3dde78036f65f156c9 (patch)
treebdbdd285ec260dc1fc96456e41ec3c3774913e82 /llvm/lib/Target/AMDGPU
parent901de03fe2e33f2c54e965d9d27d824bc9a26c83 (diff)
downloadbcm5719-llvm-0a33abdfd215336ed0bd1c3dde78036f65f156c9.tar.gz
bcm5719-llvm-0a33abdfd215336ed0bd1c3dde78036f65f156c9.zip
AMDGPU: Fix dangling references introduced by r263982
Fixes Valgrind errors on the test cases that were reported as failing by buildbots. llvm-svn: 264000
Diffstat (limited to 'llvm/lib/Target/AMDGPU')
-rw-r--r--llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
index d735d38ba9b..1b1d422003b 100644
--- a/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ b/llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -184,14 +184,16 @@ char SIWholeQuadMode::scanInstructions(const MachineFunction &MF,
void SIWholeQuadMode::propagateInstruction(const MachineInstr &MI,
std::vector<WorkItem>& Worklist) {
const MachineBasicBlock &MBB = *MI.getParent();
- InstrInfo &II = Instructions[&MI];
+ InstrInfo II = Instructions[&MI]; // take a copy to prevent dangling references
BlockInfo &BI = Blocks[&MBB];
// Control flow-type instructions that are followed by WQM computations
// must themselves be in WQM.
if ((II.OutNeeds & StateWQM) && !(II.Needs & StateWQM) &&
- (MI.isBranch() || MI.isTerminator() || MI.getOpcode() == AMDGPU::SI_KILL))
+ (MI.isBranch() || MI.isTerminator() || MI.getOpcode() == AMDGPU::SI_KILL)) {
+ Instructions[&MI].Needs = StateWQM;
II.Needs = StateWQM;
+ }
// Propagate to block level
BI.Needs |= II.Needs;
@@ -253,7 +255,7 @@ void SIWholeQuadMode::propagateInstruction(const MachineInstr &MI,
void SIWholeQuadMode::propagateBlock(const MachineBasicBlock &MBB,
std::vector<WorkItem>& Worklist) {
- BlockInfo &BI = Blocks[&MBB];
+ BlockInfo BI = Blocks[&MBB]; // take a copy to prevent dangling references
// Propagate through instructions
if (!MBB.empty()) {
OpenPOWER on IntegriCloud