[PATCH] D88409: [SVE] Make ElementCount and TypeSize use a new PolySize class

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 05:27:58 PDT 2020


david-arm created this revision.
david-arm added reviewers: sdesmalen, ctetreau, efriedma, kmclaughlin, paulwalker-arm.
Herald added subscribers: llvm-commits, tatianashp, msifontes, ecnelises, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini, psnobl, rogfer01, hiraditya, tschuett.
Herald added a reviewer: aartbik.
Herald added a reviewer: ftynse.
Herald added projects: MLIR, LLVM.
david-arm requested review of this revision.
Herald added subscribers: vkmr, stephenneuendorffer, nicolasvasilache.

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 instance of PolySize<unsigned>, whereas TypeSize
remains as a class that derives from PolySize<uint64_t>. The
TypeSize class still needs to contain the uint64_t cast operator
because there are still many places in the code that rely upon it.
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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88409

Files:
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/include/llvm/CodeGen/ValueTypes.h
  llvm/include/llvm/Support/MachineValueType.h
  llvm/include/llvm/Support/TypeSize.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/CodeGen/TargetLoweringBase.cpp
  llvm/lib/Support/LowLevelType.cpp
  llvm/lib/Target/X86/X86InterleavedAccess.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.cpp
  mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88409.294669.patch
Type: text/x-patch
Size: 26108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200928/e85c68bb/attachment.bin>


More information about the llvm-commits mailing list