[PATCH] D148986: [InstSimplify] with logical ops: (X | Y) ? 0 : X --> 0

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 22 20:03:23 PDT 2023


Allen added a comment.

hi @nikic,  Why do we need delete the following modifications? I find some regression with some case, such as select_or_1

  Remove https://github.com/llvm/llvm-project/blob/9ea3fcfa380c6097fddd0d9a9b2c13f0f20bc41a/llvm/lib/Analysis/InstructionSimplify.cpp#L4585-L4598

  +++ b/llvm/test/Transforms/InstSimplify/select_or_and.ll
  @@ -5,7 +5,9 @@
   define i32 @select_or_1(i32 %x, i32 %y) {
   ; CHECK-LABEL: @select_or_1(
   ; CHECK-NEXT:    [[OR:%.*]] = or i32 [[Y:%.*]], [[X:%.*]]
  -; CHECK-NEXT:    ret i32 [[OR]]
  +; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i32 [[OR]], 0
  +; CHECK-NEXT:    [[RET:%.*]] = select i1 [[CMP]], i32 [[X]], i32 [[OR]]
  +; CHECK-NEXT:    ret i32 [[RET]]


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

https://reviews.llvm.org/D148986



More information about the llvm-commits mailing list