Commit 7f3b97db authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix OSR bug: OSR entry block has to figure out which is_defined names it will receive

parent 2c7ccccf
...@@ -586,6 +586,15 @@ static void emitBBs(IRGenState* irstate, const char* bb_type, GuardList &out_gua ...@@ -586,6 +586,15 @@ static void emitBBs(IRGenState* irstate, const char* bb_type, GuardList &out_gua
generator->giveLocalSymbol(*it, var); generator->giveLocalSymbol(*it, var);
(*phis)[*it] = std::make_pair(type, phi); (*phis)[*it] = std::make_pair(type, phi);
if (source->phis->isPotentiallyUndefinedAfter(*it, block->predecessors[0])) {
std::string is_defined_name = "!is_defined_" + *it;
llvm::PHINode *phi = emitter->getBuilder()->CreatePHI(g.i1, block->predecessors.size(), is_defined_name);
ConcreteCompilerVariable *var = new ConcreteCompilerVariable(BOOL, phi, true);
generator->giveLocalSymbol(is_defined_name, var);
(*phis)[is_defined_name] = std::make_pair(BOOL, phi);
}
} }
} else { } else {
assert(pred); assert(pred);
......
# expected: fail
# Regression test to make sure we can do an OSR if one of the live variables # Regression test to make sure we can do an OSR if one of the live variables
# is potentially-undefined. # is potentially-undefined.
......
# expected: fail
# Regression test to make sure we can do an OSR if one of the live variables # Regression test to make sure we can do an OSR if one of the live variables
# is potentially-undefined. # is potentially-undefined.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment