OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |