[all-commits] [llvm/llvm-project] a31f4b: [CodeGen][SVE] Use whilelo instruction when loweri...

david-arm via All-commits all-commits at lists.llvm.org
Mon Nov 29 00:30:43 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a31f4bdfe8211ecb38741c4fd570baf0d6e16f76
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2021-11-29 (Mon, 29 Nov 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.h
    M llvm/test/CodeGen/AArch64/active_lane_mask.ll

  Log Message:
  [CodeGen][SVE] Use whilelo instruction when lowering @llvm.get.active.lane.mask

In most common cases the @llvm.get.active.lane.mask intrinsic maps directly
to the SVE whilelo instruction, which already takes overflow into account.
However, currently in SelectionDAGBuilder::visitIntrinsicCall we always lower
this immediately to a generic sequence of instructions that explicitly
take overflow into account. This makes it very difficult to then later
transform back into a single whilelo instruction. Therefore, this patch
introduces a new TLI function called shouldExpandGetActiveLaneMask that asks if
we should lower/expand this to a sequence of generic ISD nodes, or instead
just leave it as an intrinsic for the target to lower.

You can see the significant improvement in code quality for some of the
tests in this file:


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

More information about the All-commits mailing list