[all-commits] [llvm/llvm-project] 255ad7: [ARM] Make MVE v2i1 predicates legal

David Green via All-commits all-commits at lists.llvm.org
Fri Dec 3 06:05:53 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 255ad7342436ff4901d39579f694857f83386dad
      https://github.com/llvm/llvm-project/commit/255ad7342436ff4901d39579f694857f83386dad
  Author: David Green <david.green at arm.com>
  Date:   2021-12-03 (Fri, 03 Dec 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/lib/Target/ARM/ARMInstrMVE.td
    M llvm/lib/Target/ARM/ARMRegisterInfo.td
    M llvm/test/Analysis/CostModel/ARM/arith-overflow.ll
    M llvm/test/Analysis/CostModel/ARM/arith-ssat.ll
    M llvm/test/Analysis/CostModel/ARM/arith-usat.ll
    M llvm/test/Analysis/CostModel/ARM/mve-abs.ll
    M llvm/test/Analysis/CostModel/ARM/mve-minmax.ll
    M llvm/test/Analysis/CostModel/ARM/reduce-smax.ll
    M llvm/test/Analysis/CostModel/ARM/reduce-smin.ll
    M llvm/test/Analysis/CostModel/ARM/reduce-umax.ll
    M llvm/test/Analysis/CostModel/ARM/reduce-umin.ll
    M llvm/test/Analysis/CostModel/ARM/select.ll
    M llvm/test/CodeGen/Thumb2/active_lane_mask.ll
    M llvm/test/CodeGen/Thumb2/mve-fpclamptosat_vec.ll
    M llvm/test/CodeGen/Thumb2/mve-fptosi-sat-vector.ll
    M llvm/test/CodeGen/Thumb2/mve-fptoui-sat-vector.ll
    M llvm/test/CodeGen/Thumb2/mve-intrinsics/predicates.ll
    M llvm/test/CodeGen/Thumb2/mve-laneinterleaving.ll
    M llvm/test/CodeGen/Thumb2/mve-masked-ldst.ll
    M llvm/test/CodeGen/Thumb2/mve-masked-load.ll
    M llvm/test/CodeGen/Thumb2/mve-masked-store.ll
    M llvm/test/CodeGen/Thumb2/mve-minmax.ll
    M llvm/test/CodeGen/Thumb2/mve-minmaxi.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-and.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-bitcast.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-build-const.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-build-var.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-const.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-ext.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-loadstore.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-not.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-or.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-shuffle.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-spill.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-vselect.ll
    M llvm/test/CodeGen/Thumb2/mve-pred-xor.ll
    M llvm/test/CodeGen/Thumb2/mve-satmul-loops.ll
    M llvm/test/CodeGen/Thumb2/mve-saturating-arith.ll
    M llvm/test/CodeGen/Thumb2/mve-vabdus.ll
    M llvm/test/CodeGen/Thumb2/mve-vcmp.ll
    M llvm/test/CodeGen/Thumb2/mve-vcmpr.ll
    M llvm/test/CodeGen/Thumb2/mve-vcmpz.ll
    M llvm/test/CodeGen/Thumb2/mve-vctp.ll
    M llvm/test/CodeGen/Thumb2/mve-vecreduce-addpred.ll
    M llvm/test/CodeGen/Thumb2/mve-vecreduce-mlapred.ll
    M llvm/test/CodeGen/Thumb2/mve-vmovimm.ll
    M llvm/test/CodeGen/Thumb2/mve-vpsel.ll
    M llvm/test/CodeGen/Thumb2/mve-vqmovn.ll
    M llvm/test/CodeGen/Thumb2/mve-vqshrn.ll
    M llvm/test/CodeGen/Thumb2/mve-vselect-constants.ll
    M llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
    M llvm/test/Transforms/LoopVectorize/ARM/mve-selectandorcost.ll

  Log Message:
  -----------
  [ARM] Make MVE v2i1 predicates legal

MVE can treat v16i1, v8i1, v4i1 and v2i1 as different views onto the
same 16bit VPR.P0 register, with v2i1 holding two 8 bit values for the
two halves. This was never treated as a legal type in llvm in the past
as there are not many 64bit instructions and no 64bit compares. There
are a few instructions that could use it though, notably a VSELECT (as
it can handle any size using the underlying v16i8 VPSEL), AND/OR/XOR for
similar reasons, some gathers/scatter and long multiplies and VCTP64
instructions.

This patch goes through and makes v2i1 a legal type, handling all the
cases that fall out of that. It also makes VSELECT legal for v2i64 as a
side benefit. A lot of the codegen changes as a result - usually in way
that is a little better or a little worse, but still expensive. Costs
can change a little too in the process, again in a way that expensive
things remain expensive. A lot of the tests that changed are mainly to
ensure correctness - the code can hopefully be improved in the future
where it comes up in practice.

The intrinsics currently remain using the v4i1 they previously did to
emulate a v2i1. This will be changed in a followup patch but this one
was already large enough.

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




More information about the All-commits mailing list