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

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 12:30:12 PST 2017


hfinkel added a subscriber: kparzysz.
hfinkel added a comment.

Is this something that RDF copy propagation would do for us as well? @kparzysz might know. FWIW, if this is something that RDF would help with, I'd rather see our efforts put there rather than recreating a less-powerful version of that infrastructure just for this specific case.



================
Comment at: lib/Target/PowerPC/PPCRegCopyElim.cpp:267
+            if (Reg == PPC::X1 || Reg == PPC::R1 ||
+                Reg == PPC::X2 || Reg == PPC::R2 ||
+                (TFI->needsFP(*MF) && (Reg == PPC::X31 || Reg == PPC::R31)) ||
----------------
X2 is not always special (in leaf functions, it might be allocatable). You can check using:
  MF->getRegInfo().isAllocatable(PPC::X2) or !getReservedRegs(*MF).test(PPC::X2) or similar.


https://reviews.llvm.org/D39536





More information about the llvm-commits mailing list