summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-02-20 00:32:29 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-02-20 00:32:29 +0000
commite611698e845c1d019960230930966632b911abe7 (patch)
tree0f2fb1e7afad14de68f01ae7ae4081e3bfdf3adf /llvm/lib/CodeGen/RegAllocFast.cpp
parent3dfec7580b1e7d8d9fcd99895e5f390f13a1e901 (diff)
downloadbcm5719-llvm-e611698e845c1d019960230930966632b911abe7.tar.gz
bcm5719-llvm-e611698e845c1d019960230930966632b911abe7.zip
[RegAllocFast] Properly track the physical register definitions on calls.
PR26485 llvm-svn: 261384
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocFast.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp
index f4c076fea0e..8d7a7213ba0 100644
--- a/llvm/lib/CodeGen/RegAllocFast.cpp
+++ b/llvm/lib/CodeGen/RegAllocFast.cpp
@@ -1002,11 +1002,13 @@ void RAFast::AllocateBasicBlock() {
unsigned DefOpEnd = MI->getNumOperands();
if (MI->isCall()) {
- // Spill all virtregs before a call. This serves two purposes: 1. If an
+ // Spill all virtregs before a call. This serves one purpose: If an
// exception is thrown, the landing pad is going to expect to find
- // registers in their spill slots, and 2. we don't have to wade through
- // all the <imp-def> operands on the call instruction.
- DefOpEnd = VirtOpEnd;
+ // registers in their spill slots.
+ // Note: although this is appealing to just consider all definitions
+ // as call-clobbered, this is not correct because some of those
+ // definitions may be used later on and we do not want to reuse
+ // those for virtual registers in between.
DEBUG(dbgs() << " Spilling remaining registers before call.\n");
spillAll(MI);
OpenPOWER on IntegriCloud