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

Unified Diff: src/IceTargetLowering.cpp

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, 5 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
Index: src/IceTargetLowering.cpp
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 05ae1216547b4f6d7fe2d30d5f0d1ba1cb0d3555..f3eccc499858f5d23b2a81717d0bba1c61ca9a21 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -26,7 +26,8 @@ namespace Ice {
void LoweringContext::init(CfgNode *N) {
Node = N;
- Cur = getNode()->getInsts().begin();
+ Begin = getNode()->getInsts().begin();
+ Cur = Begin;
End = getNode()->getInsts().end();
skipDeleted(Cur);
Next = Cur;
@@ -50,6 +51,19 @@ void LoweringContext::advance(InstList::iterator &I) {
}
}
+void LoweringContext::rewind(InstList::iterator &I) const {
+ assert(I != Begin);
+ --I;
Jim Stichnoth 2014/07/29 17:54:09 do { --I; } while (I != Begin && (*I)->isDeleted
jvoung (off chromium) 2014/07/30 15:17:13 Done.
+ while (I != Begin && (*I)->isDeleted())
+ --I;
+}
+
+Inst *LoweringContext::getLastInserted() const {
+ InstList::iterator Cursor = Next;
+ rewind(Cursor);
+ return *Cursor;
+}
+
TargetLowering *TargetLowering::createLowering(TargetArch Target, Cfg *Func) {
// These statements can be #ifdef'd to specialize the code generator
// to a subset of the available targets. TODO: use CRTP.

Powered by Google App Engine
This is Rietveld 408576698