[llvm-commits] [llvm] r134369 - /llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Sun Jul 3 17:05:28 PDT 2011


Author: stoklund
Date: Sun Jul  3 19:05:28 2011
New Revision: 134369

URL: http://llvm.org/viewvc/llvm-project?rev=134369&view=rev
Log:
Fix PR10244.

A split point inserted in a block with a landing pad successor may be
hoisted above the call to ensure that it dominates all successors. The
code that handles the rest of the basic block must take this into
account.

I am not including a test case, it would be very fragile. PR10244 comes
from building clang with exceptions enabled.

Modified:
    llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=134369&r1=134368&r2=134369&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Sun Jul  3 19:05:28 2011
@@ -812,9 +812,9 @@
     tie(Start, Stop) = Indexes->getMBBRange(BI.MBB);
     Intf.moveToBlock(BI.MBB->getNumber());
     DEBUG(dbgs() << "EB#" << Bundles->getBundle(BI.MBB->getNumber(), 0)
-                 << (RegIn ? " => " : " -- ")
+                 << (BI.LiveIn ? (RegIn ? " => " : " -> ") : "    ")
                  << "BB#" << BI.MBB->getNumber()
-                 << (RegOut ? " => " : " -- ")
+                 << (BI.LiveOut ? (RegOut ? " => " : " -> ") : "    ")
                  << " EB#" << Bundles->getBundle(BI.MBB->getNumber(), 1)
                  << " [" << Start << ';'
                  << SA->getLastSplitPoint(BI.MBB->getNumber()) << '-' << Stop
@@ -1062,7 +1062,7 @@
       //     |---o--    Live-in in MainIntv.
       //     ====---    Switch to LocalIntv before interference.
       //
-      SlotIndex Switch = SE->enterIntvBefore(Intf.first());
+      SlotIndex Switch = SE->enterIntvBefore(std::min(Pos, Intf.first()));
       assert(Switch <= Intf.first() && "Expected to avoid interference");
       SE->useIntv(Switch, Pos);
       SE->selectIntv(MainIntv);
@@ -1080,7 +1080,7 @@
       //     |   o--    Defined in block.
       //         ---    Begin LocalIntv at first use.
       //
-      SlotIndex Switch = SE->enterIntvBefore(BI.FirstUse);
+      SlotIndex Switch = SE->enterIntvBefore(std::min(Pos, BI.FirstUse));
       SE->useIntv(Switch, Pos);
     }
   }





More information about the llvm-commits mailing list