[PATCH] D102262: [ValueTypes] Rename MVT::getVectorNumElements() to MVT::getVectorMinNumElements(). Fix some misuses of getVectorNumElements()

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 11:01:59 PDT 2021


craig.topper created this revision.
craig.topper added reviewers: frasercrmck, sdesmalen, evandro, HsiangKai, khchen, arcbbb, rogfer01.
Herald added subscribers: StephenFan, dexonsmith, luismarques, pengfei, s.egerton, PkmX, simoncook, hiraditya.
craig.topper requested review of this revision.
Herald added a project: LLVM.

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.

This was motivated by the bug I fixed yesterday in 80b9510806cf11c57f2dd87191d3989fc45defa8 <https://reviews.llvm.org/rG80b9510806cf11c57f2dd87191d3989fc45defa8>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102262

Files:
  llvm/include/llvm/Support/MachineValueType.h
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/utils/TableGen/CodeGenDAGPatterns.cpp
  llvm/utils/TableGen/IntrinsicEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102262.344490.patch
Type: text/x-patch
Size: 5049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210511/0200c2b3/attachment.bin>


More information about the llvm-commits mailing list