Fix 2 small Statement issues (dotnet/coreclr#27183)
authormikedn <onemihaid@hotmail.com>
Mon, 14 Oct 2019 23:10:23 +0000 (02:10 +0300)
committerSergey Andreenko <seandree@microsoft.com>
Mon, 14 Oct 2019 23:10:23 +0000 (16:10 -0700)
1. Statement data members have "incorrect" order that leads to unnecessary alignment holes
2. LocalAddressVisitor dumps the statement tree twice

Commit migrated from https://github.com/dotnet/coreclr/commit/0f71a90f41cfae2a9675bb37150d3a7d4e8b1423

src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/morph.cpp

index d82e44f..b02b48e 100644 (file)
@@ -5303,14 +5303,14 @@ public:
     Statement(GenTree* expr, IL_OFFSETX offset DEBUGARG(unsigned stmtID))
         : m_rootNode(expr)
         , m_treeList(nullptr)
+        , m_next(nullptr)
+        , m_prev(nullptr)
         , m_inlineContext(nullptr)
         , m_ILOffsetX(offset)
 #ifdef DEBUG
         , m_lastILOffset(BAD_IL_OFFSET)
         , m_stmtID(stmtID)
 #endif
-        , m_next(nullptr)
-        , m_prev(nullptr)
         , m_compilerAdded(false)
     {
     }
@@ -5432,6 +5432,12 @@ private:
     // The value is `nullptr` until we have set the sequencing of the nodes.
     GenTree* m_treeList;
 
+    // The statement nodes are doubly-linked. The first statement node in a block points
+    // to the last node in the block via its `m_prev` link. Note that the last statement node
+    // does not point to the first: it's `m_next == nullptr`; that is, the list is not fully circular.
+    Statement* m_next;
+    Statement* m_prev;
+
     InlineContext* m_inlineContext; // The inline context for this statement.
 
     IL_OFFSETX m_ILOffsetX; // The instr offset (if available).
@@ -5441,12 +5447,6 @@ private:
     unsigned  m_stmtID;
 #endif
 
-    // The statement nodes are doubly-linked. The first statement node in a block points
-    // to the last node in the block via its `m_prev` link. Note that the last statement node
-    // does not point to the first: it's `m_next == nullptr`; that is, the list is not fully circular.
-    Statement* m_next;
-    Statement* m_prev;
-
     bool m_compilerAdded; // Was the statement created by optimizer?
 };
 
index febdaa9..f834b14 100644 (file)
@@ -17857,7 +17857,6 @@ public:
             if (m_stmtModified)
             {
                 printf("LocalAddressVisitor modified statement:\n");
-                m_compiler->gtDispTree(stmt->GetRootNode());
                 m_compiler->gtDispStmt(stmt);
             }