From: Jinsong Ji Date: Thu, 2 Sep 2021 02:39:51 +0000 (+0000) Subject: [InstrProfiling] Add AIX triple to more tests X-Git-Tag: upstream/15.0.7~32464 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5505a2ca631b39d75a71c8ad7c0770d9c106fc4;p=platform%2Fupstream%2Fllvm.git [InstrProfiling] Add AIX triple to more tests Following patch of https://reviews.llvm.org/D108490. Add AIX triples to tests in /Instrumentation/InstrProfiling/ to make sure we can catch regressions earlier. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D109089 --- diff --git a/llvm/test/Instrumentation/InstrProfiling/no-counters.ll b/llvm/test/Instrumentation/InstrProfiling/no-counters.ll index 4c1905b..ab103ae 100644 --- a/llvm/test/Instrumentation/InstrProfiling/no-counters.ll +++ b/llvm/test/Instrumentation/InstrProfiling/no-counters.ll @@ -3,6 +3,7 @@ ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -instrprof -S | FileCheck %s -check-prefixes=ALL,DARWIN ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -passes=instrprof -S | FileCheck %s -check-prefixes=ALL,DARWIN ; RUN: opt < %s -mtriple=x86_64-linux-unknown -passes=instrprof -S | FileCheck %s -check-prefixes=ALL,LINUX +; RUN: opt < %s -mtriple=powerpc64-ibm-aix-xcoff -passes=instrprof -S | FileCheck %s -check-prefixes=ALL,DARWIN ; ALL-NOT: @__profc ; ALL-NOT: @__profd ; DARWIN: @__llvm_profile_runtime diff --git a/llvm/test/Instrumentation/InstrProfiling/profiling.ll b/llvm/test/Instrumentation/InstrProfiling/profiling.ll index f5c0c56..6efaf65f 100644 --- a/llvm/test/Instrumentation/InstrProfiling/profiling.ll +++ b/llvm/test/Instrumentation/InstrProfiling/profiling.ll @@ -5,10 +5,12 @@ ; RUN: opt < %s -mtriple=x86_64-unknown-linux -passes=instrprof -S | FileCheck %s --check-prefixes=ELF ; RUN: opt < %s -mtriple=x86_64-unknown-fuchsia -passes=instrprof -S | FileCheck %s --check-prefixes=ELF ; RUN: opt < %s -mtriple=x86_64-pc-win32-coff -passes=instrprof -S | FileCheck %s --check-prefixes=COFF +; RUN: opt < %s -mtriple=powerpc64-ibm-aix-xcoff -passes=instrprof -S | FileCheck %s --check-prefixes=XCOFF ; MACHO: @__llvm_profile_runtime = external global i32 ; ELF_GENERIC: @__llvm_profile_runtime = external global i32 ; ELF-NOT: @__llvm_profile_runtime = external global i32 +; XCOFF: @__llvm_profile_runtime = external global i32 ; ELF: $__profc_foo = comdat nodeduplicate ; ELF: $__profc_foo_weak = comdat nodeduplicate @@ -29,6 +31,9 @@ ; COFF: @__profc_foo = private global ; COFF-NOT: comdat ; COFF: @__profd_foo = private global +; XCOFF: @__profc_foo = private global +; XCOFF-NOT: comdat +; XCOFF: @__profd_foo = private global define void @foo() { call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0) ret void @@ -40,6 +45,8 @@ define void @foo() { ; MACHO: @__profd_foo_weak = weak hidden global ; COFF: @__profc_foo_weak = weak hidden global ; COFF: @__profd_foo_weak = private global +; XCOFF: @__profc_foo_weak = weak hidden global +; XCOFF: @__profd_foo_weak = weak hidden global define weak void @foo_weak() { call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0) ret void @@ -51,6 +58,8 @@ define weak void @foo_weak() { ; MACHO: @"__profd_linkage.ll:foo_internal" = private global ; COFF: @"__profc_linkage.ll:foo_internal" = private global ; COFF: @"__profd_linkage.ll:foo_internal" = private global +; XCOFF: @"__profc_linkage.ll:foo_internal" = private global +; XCOFF: @"__profd_linkage.ll:foo_internal" = private global define internal void @foo_internal() { call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @"__profn_linkage.ll:foo_internal", i32 0, i32 0), i64 0, i32 1, i32 0) ret void @@ -62,6 +71,8 @@ define internal void @foo_internal() { ; MACHO: @__profd_foo_inline = linkonce_odr hidden global ; COFF: @__profc_foo_inline = linkonce_odr hidden global{{.*}} section ".lprfc$M", align 8 ; COFF: @__profd_foo_inline = private global{{.*}} section ".lprfd$M", align 8 +; XCOFF: @__profc_foo_inline = linkonce_odr hidden global +; XCOFF: @__profd_foo_inline = linkonce_odr hidden global define linkonce_odr void @foo_inline() { call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0) ret void @@ -73,6 +84,8 @@ define linkonce_odr void @foo_inline() { ; MACHO: @__profd_foo_extern = linkonce_odr hidden global ; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfc$M", comdat, align 8 ; COFF: @__profd_foo_extern = private global {{.*}}section ".lprfd$M", comdat($__profc_foo_extern), align 8 +; XCOFF: @__profc_foo_extern = linkonce_odr hidden global +; XCOFF: @__profd_foo_extern = linkonce_odr hidden global define available_externally void @foo_extern() { call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0) ret void @@ -92,11 +105,22 @@ declare void @llvm.instrprof.increment(i8*, i64, i32, i32) ; COFF: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} comdat { ; ELF-NOT: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} { ; ELF-NOT: %[[REG:.*]] = load i32, i32* @__llvm_profile_runtime +; XCOFF: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} { +; XCOFF: %[[REG:.*]] = load i32, i32* @__llvm_profile_runtime +; XCOFF: ret i32 %[[REG]] +; XCOFF: } ; ELF_GENERIC: define internal void @__llvm_profile_register_functions() unnamed_addr { ; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(i8* bitcast (i32* @__llvm_profile_runtime to i8*)) -; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*)) -; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo_weak to i8*)) +; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [{{.*}} x i16] }* @__profd_foo to i8*)) +; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [{{.*}} x i16] }* @__profd_foo_weak to i8*)) ; ELF_GENERIC: call void @__llvm_profile_register_names_function(i8* getelementptr inbounds {{.*}} @__llvm_prf_nm ; ELF_GENERIC-NEXT: ret void ; ELF_GENERIC-NEXT: } + +; XCOFF: define internal void @__llvm_profile_register_functions() unnamed_addr { +; XCOFF-NEXT: call void @__llvm_profile_register_function(i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [{{.*}} x i16] }* @__profd_foo to i8*)) +; XCOFF-NEXT: call void @__llvm_profile_register_function(i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [{{.*}} x i16] }* @__profd_foo_weak to i8*)) +; XCOFF: call void @__llvm_profile_register_names_function(i8* getelementptr inbounds {{.*}} @__llvm_prf_nm +; XCOFF-NEXT: ret void +; XCOFF-NEXT: }