diff options
| author | Dan Gohman <gohman@apple.com> | 2010-11-12 19:14:00 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-11-12 19:14:00 +0000 |
| commit | 0284c5d0c7900d2b378f8c846290202455474fe9 (patch) | |
| tree | b5b7d5da225a0727743481887d19f0cea64020ad /llvm/lib | |
| parent | 87cf7f787e2373f5bcd57e66a2b45dd387104e19 (diff) | |
| download | bcm5719-llvm-0284c5d0c7900d2b378f8c846290202455474fe9.tar.gz bcm5719-llvm-0284c5d0c7900d2b378f8c846290202455474fe9.zip | |
When the definition of an address value is in a different block
from the user of the address, fall back to just using the
address in a register instead of bailing out of fast-isel
altogether.
llvm-svn: 118917
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86FastISel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp index b938539a7f4..ee6643336fd 100644 --- a/llvm/lib/Target/X86/X86FastISel.cpp +++ b/llvm/lib/Target/X86/X86FastISel.cpp @@ -320,11 +320,11 @@ bool X86FastISel::X86SelectAddress(const Value *V, X86AddressMode &AM) { // 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 (FuncInfo.MBBMap[I->getParent()] != FuncInfo.MBB) - return false; - - Opcode = I->getOpcode(); - U = I; + if (FuncInfo.StaticAllocaMap.count(static_cast<const AllocaInst *>(V)) || + FuncInfo.MBBMap[I->getParent()] == FuncInfo.MBB) { + Opcode = I->getOpcode(); + U = I; + } } else if (const ConstantExpr *C = dyn_cast<ConstantExpr>(V)) { Opcode = C->getOpcode(); U = C; |

