summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-09 00:25:36 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-09 00:25:36 +0000
commit0b2f8d24b3c783061abae38d66f761924a18e686 (patch)
treed83e80b2f7c461d28a8de7e238537995abe0471c
parent123b89b67f4b49f5e125dd306f75e481be365586 (diff)
downloadbcm5719-llvm-0b2f8d24b3c783061abae38d66f761924a18e686.tar.gz
bcm5719-llvm-0b2f8d24b3c783061abae38d66f761924a18e686.zip
Set an allocation hint when rematting before a COPY.
This almost guarantees that the COPY will be coalesced. llvm-svn: 125140
-rw-r--r--llvm/lib/CodeGen/InlineSpiller.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp
index 00ca3d5bb64..a1bd972d38e 100644
--- a/llvm/lib/CodeGen/InlineSpiller.cpp
+++ b/llvm/lib/CodeGen/InlineSpiller.cpp
@@ -154,6 +154,10 @@ bool InlineSpiller::reMaterializeFor(MachineBasicBlock::iterator MI) {
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_);
OpenPOWER on IntegriCloud