Skip to content

Commit

Permalink
[RLE-DSE] Refactor in DSE. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
trentxintong committed Nov 10, 2015
1 parent d62eee4 commit ea87329
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/SILPasses/GlobalDeadStoreElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
/// each block. The kill set tracks what MemLocations are stored into by this
/// basic block and its successors.
///
/// 3. An optimistic iterative dataflow is performed on the kill sets until
/// convergence.
/// 3. An optimistic iterative dataflow is performed on the gen sets and kill
/// sets until convergence.
///
/// At the core of DSE, there is the MemLocation class. a MemLocation is an
/// abstraction of an object field in program. It consists of a base and a
Expand Down Expand Up @@ -196,8 +196,8 @@ class BBState {
BBKillSet.resize(MemLocationCount, false);
}

/// Check whether the WriteSetIn has changed. If it does, we need to
/// re-iterate to reach fixed point.
/// Check whether the WriteSetIn has changed. If it does, we need to reiterate
/// to reach fixed point.
bool updateWriteSetIn();

/// Functions to manipulate the write set.
Expand All @@ -212,11 +212,9 @@ class BBState {
} // end anonymous namespace

bool BBState::updateWriteSetIn() {
if (WriteSetIn != WriteSetOut) {
WriteSetIn = WriteSetOut;
return true;
}
return false;
bool Changed = (WriteSetIn != WriteSetOut);
WriteSetIn = WriteSetOut;
return Changed;
}

void BBState::clearMemLocations() { WriteSetOut.reset(); }
Expand Down

0 comments on commit ea87329

Please sign in to comment.