Author: hans Date: Tue Apr 16 05:13:25 2019 New Revision: 358483 URL: http://llvm.org/viewvc/llvm-project?rev=358483&view=rev Log: Re-commit r357452: SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)
The original commit caused false positives from AddressSanitizer's use-after-scope checks, which have now been fixed in r358478. > The code was previously checking that candidates for sinking had exactly > one use or were a store instruction (which can't have uses). This meant > we could sink call instructions only if they had a use. > > That limitation seemed a bit arbitrary, so this patch changes it to > "instruction has zero or one use" which seems more natural and removes > the need to special-case stores. > > Differential revision: https://reviews.llvm.org/D59936 Modified: cfe/trunk/test/CodeGenCXX/nrvo.cpp cfe/trunk/test/CodeGenCXX/stack-reuse-exceptions.cpp cfe/trunk/test/CodeGenObjC/exceptions.m Modified: cfe/trunk/test/CodeGenCXX/nrvo.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/nrvo.cpp?rev=358483&r1=358482&r2=358483&view=diff ============================================================================== --- cfe/trunk/test/CodeGenCXX/nrvo.cpp (original) +++ cfe/trunk/test/CodeGenCXX/nrvo.cpp Tue Apr 16 05:13:25 2019 @@ -60,7 +60,6 @@ X test2(bool B) { // CHECK-NEXT: call void @llvm.lifetime.start // CHECK-NEXT: call {{.*}} @_ZN1XC1Ev // CHECK: call {{.*}} @_ZN1XC1ERKS_ - // CHECK: call {{.*}} @_ZN1XC1ERKS_ // CHECK: call {{.*}} @_ZN1XD1Ev // CHECK-NEXT: call void @llvm.lifetime.end // CHECK: call {{.*}} @_ZN1XD1Ev Modified: cfe/trunk/test/CodeGenCXX/stack-reuse-exceptions.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/stack-reuse-exceptions.cpp?rev=358483&r1=358482&r2=358483&view=diff ============================================================================== --- cfe/trunk/test/CodeGenCXX/stack-reuse-exceptions.cpp (original) +++ cfe/trunk/test/CodeGenCXX/stack-reuse-exceptions.cpp Tue Apr 16 05:13:25 2019 @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -o - -emit-llvm -O1 \ -// RUN: -fexceptions -fcxx-exceptions | FileCheck %s +// RUN: -fexceptions -fcxx-exceptions -mllvm -simplifycfg-sink-common=false | FileCheck %s // // We should emit lifetime.ends for these temporaries in both the 'exception' // and 'normal' paths in functions. Modified: cfe/trunk/test/CodeGenObjC/exceptions.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/exceptions.m?rev=358483&r1=358482&r2=358483&view=diff ============================================================================== --- cfe/trunk/test/CodeGenObjC/exceptions.m (original) +++ cfe/trunk/test/CodeGenObjC/exceptions.m Tue Apr 16 05:13:25 2019 @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fobjc-exceptions -O2 -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fobjc-exceptions -mllvm -simplifycfg-sink-common=false -O2 -o - %s | FileCheck %s // // <rdar://problem/7471679> [irgen] [eh] Exception code built with clang (x86_64) crashes _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits