Chromium Code Reviews| Index: src/IceCfgNode.cpp |
| diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp |
| index f0fae92af6de29990c3fd0fb42e16d76460dc83b..03c75bd50d3490d54da3ebe227cd24627f1bcf08 100644 |
| --- a/src/IceCfgNode.cpp |
| +++ b/src/IceCfgNode.cpp |
| @@ -218,6 +218,11 @@ void CfgNode::deletePhis() { |
| // not contain duplicates. |
| CfgNode *CfgNode::splitIncomingEdge(CfgNode *Pred, SizeT EdgeIndex) { |
| CfgNode *NewNode = Func->makeNode(); |
| + // Depth is the minimum as it works if both are the same, but if one is |
| + // outside the loop and the other is inside, the new node should be placed |
| + // outside and not be executed multiple times within the loop. |
| + NewNode->setLoopNestDepth( |
| + std::min(getLoopNestDepth(), Pred->getLoopNestDepth())); |
| if (BuildDefs::dump()) |
| NewNode->setName("split_" + Pred->getName() + "_" + getName() + "_" + |
| std::to_string(EdgeIndex)); |
| @@ -1179,9 +1184,12 @@ void CfgNode::dump(Cfg *Func) const { |
| Func->setCurrentNode(this); |
| Ostream &Str = Func->getContext()->getStrDump(); |
| Liveness *Liveness = Func->getLiveness(); |
| - if (Func->isVerbose(IceV_Instructions)) { |
| - Str << getName() << ":\n"; |
| - } |
| + if (Func->isVerbose(IceV_Instructions)) |
| + Str << getName() << ":"; |
| + // Dump the loop nest depth |
| + if (Func->isVerbose(IceV_Loop)) |
| + Str << " // LoopNestDepth = " << getLoopNestDepth(); |
| + Str << "\n"; |
|
Jim Stichnoth
2015/09/03 23:23:30
Whoops. This "\n" should only be dumped if verbos
ascull
2015/09/04 00:23:51
Done.
|
| // Dump list of predecessor nodes. |
| if (Func->isVerbose(IceV_Preds) && !InEdges.empty()) { |
| Str << " // preds = "; |