[PATCH] D133449: [InstCombine] Baseline tests for folding x + (x | -x) to x & (x - 1)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 15:43:23 PDT 2022


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/add_or_sub.ll:92
+
+define i19 @add_or_sub_comb_i19_multiuse(i19 %p) {
+; CHECK-LABEL: @add_or_sub_comb_i19_multiuse(
----------------
This looks good, but there should be 3 of these multi-use tests:
1. Extra use of the sub only.
2. Extra use of the or only.
3. Extra use of both sub and or (that's what we have currently).

The general rule for instcombine transforms is that we don't want to end up with more instructions than we started with, so it can get a bit tricky, but we'll sort that out in the code patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133449



More information about the llvm-commits mailing list