[PATCH] D145299: [InstCombine] Generate better code for std::bit_ceil

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 19 13:47:09 PDT 2023


kazu marked an inline comment as done.
kazu added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/bit_ceil.ll:14
 ;
   %dec = add i32 %x, -1
   %ctlz = tail call i32 @llvm.ctlz.i32(i32 %dec, i1 false)
----------------
goldstein.w.n wrote:
> Can you add some tests where there are prior transformations on `%x` (some binops like add/sub/shift/and/xor/or) to test that this impl is is reasonable robust in finding the pattern.
I added a few more tests:

https://github.com/llvm/llvm-project/commit/ef860cf150f0d7e0f635026c55182bc1f65ac8f9

I'll update this patch shortly


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145299



More information about the llvm-commits mailing list