[all-commits] [llvm/llvm-project] fd2bb5: [ADT] Add APInt/MathExtras isShiftedMask variant r...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Feb 8 04:04:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd2bb51f1ec3f53e5dd1e69eb48bf191b49edda4
      https://github.com/llvm/llvm-project/commit/fd2bb51f1ec3f53e5dd1e69eb48bf191b49edda4
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-02-08 (Tue, 08 Feb 2022)

  Changed paths:
    M llvm/include/llvm/ADT/APInt.h
    M llvm/include/llvm/Support/MathExtras.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
    M llvm/lib/Target/Mips/MipsISelLowering.cpp
    M llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp
    M llvm/unittests/ADT/APIntTest.cpp
    M llvm/unittests/Support/MathExtrasTest.cpp

  Log Message:
  -----------
  [ADT] Add APInt/MathExtras isShiftedMask variant returning mask offset/length

In many cases, calls to isShiftedMask are immediately followed with checks to determine the size and position of the bitmask.

This patch adds variants of APInt::isShiftedMask, isShiftedMask_32 and isShiftedMask_64 that return these values as additional arguments.

I've updated a number of cases that were either performing seperate size/position calculations or had created their own local wrapper versions of these.

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




More information about the All-commits mailing list