OLD | NEW |
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// | 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// |
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 // This file implements the skeleton of the TargetLowering class, | 10 // This file implements the skeleton of the TargetLowering class, |
(...skipping 26 matching lines...) Loading... |
37 "max-nops-per-instruction", | 37 "max-nops-per-instruction", |
38 cl::desc("Max number of nops to insert per instruction"), cl::init(1)); | 38 cl::desc("Max number of nops to insert per instruction"), cl::init(1)); |
39 | 39 |
40 cl::opt<int> NopProbabilityAsPercentage( | 40 cl::opt<int> NopProbabilityAsPercentage( |
41 "nop-insertion-percentage", | 41 "nop-insertion-percentage", |
42 cl::desc("Nop insertion probability as percentage"), cl::init(10)); | 42 cl::desc("Nop insertion probability as percentage"), cl::init(10)); |
43 } // end of anonymous namespace | 43 } // end of anonymous namespace |
44 | 44 |
45 void LoweringContext::init(CfgNode *N) { | 45 void LoweringContext::init(CfgNode *N) { |
46 Node = N; | 46 Node = N; |
47 Begin = getNode()->getInsts().begin(); | |
48 Cur = Begin; | |
49 End = getNode()->getInsts().end(); | 47 End = getNode()->getInsts().end(); |
50 skipDeleted(Cur); | 48 rewind(); |
51 Next = Cur; | |
52 advanceForward(Next); | 49 advanceForward(Next); |
53 } | 50 } |
54 | 51 |
| 52 void LoweringContext::rewind() { |
| 53 Begin = getNode()->getInsts().begin(); |
| 54 Cur = Begin; |
| 55 skipDeleted(Cur); |
| 56 Next = Cur; |
| 57 } |
| 58 |
55 void LoweringContext::insert(Inst *Inst) { | 59 void LoweringContext::insert(Inst *Inst) { |
56 getNode()->getInsts().insert(Next, Inst); | 60 getNode()->getInsts().insert(Next, Inst); |
57 LastInserted = Inst; | 61 LastInserted = Inst; |
58 } | 62 } |
59 | 63 |
60 void LoweringContext::skipDeleted(InstList::iterator &I) const { | 64 void LoweringContext::skipDeleted(InstList::iterator &I) const { |
61 while (I != End && (*I)->isDeleted()) | 65 while (I != End && (*I)->isDeleted()) |
62 ++I; | 66 ++I; |
63 } | 67 } |
64 | 68 |
(...skipping 184 matching lines...) Loading... |
249 if (Target == Target_ARM64) | 253 if (Target == Target_ARM64) |
250 return IceTargetGlobalInitARM64::create(Ctx); | 254 return IceTargetGlobalInitARM64::create(Ctx); |
251 #endif | 255 #endif |
252 llvm_unreachable("Unsupported target"); | 256 llvm_unreachable("Unsupported target"); |
253 return NULL; | 257 return NULL; |
254 } | 258 } |
255 | 259 |
256 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} | 260 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} |
257 | 261 |
258 } // end of namespace Ice | 262 } // end of namespace Ice |
OLD | NEW |