[PATCH] D146792: [LoopPredication] Do not sink conditions to branches. PR61673

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 26 21:49:26 PDT 2023


mkazantsev added a comment.

> It seems there is a wider problem here. At least, according to me, there is nothing in the semantics of widenable condition that prevents us from sinking widenable condition into the loop.

@anna here is how WC is declared:

  // Supports widenable conditions for guards represented as explicit branches.
  def int_experimental_widenable_condition : Intrinsic<[llvm_i1_ty], [],
                                             [IntrInaccessibleMemOnly, IntrWillReturn]>;

it has semantics of accessing innacessible memory. In particular, it can read or write it. So you cannot sink it into the loops for the same reasons as you cannot do so to volatile loads. Hoisting - possibly legal (assuming that no one else is accessing this memory), but sinking is sure not.


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

https://reviews.llvm.org/D146792



More information about the llvm-commits mailing list