Newer
Older
Ops.insert(Ops.begin(), Tmp);
DEBUG(errs() << "RAOut:\t"; PrintOps(I, Ops); errs() << '\n');
if (Ops.size() == 1) {
// This expression tree simplified to something that isn't a tree,
// eliminate it.
I->replaceAllUsesWith(Ops[0].Op);
RemoveDeadBinaryOp(I);
return Ops[0].Op;
// Now that we ordered and optimized the expressions, splat them back into
// the expression tree, removing any unneeded nodes.
RewriteExprTree(I, Ops);
return I;
// Recalculate the rank map for F
BuildRankMap(F);
Chris Lattner
committed
MadeChange = false;
for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
Chris Lattner
committed
ReassociateBB(FI);
// We are done with the rank map.
ValueRankMap.clear();
Chris Lattner
committed
return MadeChange;