mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-26 16:05:54 +00:00
AMDGPU: Fix dangling references introduced by r263982
Fixes Valgrind errors on the test cases that were reported as failing by buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264000 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
752e5f9178
commit
3f4c92194f
@ -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()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user