summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorSilviu Baranga <silviu.baranga@arm.com>2012-10-03 08:29:36 +0000
committerSilviu Baranga <silviu.baranga@arm.com>2012-10-03 08:29:36 +0000
commit541a858f1a4e65a714fe54293d43d0861cd12b8f (patch)
tree8b635258c07f74fece802bd5ef590e3239edad91 /lib/CodeGen
parent322e9ba2cb92330a345bd6e606c64a7b16bd929f (diff)
downloadexternal_llvm-541a858f1a4e65a714fe54293d43d0861cd12b8f.zip
external_llvm-541a858f1a4e65a714fe54293d43d0861cd12b8f.tar.gz
external_llvm-541a858f1a4e65a714fe54293d43d0861cd12b8f.tar.bz2
Fixed a bug in the ExecutionDependencyFix pass that caused dependencies to not propagate through implicit defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/ExecutionDepsFix.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/ExecutionDepsFix.cpp b/lib/CodeGen/ExecutionDepsFix.cpp
index fee8e47..2311842 100644
--- a/lib/CodeGen/ExecutionDepsFix.cpp
+++ b/lib/CodeGen/ExecutionDepsFix.cpp
@@ -626,9 +626,12 @@ void ExeDepsFix::visitSoftInstr(MachineInstr *mi, unsigned mask) {
}
dv->Instrs.push_back(mi);
- // Finally set all defs and non-collapsed uses to dv.
- for (unsigned i = 0, e = mi->getDesc().getNumOperands(); i != e; ++i) {
- MachineOperand &mo = mi->getOperand(i);
+ // Finally set all defs and non-collapsed uses to dv. We must iterate through
+ // all the operators, including imp-def ones.
+ for (MachineInstr::mop_iterator ii = mi->operands_begin(),
+ ee = mi->operands_end();
+ ii != ee; ++ii) {
+ MachineOperand &mo = *ii;
if (!mo.isReg()) continue;
int rx = regIndex(mo.getReg());
if (rx < 0) continue;