Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: src/IceConverter.cpp

Issue 1738443002: Subzero. Performance tweaks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments -- all of them Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceDefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceConverter.cpp
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index b89666b379b43793ecf220e1d2604b84e9081463..387128909b51d393744878ce0e9e31a119356390 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -96,32 +96,32 @@ public:
void convertFunction(const Function *F) {
Func = Ice::Cfg::create(Ctx, Converter.getNextSequenceNumber());
- Ice::Cfg::setCurrentCfg(Func.get());
-
- VarMap.clear();
- NodeMap.clear();
- Func->setFunctionName(F->getName());
- Func->setReturnType(convertToIceType(F->getReturnType()));
- Func->setInternal(F->hasInternalLinkage());
- Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func.get());
-
- // The initial definition/use of each arg is the entry node.
- for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE;
- ++ArgI) {
- Func->addArg(mapValueToIceVar(ArgI));
- }
-
- // Make an initial pass through the block list just to resolve the blocks
- // in the original linearized order. Otherwise the ICE linearized order
- // will be affected by branch targets in terminator instructions.
- for (const BasicBlock &BBI : *F)
- mapBasicBlockToNode(&BBI);
- for (const BasicBlock &BBI : *F)
- convertBasicBlock(&BBI);
- Func->setEntryNode(mapBasicBlockToNode(&F->getEntryBlock()));
- Func->computeInOutEdges();
-
- Ice::Cfg::setCurrentCfg(nullptr);
+ {
+ Ice::CfgLocalAllocatorScope _(Func.get());
+
+ VarMap.clear();
+ NodeMap.clear();
+ Func->setFunctionName(F->getName());
+ Func->setReturnType(convertToIceType(F->getReturnType()));
+ Func->setInternal(F->hasInternalLinkage());
+ Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func.get());
+
+ // The initial definition/use of each arg is the entry node.
+ for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE;
+ ++ArgI) {
+ Func->addArg(mapValueToIceVar(ArgI));
+ }
+
+ // Make an initial pass through the block list just to resolve the blocks
+ // in the original linearized order. Otherwise the ICE linearized order
+ // will be affected by branch targets in terminator instructions.
+ for (const BasicBlock &BBI : *F)
+ mapBasicBlockToNode(&BBI);
+ for (const BasicBlock &BBI : *F)
+ convertBasicBlock(&BBI);
+ Func->setEntryNode(mapBasicBlockToNode(&F->getEntryBlock()));
+ Func->computeInOutEdges();
+ }
Converter.translateFcn(std::move(Func));
}
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceDefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698