<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Oct 30, 2012, at 1:12 PM, Jakob Stoklund Olesen <<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Oct 30, 2012, at 12:11 PM, Chad Rosier <<a href="mailto:mcrosier@apple.com">mcrosier@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Author: mcrosier<br>Date: Tue Oct 30 14:11:54 2012<br>New Revision: 167040<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=167040&view=rev">http://llvm.org/viewvc/llvm-project?rev=167040&view=rev</a><br>Log:<br>[inline asm] Implement mayLoad and mayStore for inline assembly.  In general,<br>the MachineInstr MayLoad/MayLoad flags are based on the tablegen implementation.<br>For inline assembly, however, we need to compute these based on the constraints.<br><br>Revert r166929 as this is no longer needed, but leave the test case in place. <br><a href="rdar://12033048">rdar://12033048</a> and PR13504<br><br>Modified:<br>    llvm/trunk/include/llvm/CodeGen/MachineInstr.h<br>    llvm/trunk/include/llvm/InlineAsm.h<br>    llvm/trunk/lib/CodeGen/MachineVerifier.cpp<br>    llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp<br>    llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp<br>    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp<br><br>Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=167040&r1=167039&r2=167040&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=167040&r1=167039&r2=167040&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)<br>+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Tue Oct 30 14:11:54 2012<br>@@ -58,8 +58,10 @@<br>     NoFlags      = 0,<br>     FrameSetup   = 1 << 0,              // Instruction is used as a part of<br>                                         // function frame setup code.<br>-    InsideBundle = 1 << 1               // Instruction is inside a bundle (not<br>+    InsideBundle = 1 << 1,              // Instruction is inside a bundle (not<br>                                         // the first MI in a bundle)<br>+    MayLoad      = 1 << 2,              // Instruction could possibly read memory.<br>+    MayStore     = 1 << 3               // Instruction could possibly modify memory.<br>   };<br></blockquote><div><br></div><div>Hi Chad,</div><div><br></div><div>Are there other instructions than inline asm that need dynamic mayLoad/mayStore flags?</div></div></div></blockquote><div><br></div><div>Not that I'm aware of.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div><br></div><div>If not, it seems you can just as easily get your flags from the INLINEASM flag operand (ExtraInfo):</div></div></div></blockquote><div><br></div><div>Committed revision 167050.  Thanks for the suggestion, Jakob.</div><div><br></div><div> Chad</div><div><br></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div>--- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Tue Oct 30 14:11:54 2012<br>@@ -903,6 +903,13 @@<br>                          getZExtValue();<br>    <b>MI->addOperand(MachineOperand::CreateImm(ExtraInfo));</b><br><br>+    // Set the MayLoad and MayStore flags.<br>+    if (ExtraInfo & InlineAsm::Extra_MayLoad)<br>+      MI->setFlag(MachineInstr::MayLoad);<br>+<br>+    if (ExtraInfo & InlineAsm::Extra_MayStore)<br>+      MI->setFlag(MachineInstr::MayStore);<br>+<br>    // Remember to operand index of the group flags.<br>    SmallVector<unsigned, 8> GroupIdx;<br><br><br></div></div></div></blockquote></div><br></body></html>