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

Side by Side Diff: src/IceTargetLowering.h

Issue 417353003: Fix bug when atomic load is fused with an arith op (and not in the entry BB) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: or do getLast by rewinding from Next Created 6 years, 4 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 | « no previous file | src/IceTargetLowering.cpp » ('j') | src/IceTargetLowering.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- 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 // This file declares the TargetLowering and LoweringContext 10 // This file declares the TargetLowering and LoweringContext
(...skipping 28 matching lines...) Expand all
39 Inst *getNextInst() const { 39 Inst *getNextInst() const {
40 if (Next == End) 40 if (Next == End)
41 return NULL; 41 return NULL;
42 return *Next; 42 return *Next;
43 } 43 }
44 CfgNode *getNode() const { return Node; } 44 CfgNode *getNode() const { return Node; }
45 bool atEnd() const { return Cur == End; } 45 bool atEnd() const { return Cur == End; }
46 InstList::iterator getCur() const { return Cur; } 46 InstList::iterator getCur() const { return Cur; }
47 InstList::iterator getEnd() const { return End; } 47 InstList::iterator getEnd() const { return End; }
48 void insert(Inst *Inst); 48 void insert(Inst *Inst);
49 Inst *getLastInserted() const;
49 void advanceCur() { Cur = Next; } 50 void advanceCur() { Cur = Next; }
50 void advanceNext() { advance(Next); } 51 void advanceNext() { advance(Next); }
51 void setInsertPoint(const InstList::iterator &Position) { Next = Position; } 52 void setInsertPoint(const InstList::iterator &Position) { Next = Position; }
52 53
53 private: 54 private:
54 // Node is the argument to Inst::updateVars(). 55 // Node is the argument to Inst::updateVars().
55 CfgNode *Node; 56 CfgNode *Node;
56 // Cur points to the current instruction being considered. It is 57 // Cur points to the current instruction being considered. It is
57 // guaranteed to point to a non-deleted instruction, or to be End. 58 // guaranteed to point to a non-deleted instruction, or to be End.
58 InstList::iterator Cur; 59 InstList::iterator Cur;
59 // Next doubles as a pointer to the next valid instruction (if any), 60 // Next doubles as a pointer to the next valid instruction (if any),
60 // and the new-instruction insertion point. It is also updated for 61 // and the new-instruction insertion point. It is also updated for
61 // the caller in case the lowering consumes more than one high-level 62 // the caller in case the lowering consumes more than one high-level
62 // instruction. It is guaranteed to point to a non-deleted 63 // instruction. It is guaranteed to point to a non-deleted
63 // instruction after Cur, or to be End. TODO: Consider separating 64 // instruction after Cur, or to be End. TODO: Consider separating
64 // the notion of "next valid instruction" and "new instruction 65 // the notion of "next valid instruction" and "new instruction
65 // insertion point", to avoid confusion when previously-deleted 66 // insertion point", to avoid confusion when previously-deleted
66 // instructions come between the two points. 67 // instructions come between the two points.
67 InstList::iterator Next; 68 InstList::iterator Next;
69 // Begin is a copy of Insts.begin(), used if iterators need to be rewinded.
Jim Stichnoth 2014/07/29 17:54:09 rewound
jvoung (off chromium) 2014/07/30 15:17:14 Done, used the "backward" language to match the ne
70 InstList::iterator Begin;
68 // End is a copy of Insts.end(), used if Next needs to be advanced. 71 // End is a copy of Insts.end(), used if Next needs to be advanced.
69 InstList::iterator End; 72 InstList::iterator End;
70 73
71 void skipDeleted(InstList::iterator &I); 74 void skipDeleted(InstList::iterator &I);
72 void advance(InstList::iterator &I); 75 void advance(InstList::iterator &I);
76 void rewind(InstList::iterator &I) const;
Jim Stichnoth 2014/07/29 17:54:09 I assumed on first read that "rewind" meant "rewin
jvoung (off chromium) 2014/07/30 15:17:13 Good point, hmm... going to go with advanceForward
73 LoweringContext(const LoweringContext &) LLVM_DELETED_FUNCTION; 77 LoweringContext(const LoweringContext &) LLVM_DELETED_FUNCTION;
74 LoweringContext &operator=(const LoweringContext &) LLVM_DELETED_FUNCTION; 78 LoweringContext &operator=(const LoweringContext &) LLVM_DELETED_FUNCTION;
75 }; 79 };
76 80
77 class TargetLowering { 81 class TargetLowering {
78 public: 82 public:
79 static TargetLowering *createLowering(TargetArch Target, Cfg *Func); 83 static TargetLowering *createLowering(TargetArch Target, Cfg *Func);
80 void translate() { 84 void translate() {
81 switch (Ctx->getOptLevel()) { 85 switch (Ctx->getOptLevel()) {
82 case Opt_m1: 86 case Opt_m1:
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 private: 229 private:
226 TargetGlobalInitLowering(const TargetGlobalInitLowering &) 230 TargetGlobalInitLowering(const TargetGlobalInitLowering &)
227 LLVM_DELETED_FUNCTION; 231 LLVM_DELETED_FUNCTION;
228 TargetGlobalInitLowering & 232 TargetGlobalInitLowering &
229 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION; 233 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION;
230 }; 234 };
231 235
232 } // end of namespace Ice 236 } // end of namespace Ice
233 237
234 #endif // SUBZERO_SRC_ICETARGETLOWERING_H 238 #endif // SUBZERO_SRC_ICETARGETLOWERING_H
OLDNEW
« no previous file with comments | « no previous file | src/IceTargetLowering.cpp » ('j') | src/IceTargetLowering.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698