[llvm] [X86][MC] Keep backward compatibility in inline asm for constraints (PR #73529)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 09:18:58 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}"()
----------------
nickdesaulniers wrote:

you can get rid of `,~{dirflag},~{fpsr},~{flags}` here and below.

https://github.com/llvm/llvm-project/pull/73529


More information about the llvm-commits mailing list