[llvm] [X86][MC] Keep backward compatibility in inline asm for constraints (PR #73529)
Shengchen Kan via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 17:29:53 PST 2023
================
@@ -0,0 +1,24 @@
+; Check r16-r31 can not be used with 'q','r','l' constraint for backward compatibility.
+; RUN: not llc < %s -mtriple=x86_64-unknown-unknown -mattr=+egpr 2>&1 | FileCheck %s
+
+define dso_local void @q() {
+entry:
+; CHECK: error: inline assembly requires more registers than available
+ %0 = tail call i32 asm sideeffect "movq %rax, $0", "=q,~{rax},~{rbx},~{rcx},~{rdx},~{rdi},~{rsi},~{rbp},~{rsp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"()
----------------
KanRobert wrote:
Done. I keep the `sideeffect` here, otherwise the `call` would be removed as dead code and no error was thrown.
https://github.com/llvm/llvm-project/pull/73529
More information about the llvm-commits
mailing list