[PATCH] D76297: [clang][AArch64] readd support for 'p' inline asm constraint
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 17 10:11:07 PDT 2020
nickdesaulniers created this revision.
nickdesaulniers added a reviewer: eli.friedman.
Herald added subscribers: cfe-commits, kristof.beyls.
Herald added a project: clang.
nickdesaulniers marked an inline comment as done.
sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.
nickdesaulniers updated this revision to Diff 250812.
nickdesaulniers marked an inline comment as done.
LGTM!
nickdesaulniers added a comment.
- fix 'U' case
================
Comment at: clang/lib/Basic/Targets/AArch64.h:97
Constraint += 2;
break;
}
----------------
nit: does this need a `default: break`?
================
Comment at: clang/lib/Basic/Targets/AArch64.h:98
break;
- default:
- R = std::string(1, *Constraint);
- break;
}
+ return TargetInfo::convertConstraint(Constraint);
----------------
bah, need to return `R` for the previous case.
Was accidentally removed by commit af64948e2a05 <https://reviews.llvm.org/rGaf64948e2a050d1ef3b7fd314ed07b2a2fe402a5> when it overrode
TargetInfo::convertConstraint.
Fixes: pr/45225
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D76297
Files:
clang/lib/Basic/Targets/AArch64.h
clang/test/CodeGen/inline-asm-p-constraint.c
Index: clang/test/CodeGen/inline-asm-p-constraint.c
===================================================================
--- /dev/null
+++ clang/test/CodeGen/inline-asm-p-constraint.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple aarch64-linux-gnu | FileCheck %s
+void foo(void* ptr) {
+ asm volatile("prfm pldl1keep, %a0\n" : : "p" (ptr));
+ // CHECK: call void asm sideeffect "prfm pldl1keep, ${0:a}\0A", "r"(i8* %0)
+ // CHECK-NOT: call void asm sideeffect "prfm pldl1keep, ${0:a}\0A", "p"(i8* %0)
+}
Index: clang/lib/Basic/Targets/AArch64.h
===================================================================
--- clang/lib/Basic/Targets/AArch64.h
+++ clang/lib/Basic/Targets/AArch64.h
@@ -96,7 +96,7 @@
Constraint += 2;
break;
default:
- R = std::string(1, *Constraint);
+ R = TargetInfo::convertConstraint(Constraint);
break;
}
return R;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76297.250812.patch
Type: text/x-patch
Size: 912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200317/244ed893/attachment.bin>
More information about the cfe-commits
mailing list