[PATCH] D71708: [OPENMP50]Codegen for nontemporal clause.

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 20 07:58:25 PST 2019


ABataev marked an inline comment as done.
ABataev added inline comments.


================
Comment at: clang/lib/CodeGen/CGExpr.cpp:3952
+           CGM.getOpenMPRuntime().isNontemporalDecl(Field)) ||
+          (!E->isArrow() && BaseLV.isNontemporal()))
+        LV.setNontemporal(/*Value=*/true);
----------------
ABataev wrote:
> rjmccall wrote:
> > Is the `!E->isArrow()` condition necessary here?  Why not just propagate the non-temporality of the base?
> > 
> > Similarly, what's the case in which the declaration is marked non-temporal and you *don't* want to trust that?
> That's the main question. I try to mimic the behavior we currenty have in the codegen. If the lvalue for the pointer is marked as nontemporal, only loads/stores for the pointer itself are marked as nontemporal. Operations with the memory it points to are not marked as nontemporal. I'm trying to do the same. E.g., if have something like `a.b->c` and `a` is nontemporal, then only `a.b = x;` must be marked as nontemporal, but not `a.b->c = x;`
> Similarly, what's the case in which the declaration is marked non-temporal and you *don't* want to trust that?

There is no such case. We can mark `this->member` as nontemporal or `declref`. The first check here checks if we have `this->member` marked as nontemporal, the second check just propagates the flag if the base is marked as nontemporal.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71708





More information about the cfe-commits mailing list