[PATCH] D12221: [RFC] Introduce `__attribute__((nontemporal))`.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 21 13:22:45 PDT 2015


On Fri, Aug 21, 2015 at 12:14 PM, Michael Zolotukhin via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> mzolotukhin added a comment.
>
> Oh, I see. So, you meant something like this?
>
>   void foo(std::vector<float * __attribute__((nontemporal))> av, float *
> b, int N) {
>     for (auto a: av)      // << `a` doesn't have nontemporal attribute here
>       for (int i = 0; i < N; i++)
>         a[i] = b[i]+1;
>   }
>
> One can easily work around it by using an explicit type here (`float *
> __attribute__((nontemporal))` instead of `auto`), but I agree that
> disappeared attribute might be a surprise for the user. Do you think it
> would be a frequent case?
>
> BTW, there are other type attributes, which also suffer from the same
> issue, e.g. `vector_size`. What was the rationale of making them type
> attributes?


vector_size produces a completely different type, with a different size,
alignment, different semantics and constraints for primitive operations,
and so on.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150821/b4d3d6a0/attachment.html>


More information about the cfe-commits mailing list