Don't forward-declare registers for static allocas, which we'll

prefer to materialize as local constants. This fixes the clang
bootstrap abort.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107840 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-07-07 23:52:58 +00:00
parent 61b7cea126
commit 49dcb0f9ec

View File

@ -120,7 +120,9 @@ unsigned FastISel::getRegForValue(const Value *V) {
// In bottom-up mode, just create the virtual register which will be used
// to hold the value. It will be materialized later.
if (isa<Instruction>(V)) {
if (isa<Instruction>(V) &&
(!isa<AllocaInst>(V) ||
!FuncInfo.StaticAllocaMap.count(cast<AllocaInst>(V)))) {
Reg = createResultReg(TLI.getRegClassFor(VT));
FuncInfo.ValueMap[V] = Reg;
return Reg;