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

Michael Zolotukhin via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 21 12:14:08 PDT 2015


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?


http://reviews.llvm.org/D12221





More information about the cfe-commits mailing list