[PATCH] D42667: SplitKit: Fix liveness recomputation in some remat cases.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 15:33:14 PST 2018


MatzeB created this revision.
MatzeB added reviewers: qcolombet, wmi, kparzysz.
Herald added a subscriber: mcrosier.

Example situation:

  BB0:
    %0 = ...
    use %0
    ; ...
    condjump BB1
    jmp BB2
  
  BB1:
    %0 = ...   ; rematerialized def from above (from earlier split step)
    jmp BB2
  
  BB2:
    ; ...
    use %0

%0 has a live interval with 3 value numbers (for the BB0, BB1 and
BB2 parts). Now SplitKit tries to rematerialize the value in BB2 before the use.
This can succeed if this is actually a secondary split
SplitKit can still trace it all back to a single original definition.

In case of rematerialization live ranges may become shorter and need to be recomputed.
The case that we missed before is that when the value
that is rematerialized is at a join (Phi VNI) then we also have to
recompute liveness for the predecessor VNIs.

Do you guys want a 500kb testcase (that is the size after reducing it with bugpoint) in the repository for this?


Repository:
  rL LLVM

https://reviews.llvm.org/D42667

Files:
  lib/CodeGen/SplitKit.cpp
  lib/CodeGen/SplitKit.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42667.131888.patch
Type: text/x-patch
Size: 4959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180129/f70fe759/attachment.bin>


More information about the llvm-commits mailing list