[PATCH] D131473: [XCOFF] ignore the cold attribute.
Esme Yi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 9 19:35:00 PDT 2022
Esme updated this revision to Diff 451337.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131473/new/
https://reviews.llvm.org/D131473
Files:
llvm/lib/MC/MCXCOFFStreamer.cpp
llvm/test/CodeGen/PowerPC/aix-xcoff-cold.ll
Index: llvm/test/CodeGen/PowerPC/aix-xcoff-cold.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/aix-xcoff-cold.ll
@@ -0,0 +1,16 @@
+; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -filetype=obj -o %t.o < %s
+; RUN: llvm-objdump --syms %t.o | FileCheck %s
+
+; CHECK: SYMBOL TABLE:
+; CHECK-NEXT: 0000000000000000 df *DEBUG* 0000000000000000 <stdin>
+; CHECK-NEXT: 0000000000000000 l .text 000000000000001e .text
+; CHECK-NEXT: 0000000000000000 g F .text (csect: .text) 0000000000000000 .cold_fun
+; CHECK-NEXT: 0000000000000020 g O .data 0000000000000018 cold_fun
+; CHECK-NEXT: 0000000000000038 l .data 0000000000000000 TOC
+
+define dso_local void @cold_fun() #1 {
+entry:
+ ret void
+}
+
+attributes #1 = { cold }
Index: llvm/lib/MC/MCXCOFFStreamer.cpp
===================================================================
--- llvm/lib/MC/MCXCOFFStreamer.cpp
+++ llvm/lib/MC/MCXCOFFStreamer.cpp
@@ -37,6 +37,10 @@
getAssembler().registerSymbol(*Symbol);
switch (Attribute) {
+ // XCOFF doesn't support the cold feature.
+ case MCSA_Cold:
+ return false;
+
case MCSA_Global:
case MCSA_Extern:
Symbol->setStorageClass(XCOFF::C_EXT);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131473.451337.patch
Type: text/x-patch
Size: 1257 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220810/b2004519/attachment.bin>
More information about the llvm-commits
mailing list