[all-commits] [llvm/llvm-project] e909c0: [SelectOpt] Add support for AShr/LShr operands (#1...

Igor Kirillov via All-commits all-commits at lists.llvm.org
Thu Dec 12 06:06:45 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e909c0ccd40e6d6aa2d10e0b60e8b992f3cde35b
      https://github.com/llvm/llvm-project/commit/e909c0ccd40e6d6aa2d10e0b60e8b992f3cde35b
  Author: Igor Kirillov <igor.kirillov at arm.com>
  Date:   2024-12-12 (Thu, 12 Dec 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectOptimize.cpp
    M llvm/test/CodeGen/AArch64/selectopt-cast.ll

  Log Message:
  -----------
  [SelectOpt] Add support for AShr/LShr operands (#118495)

For conditional increments with sign check conditions like X < 0 or X >= 0,
the compiler may generate code like this:

  %cmp = icmp sgt i64 %1, -1
  %shift = ashr i64 %1, 63
  %j.next = add nsw i64 %j, %shift
  %sel = select i1 %cmp ...

, where %cmp is not in computation but in some other implicit or regular
expressions. This patch allows SelectOptimize pass to recognise these
cases.



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