From 0175461296044bd572559b9a4a5473ddcd411bce Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Wed, 20 Mar 2013 16:59:38 +0000 Subject: Exploit this-return of a callsite in a this-return function. For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. Updated from r177211. rdar://12818789 llvm-svn: 177541 --- clang/test/CodeGenCXX/arm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/test/CodeGenCXX/arm.cpp') diff --git a/clang/test/CodeGenCXX/arm.cpp b/clang/test/CodeGenCXX/arm.cpp index 3d3b147aa1f..48f2f008401 100644 --- a/clang/test/CodeGenCXX/arm.cpp +++ b/clang/test/CodeGenCXX/arm.cpp @@ -56,15 +56,15 @@ namespace test1 { // CHECK: [[THIS:%.*]] = alloca [[A]]*, align 4 // CHECK: store [[A]]* {{.*}}, [[A]]** [[THIS]] // CHECK: [[THIS1:%.*]] = load [[A]]** [[THIS]] - // CHECK: call [[A]]* @_ZN5test11AC2Ei( - // CHECK: ret [[A]]* [[THIS1]] + // CHECK: [[THIS2:%.*]] = call [[A]]* @_ZN5test11AC2Ei( + // CHECK: ret [[A]]* [[THIS2]] // CHECK: define linkonce_odr [[A]]* @_ZN5test11AD1Ev([[A]]* %this) unnamed_addr // CHECK: [[THIS:%.*]] = alloca [[A]]*, align 4 // CHECK: store [[A]]* {{.*}}, [[A]]** [[THIS]] // CHECK: [[THIS1:%.*]] = load [[A]]** [[THIS]] - // CHECK: call [[A]]* @_ZN5test11AD2Ev( - // CHECK: ret [[A]]* [[THIS1]] + // CHECK: [[THIS2:%.*]] = call [[A]]* @_ZN5test11AD2Ev( + // CHECK: ret [[A]]* [[THIS2]] } // Awkward virtual cases. -- cgit v1.2.3