[PATCH] [Peephole] Advanced rewriting of copies to avoid cross register banks copies.

hfinkel at anl.gov hfinkel at anl.gov
Tue Jul 1 04:25:54 PDT 2014


With the agreed-to changes, LGTM.

================
Comment at: lib/CodeGen/PeepholeOptimizer.cpp:561
@@ -458,3 +560,3 @@
 
     if (TargetRegisterInfo::isPhysicalRegister(Src))
       break;
----------------
Quentin Colombet wrote:
> hfinkel at anl.gov wrote:
> > What does not work for physical registers?
> You do not want to extend the live-ranges of physical registers as they add constraints to the register allocator.
> Moreover, if you allow to extend the live-range of a physical register, unlike SSA virtual register, you will have to check that you do not redefine that register.
Okay; please add this explanation as a comment here.

================
Comment at: lib/CodeGen/PeepholeOptimizer.cpp:981
@@ +980,3 @@
+    return getNextSourceFromInsertSubreg(SrcIdx, SrcSubReg);
+  if (Def->getOpcode() == TargetOpcode::EXTRACT_SUBREG)
+    return getNextSourceFromExtractSubreg(SrcIdx, SrcSubReg);
----------------
Quentin Colombet wrote:
> hfinkel at anl.gov wrote:
> > I think you might as well add isExtractSubreg().
> Agree.
> Though, I did not want to do that in that patch.
> I can either do it before or after this patch lands.
> Any preference?
I don't have a strong preference. Personally, I'd do it first.

http://reviews.llvm.org/D4086






More information about the llvm-commits mailing list