1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[RewriteStatepointsForGC] Reduce indentation via early continue [NFC]

llvm-svn: 230829
This commit is contained in:
Philip Reames 2015-02-28 00:54:41 +00:00
parent c0081494c4
commit 5658248d0a

View File

@ -782,7 +782,9 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
PhiState state = Pair.second;
assert(!isKnownBaseResult(v) && "why did it get added?");
assert(!state.isUnknown() && "Optimistic algorithm didn't complete!");
if (state.isConflict()) {
if (!state.isConflict())
continue;
if (isa<PHINode>(v)) {
int num_preds =
std::distance(pred_begin(v->getParent()), pred_end(v->getParent()));
@ -799,7 +801,8 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
v->getParent()->getParent()->getParent()->getContext(), MDConst);
phi->setMetadata("is_base_value", md);
states[v] = PhiState(PhiState::Conflict, phi);
} else if (SelectInst *sel = dyn_cast<SelectInst>(v)) {
} else {
SelectInst *sel = cast<SelectInst>(v);
// The undef will be replaced later
UndefValue *undef = UndefValue::get(sel->getType());
SelectInst *basesel = SelectInst::Create(sel->getCondition(), undef,
@ -815,8 +818,6 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache,
v->getParent()->getParent()->getParent()->getContext(), MDConst);
basesel->setMetadata("is_base_value", md);
states[v] = PhiState(PhiState::Conflict, basesel);
} else
llvm_unreachable("unknown conflict type");
}
}