Skip to content

Commit 9325381

Browse files
authored
[PowerPC][GlobalMerge] Enable GlobalMerge by default on AIX (#101226)
This patch turns on the GlobalMerge pass by default on AIX and updates LIT tests accordingly.
1 parent 2b0a8fc commit 9325381

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

llvm/lib/Target/PowerPC/PPCTargetMachine.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,12 @@ void PPCPassConfig::addIRPasses() {
500500
}
501501

502502
bool PPCPassConfig::addPreISel() {
503-
if (EnableGlobalMerge)
503+
// The GlobalMerge pass is intended to be on by default on AIX.
504+
// Specifying the command line option overrides the AIX default.
505+
if ((EnableGlobalMerge.getNumOccurrences() > 0)
506+
? EnableGlobalMerge
507+
: (TM->getTargetTriple().isOSAIX() &&
508+
getOptLevel() != CodeGenOptLevel::None))
504509
addPass(
505510
createGlobalMergePass(TM, GlobalMergeMaxOffset, false, false, true));
506511

llvm/test/CodeGen/PowerPC/merge-private.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux -mcpu=pwr8 \
1212
; RUN: -ppc-asm-full-reg-names -ppc-global-merge=true < %s | FileCheck %s \
1313
; RUN: --check-prefix=LINUX64BE
14+
; The below run line is added to ensure that the assembly corresponding to
15+
; the following check-prefix is generated by default on AIX (without any
16+
; options).
17+
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr8 \
18+
; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s \
19+
; RUN: --check-prefix=AIX64
1420

1521
@.str = private unnamed_addr constant [15 x i8] c"Private global\00", align 1
1622
@str = internal constant [16 x i8] c"Internal global\00", align 1

llvm/test/CodeGen/PowerPC/mergeable-string-pool.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr8 \
1+
; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr8 -enable-global-merge=false \
22
; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s --check-prefixes=AIX32,AIXDATA
3-
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr8 \
3+
; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr8 -enable-global-merge=false \
44
; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s --check-prefixes=AIX64,AIXDATA
55
; RUN: llc -verify-machineinstrs -mtriple powerpc64-unknown-linux -mcpu=pwr8 \
66
; RUN: -ppc-asm-full-reg-names < %s | FileCheck %s --check-prefixes=LINUX64BE,LINUXDATA

llvm/test/DebugInfo/Symbolize/XCOFF/xcoff-symbolize-data.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; AIX assembly syntax.
66

77
; REQUIRES: powerpc-registered-target
8-
; RUN: llc -filetype=obj -o %t -mtriple=powerpc-aix-ibm-xcoff < %s
8+
; RUN: llc -filetype=obj -o %t -mtriple=powerpc-aix-ibm-xcoff -ppc-global-merge=false < %s
99
; RUN: llvm-symbolizer --obj=%t 'DATA 0x60' 'DATA 0x61' 'DATA 0x64' 'DATA 0X68' \
1010
; RUN: 'DATA 0x90' 'DATA 0x94' 'DATA 0X98' | \
1111
; RUN: FileCheck %s

0 commit comments

Comments
 (0)