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

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 02:06:05 PDT 2022


pengfei added inline comments.


================
Comment at: clang/test/CodeGen/ms-inline-asm-functions.c:25
   __asm call kimport;
-  // CHECK:     calll   *({{.*}})
+  // CHECK:     calll   __imp__kimport
 
----------------
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


================
Comment at: llvm/lib/IR/InlineAsm.cpp:65
+  AsmStrs.clear();
+  AsmStr.split(AsmStrs, "\n\t", -1, false);
+}
----------------
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


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

https://reviews.llvm.org/D133914



More information about the llvm-commits mailing list