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

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 04:17:34 PDT 2020


shchenz added a comment.

> Since PHI elimination runs after having removed IMPLICIT_DEF:s, the PHI node here is the first reference to %2. So there is no def of %2 in any predecessor blocks.

I am not familiar with the PHI elimination pass, but the IR `%3:g8rc = PHI [%1, %bb.0], [undef %2:g8rc, %bb.0]` seems a little strange to me. We have two incoming values from bb `%bb.0`, `undef` and `%2:g8rc`. Which one is right? and what if `%2:g8rc` has a definition in predecessor blocks? I think if `undef` is generated in PHI elimination pass based on that `%2:g8rc` has no definition, then why don't we just eliminate `%2:g8rc` when we add `undef` use?


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