[LLVMdev] Aliasing of volatile and non-volatile

Krzysztof Parzyszek kparzysz at codeaurora.org
Wed Sep 4 15:18:49 PDT 2013

On 9/4/2013 4:48 PM, Eli Friedman wrote:
> Accessing a variable declared as "volatile int" through a non-volatile
> pointer isn't allowed.  Accessing a variable declared as non-volatile
> "int" through a volatile pointer is allowed.

Ok, that's not a problem.  The problem here is the invariance of the 
non-volatile load.  In the alias set tracker, the alias set that 
contains a volatile load is marked as "mod/ref".  This then implies that 
any other load (volatile or not) from that set is not invariant in a 
given region.  For that "variance" to happen that load would have to be 
accessing volatile memory, which isn't legal for non-volatile loads.


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation

More information about the llvm-dev mailing list