[llvm-commits] [llvm] r106310 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp

Dan Gohman gohman at apple.com
Fri Jun 18 13:44:47 PDT 2010


Author: djg
Date: Fri Jun 18 15:44:47 2010
New Revision: 106310

URL: http://llvm.org/viewvc/llvm-project?rev=106310&view=rev
Log:
Fix X86FastISel's address-mode folding to stay within the
original basic block. This avoids trouble with examining
instructions in other basic blocks which haven't been
assigned registers yet.

Modified:
    llvm/trunk/lib/Target/X86/X86FastISel.cpp

Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=106310&r1=106309&r2=106310&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Fri Jun 18 15:44:47 2010
@@ -342,6 +342,12 @@
   const User *U = NULL;
   unsigned Opcode = Instruction::UserOp1;
   if (const Instruction *I = dyn_cast<Instruction>(V)) {
+    // Don't walk into other basic blocks; it's possible we haven't
+    // visited them yet, so the instructions may not yet be assigned
+    // virtual registers.
+    if (MBBMap[I->getParent()] != MBB)
+      return false;
+
     Opcode = I->getOpcode();
     U = I;
   } else if (const ConstantExpr *C = dyn_cast<ConstantExpr>(V)) {





More information about the llvm-commits mailing list