[all-commits] [llvm/llvm-project] 44e0e9: [ValueTypes] Rename MVT::getVectorNumElements() to...

Craig Topper via All-commits all-commits at lists.llvm.org
Wed May 12 08:03:56 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 44e0e91db01abb9de1868f5acf3ff4f2648b8fc0
      https://github.com/llvm/llvm-project/commit/44e0e91db01abb9de1868f5acf3ff4f2648b8fc0
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-05-12 (Wed, 12 May 2021)

  Changed paths:
    M llvm/include/llvm/Support/MachineValueType.h
    M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
    M llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
    M llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
    M llvm/lib/Target/PowerPC/PPCISelLowering.h
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/utils/TableGen/CodeGenDAGPatterns.cpp
    M llvm/utils/TableGen/IntrinsicEmitter.cpp

  Log Message:
  -----------
  [ValueTypes] Rename MVT::getVectorNumElements() to MVT::getVectorMinNumElements(). Fix some misuses of getVectorNumElements()

getVectorNumElements() returns a value for scalable vectors
without any warning so it is effectively getVectorMinNumElements().
By renaming it and making getVectorNumElements() forward to
it, we can insert a check for scalable vectors into getVectorNumElements()
similar to EVT. I didn't do that in this patch because there are still more
fixes needed, but I was able to temporarily do it and passed the RISCV
lit tests with these changes.

The changes to isPow2VectorType and getPow2VectorType are copied from EVT.

The change to TypeInfer::EnforceSameNumElts reduces the size of AArch64's isel table.
We're now considering SameNumElts to require the scalable property to match which
removes some unneeded type checks.

This was motivated by the bug I fixed yesterday in 80b9510806cf11c57f2dd87191d3989fc45defa8

Reviewed By: frasercrmck, sdesmalen

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




More information about the All-commits mailing list