[PATCH] D150294: [X86] Transforming `(x*C0)&C1`->`(-x<<log2(C0&(-C0)))&C1`

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 00:48:54 PDT 2023


pengfei added a comment.

The title is misleading because we cannot transforming arbitrary `C0`. Maybe "[X86] Invert transforming `(x * (Pow2_Ceil(C0) - (1 << C1))) & C0` -> `(-x << C1) & C0`"?

Typo: "wan't" -> "want"



================
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)
----------------
The comments don't match description. Maybe change one side.


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