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

Side by Side Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1784243006: Subzero: Improve the use of timers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | src/IceTimerTree.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 MemA->getOffset() == MemB->getOffset() && 608 MemA->getOffset() == MemB->getOffset() &&
609 MemA->getIndex() == MemB->getIndex() && 609 MemA->getIndex() == MemB->getIndex() &&
610 MemA->getShift() == MemB->getShift() && 610 MemA->getShift() == MemB->getShift() &&
611 MemA->getSegmentRegister() == MemB->getSegmentRegister(); 611 MemA->getSegmentRegister() == MemB->getSegmentRegister();
612 } 612 }
613 } 613 }
614 return false; 614 return false;
615 } 615 }
616 616
617 template <typename TraitsType> void TargetX86Base<TraitsType>::findRMW() { 617 template <typename TraitsType> void TargetX86Base<TraitsType>::findRMW() {
618 TimerMarker _(TimerStack::TT_findRMW, Func);
618 Func->dump("Before RMW"); 619 Func->dump("Before RMW");
619 if (Func->isVerbose(IceV_RMW)) 620 if (Func->isVerbose(IceV_RMW))
620 Func->getContext()->lockStr(); 621 Func->getContext()->lockStr();
621 for (CfgNode *Node : Func->getNodes()) { 622 for (CfgNode *Node : Func->getNodes()) {
622 // Walk through the instructions, considering each sequence of 3 623 // Walk through the instructions, considering each sequence of 3
623 // instructions, and look for the particular RMW pattern. Note that this 624 // instructions, and look for the particular RMW pattern. Note that this
624 // search can be "broken" (false negatives) if there are intervening 625 // search can be "broken" (false negatives) if there are intervening
625 // deleted instructions, or intervening instructions that could be safely 626 // deleted instructions, or intervening instructions that could be safely
626 // moved out of the way to reveal an RMW pattern. 627 // moved out of the way to reveal an RMW pattern.
627 auto E = Node->getInsts().end(); 628 auto E = Node->getInsts().end();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 return true; 726 return true;
726 } 727 }
727 if (Src0 != LoadDest && Src1 == LoadDest) { 728 if (Src0 != LoadDest && Src1 == LoadDest) {
728 Src1 = LoadSrc; 729 Src1 = LoadSrc;
729 return true; 730 return true;
730 } 731 }
731 return false; 732 return false;
732 } 733 }
733 734
734 template <typename TraitsType> void TargetX86Base<TraitsType>::doLoadOpt() { 735 template <typename TraitsType> void TargetX86Base<TraitsType>::doLoadOpt() {
736 TimerMarker _(TimerStack::TT_loadOpt, Func);
735 for (CfgNode *Node : Func->getNodes()) { 737 for (CfgNode *Node : Func->getNodes()) {
736 Context.init(Node); 738 Context.init(Node);
737 while (!Context.atEnd()) { 739 while (!Context.atEnd()) {
738 Variable *LoadDest = nullptr; 740 Variable *LoadDest = nullptr;
739 Operand *LoadSrc = nullptr; 741 Operand *LoadSrc = nullptr;
740 Inst *CurInst = Context.getCur(); 742 Inst *CurInst = Context.getCur();
741 Inst *Next = Context.getNextInst(); 743 Inst *Next = Context.getNextInst();
742 // Determine whether the current instruction is a Load instruction or 744 // Determine whether the current instruction is a Load instruction or
743 // equivalent. 745 // equivalent.
744 if (auto *Load = llvm::dyn_cast<InstLoad>(CurInst)) { 746 if (auto *Load = llvm::dyn_cast<InstLoad>(CurInst)) {
(...skipping 6655 matching lines...) Expand 10 before | Expand all | Expand 10 after
7400 emitGlobal(*Var, SectionSuffix); 7402 emitGlobal(*Var, SectionSuffix);
7401 } 7403 }
7402 } 7404 }
7403 } break; 7405 } break;
7404 } 7406 }
7405 } 7407 }
7406 } // end of namespace X86NAMESPACE 7408 } // end of namespace X86NAMESPACE
7407 } // end of namespace Ice 7409 } // end of namespace Ice
7408 7410
7409 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H 7411 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
OLDNEW
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | src/IceTimerTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698