[PATCH] D75401: [InstSimplify] Remove freeze if its operand is used as a branch condition

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 29 15:04:01 PST 2020


aqjune added a comment.

In D75401#1899675 <https://reviews.llvm.org/D75401#1899675>, @sanjoy wrote:

> I don't remember this code very well but can there be an exit(0) between the freeze and branch?


Hi, I guess the condition was needed for loop unswitching:

  for (..) {
    g();
    if(b) { A } else { B }
  }

When unswitching `if(b)`, `g()` might exit or throw an exception, so `b` should be freezed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75401





More information about the llvm-commits mailing list