[all-commits] [llvm/llvm-project] 4a9680: [AArch64] Avoid overflow when using shl lower mul ...

DianQK via All-commits all-commits at lists.llvm.org
Sat Jun 29 15:23:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a96803abda2ad74f326de0af6b16552067bda65
      https://github.com/llvm/llvm-project/commit/4a96803abda2ad74f326de0af6b16552067bda65
  Author: DianQK <dianqk at dianqk.net>
  Date:   2024-06-30 (Sun, 30 Jun 2024)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/test/CodeGen/AArch64/mul_pow2.ll

  Log Message:
  -----------
  [AArch64] Avoid overflow when using shl lower mul (#97148)

Fixes #97147.

Transforming `(mul x, -(2^(N-M) - 1) * 2^M)` to `(sub (shl x, M), (shl
x, N))` will cause overflow when N is 32 and M is 31. I still added
checks for all scenarios, even other scenarios, don't seem to cause overflow.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list