[PATCH] D99452: Make FoldBranchToCommonDest poison-safe by default

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 27 02:40:59 PDT 2021


aqjune added inline comments.


================
Comment at: llvm/test/Transforms/IRCE/bad_expander.ll:101
 ; CHECK-NEXT:    %rc = icmp slt i64 %iv.next, %div_result
-; CHECK-NEXT:    %or.cond = and i1 %maybe_exit, true
+; CHECK-NEXT:    %or.cond = select i1 %maybe_exit, i1 true, i1 false
 ; CHECK-NEXT:    br i1 %or.cond, label %guarded, label %exit.loopexit1
----------------
nikic wrote:
> This looks a bit suspect to me. Shouldn't the impliesPoison turn this into an `and`, because `true` cannot be poison? Or does this only get folded to true lateron?
FoldBranchToCommonDest merges `%maybe_exit` and `%rc`, so `select` is created at the moment. `%rc` is folded to true later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99452



More information about the llvm-commits mailing list