[PATCH] D16379: LiveIntervalAnalysis: Cleanup handleMove{Down|Up}() functions, NFC

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 16:08:00 PST 2016


MatzeB created this revision.
MatzeB added reviewers: atrick, qcolombet, stoklund.
MatzeB added a subscriber: llvm-commits.
MatzeB set the repository for this revision to rL LLVM.
Herald added subscribers: mcrosier, MatzeB.

These two functions are hard to reason about. This commit makes
the code more comprehensible:
- Use four distinct variables (OldIdxIn, OldIdxOut, NewIdxIn, NewIdxOut)
  with a fixed value instead of a changing iterator I that points to
  different things during the function.
- Remove the early explanation before the function in favor of more
  detailed comments inside the function. Should have more/clearer comments now
  stating which conditions are tested and which invariants hold at
  different points in the functions.

The behaviour of the code was not changed.

I hope that this will make it easier to review the changes in
http://reviews.llvm.org/D9067 which I will adapt next.

Repository:
  rL LLVM

http://reviews.llvm.org/D16379

Files:
  include/llvm/CodeGen/SlotIndexes.h
  lib/CodeGen/LiveIntervalAnalysis.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16379.45459.patch
Type: text/x-patch
Size: 14258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160121/6b122fd3/attachment.bin>


More information about the llvm-commits mailing list