r354211 - [X86] Prevent clang clobber checking for asm flag constraints.
Nirav Dave via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 16 19:53:23 PST 2019
Author: niravd
Date: Sat Feb 16 19:53:23 2019
New Revision: 354211
URL: http://llvm.org/viewvc/llvm-project?rev=354211&view=rev
Log:
[X86] Prevent clang clobber checking for asm flag constraints.
Update getConstraintRegister as X86 Asm flag output constraints are no
longer fully alphanumeric,
Modified:
cfe/trunk/lib/Basic/Targets/X86.h
cfe/trunk/test/CodeGen/inline-asm-x86-flag-output.c
Modified: cfe/trunk/lib/Basic/Targets/X86.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/X86.h?rev=354211&r1=354210&r2=354211&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/X86.h (original)
+++ cfe/trunk/lib/Basic/Targets/X86.h Sat Feb 16 19:53:23 2019
@@ -198,7 +198,7 @@ public:
StringRef Expression) const override {
StringRef::iterator I, E;
for (I = Constraint.begin(), E = Constraint.end(); I != E; ++I) {
- if (isalpha(*I))
+ if (isalpha(*I) || *I == '@')
break;
}
if (I == E)
Modified: cfe/trunk/test/CodeGen/inline-asm-x86-flag-output.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/inline-asm-x86-flag-output.c?rev=354211&r1=354210&r2=354211&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/inline-asm-x86-flag-output.c (original)
+++ cfe/trunk/test/CodeGen/inline-asm-x86-flag-output.c Sat Feb 16 19:53:23 2019
@@ -363,3 +363,14 @@ int test_ccs(long nr, volatile long *add
return 0;
return 1;
}
+
+_Bool check_no_clobber_conflicts() {
+ //CHECK-LABEL: @check_no_clobber_conflicts
+ //CHECK: = tail call i8 asm "", "={@cce},~{cx},~{dirflag},~{fpsr},~{flags}"()
+ _Bool b;
+ asm(""
+ : "=@cce"(b)
+ :
+ : "cx");
+ return b;
+}
More information about the cfe-commits
mailing list