diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-07-05 15:32:28 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-07-05 15:32:28 +0000 |
| commit | 27a6985d907a1f38bd320c8c9ab6e7bf8775d684 (patch) | |
| tree | 23279e811bd9ee0d40914a3a44e862dcf8ae2d13 /llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | |
| parent | 3aef35288b5387d3b1e8c1627df5c031b9c151c7 (diff) | |
| download | bcm5719-llvm-27a6985d907a1f38bd320c8c9ab6e7bf8775d684.tar.gz bcm5719-llvm-27a6985d907a1f38bd320c8c9ab6e7bf8775d684.zip | |
ScheduleDAG: Fix incorrectly killing registers in bundles
When looking for uses/defs to add kill flags, the iterator was double
incremented, skipping the first instruction in the bundle. The use
register in the first bundle instruction was then incorrectly killed.
The "First" instruction should be the BUNDLE itself as the proper
reverse iterator endpoint.
llvm-svn: 365216
Diffstat (limited to 'llvm/lib/CodeGen/ScheduleDAGInstrs.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp index 40ed1b90b7d..a5380108896 100644 --- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -1104,22 +1104,21 @@ void ScheduleDAGInstrs::fixupKills(MachineBasicBlock &MBB) { if (!MI.isBundled()) { toggleKills(MRI, LiveRegs, MI, true); } else { - MachineBasicBlock::instr_iterator First = MI.getIterator(); - if (MI.isBundle()) { + MachineBasicBlock::instr_iterator Bundle = MI.getIterator(); + if (MI.isBundle()) toggleKills(MRI, LiveRegs, MI, false); - ++First; - } + // Some targets make the (questionable) assumtion that the instructions // inside the bundle are ordered and consequently only the last use of // a register inside the bundle can kill it. - MachineBasicBlock::instr_iterator I = std::next(First); + MachineBasicBlock::instr_iterator I = std::next(Bundle); while (I->isBundledWithSucc()) ++I; do { if (!I->isDebugInstr()) toggleKills(MRI, LiveRegs, *I, true); --I; - } while(I != First); + } while (I != Bundle); } } } |

