llvm.org GIT mirror llvm / 4e6ed5e
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 Dan Gohman 12 years ago
1 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
13641364 }
13651365
13661366 unsigned X86FastISel::TargetMaterializeAlloca(AllocaInst *C) {
1367 // Fail on dynamic allocas. At this point, getRegForValue has already
1368 // checked its CSE maps, so if we're here trying to handle a dynamic
1369 // alloca, we're not going to succeed. X86SelectAddress has a
1370 // check for dynamic allocas, because it's called directly from
1371 // various places, but TargetMaterializeAlloca also needs a check
1372 // in order to avoid recursion between getRegForValue,
1373 // X86SelectAddrss, and TargetMaterializeAlloca.
1374 if (!StaticAllocaMap.count(C))
1375 return 0;
1376
13671377 X86AddressMode AM;
13681378 if (!X86SelectAddress(C, AM, false))
13691379 return 0;