[PATCH] D150294: [X86] Invert transforming `(x * (Pow2_Ceil(C1) - (1 << C0))) & C1` -> `(-x << C0) & C1`
Noah Goldstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 13 10:12:20 PDT 2023
goldstein.w.n marked 3 inline comments as done.
goldstein.w.n added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:50332
+ /*AllowTruncation*/ false);
+ if (N1C && N01C) {
+ const APInt &MulC = N01C->getAPIntValue();
----------------
RKSimon wrote:
> There's no strong reason to require N1 to be a splat - you should be able to use matchUnaryPredicate, this is true for N01C as well, but non-uniform shift costs are trickier (even where they're legal).
>
> But all this can be looked at in a followup - maybe add a TODO?
Added TODO (tests also have todo for this).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150294/new/
https://reviews.llvm.org/D150294
More information about the llvm-commits
mailing list