forked from OSchip/llvm-project
Revert "[CodeGen] Disable aggressive structor optimizations at -O0"
It breaks the sanitizer build <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/23739> This reverts commit r332228. llvm-svn: 332232
This commit is contained in:
parent
dffc4ca4f2
commit
c370f26251
|
@ -3630,16 +3630,12 @@ static StructorCodegen getCodegenToUse(CodeGenModule &CGM,
|
|||
}
|
||||
llvm::GlobalValue::LinkageTypes Linkage = CGM.getFunctionLinkage(AliasDecl);
|
||||
|
||||
// Only use RAUW in optimized code, as it makes the complete structor symbol
|
||||
// disappear completely, which degrades debugging experience.
|
||||
if (CGM.getCodeGenOpts().OptimizationLevel > 0) {
|
||||
if (llvm::GlobalValue::isDiscardableIfUnused(Linkage))
|
||||
return StructorCodegen::RAUW;
|
||||
|
||||
// FIXME: Should we allow available_externally aliases?
|
||||
if (!llvm::GlobalAlias::isValidLinkage(Linkage))
|
||||
return StructorCodegen::RAUW;
|
||||
}
|
||||
|
||||
if (llvm::GlobalValue::isWeakForLinker(Linkage)) {
|
||||
// Only ELF and wasm support COMDATs with arbitrary names (C5/D5).
|
||||
|
|
|
@ -77,12 +77,11 @@ namespace test4 {
|
|||
// CHECK1: call i32 @__cxa_atexit{{.*}}_ZN5test41AD2Ev
|
||||
// CHECK1: define linkonce_odr void @_ZN5test41AD2Ev({{.*}} comdat align
|
||||
|
||||
// test that we don't do this optimization at -O0 and call the complete
|
||||
// destructor for B instead. This enables the debugger to see both
|
||||
// destructors.
|
||||
// NOOPT: @_ZN5test41BD1Ev = linkonce_odr alias void {{.*}} @_ZN5test41BD2Ev
|
||||
// test that we don't do this optimization at -O0 so that the debugger can
|
||||
// see both destructors.
|
||||
// NOOPT: define internal void @__cxx_global_var_init.2()
|
||||
// NOOPT: call i32 @__cxa_atexit{{.*}}@_ZN5test41BD1Ev
|
||||
// NOOPT: call i32 @__cxa_atexit{{.*}}@_ZN5test41BD2Ev
|
||||
// NOOPT: define linkonce_odr void @_ZN5test41BD2Ev({{.*}} comdat align
|
||||
struct A {
|
||||
virtual ~A() {}
|
||||
};
|
||||
|
|
|
@ -103,7 +103,7 @@ int main(void) {
|
|||
|
||||
C1 c1(f1l);
|
||||
// CHECK-DAG: [[F1L:%[a-z0-9]+]] = load half, half* %{{.*}}, align 2
|
||||
// CHECK-DAG: call void @_ZN2C1C1EDF16_(%class.C1* %{{.*}}, half %{{.*}})
|
||||
// CHECK-DAG: call void @_ZN2C1C2EDF16_(%class.C1* %{{.*}}, half %{{.*}})
|
||||
|
||||
S1<_Float16> s1 = { 132.f16 };
|
||||
// CHECK-DAG: @_ZZ4mainE2s1 = private unnamed_addr constant %struct.S1 { half 0xH5820 }, align 2
|
||||
|
|
Loading…
Reference in New Issue