[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
Thu May 11 15:09:50 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:50299-50301
+  //    (and (shl (sub 0, x), C0), C1)
+  // to
+  //    (and (mul x, (Pow2_Ceil(C1) - (1 << C0))), C1)
----------------
pengfei wrote:
> goldstein.w.n wrote:
> > pengfei wrote:
> > > The comments don't match description. Maybe change one side.
> > hmm? Think its correct although it may be confusing because its talking about the transform we are undoing, not what we are doing. 
> Just nitpick. I mean you use `C1/C2` in description but `C0/C1` here. Also `and/mul` vs. `&/*`.
Ahh I see. Did the `&/*` in the title to save characters. Then finished the summary like that to stay consistent. 

But done, made this part consistent as well.


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