[PATCH] D18448: Fix Sub-register Rewriting in Aggressive Anti-Dependence Breaker
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 25 08:07:06 PDT 2016
hfinkel accepted this revision.
hfinkel added a comment.
This revision is now accepted and ready to land.
LGTM, thanks! -- Nice efficient patch :-) [I realize that I'm ruining that somewhat by asking for a comment ;) ]
================
Comment at: ../llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp:315
@@ -314,14 +314,3 @@
DEBUG(dbgs() << "->g" << State->GetGroup(Reg) << tag);
- }
- // Repeat for subregisters.
- for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) {
- unsigned SubregReg = *SubRegs;
- if (!State->IsLive(SubregReg)) {
- KillIndices[SubregReg] = KillIdx;
- DefIndices[SubregReg] = ~0u;
- RegRefs.erase(SubregReg);
- State->LeaveGroup(SubregReg);
- DEBUG(if (header) {
- dbgs() << header << TRI->getName(Reg); header = nullptr; });
- DEBUG(dbgs() << " " << TRI->getName(SubregReg) << "->g" <<
- State->GetGroup(SubregReg) << tag);
+ // Repeat for subregisters.
+ for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) {
----------------
Please add a comment here explaining why we do this only if the superregister was not live. Maybe something like this:
// Note that we only do this if the superregister was not live because otherwise, regardless whether we have an explicit use of the subregister, the subregister's contents are needed for the uses of the superregister.
http://reviews.llvm.org/D18448
More information about the llvm-commits
mailing list