[llvm] [InlineAsm] Add constraint A to getMemConstraintName (PR #65292)

Wang Pengcheng via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 22:02:13 PDT 2023


https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/65292:

>From f46f9098f2a2bed7a632fb9037baf5e984aa76e4 Mon Sep 17 00:00:00 2001
From: wangpc <wangpengcheng.pp at bytedance.com>
Date: Mon, 4 Sep 2023 19:59:12 +0800
Subject: [PATCH 1/2] [InlineAsm] Add constraint A to getMemConstraintName

We will get an assertion of 'Unknown memory constraint' when we dump
`MachineOperand` with constraint A.
---
 llvm/include/llvm/IR/InlineAsm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/include/llvm/IR/InlineAsm.h b/llvm/include/llvm/IR/InlineAsm.h
index b489b842d41cab2..1e9ade1befd010b 100644
--- a/llvm/include/llvm/IR/InlineAsm.h
+++ b/llvm/include/llvm/IR/InlineAsm.h
@@ -443,6 +443,8 @@ class InlineAsm final : public Value {
       return "m";
     case InlineAsm::Constraint_o:
       return "o";
+    case InlineAsm::Constraint_A:
+      return "A";
     case InlineAsm::Constraint_v:
       return "v";
     case InlineAsm::Constraint_Q:

>From b2646831d1a9972c9fc479d31358b08f4bddf4d6 Mon Sep 17 00:00:00 2001
From: wangpc <wangpengcheng.pp at bytedance.com>
Date: Tue, 5 Sep 2023 13:01:43 +0800
Subject: [PATCH 2/2] fixup! [InlineAsm] Add constraint A to
 getMemConstraintName

---
 llvm/include/llvm/IR/InlineAsm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/include/llvm/IR/InlineAsm.h b/llvm/include/llvm/IR/InlineAsm.h
index 1e9ade1befd010b..227aeca63193682 100644
--- a/llvm/include/llvm/IR/InlineAsm.h
+++ b/llvm/include/llvm/IR/InlineAsm.h
@@ -443,10 +443,10 @@ class InlineAsm final : public Value {
       return "m";
     case InlineAsm::Constraint_o:
       return "o";
-    case InlineAsm::Constraint_A:
-      return "A";
     case InlineAsm::Constraint_v:
       return "v";
+    case InlineAsm::Constraint_A:
+      return "A";
     case InlineAsm::Constraint_Q:
       return "Q";
     case InlineAsm::Constraint_R:



More information about the llvm-commits mailing list