Open Quuxplusone opened 13 years ago
Attached volatile-combine.ll
(179 bytes, application/octet-stream): Test case for reordering of volatiles.
Note that -combiner-alias-analysis is an experimental option, and issues are expected.
As far as I know reordering volatiles is perfectly valid. You need a memory
barrier if you want to enforce ordering.
(In reply to comment #2)
> As far as I know reordering volatiles is perfectly valid. You need a memory
> barrier if you want to enforce ordering.
From LangRef: "The optimizers must not change the number of volatile operations
or change their order of execution relative to other volatile operations."
Eli is right, reordering these loads is invalid.
volatile-combine.ll
(179 bytes, application/octet-stream)