<span style=" font-size:10pt;font-family:sans-serif">Hi Dominique,</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">MayLoad/MayStore
is a property that is true if the instruction could possibly read/write
memory even if it is not just a simple load/store instruction. This is
documented in llvm/include/llvm/CodeGen/MachineInstr.h: </span><a href=http://llvm.org/doxygen/classllvm_1_1MachineInstr.html#a682028ac4a06c9e3550fa8e6e1909fa9><span style=" font-size:10pt;color:blue;font-family:sans-serif">http://llvm.org/doxygen/classllvm_1_1MachineInstr.html#a682028ac4a06c9e3550fa8e6e1909fa9</span></a>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">Looking it functions
referencing it, it does affect scheduling, e.g., whether instructions can
be reordered or folded into others.</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">Memory barriers
or memory fences are part of a machine's and/or compilers memory model
that define which operations (loads or stores in a single or different
threads) may be reordered and in which way. A "load barrier"
might mean an instruction within a CPU architecture that forces all memory
stores to finish before the next load, but you'll have to consult the exact
memory model of that CPU. For a compiler/LLVM, a "load barrier"
might be an intrinsic limits which type of instruction reordering the compiler
can do (and possibly also issue a memory fence instruction to tell the
CPU the same).</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">In general, for
memory models I recommend:</span>
<br><a href="https://www.kernel.org/doc/Documentation/memory-barriers.txt"><span style=" font-size:10pt;color:blue;font-family:sans-serif">https://www.kernel.org/doc/Documentation/memory-barriers.txt</span></a><span style=" font-size:10pt;font-family:sans-serif">
for a general description and how it effects the Linux kernel</span>
<br><a href=https://en.cppreference.com/w/c/atomic/memory_order><span style=" font-size:10pt;color:blue;font-family:sans-serif">https://en.cppreference.com/w/c/atomic/memory_order</span></a><span style=" font-size:10pt;font-family:sans-serif">
for how it relates to C code (the LLVM memory model tries to follow that
I believe)</span>
<br><a href=http://releases.llvm.org/4.0.1/docs/LangRef.html#ordering><span style=" font-size:10pt;color:blue;font-family:sans-serif">http://releases.llvm.org/4.0.1/docs/LangRef.html#ordering</span></a><span style=" font-size:10pt;font-family:sans-serif">
for how LLVM specifically defines different memory orderings</span>
<br><a href="http://releases.llvm.org/4.0.1/docs/LangRef.html#fence-instruction"><span style=" font-size:10pt;color:blue;font-family:sans-serif">http://releases.llvm.org/4.0.1/docs/LangRef.html#fence-instruction</span></a><span style=" font-size:10pt;font-family:sans-serif">
The fence instruction might be the specific load barrier you asked about
in LLVM IR</span>
<br>
<br><span style=" font-size:10pt;font-family:sans-serif">Boldizsar Palotas</span>
<br>
<br>
<br>
<br>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">From:
       </span><span style=" font-size:9pt;font-family:sans-serif">Dominique
Torette via llvm-dev <llvm-dev@lists.llvm.org></span>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">To:
       </span><span style=" font-size:9pt;font-family:sans-serif">"llvm-dev@lists.llvm.org"
<llvm-dev@lists.llvm.org></span>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Date:
       </span><span style=" font-size:9pt;font-family:sans-serif">2018.09.28
10:59</span>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Subject:
       </span><span style=" font-size:9pt;font-family:sans-serif">[llvm-dev]
‘mayLoad’ and ‘mayStore’ attributes</span>
<br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Sent
by:        </span><span style=" font-size:9pt;font-family:sans-serif">"llvm-dev"
<llvm-dev-bounces@lists.llvm.org></span>
<br>
<hr noshade>
<br>
<br>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri">Hi,</span></p>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri"> </span></p>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri">I
have a  few short questions:</span></p>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri">I
haven’t found any documentation on the purposes of the ‘mayLoad’ and
‘mayStore’ attributes of the .td file Instruction class...</span></p>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri">Have
these attributes some effects on final instruction scheduling ? What is
the concept of ‘load barrier’ ?</span></p>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri">References
to articles will be welcome.</span></p>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri"> </span></p>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri">TIA,
       Dominique T.</span><span style=" font-size:12pt;font-family:Times New Roman"><br>
<br>
<br>
<br>
<br>
</span></p>
<br>
<table width=537 style="border-collapse:collapse;">
<tr height=8>
<td width=536 style="border-style:none none solid none;border-color:#C0C0C0;border-width:0px 0px 1px 0px;padding:0px 0px;">
<tr height=8>
<td width=535 style="border-style:solid solid solid solid;border-color:#C0C0C0;border-width:1px 1px 1px 1px;padding:0px 0px;">
<div align=center><span style=" font-size:10pt;font-family:Calibri"><b>Dominique
Torette</b> <br>
System Architect<br>
Rue des Chasseurs Ardennais - Liège Science Park - B-4031 Angleur <br>
Tel: +32 (0) 4 361 81 11 - Fax: +32 (0) 4 361 81 20 </span><span style=" font-size:10pt;color:blue;font-family:Calibri"><u><br>
</u></span><a href=http://www.spacebel.be/><span style=" font-size:10pt;color:blue;font-family:Calibri"><u>www.spacebel.be</u></span></a></div></table>
<p style="margin-top:0px;margin-Bottom:0px"><span style=" font-size:11pt;font-family:Calibri"> </span></p>
<br><span style=" font-size:12pt"><br>
------------------------------------------------------------------------------<br>
<br>
E-MAIL DISCLAIMER<br>
<br>
The present message may contain confidential and/or legally privileged
information. If you are not the intended addressee and in case of a transmission
error, please notify the sender immediately and destroy this E-mail. Disclosure,
reproduction or distribution of this document and its possible attachments
is strictly forbidden.<br>
<br>
SPACEBEL denies all liability for incomplete, improper, inaccurate, intercepted,
(partly) destroyed, lost and/or belated transmission of the current information
given that unencrypted electronic transmission cannot currently be guaranteed
to be secure or error free.<br>
Upon request or in conformity with formal, contractual agreements, an originally
signed hard copy will be sent to you to confirm the information contained
in this E-mail.<br>
<br>
SPACEBEL denies all liability where E-mail is used for private use.<br>
<br>
SPACEBEL cannot be held responsible for possible viruses that might corrupt
this message and/or your computer system.<br>
-------------------------------------------------------------------------------</span>
<br><tt><span style=" font-size:10pt">_______________________________________________<br>
LLVM Developers mailing list<br>
llvm-dev@lists.llvm.org<br>
</span></tt><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"><tt><span style=" font-size:10pt">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</span></tt></a><tt><span style=" font-size:10pt"><br>
</span></tt>
<br>
<br> <PRE>This message is intended only for the recipient(s) named above. It may contain proprietary information and/or
protected content. Any unauthorised disclosure, use, retention or dissemination is prohibited. If you have received
this e-mail in error, please notify the sender immediately. ESA applies appropriate organisational measures to protect
personal data, in case of data privacy queries, please contact the ESA Data Protection Officer (dpo@esa.int).
</PRE>