[PATCH] D80077: [LiveVariables] Don't set undef reg PHI used as live for FromMBB

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 02:08:24 PDT 2020


lkail added a comment.

> For example:
> 
> bb.0:
> 
>   ... // no-definiton for %2
> 
> bb.1:
> 
>   ...  // definiton for %1
> 
> bb.2:
> 
>   %3:g8rc = PHI %1, %bb.1, undef %2:g8rc, %bb.0
> 
> It's obvious that, the %2 shouldn't live in bb.0, but the patch D73152 <https://reviews.llvm.org/D73152> will set it live for bb.0.

I think it makes sense that `%2` live through `bb.0`, as comment of `VarInfo` in `LiveVariables.h` writes

  /// PHI nodes complicate things a bit.  If a PHI node is the last user of a
  /// value in one of its predecessor blocks, it is not listed in the kills set,
  /// but does include the predecessor block in the AliveBlocks set (unless that
  /// block also defines the value).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80077/new/

https://reviews.llvm.org/D80077





More information about the llvm-commits mailing list