[PATCH] D132322: [AArch64][SelectionDAG] Optimize multiplication by constant

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 17:08:46 PDT 2022


hiraditya added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:13599
+    if ((Imm + 1).isPowerOf2() || (Imm - 1).isPowerOf2() ||
+        (1 - Imm).isPowerOf2() || (-1 - Imm).isPowerOf2())
+      return true;
----------------
What is the rationale behind checking `Imm+1` etc?


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

https://reviews.llvm.org/D132322



More information about the llvm-commits mailing list