The last commit was overly conservative. It's ok to reuse value that's already marked...
authorEvan Cheng <evan.cheng@apple.com>
Thu, 26 Feb 2009 03:02:21 +0000 (03:02 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 26 Feb 2009 03:02:21 +0000 (03:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65498 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/VirtRegMap.cpp
test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll

index e768e1c2043f49c8a6e78062d4e0558b9abe370f..0103e2042f3007d6295c6a97c2af8a45e838f0db 100644 (file)
@@ -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 {
index bb16a94f485c095a56428b473400e0b30f4111e5..0a73b3fc2573d59ec289944dfdfa6ddba91f6965 100644 (file)
@@ -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 }