[PATCH] D109089: [InstrProfiling] Add AIX triple to more tests

Jinsong Ji via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 19:28:58 PDT 2021


jsji updated this revision to Diff 370140.
jsji added a comment.

Rebase.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109089/new/

https://reviews.llvm.org/D109089

Files:
  llvm/test/Instrumentation/InstrProfiling/no-counters.ll
  llvm/test/Instrumentation/InstrProfiling/profiling.ll


Index: llvm/test/Instrumentation/InstrProfiling/profiling.ll
===================================================================
--- llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ 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 @@
 ; 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 @@
 ; 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 @@
 ; 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 @@
 ; 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 @@
 ; 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: }
Index: llvm/test/Instrumentation/InstrProfiling/no-counters.ll
===================================================================
--- llvm/test/Instrumentation/InstrProfiling/no-counters.ll
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109089.370140.patch
Type: text/x-patch
Size: 6342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210902/65b42bed/attachment.bin>


More information about the llvm-commits mailing list