[PATCH] D20126: [ScheduleDAG] Make sure that addVRegUseDeps is called on subreg defs
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Tue May 10 13:16:07 PDT 2016
kparzysz created this revision.
kparzysz added reviewers: atrick, MatzeB.
kparzysz added a subscriber: llvm-commits.
kparzysz set the repository for this revision to rL LLVM.
Herald added a subscriber: MatzeB.
A follow-up to D20102:
A def operand of a virtual register can actually read a register as well. Specifically, this happens in definitions of subregisters of a virtual register (unless the "undef" flag is present). This form of a use of a register should be accounted for in the construction of the dependence graph. In ScheduleDAGInstrs::buildSchedGraph, make sure that the function addVRegUseDeps is called for such defs.
Repository:
rL LLVM
http://reviews.llvm.org/D20126
Files:
lib/CodeGen/ScheduleDAGInstrs.cpp
Index: lib/CodeGen/ScheduleDAGInstrs.cpp
===================================================================
--- lib/CodeGen/ScheduleDAGInstrs.cpp
+++ lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -971,15 +971,16 @@
// Now process all uses.
for (unsigned j = 0, n = MI->getNumOperands(); j != n; ++j) {
const MachineOperand &MO = MI->getOperand(j);
- if (!MO.isReg() || !MO.isUse())
+ if (!MO.isReg())
continue;
unsigned Reg = MO.getReg();
if (Reg == 0)
continue;
- if (TRI->isPhysicalRegister(Reg))
- addPhysRegDeps(SU, j);
- else if (MO.readsReg()) // ignore undef operands
+ if (TRI->isPhysicalRegister(Reg)) {
+ if (MO.isUse())
+ addPhysRegDeps(SU, j);
+ } else if (MO.readsReg()) // ignore undef operands
addVRegUseDeps(SU, j);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20126.56791.patch
Type: text/x-patch
Size: 846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160510/f3e9e523/attachment.bin>
More information about the llvm-commits
mailing list