[llvm-commits] [llvm] r125140 - /llvm/trunk/lib/CodeGen/InlineSpiller.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Feb 8 16:25:36 PST 2011
Author: stoklund
Date: Tue Feb 8 18:25:36 2011
New Revision: 125140
URL: http://llvm.org/viewvc/llvm-project?rev=125140&view=rev
Log:
Set an allocation hint when rematting before a COPY.
This almost guarantees that the COPY will be coalesced.
Modified:
llvm/trunk/lib/CodeGen/InlineSpiller.cpp
Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=125140&r1=125139&r2=125140&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original)
+++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Tue Feb 8 18:25:36 2011
@@ -154,6 +154,10 @@
LiveInterval &NewLI = edit_->create(mri_, lis_, vrm_);
NewLI.markNotSpillable();
+ // Rematting for a copy: Set allocation hint to be the destination register.
+ if (MI->isCopy())
+ mri_.setRegAllocationHint(NewLI.reg, 0, MI->getOperand(0).getReg());
+
// Finally we can rematerialize OrigMI before MI.
SlotIndex DefIdx = edit_->rematerializeAt(*MI->getParent(), MI, NewLI.reg, RM,
lis_, tii_, tri_);
More information about the llvm-commits
mailing list