[PATCH] D151295: [LVI] Don't compute range on not guaranteed not to be undef condition in SelectInst

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 00:41:49 PDT 2023


StephenFan added inline comments.


================
Comment at: llvm/test/Transforms/CorrelatedValuePropagation/select.ll:268
+; CHECK-NEXT:    [[IS_A_NONNEGATIVE:%.*]] = icmp sgt i32 [[A:%.*]], 1
+; CHECK-NEXT:    [[NARROW:%.*]] = select i1 [[IS_A_NONNEGATIVE]], i32 [[A]], i32 0
+; CHECK-NEXT:    [[MAX:%.*]] = sext i32 [[NARROW]] to i64
----------------
Allen wrote:
> could it freeze the operand instead ? https://alive2.llvm.org/ce/z/xfwAJ2
Yes, we can do this. But LazyValueInfo is an analysis pass, we can not freeze it in it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151295



More information about the llvm-commits mailing list