[all-commits] [llvm/llvm-project] 6f75c6: [KnownBits] Add fast-path for shl with unknown shi...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri May 26 04:57:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f75c6681d47164072daea54dde2727c51b0e739
      https://github.com/llvm/llvm-project/commit/6f75c6681d47164072daea54dde2727c51b0e739
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-05-26 (Fri, 26 May 2023)

  Changed paths:
    M llvm/lib/Support/KnownBits.cpp

  Log Message:
  -----------
  [KnownBits] Add fast-path for shl with unknown shift amount (NFC)

We currently don't call into KnownBits::shl() from ValueTracking
if the shift amount is unknown. If we do try to do so, we get
significant compile-time regressions, because evaluating all 64
shift amounts if quite expensive, and mostly pointless in this case.
Add a fast-path for the case where the shift amount is the full
[0, BitWidth-1] range. This primarily requires a more accurate
estimate of the max shift amount, to avoid taking the fast-path in
too many cases.

Differential Revision: https://reviews.llvm.org/D151540




More information about the All-commits mailing list