[all-commits] [llvm/llvm-project] c5ba0d: [SVE] Make ElementCount and TypeSize use a new Pol...

david-arm via All-commits all-commits at lists.llvm.org
Mon Oct 12 00:54:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c5ba0d33cc060cc06a28a5d9101060afd1c0ee9a
      https://github.com/llvm/llvm-project/commit/c5ba0d33cc060cc06a28a5d9101060afd1c0ee9a
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2020-10-12 (Mon, 12 Oct 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/include/llvm/CodeGen/ValueTypes.h
    M llvm/include/llvm/IR/Intrinsics.h
    M llvm/include/llvm/Support/MachineValueType.h
    M llvm/include/llvm/Support/TypeSize.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/TargetLoweringBase.cpp
    M llvm/lib/Support/LowLevelType.cpp
    M llvm/lib/Target/X86/X86InterleavedAccess.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.cpp

  Log Message:
  -----------
  [SVE] Make ElementCount and TypeSize use a new PolySize class

I have introduced a new template PolySize class, where the template
parameter determines the type of quantity, i.e. for an element
count this is just an unsigned value. The ElementCount class is
now just a simple derivation of PolySize<unsigned>, whereas TypeSize
is more complicated because it still needs to contain the uint64_t
cast operator, since there are still many places in the code that
rely upon this implicit cast. As such the class also still needs
some of it's own operators.

I've tried to minimise the amount of code in the base PolySize
class, which led to a couple of changes:

1. In some places we were relying on '==' operator comparisons
between ElementCounts and the scalar value 1. I didn't put this
operator in the new PolySize class, and thought it was actually
clearer to use the isScalar() function instead.
2. I removed the isByteSized function and replaced it with calls
to isKnownMultipleOf(8).

I've also renamed NextPowerOf2 to be coefficientNextPowerOf2 so
that it's more consistent with coefficientDivideBy.

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




More information about the All-commits mailing list