[PATCH] D156619: [InstCombine] Improve foldOpIntoPhi() to use isImpliedCondition tests

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 11:28:34 PDT 2023


nikic added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/phi.ll:1703
+  ret i1 %cmp
+}
+
----------------
Please run these tests through `-passes=instnamer` to get rid of the unnamed variables.


================
Comment at: llvm/test/Transforms/InstCombine/phi.ll:1778
+
+sub_is_zero:
+  %5 = getelementptr inbounds i8, ptr %C, i64 1
----------------
This is really sub_is_not_zero.


================
Comment at: llvm/test/Transforms/InstCombine/phi.ll:1876
+
+define i1 @cmp_ne_phi_node_can_fold_2(ptr %C) {
+; CHECK-LABEL: @cmp_ne_phi_node_can_fold_2(
----------------
I think you can omit the _2, _3, _4 variants of this test. They're already checked for _eq, and we don't need to repeat all variants every time.


================
Comment at: llvm/test/Transforms/InstCombine/phi.ll:2034
+
+sub_is_zero:
+  %5 = getelementptr inbounds i8, ptr %C, i64 1
----------------
sub_is_not_zero


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156619



More information about the llvm-commits mailing list