-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC][AIX] Emit PowerPC version for XCOFF (#113214)
This PR emits implements the ability to emit the PPC version for both assembly and object files on AIX.
- Loading branch information
Showing
27 changed files
with
265 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
llvm/test/CodeGen/PowerPC/aix-cpu-version-multifunction.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s | ||
|
||
; For the .machine directive emitted on AIX, the "target-cpu" attribute that is | ||
; the newest will be used as the CPU for the module (in this case, PWR10). | ||
|
||
; CHECK: .file "file.c" | ||
; CHECK-NEXT: .csect ..text..[PR],5 | ||
; CHECK-NEXT: .rename ..text..[PR],"" | ||
; CHECK-NEXT: .machine "PWR10" | ||
; CHECK-NOT: .machine "PWR8" | ||
|
||
source_filename = "file.c" | ||
|
||
define dso_local signext i32 @testFunc1() #0 { | ||
entry: | ||
%retval = alloca i32, align 4 | ||
store i32 0, ptr %retval, align 4 | ||
ret i32 0 | ||
} | ||
|
||
define dso_local signext i32 @testFunc2() #1 { | ||
entry: | ||
%retval = alloca i32, align 4 | ||
store i32 0, ptr %retval, align 4 | ||
ret i32 0 | ||
} | ||
|
||
attributes #0 = { "target-cpu" = "pwr8" } | ||
attributes #1 = { "target-cpu" = "pwr10" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s | ||
|
||
; CHECK: .file "1.c" | ||
; CHECK-NEXT: .csect ..text..[PR],5 | ||
; CHECK-NEXT: .rename ..text..[PR],"" | ||
; CHECK-NEXT: .machine "PWR8" | ||
|
||
source_filename = "1.c" | ||
|
||
define dso_local signext i32 @main() #0 { | ||
entry: | ||
%retval = alloca i32, align 4 | ||
store i32 0, ptr %retval, align 4 | ||
ret i32 0 | ||
} | ||
|
||
attributes #0 = {"target-cpu"="pwr8"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,57 @@ | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s | ||
; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=OBJ,OBJ32 %s | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t64.o < %s | ||
; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=OBJ,OBJ64 %s | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr9 < %s | FileCheck --check-prefixes=ASM %s | ||
|
||
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr9 -filetype=obj -o %t.o < %s | ||
; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=OBJ32 %s | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr9 -filetype=obj -o %t64.o < %s | ||
; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=OBJ64 %s | ||
|
||
source_filename = "1.c" | ||
|
||
; OBJ: Name: .file | ||
; OBJ: Source Language ID: TB_C (0x0) | ||
; OBJ32: CPU Version ID: TCPU_COM (0x3) | ||
; OBJ64: CPU Version ID: TCPU_PPC64 (0x2) | ||
; OBJ: Name: 1.c | ||
; ASM: .file "1.c",,"LLVM{{.*}}" | ||
; ASM-NEXT: .csect ..text..[PR],5 | ||
; ASM-NEXT: .rename ..text..[PR],"" | ||
; ASM-NEXT: .machine "PWR9" | ||
|
||
; OBJ32: Symbol { | ||
; OBJ32-NEXT: Index: 0 | ||
; OBJ32-NEXT: Name: .file | ||
; OBJ32-NEXT: Value (SymbolTableIndex): 0x0 | ||
; OBJ32-NEXT: Section: N_DEBUG | ||
; OBJ32-NEXT: Source Language ID: TB_C (0x0) | ||
; OBJ32-NEXT: CPU Version ID: TCPU_PWR9 (0x1A) | ||
; OBJ32-NEXT: StorageClass: C_FILE (0x67) | ||
; OBJ32-NEXT: NumberOfAuxEntries: 2 | ||
; OBJ32-NEXT: File Auxiliary Entry { | ||
; OBJ32-NEXT: Index: 1 | ||
; OBJ32-NEXT: Name: 1.c | ||
; OBJ32-NEXT: Type: XFT_FN (0x0) | ||
; OBJ32-NEXT: } | ||
; OBJ32-NEXT: File Auxiliary Entry { | ||
; OBJ32-NEXT: Index: 2 | ||
; OBJ32-NEXT: Name: LLVM | ||
; OBJ32-NEXT: Type: XFT_CV (0x2) | ||
; OBJ32-NEXT: } | ||
; OBJ32-NEXT: } | ||
|
||
; OBJ64: Symbol { | ||
; OBJ64-NEXT: Index: 0 | ||
; OBJ64-NEXT: Name: .file | ||
; OBJ64-NEXT: Value (SymbolTableIndex): 0x0 | ||
; OBJ64-NEXT: Section: N_DEBUG | ||
; OBJ64-NEXT: Source Language ID: TB_C (0x0) | ||
; OBJ64-NEXT: CPU Version ID: TCPU_PWR9 (0x1A) | ||
; OBJ64-NEXT: StorageClass: C_FILE (0x67) | ||
; OBJ64-NEXT: NumberOfAuxEntries: 2 | ||
; OBJ64-NEXT: File Auxiliary Entry { | ||
; OBJ64-NEXT: Index: 1 | ||
; OBJ64-NEXT: Name: 1.c | ||
; OBJ64-NEXT: Type: XFT_FN (0x0) | ||
; OBJ64-NEXT: Auxiliary Type: AUX_FILE (0xFC) | ||
; OBJ64-NEXT: } | ||
; OBJ64-NEXT: File Auxiliary Entry { | ||
; OBJ64-NEXT: Index: 2 | ||
; OBJ64-NEXT: Name: LLVM | ||
; OBJ64-NEXT: Type: XFT_CV (0x2) | ||
; OBJ64-NEXT: Auxiliary Type: AUX_FILE (0xFC) | ||
; OBJ64-NEXT: } | ||
; OBJ64-NEXT: } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s | ||
; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=OBJ,OBJ32 %s | ||
; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=OBJ %s | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t64.o < %s | ||
; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=OBJ,OBJ64 %s | ||
; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=OBJ %s | ||
|
||
source_filename = "1.cpp" | ||
|
||
; OBJ: Name: .file | ||
; OBJ: Source Language ID: TB_CPLUSPLUS (0x9) | ||
; OBJ32: CPU Version ID: TCPU_COM (0x3) | ||
; OBJ64: CPU Version ID: TCPU_PPC64 (0x2) | ||
; OBJ: CPU Version ID: TCPU_PWR7 (0x18) | ||
; OBJ: Name: 1.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -filetype=obj -o %t.o < %s | ||
; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=OBJ,OBJ32 %s | ||
; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefixes=OBJ %s | ||
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t64.o < %s | ||
; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=OBJ,OBJ64 %s | ||
; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefixes=OBJ %s | ||
|
||
source_filename = "1.f95" | ||
|
||
; OBJ: Name: .file | ||
; OBJ: Source Language ID: TB_Fortran (0x1) | ||
; OBJ32: CPU Version ID: TCPU_COM (0x3) | ||
; OBJ64: CPU Version ID: TCPU_PPC64 (0x2) | ||
; OBJ: CPU Version ID: TCPU_PWR7 (0x18) | ||
; OBJ: Name: 1.f95 |
Oops, something went wrong.