Add a readonly flag for loads (#562)

* Add readonly MemFlag

* Add readonly flag verifier check

* Make global loads readonly

* Fix gvn to consider readonly loads
This commit is contained in:
Lachlan Sneff
2018-10-23 00:50:09 -04:00
committed by Dan Gohman
parent 3ec21459c5
commit 586a8835e9
9 changed files with 120 additions and 16 deletions

View File

@@ -502,12 +502,13 @@ Memory operation flags
Loads and stores can have flags that loosen their semantics in order to enable
optimizations.
======= ===========================================
Flag Description
======= ===========================================
notrap Memory is assumed to be :term:`accessible`.
aligned Trapping allowed for misaligned accesses.
======= ===========================================
======= ===========================================
Flag Description
======= ===========================================
notrap Memory is assumed to be :term:`accessible`.
aligned Trapping allowed for misaligned accesses.
readonly The data at the specified address will not modified between when this function is called and exited.
======= ===========================================
When the ``accessible`` flag is set, the behavior is undefined if the memory
is not :term:`accessible`.