[PATCH] D39536: [PowerPC] Eliminate redundant register copys after register allocation
Zaara Syeda via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 26 12:55:47 PDT 2018
syzaara added inline comments.
================
Comment at: lib/Target/PowerPC/PPCRegCopyElim.cpp:80
+ MF = &MFParm;
+ TII = MF->getSubtarget<PPCSubtarget>().getInstrInfo();
+ DEBUG(dbgs() <<
----------------
I don't see any uses of TII, but there are uses of TRI. Maybe replace this with TRI?
================
Comment at: lib/Target/PowerPC/PPCRegCopyElim.cpp:430
+ MachineOperand *SrcMO = nullptr, *DstMO = nullptr;
+ if (isRegCopy(CopyMI, SrcMO, DstMO)) {
+ // We avoid processing same MI twice when we re-iterate this BB.
----------------
Can we change this to
```
if (!isRegCopy(CopyMI, SrcMO, DstMO))
continue;
```
so that we don't have to nest the rest of the code.
================
Comment at: lib/Target/PowerPC/PPCRegCopyElim.cpp:454
+ DefMI = findDefBackward(++MBBRI, MBB, DstReg, SrcReg,
+ IsClobbered, IsDstUsed, OperandsToRewrite1,
+ TRI);
----------------
It seems a little messy to me for this function to have a parameter for OperandsToRewrite1. I wonder if it would be better to have another function like getOperandsToRewrite which we can call on line 482 after we know that we have erased an instruction.
https://reviews.llvm.org/D39536
More information about the llvm-commits
mailing list