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

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 19:39:22 PDT 2015


On Thu, Aug 20, 2015 at 6:39 PM, Michael Zolotukhin via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> mzolotukhin created this revision.
> mzolotukhin added reviewers: hfinkel, doug.gregor, t.p.northover, ab,
> mcrosier.
> mzolotukhin added a subscriber: cfe-commits.
> Herald added a subscriber: aemerson.
>
> Currently there is no way to generate nontemporal memory accesses for some
> architectures, e.g. for AArch64. In contrast to x86, it doesn't have
> special
> intrinsics for this, and the suggested solution is using such attribute
> (see ARM
> ACLE 2.0, section 13.1.6). The attribute would result in generating
> '!nontemporal' attribute in IR, which then will (hopefully) live through
> optimizations till backend, where it will be lowered to a non-temporal
> instruction (for AArch64 - to STNP). I have committed a couple of patches
> for
> vectorizers to preserve this attribute, and it seems that no other
> transformation removes it.
>
> So, is introducing a new type attribute a right approach for this problem?


This seems like a property of an operation, rather than a property of a
type. Have you considered adding a __builtin_nontemporal_store builtin as
an alternative?

Also, since I don't have much experience in front-end, I'd appreciate any
> help
> with the patch itself to get it ready to be committed. Specifically, I
> currently
> have following questions:
> 1) What tests should I add (examples would be appreciated)?
> 2) How does one implements constraints on how the attribute can be used,
> what
> should be the constraints in this case, and how to properly implement them?
> 3) How can I check if I covered all places where this attribute might be
> used in
> codegen? I.e. I seem to cover array-subscript and pointer-dereference
> expressions, which is probaly the only cases I care about, but I easily
> could
> miss something.
>
> Any other feedback is also welcome!
>
> Thanks,
> Michael
>
> http://reviews.llvm.org/D12221
>
> Files:
>   include/clang/AST/Type.h
>   include/clang/Basic/Attr.td
>   lib/AST/Type.cpp
>   lib/AST/TypePrinter.cpp
>   lib/CodeGen/CGExpr.cpp
>   lib/CodeGen/CGValue.h
>   lib/CodeGen/CodeGenFunction.cpp
>   lib/CodeGen/CodeGenFunction.h
>   lib/Sema/SemaType.cpp
>   test/CodeGen/nontemporal.cpp
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150820/44243d79/attachment.html>


More information about the cfe-commits mailing list