diff --git a/test/CodeGen/PowerPC/aix-lr.ll b/test/CodeGen/PowerPC/aix-lr.ll index ea92daf04f0..38ebf297e59 100644 --- a/test/CodeGen/PowerPC/aix-lr.ll +++ b/test/CodeGen/PowerPC/aix-lr.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff < %s | \ ; RUN: FileCheck --check-prefix=32BIT %s @@ -5,25 +6,32 @@ ; RUN: FileCheck --check-prefix=64BIT %s define void @bar() { +; 32BIT-LABEL: bar: +; 32BIT: # %bb.0: # %entry +; 32BIT-NEXT: mflr 0 +; 32BIT-NEXT: stw 0, 8(1) +; 32BIT-NEXT: stwu 1, -64(1) +; 32BIT-NEXT: bl .foo[PR] +; 32BIT-NEXT: nop +; 32BIT-NEXT: addi 1, 1, 64 +; 32BIT-NEXT: lwz 0, 8(1) +; 32BIT-NEXT: mtlr 0 +; 32BIT-NEXT: blr +; +; 64BIT-LABEL: bar: +; 64BIT: # %bb.0: # %entry +; 64BIT-NEXT: mflr 0 +; 64BIT-NEXT: std 0, 16(1) +; 64BIT-NEXT: stdu 1, -112(1) +; 64BIT-NEXT: bl .foo[PR] +; 64BIT-NEXT: nop +; 64BIT-NEXT: addi 1, 1, 112 +; 64BIT-NEXT: ld 0, 16(1) +; 64BIT-NEXT: mtlr 0 +; 64BIT-NEXT: blr entry: -; 32BIT: mflr 0 -; 32BIT: stw 0, 8(1) -; 32BIT: stwu 1, -64(1) -; 32BIT: bl .foo -; 32BIT: nop -; 32BIT: addi 1, 1, 64 -; 32BIT: lwz 0, 8(1) -; 32BIT: mtlr 0 -; 64BIT: mflr 0 -; 64BIT: std 0, 16(1) -; 64BIT: stdu 1, -112(1) -; 64BIT: bl .foo -; 64BIT: nop -; 64BIT: addi 1, 1, 112 -; 64BIT: ld 0, 16(1) -; 64BIT: mtlr 0 call void bitcast (void (...)* @foo to void ()*)() ret void diff --git a/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll b/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll index cd545199697..d31a3361635 100644 --- a/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll +++ b/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll @@ -1,4 +1,5 @@ ; RUN: llc -enable-machine-outliner -mtriple=ppc32-unknown-linux < %s | FileCheck %s +; RUN: llc -enable-machine-outliner -mtriple=powerpc-ibm-aix-xcoff < %s | FileCheck %s -check-prefix=AIX ; ; NOTE: Machine outliner doesn't run. @x = global i32 0, align 4 diff --git a/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll.generated.expected b/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll.generated.expected index 57298fa6e01..1fca598d23f 100644 --- a/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll.generated.expected +++ b/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll.generated.expected @@ -1,5 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --include-generated-funcs ; RUN: llc -enable-machine-outliner -mtriple=ppc32-unknown-linux < %s | FileCheck %s +; RUN: llc -enable-machine-outliner -mtriple=powerpc-ibm-aix-xcoff < %s | FileCheck %s -check-prefix=AIX ; NOTE: Machine outliner doesn't run. @x = global i32 0, align 4 @@ -127,3 +128,62 @@ attributes #0 = { noredzone nounwind ssp uwtable "frame-pointer"="all" } ; CHECK-NEXT: lwz 31, 28(1) ; CHECK-NEXT: addi 1, 1, 32 ; CHECK-NEXT: blr +; +; AIX-LABEL: check_boundaries: +; AIX: # %bb.0: +; AIX-NEXT: stw 31, -4(1) +; AIX-NEXT: stwu 1, -48(1) +; AIX-NEXT: mr 31, 1 +; AIX-NEXT: li 4, 0 +; AIX-NEXT: li 3, 1 +; AIX-NEXT: stw 4, 40(31) +; AIX-NEXT: li 4, 2 +; AIX-NEXT: li 5, 3 +; AIX-NEXT: li 6, 4 +; AIX-NEXT: cmplwi 3, 0 +; AIX-NEXT: stw 3, 36(31) +; AIX-NEXT: stw 4, 32(31) +; AIX-NEXT: stw 5, 28(31) +; AIX-NEXT: stw 6, 24(31) +; AIX-NEXT: beq 0, L..BB0_2 +; AIX-NEXT: # %bb.1: +; AIX-NEXT: stw 3, 28(31) +; AIX-NEXT: b L..BB0_3 +; AIX-NEXT: L..BB0_2: +; AIX-NEXT: stw 3, 36(31) +; AIX-NEXT: stw 4, 32(31) +; AIX-NEXT: stw 5, 28(31) +; AIX-NEXT: stw 6, 24(31) +; AIX-NEXT: L..BB0_3: +; AIX-NEXT: li 3, 0 +; AIX-NEXT: addi 1, 1, 48 +; AIX-NEXT: lwz 31, -4(1) +; AIX-NEXT: blr +; +; AIX-LABEL: main: +; AIX: # %bb.0: +; AIX-NEXT: stw 31, -4(1) +; AIX-NEXT: stwu 1, -48(1) +; AIX-NEXT: lwz 4, L..C0(2) +; AIX-NEXT: mr 31, 1 +; AIX-NEXT: li 3, 0 +; AIX-NEXT: stw 3, 40(31) +; AIX-NEXT: li 3, 1 +; AIX-NEXT: li 5, 2 +; AIX-NEXT: li 6, 3 +; AIX-NEXT: li 7, 4 +; AIX-NEXT: stw 3, 36(31) +; AIX-NEXT: stw 5, 32(31) +; AIX-NEXT: stw 6, 28(31) +; AIX-NEXT: stw 7, 24(31) +; AIX-NEXT: stw 3, 0(4) +; AIX-NEXT: #APP +; AIX-NEXT: #NO_APP +; AIX-NEXT: stw 3, 36(31) +; AIX-NEXT: li 3, 0 +; AIX-NEXT: stw 5, 32(31) +; AIX-NEXT: stw 6, 28(31) +; AIX-NEXT: stw 7, 24(31) +; AIX-NEXT: addi 1, 1, 48 +; AIX-NEXT: lwz 31, -4(1) +; AIX-NEXT: blr diff --git a/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll.nogenerated.expected b/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll.nogenerated.expected index 2005ff401b4..13512d401a7 100644 --- a/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll.nogenerated.expected +++ b/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/ppc_generated_funcs.ll.nogenerated.expected @@ -1,5 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -enable-machine-outliner -mtriple=ppc32-unknown-linux < %s | FileCheck %s +; RUN: llc -enable-machine-outliner -mtriple=powerpc-ibm-aix-xcoff < %s | FileCheck %s -check-prefix=AIX ; ; NOTE: Machine outliner doesn't run. @x = global i32 0, align 4 @@ -38,6 +39,37 @@ define dso_local i32 @check_boundaries() #0 { ; CHECK-NEXT: lwz 31, 28(1) ; CHECK-NEXT: addi 1, 1, 32 ; CHECK-NEXT: blr +; +; AIX-LABEL: check_boundaries: +; AIX: # %bb.0: +; AIX-NEXT: stw 31, -4(1) +; AIX-NEXT: stwu 1, -48(1) +; AIX-NEXT: mr 31, 1 +; AIX-NEXT: li 4, 0 +; AIX-NEXT: li 3, 1 +; AIX-NEXT: stw 4, 40(31) +; AIX-NEXT: li 4, 2 +; AIX-NEXT: li 5, 3 +; AIX-NEXT: li 6, 4 +; AIX-NEXT: cmplwi 3, 0 +; AIX-NEXT: stw 3, 36(31) +; AIX-NEXT: stw 4, 32(31) +; AIX-NEXT: stw 5, 28(31) +; AIX-NEXT: stw 6, 24(31) +; AIX-NEXT: beq 0, L..BB0_2 +; AIX-NEXT: # %bb.1: +; AIX-NEXT: stw 3, 28(31) +; AIX-NEXT: b L..BB0_3 +; AIX-NEXT: L..BB0_2: +; AIX-NEXT: stw 3, 36(31) +; AIX-NEXT: stw 4, 32(31) +; AIX-NEXT: stw 5, 28(31) +; AIX-NEXT: stw 6, 24(31) +; AIX-NEXT: L..BB0_3: +; AIX-NEXT: li 3, 0 +; AIX-NEXT: addi 1, 1, 48 +; AIX-NEXT: lwz 31, -4(1) +; AIX-NEXT: blr %1 = alloca i32, align 4 %2 = alloca i32, align 4 %3 = alloca i32, align 4 @@ -105,6 +137,34 @@ define dso_local i32 @main() #0 { ; CHECK-NEXT: lwz 31, 28(1) ; CHECK-NEXT: addi 1, 1, 32 ; CHECK-NEXT: blr +; +; AIX-LABEL: main: +; AIX: # %bb.0: +; AIX-NEXT: stw 31, -4(1) +; AIX-NEXT: stwu 1, -48(1) +; AIX-NEXT: lwz 4, L..C0(2) +; AIX-NEXT: mr 31, 1 +; AIX-NEXT: li 3, 0 +; AIX-NEXT: stw 3, 40(31) +; AIX-NEXT: li 3, 1 +; AIX-NEXT: li 5, 2 +; AIX-NEXT: li 6, 3 +; AIX-NEXT: li 7, 4 +; AIX-NEXT: stw 3, 36(31) +; AIX-NEXT: stw 5, 32(31) +; AIX-NEXT: stw 6, 28(31) +; AIX-NEXT: stw 7, 24(31) +; AIX-NEXT: stw 3, 0(4) +; AIX-NEXT: #APP +; AIX-NEXT: #NO_APP +; AIX-NEXT: stw 3, 36(31) +; AIX-NEXT: li 3, 0 +; AIX-NEXT: stw 5, 32(31) +; AIX-NEXT: stw 6, 28(31) +; AIX-NEXT: stw 7, 24(31) +; AIX-NEXT: addi 1, 1, 48 +; AIX-NEXT: lwz 31, -4(1) +; AIX-NEXT: blr %1 = alloca i32, align 4 %2 = alloca i32, align 4 %3 = alloca i32, align 4 diff --git a/utils/UpdateTestChecks/asm.py b/utils/UpdateTestChecks/asm.py index a42a75ed26b..407b26cf152 100644 --- a/utils/UpdateTestChecks/asm.py +++ b/utils/UpdateTestChecks/asm.py @@ -68,15 +68,14 @@ ASM_FUNCTION_MSP430_RE = re.compile( flags=(re.M | re.S)) ASM_FUNCTION_PPC_RE = re.compile( - r'^_?(?P[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n' + r'#[ \-\t]*Begin function (?P[^.:]+)\n' r'.*?' - r'\.Lfunc_begin[0-9]+:\n' - r'(?:[ \t]+.cfi_startproc\n)?' - r'(?:\.Lfunc_[gl]ep[0-9]+:\n(?:[ \t]+.*?\n)*)*' + r'^[_.]?(?P=func):(?:[ \t]*#+[ \t]*@"?(?P=func)"?)?\n' + r'(?:^[^#]*\n)*' r'(?P.*?)\n' # This list is incomplete - r'(?:^[ \t]*(?:\.long[ \t]+[^\n]+|\.quad[ \t]+[^\n]+)\n)*' - r'.Lfunc_end[0-9]+:\n', + r'(?:^[ \t]*(?:\.(?:long|quad|v?byte)[ \t]+[^\n]+)\n)*' + r'(?:\.Lfunc_end|L\.\.(?P=func))[0-9]+:\n', flags=(re.M | re.S)) ASM_FUNCTION_RISCV_RE = re.compile(