Calculate last uses during buildIntervals.
authorPat Gavlin <pagavlin@microsoft.com>
Wed, 8 Mar 2017 03:50:53 +0000 (19:50 -0800)
committerPat Gavlin <pagavlin@microsoft.com>
Wed, 8 Mar 2017 06:17:15 +0000 (22:17 -0800)
commitadf3dd7ccdb8f25173d0b96872c4916dd50be20c
treed4cf066b977bfa6fe6712a1131e075c345b2e5fb
parent8902cdb044587ec713f25cb2a137b9532b98e7a2
Calculate last uses during buildIntervals.

This change moves LSRA's last use calculation from `setLastUses`
into `buildIntervals`.

The algorithm flips is as follows:
- When adding a ref position to a lclVar interval:
    - If the ref position is not a parameter def, zero init, or an
      exposed use, set the ref position's last use bit
    - Additionally, if the ref position is a use and there is a
      preceding ref position in the same basic block, clear that ref
      position's last use bit.
- Once a basic block has been processed, clear the last use bit of the
  final ref position in that basic block (if any exists) for each lclVar
  that is live out of that block.

Aside from the algorithmic change, the other major difference is that
the GTF_VAR_DEATH bit is not updated until `resolveLocalRef`.
src/jit/lsra.cpp
src/jit/lsra.h