[llvm-dev] Hoisting in the presence of volatile loads.
Krzysztof Parzyszek via llvm-dev
llvm-dev at lists.llvm.org
Wed Dec 20 11:50:40 PST 2017
On 12/20/2017 1:37 PM, Sanjoy Das wrote:>
> Fwiw, I was under the impression that regular loads could *not* be
> reordered with volatile loads since we could have e.g.:
>
> int *normal = &global_variable;
> volatile int* ptr = 0;
> int k = *ptr; // segfaults, and the signal handler writes to *normal
> int value = *normal;
>
> and that we'd have to treat volatile loads and stores essentially as
> calls to unknown functions.
For this to work, "normal" should be volatile as well.
-Krzysztof
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the llvm-dev
mailing list