[PATCH] D143175: [SimpleLoopUnswitch] Canonicalize conditions for injection of invariant condition

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 02:26:45 PST 2023


mkazantsev added inline comments.


================
Comment at: llvm/test/Transforms/SimpleLoopUnswitch/inject-invariant-conditions.ll:193
 ; CHECK-NEXT:    [[LEN:%.*]] = load i32, ptr [[LEN_P:%.*]], align 4, !noundef !0
-; CHECK-NEXT:    br label [[LOOP:%.*]]
+; CHECK-NEXT:    [[INJECTED_COND:%.*]] = icmp ule i32 -2147483648, [[LEN]]
+; CHECK-NEXT:    br i1 [[INJECTED_COND]], label [[LOOP_US:%.*]], label [[LOOP:%.*]]
----------------
skatkov wrote:
> skatkov wrote:
> > This seems unlikely profitable... Why not max from -2147483648 and [[LEN]]?
> > 
> > Or do I miss anything?
> min I meant.
It's just a confusing name, I'll rename it. In fact, it is profitable when `len <s 0`. If you look at test_04 which is the aim of this whole thing, it should make it more clear.


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

https://reviews.llvm.org/D143175



More information about the llvm-commits mailing list