[PATCH] D149299: [X86] Add tests for checking `isKnownNeverZero`; NFC
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 27 09:55:53 PDT 2023
RKSimon added inline comments.
================
Comment at: llvm/test/CodeGen/X86/known-never-zero.ll:288
+ %shl = shl i32 %x, %sub
+ %z = or i32 %shl, %shr
+ %r = call i32 @llvm.cttz.i32(i32 %z, i1 false)
----------------
goldstein.w.n wrote:
> RKSimon wrote:
> > use the fshl/fshr intrinsics here to help ensure you're testing the ROTL/ROTR paths
> I originally did this, but as I was working on the change I noticed we are also missing non-zero case for funnel-shift in the middle end. I filled in the middle-end case and found it was affecting the `CodeGen` test and figured it be best to avoid that kind of inter-dependency. Changes to `ValueTracking.cpp` shouldn't mess with a test in `CodeGen/X86`.
>
> Maybe different `llc` flags?
CodeGenPrepare (despeculateCountZeros) is trying to prevent CTLZ/CTTZ zero-input branching from appearing, using ValueTracking's variant of isKnownNonZero
I wonder if there's something other than CTTZ we could use?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149299/new/
https://reviews.llvm.org/D149299
More information about the llvm-commits
mailing list