[PATCH] D136436: [Clang][LoongArch] Add register alias handling without `$` prefix

Xi Ruoyao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 23:23:50 PDT 2022


xry111 added a comment.

In D136436#3898398 <https://reviews.llvm.org/D136436#3898398>, @xry111 wrote:

> In D136436#3898392 <https://reviews.llvm.org/D136436#3898392>, @tangyouling wrote:
>
>> Is it acceptable to add the `non-prefix $`? if not, an alternative fix for the build failure is to add the `prefix $` in sanitizer_syscall_linux_loongarch64.inc
>
> I wrote `sanitizer_syscall_linux_loongarch64.inc` and tested it with GCC.  GCC supports register variable definition like `register u64 a0 asm("a0");` but does not support `addi.d a0, a0, a1` (because in GCC such a line in inline assembly is passed to GNU as directly).
>
> Is it possible to "emulate" the behavior in Clang?

I don't have any objection to add `$` into `sanitizer_syscall_linux_loongarch64.inc` though, GCC supports both `register u64 a0 asm("a0");` and `register u64 a0 asm("$a0");`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136436



More information about the cfe-commits mailing list