summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-09-06 18:34:38 +0000
committerdim <dim@FreeBSD.org>2015-09-06 18:34:38 +0000
commit9fcebda97d0cb3d7a2235d2ad835c3a2679e7683 (patch)
tree461d3cf041290f4a99740d540bf0973d6084f98e /lib/CodeGen/RegAllocFast.cpp
parentc5dd590220d0afe971d065bfe9324f549dd00968 (diff)
downloadFreeBSD-src-9fcebda97d0cb3d7a2235d2ad835c3a2679e7683.zip
FreeBSD-src-9fcebda97d0cb3d7a2235d2ad835c3a2679e7683.tar.gz
Import llvm 3.7.0 release (r246257).
Diffstat (limited to 'lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--lib/CodeGen/RegAllocFast.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp
index 660bb4f..fd3d4d7 100644
--- a/lib/CodeGen/RegAllocFast.cpp
+++ b/lib/CodeGen/RegAllocFast.cpp
@@ -986,6 +986,10 @@ void RAFast::AllocateBasicBlock() {
}
}
+ for (UsedInInstrSet::iterator
+ I = UsedInInstr.begin(), E = UsedInInstr.end(); I != E; ++I)
+ MRI->setRegUnitUsed(*I);
+
// Track registers defined by instruction - early clobbers and tied uses at
// this point.
UsedInInstr.clear();
@@ -1046,6 +1050,10 @@ void RAFast::AllocateBasicBlock() {
killVirtReg(VirtDead[i]);
VirtDead.clear();
+ for (UsedInInstrSet::iterator
+ I = UsedInInstr.begin(), E = UsedInInstr.end(); I != E; ++I)
+ MRI->setRegUnitUsed(*I);
+
if (CopyDst && CopyDst == CopySrc && CopyDstSub == CopySrcSub) {
DEBUG(dbgs() << "-- coalescing: " << *MI);
Coalesced.push_back(MI);
@@ -1095,6 +1103,12 @@ bool RAFast::runOnMachineFunction(MachineFunction &Fn) {
AllocateBasicBlock();
}
+ // Add the clobber lists for all the instructions we skipped earlier.
+ for (const MCInstrDesc *Desc : SkippedInstrs)
+ if (const uint16_t *Defs = Desc->getImplicitDefs())
+ while (*Defs)
+ MRI->setPhysRegUsed(*Defs++);
+
// All machine operands and other references to virtual registers have been
// replaced. Remove the virtual registers.
MRI->clearVirtRegs();
OpenPOWER on IntegriCloud