[llvm-commits] [llvm] r63994 - /llvm/trunk/lib/CodeGen/MachineSink.cpp

Evan Cheng evan.cheng at apple.com
Fri Feb 6 17:21:48 PST 2009


Author: evancheng
Date: Fri Feb  6 19:21:47 2009
New Revision: 63994

URL: http://llvm.org/viewvc/llvm-project?rev=63994&view=rev
Log:
Don't sink the instruction if TargetRegisterInfo::isSafeToMoveRegClassDefs doesn't think it's safe. This works around PR1911.

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

Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=63994&r1=63993&r2=63994&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineSink.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineSink.cpp Fri Feb  6 19:21:47 2009
@@ -167,6 +167,10 @@
     } else {
       // Virtual register uses are always safe to sink.
       if (MO.isUse()) continue;
+
+      // If it's not safe to move defs of the register class, then abort.
+      if (!TII->isSafeToMoveRegClassDefs(RegInfo->getRegClass(Reg)))
+        return false;
       
       // FIXME: This picks a successor to sink into based on having one
       // successor that dominates all the uses.  However, there are cases where





More information about the llvm-commits mailing list