[PATCH] D76894: [GlobalOpt/GlobalStatus] Handle GlobalVariables passed as function call operands with access attributes

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 13:10:15 PDT 2020


ddcc added a comment.

Sure, I'm working on a instrumentation pass which is inserting calls that inhibit optimization, so I'm trying to work around the issue using function attributes, and need to look into memory to register promotion next.

I've made the changes, but I'm a little confused why read-only and write-only calls need to be handled differently. Why can't I assume that in the worst-case, the entire type is accessed? Also, what are the semantics of `readonly` and `writeonly` with respect to pointer casts? Isn't it valid behavior in C to cast any pointer type to `void *` as long as it is casted back to the original type before being accessed, so wouldn't this affect both loads and stores (that the actual load/store size could be larger than the argument type size)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76894





More information about the llvm-commits mailing list