[PATCH] D39536: [PowerPC] Eliminate redundant register copys after register allocation

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 01:20:51 PDT 2018


inouehrs marked 2 inline comments as done.
inouehrs added inline comments.


================
Comment at: lib/Target/PowerPC/PPCRegCopyElim.cpp:80
+  MF = &MFParm;
+  TII = MF->getSubtarget<PPCSubtarget>().getInstrInfo();
+  DEBUG(dbgs() <<
----------------
syzaara wrote:
> I don't see any uses of TII, but there are uses of TRI. Maybe replace this with TRI?
Removed TII. I do not add TRI as a member since TRI must be passed among static functions anyway.


================
Comment at: lib/Target/PowerPC/PPCRegCopyElim.cpp:454
+          DefMI = findDefBackward(++MBBRI, MBB, DstReg, SrcReg,
+                                  IsClobbered, IsDstUsed, OperandsToRewrite1,
+                                  TRI);
----------------
syzaara wrote:
> 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.
To implement getOperandsToRewrite helper, we need to do almost same (potentially costly) iteration again in the helper. So I have not do this yet.


https://reviews.llvm.org/D39536





More information about the llvm-commits mailing list