[all-commits] [llvm/llvm-project] 8bc7ba: [MIPS GlobalISel] Select count trailing zeros

petar-avramovic via All-commits all-commits at lists.llvm.org
Mon Jan 27 00:52:16 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8bc7ba5b9ee04c697dcdbf0345e2fb06291806d2
      https://github.com/llvm/llvm-project/commit/8bc7ba5b9ee04c697dcdbf0345e2fb06291806d2
  Author: Petar Avramovic <Petar.Avramovic at rt-rk.com>
  Date:   2020-01-27 (Mon, 27 Jan 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
    A llvm/test/CodeGen/Mips/GlobalISel/legalizer/cttz.mir
    A llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/cttz.ll

  Log Message:
  -----------
  [MIPS GlobalISel] Select count trailing zeros

llvm.cttz.<type> intrinsic has additional i1 argument is_zero_undef,
it tells whether zero as the first argument produces a defined result.
G_CTTZ is generated from llvm.cttz.<type> (<type> <src>, i1 false)
intrinsics, clang generates these intrinsics from __builtin_ctz and
__builtin_ctzll.
G_CTTZ_ZERO_UNDEF comes from llvm.cttz.<type> (<type> <src>, i1 true).
Clang generates such intrinsics as parts of expansion of builtin_ffs
and builtin_ffsll. It is also traditionally part of and many
algorithms that are now predicated on avoiding zero-value inputs.

Add narrow scalar (algorithm uses G_CTTZ_ZERO_UNDEF) for G_CTTZ.
Lower G_CTTZ and G_CTTZ_ZERO_UNDEF for MIPS32.

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




More information about the All-commits mailing list