[PATCH] D76720: [Transforms][SROA] Disable pass for scalable vectors

Cullen Rhodes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 11:49:17 PDT 2020


c-rhodes created this revision.
c-rhodes added reviewers: efriedma, cameron.mcinally, sdesmalen, ctetreau, chandlerc.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Aggregate types containing scalable vectors aren't supported and as far
as I can tell this pass is mostly concerned with optimisations on
aggregate types, so it doesn't make sense to support scalable vectors in
this pass.

This patch disables scalable vectors by simply exiting if the type of
the alloca has the scalable property set. The use of TypeSize in this
pass has also been updated to be explicitly fixed size. When invoking
the following methods in DataLayout:

- getTypeSizeInBits
- getTypeStoreSize
- getTypeStoreSizeInBits
- getTypeAllocSize

we now called getFixedSize on the resultant TypeSize. This is quite an
extensive change with around 50 calls to these functions, and also the
first change of this kind (being explicit about fixed vs scalable
size) as far as I'm aware, so feedback welcome.

A test is included containing IR with scalable vectors that this pass is
able to optimise. We check no optimisation occurs. Also worth noting
mem2reg can also do the equivalent optimisation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76720

Files:
  llvm/include/llvm/IR/Type.h
  llvm/lib/Transforms/Scalar/SROA.cpp
  llvm/test/Transforms/SROA/scalable-vectors.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76720.252384.patch
Type: text/x-patch
Size: 22999 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200324/aedf790a/attachment.bin>


More information about the llvm-commits mailing list