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

Quentin Colombet qcolombet at apple.com
Tue Jul 1 06:04:01 PDT 2014


================
Comment at: lib/CodeGen/PeepholeOptimizer.cpp:981
@@ +980,3 @@
+    return getNextSourceFromInsertSubreg(SrcIdx, SrcSubReg);
+  if (Def->getOpcode() == TargetOpcode::EXTRACT_SUBREG)
+    return getNextSourceFromExtractSubreg(SrcIdx, SrcSubReg);
----------------
hfinkel at anl.gov wrote:
> 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.
I thought there were plenty of users for this accessor but turns out all the users check the opcode of a SDNode whereas I am looking at MachineInstr. Thus, this patch is the first user of isExtractSubreg.
So I have updated the patch to include that change.

http://reviews.llvm.org/D4086






More information about the llvm-commits mailing list