[PATCH] D97756: [LoopUnswitch] unswitch if cond is in select form of and/or as well

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 19:59:50 PST 2021


aqjune added inline comments.


================
Comment at: llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch.ll:4212
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    %[[INV_AND:.*]] = and i1 %cond2, %cond1
+; CHECK-NEXT:    br i1 %[[INV_AND]], label %entry.split, label %entry.split.us
----------------
nikic wrote:
> This doesn't look safe. Previously, if `%v1` is false then `%cond1` is not used. Now we unconditionally branch on `%cond1`.
> 
> Or is the logic here that unswitching requires insertion of `freeze` for normal and/or anyway, and we leave this as a miscompile until that is resolved?
Yes, I think the issue can resolved in a separate patch; anyway loop unswitch requires insertion of `freeze`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97756



More information about the llvm-commits mailing list