[PATCH] D133914: [InlineAsm][bugfix] Correct function addressing in inline asm

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 03:44:31 PDT 2022


xiangzhangllvm added inline comments.


================
Comment at: clang/test/CodeGen/ms-inline-asm-functions.c:25
   __asm call kimport;
-  // CHECK:     calll   *({{.*}})
+  // CHECK:     calll   __imp__kimport
 
----------------
pengfei wrote:
> xiangzhangllvm wrote:
> > xiangzhangllvm wrote:
> > > pengfei wrote:
> > > > Why is it affected? Is missing a `*` before the label?
> > > The dllimport mark it is a inter linkage, so we can directly call this function.
> > typo: inter linkage --> internal linkage
> I understand it on the opposite side, the `dllimport` means it is always an external function, so it must be an indirect call here.
> https://github.com/MicrosoftDocs/cpp-docs/blob/main/docs/build/importing-into-an-application-using-declspec-dllimport.md
Thank you point out it! Seems I mix it with "dllexport", the dllexport mean this is self module symbol. let me check here.


================
Comment at: llvm/lib/IR/InlineAsm.cpp:65
+  AsmStrs.clear();
+  AsmStr.split(AsmStrs, "\n\t", -1, false);
+}
----------------
pengfei wrote:
> The inline asm is not always split by "\n\t" e.g., https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/ARM/inlineasm-64bit.ll#L37
> And we can even use `;` https://godbolt.org/z/eb8n9d364
Good catch!  let's enhance here. Thank you so much!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133914/new/

https://reviews.llvm.org/D133914



More information about the llvm-commits mailing list