From ca2d65467b7b4f39fe45c86bfff6907a64d4ed7b Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 26 Feb 2009 03:02:21 +0000 Subject: [PATCH] The last commit was overly conservative. It's ok to reuse value that's already marked livein. llvm-svn: 65498 --- llvm/lib/CodeGen/VirtRegMap.cpp | 7 ------- llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index e768e1c2043f..0103e2042f30 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -516,18 +516,11 @@ void AvailableSpills::AddAvailableRegsToLiveIn(MachineBasicBlock &MBB, I = PhysRegsAvailable.begin(), E = PhysRegsAvailable.end(); I != E; ++I) { unsigned Reg = I->first; - bool MakeAvail = true; const TargetRegisterClass* RC = TRI->getPhysicalRegisterRegClass(Reg); // FIXME: A temporary workaround. We can't reuse available value if it's // not safe to move the def of the virtual register's class. e.g. // X86::RFP* register classes. Do not add it as a live-in. if (!TII->isSafeToMoveRegClassDefs(RC)) - MakeAvail = false; - if (MBB.isLiveIn(Reg)) - // It's already livein somehow. Be conservative, do not make it available. - MakeAvail = false; - - if (!MakeAvail) // This is no longer available. NotAvailable.insert(Reg); else { diff --git a/llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll b/llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll index bb16a94f485c..0a73b3fc2573 100644 --- a/llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll +++ b/llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin9 -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin9 -stats |& grep asm-printer | grep 185 +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin9 -stats |& grep asm-printer | grep 186 %"struct.Adv5::Ekin<3>" = type <{ i8 }> %"struct.Adv5::X::Energyflux<3>" = type { double }