[cfe-commits] r107105 - in /cfe/trunk: lib/CodeGen/CGCall.cpp test/CodeGen/x86_64-arguments.c test/CodeGenCXX/x86_64-arguments.cpp

Chris Lattner sabre at nondot.org
Mon Jun 28 17:14:52 PDT 2010


Author: lattner
Date: Mon Jun 28 19:14:52 2010
New Revision: 107105

URL: http://llvm.org/viewvc/llvm-project?rev=107105&view=rev
Log:
add IR names to coerced arguments.

Modified:
    cfe/trunk/lib/CodeGen/CGCall.cpp
    cfe/trunk/test/CodeGen/x86_64-arguments.c
    cfe/trunk/test/CodeGenCXX/x86_64-arguments.cpp

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=107105&r1=107104&r2=107105&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Mon Jun 28 19:14:52 2010
@@ -910,6 +910,7 @@
         if (STy == cast<llvm::PointerType>(V->getType())->getElementType()) {
           for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
             assert(AI != Fn->arg_end() && "Argument mismatch!");
+            AI->setName(Arg->getName() + ".coerce" + llvm::Twine(i));
             llvm::Value *EltPtr = Builder.CreateConstGEP2_32(V, 0, i);
             Builder.CreateStore(AI++, EltPtr);
           }
@@ -918,6 +919,7 @@
           llvm::Value *FormalArg = llvm::UndefValue::get(STy);
           for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
             assert(AI != Fn->arg_end() && "Argument mismatch!");
+            AI->setName(Arg->getName() + ".coerce" + llvm::Twine(i));
             FormalArg = Builder.CreateInsertValue(FormalArg, AI++, i);
           }
           CreateCoercedStore(FormalArg, V, /*DestIsVolatile=*/false, *this);
@@ -925,6 +927,7 @@
       } else {
         // Simple case, just do a coerced store of the argument into the alloca.
         assert(AI != Fn->arg_end() && "Argument mismatch!");
+        AI->setName(Arg->getName() + ".coerce");
         CreateCoercedStore(AI++, V, /*DestIsVolatile=*/false, *this);
       }
       

Modified: cfe/trunk/test/CodeGen/x86_64-arguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_64-arguments.c?rev=107105&r1=107104&r2=107105&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/x86_64-arguments.c (original)
+++ cfe/trunk/test/CodeGen/x86_64-arguments.c Mon Jun 28 19:14:52 2010
@@ -45,7 +45,7 @@
 // Test merging/passing of upper eightbyte with X87 class.
 //
 // CHECK: define %0 @f8_1()
-// CHECK: define void @f8_2(i64, double)
+// CHECK: define void @f8_2(i64 %a0.coerce0, double %a0.coerce1)
 union u8 {
   long double a;
   int b;
@@ -56,7 +56,7 @@
 // CHECK: define i64 @f9()
 struct s9 { int a; int b; int : 0; } f9(void) { while (1) {} }
 
-// CHECK: define void @f10(i64)
+// CHECK: define void @f10(i64 %a0.coerce)
 struct s10 { int a; int b; int : 0; };
 void f10(struct s10 a0) {}
 
@@ -64,7 +64,7 @@
 union { long double a; float b; } f11() { while (1) {} }
 
 // CHECK: define i64 @f12_0()
-// CHECK: define void @f12_1(i64)
+// CHECK: define void @f12_1(i64 %a0.coerce)
 struct s12 { int a __attribute__((aligned(16))); };
 struct s12 f12_0(void) { while (1) {} }
 void f12_1(struct s12 a0) {}
@@ -95,7 +95,7 @@
 // Check for valid coercion.  The struct should be passed/returned as i32, not
 // as i64 for better code quality.
 // rdar://8135035
-// CHECK: define void @f18(i32 %a, i32) 
+// CHECK: define void @f18(i32 %a, i32 %f18_arg1.coerce) 
 struct f18_s0 { int f0; };
 void f18(int a, struct f18_s0 f18_arg1) { while (1) {} }
 

Modified: cfe/trunk/test/CodeGenCXX/x86_64-arguments.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/x86_64-arguments.cpp?rev=107105&r1=107104&r2=107105&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/x86_64-arguments.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/x86_64-arguments.cpp Mon Jun 28 19:14:52 2010
@@ -6,19 +6,19 @@
 // Basic base class test.
 struct f0_s0 { unsigned a; };
 struct f0_s1 : public f0_s0 { void *b; };
-// CHECK: define void @_Z2f05f0_s1(i64, i64)
+// CHECK: define void @_Z2f05f0_s1(i64 %a0.coerce0, i64 %a0.coerce1)
 void f0(f0_s1 a0) { }
 
 // Check with two eight-bytes in base class.
 struct f1_s0 { unsigned a; unsigned b; float c; };
 struct f1_s1 : public f1_s0 { float d;};
-// CHECK: define void @_Z2f15f1_s1(i64, double)
+// CHECK: define void @_Z2f15f1_s1(i64 %a0.coerce0, double %a0.coerce1)
 void f1(f1_s1 a0) { }
 
 // Check with two eight-bytes in base class and merge.
 struct f2_s0 { unsigned a; unsigned b; float c; };
 struct f2_s1 : public f2_s0 { char d;};
-// CHECK: define void @_Z2f25f2_s1(i64, i64)
+// CHECK: define void @_Z2f25f2_s1(i64 %a0.coerce0, i64 %a0.coerce1)
 void f2(f2_s1 a0) { }
 
 // PR5831
@@ -26,8 +26,8 @@
 struct s3_1 { struct s3_0 a; long b; };
 void f3(struct s3_1 x) {}
 
-// CHECK: define i64 @_Z4f4_0M2s4i(i64)
-// CHECK: define [[i64_i64_ty]] @_Z4f4_1M2s4FivE(i64, i64)
+// CHECK: define i64 @_Z4f4_0M2s4i(i64 %a.coerce)
+// CHECK: define [[i64_i64_ty]] @_Z4f4_1M2s4FivE(i64 %a.coerce0, i64 %a.coerce1)
 struct s4 {};
 typedef int s4::* s4_mdp;
 typedef int (s4::*s4_mfp)();





More information about the cfe-commits mailing list