Compiler load/store barrier; volatile pointer; barriers in general

  • From: Luke Gorrie <luke@xxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 28 Jan 2015 08:52:50 +0100

Howdy,

Questions, questions, questions...

What are the ordering properties of loads/stores to FFI objects? Are there
situations where LuaJIT will reorder these? If so, is there a way to do a
compiler load/store barrier in cases where ordering is important?

Can LuaJIT also eliminate FFI load/store operations that it thinks are
redundant? If so, is there a way to prevent this in cases where every
read/write must really be performed (e.g. when talking to hardware with
MMIO and reading/writing for side effects)?

Generally speaking: what barriers exist in LuaJIT and is it important to
think about them? (For example are there common operations that will create
a barrier and prevent optimizations that the JIT could otherwise do?)

Cheers,
-Luke

Other related posts: