[PATCH] D87304: [AttributeFuncs] Consider `align` in `typeIncompatible`

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 08:27:30 PDT 2020


jdoerfert added a comment.

> @jdoerfert I'm wondering why we need to specially treat vector of pointers? We can add a LangRef statement for this, but vector is just another type. The way I read it, whatever is done for the scalar type, we do so for the vector type by considering each element. So, in this case, the `align 8 <4 x i32*>` implies that each pointer in the vector is aligned by 8 bytes.

I don't read it that way because it is not clear this is the case/what we want for all attributes. We cannot silently pick and choose when attributes are applied element wise and when not. Take

  `align 8 inalloca noundef <4 x i32*>`

for which I do not know what applies element wise and what applies to the vector value. TBH, maybe we need both ...

A reasonable first step would be to have a statement staying some attributes apply element-wise, let's say all that apply only to pointer types.
Afterwards, `typeIncompatible` can be adjusted easily. It's important that it's not only `align` though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87304/new/

https://reviews.llvm.org/D87304



More information about the llvm-commits mailing list