|
Jlm
|
#include <IOBarrier.hpp>


Public Member Functions | |
| ~MemoryHoistBarrierOperation () noexcept override | |
| MemoryHoistBarrierOperation (const std::size_t dereferenceableSize) | |
| bool | operator== (const Operation &other) const noexcept override |
| std::string | debug_string () const override |
| std::unique_ptr< Operation > | copy () const override |
| std::size_t | getDereferenceableSize () const noexcept |
Public Member Functions inherited from jlm::rvsdg::SimpleOperation | |
| ~SimpleOperation () noexcept override | |
| SimpleOperation (std::vector< std::shared_ptr< const jlm::rvsdg::Type > > operands, std::vector< std::shared_ptr< const jlm::rvsdg::Type > > results) | |
| size_t | narguments () const noexcept |
| const std::shared_ptr< const rvsdg::Type > & | argument (size_t index) const noexcept |
| size_t | nresults () const noexcept |
| const std::shared_ptr< const rvsdg::Type > & | result (size_t index) const noexcept |
Public Member Functions inherited from jlm::rvsdg::Operation | |
| virtual | ~Operation () noexcept |
| virtual bool | operator== (const Operation &other) const noexcept=0 |
| bool | operator!= (const Operation &other) const noexcept |
Static Public Member Functions | |
| static rvsdg::Input & | getAddressInput (const rvsdg::Node &node) noexcept |
| static rvsdg::Output & | getAddressOutput (const rvsdg::Node &node) noexcept |
| static rvsdg::Input & | getIOStateInput (const rvsdg::Node &node) noexcept |
| static rvsdg::SimpleNode & | createNode (rvsdg::Output &address, rvsdg::Output &ioState, const std::size_t dereferenceableSize) |
| static std::optional< std::vector< rvsdg::Output * > > | normalizeNestedMemoryHoistBarriers (const MemoryHoistBarrierOperation &lowerMhbOp, const std::vector< rvsdg::Output * > &operands) |
Private Attributes | |
| std::size_t | dereferenceableSize_ |
A MemoryHoistBarrierOperation is used to sequentialize memory operations, such as LoadNonVolatileOperation or StoreNonVolatileOperation, after other IO state operations. It has no equivalent in LLVM.
Example:
The above code is valid C code and not undefined even if x is null. The reason for this is that the function opaque() invokes exit(0), and the load operation is never performed at runtime. In the RVSDG, the load operation might have no dependency on the function call to opaque() and therefore it can happen that it is sequentialized before the call operation, transforming the valid program to an undefined program.
The MemoryHoistBarrierOperation ensures a sequentialization of these two operations by routing the address operand through it along with an I/O state as additional operand. The load operation consumes then the result value of the MemoryHoistBarrierOperation, effectively sequentializing the load after the barrier and with that after the call operation:
... io = Call opaque .... ptr2 = MemoryHoistBarrierOperation ptr io ... = LoadNonVolatileOperation ptr2 ...
The MemoryHoistBarrierOperation has a MemoryHoistBarrierOperation::dereferenceableSize_ attribute, which determines the number of bytes that its input address is known to be dereferenceable.
Definition at line 127 of file IOBarrier.hpp.
|
overridedefaultnoexcept |
|
inlineexplicit |
Definition at line 132 of file IOBarrier.hpp.
|
overridevirtual |
Implements jlm::rvsdg::Operation.
Definition at line 50 of file IOBarrier.cpp.
|
inlinestatic |
Definition at line 182 of file IOBarrier.hpp.
|
overridevirtual |
Implements jlm::rvsdg::Operation.
Definition at line 44 of file IOBarrier.cpp.
|
inlinestaticnoexcept |
Definition at line 155 of file IOBarrier.hpp.
|
inlinestaticnoexcept |
Definition at line 164 of file IOBarrier.hpp.
|
inlinenoexcept |
Definition at line 149 of file IOBarrier.hpp.
|
inlinestaticnoexcept |
Definition at line 173 of file IOBarrier.hpp.
|
static |
The normalization performs the following transformation:
a2 = MemoryHoistBarrierOperation[1] a1 io1 a3 = MemoryHoistBarrierOperation[4] a2 io1 => a3 = MemoryHoistBarrierOperation[1] a1 io1
| lowerMhbOp | The MemoryHoistBarrierOperation on which the transformation is performed. |
| operands | The operands of the MemoryHoistBarrierOperation node. |
Definition at line 56 of file IOBarrier.cpp.
|
overridenoexcept |
Definition at line 37 of file IOBarrier.cpp.
|
private |
Dereferenceable size of the memory input in bytes.
Definition at line 216 of file IOBarrier.hpp.