r225601 - CodeGen: Simplify consecutive '&' modifiers

David Majnemer david.majnemer at gmail.com
Sun Jan 11 01:09:01 PST 2015


Author: majnemer
Date: Sun Jan 11 03:09:01 2015
New Revision: 225601

URL: http://llvm.org/viewvc/llvm-project?rev=225601&view=rev
Log:
CodeGen: Simplify consecutive '&' modifiers

LLVM the consecutive '&' modifiers are redundant, skip them.

Modified:
    cfe/trunk/lib/CodeGen/CGStmt.cpp
    cfe/trunk/test/CodeGen/asm.c

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=225601&r1=225600&r2=225601&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Sun Jan 11 03:09:01 2015
@@ -1659,6 +1659,11 @@ SimplifyConstraint(const char *Constrain
       while (Constraint[1] && Constraint[1] != ',')
         Constraint++;
       break;
+    case '&':
+      Result += '&';
+      while (Constraint[1] && Constraint[1] == '&')
+        Constraint++;
+      break;
     case ',':
       Result += "|";
       break;

Modified: cfe/trunk/test/CodeGen/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/asm.c?rev=225601&r1=225600&r2=225601&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/asm.c (original)
+++ cfe/trunk/test/CodeGen/asm.c Sun Jan 11 03:09:01 2015
@@ -248,3 +248,10 @@ void t29(void) {
   // CHECK: @t29
   // CHECK: call void asm sideeffect "movl %eax, $0", "*m,~{dirflag},~{fpsr},~{flags}"([1 x i32]* @t29_var)
 }
+
+void t30(int len) {
+  __asm__ volatile(""
+                   : "+&&rm"(len));
+  // CHECK: @t30
+  // CHECK: call void asm sideeffect "", "=*&rm,0,~{dirflag},~{fpsr},~{flags}"
+}





More information about the cfe-commits mailing list