mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-28 00:50:37 +00:00
Fix X86FastISel to handle dynamic allocas that have avoided
getting inserted into the ValueMap. This avoids infinite recursion in some rare cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56989 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a079e2bdf5
commit
4e6ed5eefd
@ -1365,6 +1365,16 @@ unsigned X86FastISel::TargetMaterializeConstant(Constant *C) {
|
||||
}
|
||||
|
||||
unsigned X86FastISel::TargetMaterializeAlloca(AllocaInst *C) {
|
||||
// Fail on dynamic allocas. At this point, getRegForValue has already
|
||||
// checked its CSE maps, so if we're here trying to handle a dynamic
|
||||
// alloca, we're not going to succeed. X86SelectAddress has a
|
||||
// check for dynamic allocas, because it's called directly from
|
||||
// various places, but TargetMaterializeAlloca also needs a check
|
||||
// in order to avoid recursion between getRegForValue,
|
||||
// X86SelectAddrss, and TargetMaterializeAlloca.
|
||||
if (!StaticAllocaMap.count(C))
|
||||
return 0;
|
||||
|
||||
X86AddressMode AM;
|
||||
if (!X86SelectAddress(C, AM, false))
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user