<div dir="ltr">That did it: issue was in X86AsmPrinter::PrintOperand, which emitted a prefix of "$" when printing an address operand in AT&T syntax... but didn't add the prefix "offset " when in Intel syntax.<div><br></div><div>Still need to get clang to emit the operand with the "i" constraint, but now at least I know what success will look like.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 11, 2019 at 2:32 PM Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Wed, Dec 11, 2019 at 9:45 AM Eric Astor <<a href="mailto:epastor@google.com" target="_blank">epastor@google.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Interesting - the patch doesn't address this yet. It looks like we have a difference (maybe bug?) in how we handle Intel vs. AT&T inline assembly: <a href="https://godbolt.org/z/GQw9ED" target="_blank">https://godbolt.org/z/GQw9ED</a><div><br></div><div>Suppose we're expanding an operand with an 'i' constraint, where the operand is given as, e.g. (i32* @Bar).</div><div>If the inline assembly is in Intel dialect, this expands as "Bar" in AT&T syntax or "dword ptr [Bar]" in Intel syntax.</div><div>If the inline assembly is in AT&T dialect, it expands as "$Bar" in AT&T syntax or "offset Bar" in Intel syntax.</div></div></blockquote><div><br></div><div>That sounds right.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'd like to try to reconcile this, but I haven't been able to track down where inline-assembly operands are expanded yet... anyone know where I should be looking?</div></div></blockquote><div><br></div><div>I'm pretty sure this is llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote></div>
</blockquote></div></div>
</blockquote></div>