[PATCH] D147692: [LoongArch] Optimize multiplication with immediates

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 20:04:59 PDT 2023


benshi001 marked an inline comment as done.
benshi001 added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:3169
+    // Break (MUL x, imm) into (ADD/SUB (SLLI x, s0), (SLLI x, s1)),
+    // in which the immediate has two set bits.
+    // We should reject immediates which can be composed via a single
----------------
SixWeining wrote:
> Seems this condition only applies to `ADD` but no `SUB`. For example, in below test, `65280` is 0xff00 which has 8 consecutive set bits.
> 
Thanks. Fixed.


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

https://reviews.llvm.org/D147692



More information about the llvm-commits mailing list