[PATCH] D130495: Have a simple StackSizesSection on PS4.
Ying Yi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 27 01:40:52 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8d46cb343f52: Emit a simple StackSizesSection on PS4. (authored by MaggieYi).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130495/new/
https://reviews.llvm.org/D130495
Files:
llvm/lib/MC/MCObjectFileInfo.cpp
llvm/test/CodeGen/X86/stack-size-section.ll
Index: llvm/test/CodeGen/X86/stack-size-section.ll
===================================================================
--- llvm/test/CodeGen/X86/stack-size-section.ll
+++ llvm/test/CodeGen/X86/stack-size-section.ll
@@ -1,8 +1,12 @@
-; RUN: llc < %s -mtriple=x86_64-linux -stack-size-section | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-linux -stack-size-section | FileCheck %s --check-prefix=CHECK --check-prefix=GROUPS
+
+; PS4 'as' does not recognize the section attribute "o". So we have a simple .stack_sizes section on PS4.
+; RUN: llc < %s -mtriple=x86_64-scei-ps4 -stack-size-section | FileCheck %s --check-prefix=CHECK --check-prefix=NOGROUPS
; CHECK-LABEL: func1:
; CHECK-NEXT: .Lfunc_begin0:
-; CHECK: .section .stack_sizes,"o", at progbits,.text{{$}}
+; GROUPS: .section .stack_sizes,"o", at progbits,.text{{$}}
+; NOGROUPS: .section .stack_sizes,"", at progbits
; CHECK-NEXT: .quad .Lfunc_begin0
; CHECK-NEXT: .byte 8
define void @func1(i32, i32) #0 {
@@ -13,7 +17,8 @@
; CHECK-LABEL: func2:
; CHECK-NEXT: .Lfunc_begin1:
-; CHECK: .section .stack_sizes,"o", at progbits,.text{{$}}
+; GROUPS: .section .stack_sizes,"o", at progbits,.text{{$}}
+; NOGROUPS: .section .stack_sizes,"", at progbits
; CHECK-NEXT: .quad .Lfunc_begin1
; CHECK-NEXT: .byte 24
define void @func2() #0 {
@@ -24,14 +29,16 @@
; Check that we still put .stack_sizes into the corresponding COMDAT group if any.
; CHECK: .section .text._Z4fooTIiET_v,"axG", at progbits,_Z4fooTIiET_v,comdat
-; CHECK: .section .stack_sizes,"Go", at progbits,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
+; GROUPS: .section .stack_sizes,"Go", at progbits,_Z4fooTIiET_v,comdat,.text._Z4fooTIiET_v{{$}}
+; NOGROUPS: .section .stack_sizes,"", at progbits
$_Z4fooTIiET_v = comdat any
define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {
ret i32 0
}
; CHECK: .section .text.func3,"ax", at progbits
-; CHECK: .section .stack_sizes,"o", at progbits,.text.func3{{$}}
+; GROUPS: .section .stack_sizes,"o", at progbits,.text.func3{{$}}
+; NOGROUPS: .section .stack_sizes,"", at progbits
define dso_local i32 @func3() section ".text.func3" {
%1 = alloca i32, align 4
store i32 0, ptr %1, align 4
Index: llvm/lib/MC/MCObjectFileInfo.cpp
===================================================================
--- llvm/lib/MC/MCObjectFileInfo.cpp
+++ llvm/lib/MC/MCObjectFileInfo.cpp
@@ -1103,7 +1103,8 @@
MCSection *
MCObjectFileInfo::getStackSizesSection(const MCSection &TextSec) const {
- if (Ctx->getObjectFileType() != MCContext::IsELF)
+ if ((Ctx->getObjectFileType() != MCContext::IsELF) ||
+ Ctx->getTargetTriple().isPS4())
return StackSizesSection;
const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130495.447949.patch
Type: text/x-patch
Size: 2700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220727/3232cc8d/attachment.bin>
More information about the llvm-commits
mailing list