[all-commits] [llvm/llvm-project] 3bf83e: [LoopIdiom] Reland: Support 'shift until less-than...

Hari Limaye via All-commits all-commits at lists.llvm.org
Tue Jul 16 05:58:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3bf83e3866237cd35c9828880241f5863d625ed9
      https://github.com/llvm/llvm-project/commit/3bf83e3866237cd35c9828880241f5863d625ed9
  Author: Hari Limaye <hari.limaye at arm.com>
  Date:   2024-07-16 (Tue, 16 Jul 2024)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
    A llvm/test/Transforms/LoopIdiom/AArch64/ctlz.ll

  Log Message:
  -----------
  [LoopIdiom] Reland: Support 'shift until less-than' idiom #95002 (#98298)

The original patch failed to handle the case where the loopback
condition compared against a constant exceeding 64 bit unsigned range -
which caused a buildbot failure.

This PR fixes this and relands the original PR #95002.

The current loop idiom code for recognising and inserting a CTLZ
intrinsic does not support loops where the loopback control is based on
an unsigned less-than condition. This patch adds support for recognising
these loops and inserting a CTLZ intrinsic.

Fixes the missed optimization cases in #51064.

---------

Co-authored-by: David Sherwood <david.sherwood at arm.com>



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