[llvm] d3f8eab - [PowerPC] Add test to show alignment of toc-data symbol is changed. NFC.
Kai Luo via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 6 01:52:01 PDT 2024
Author: Kai Luo
Date: 2024-06-06T08:58:04Z
New Revision: d3f8eab0accfdddc897aea61763ef57dbc83ee30
URL: https://github.com/llvm/llvm-project/commit/d3f8eab0accfdddc897aea61763ef57dbc83ee30
DIFF: https://github.com/llvm/llvm-project/commit/d3f8eab0accfdddc897aea61763ef57dbc83ee30.diff
LOG: [PowerPC] Add test to show alignment of toc-data symbol is changed. NFC.
After O3 opt pipeline, the alignment of toc-data symbol is changed which is
unexpected.
Added:
llvm/test/CodeGen/PowerPC/tocdata-firm-alignment.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/PowerPC/tocdata-firm-alignment.ll b/llvm/test/CodeGen/PowerPC/tocdata-firm-alignment.ll
new file mode 100644
index 000000000000..c982713d4f8d
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/tocdata-firm-alignment.ll
@@ -0,0 +1,24 @@
+; RUN: opt -S -passes='default<O3>' < %s | FileCheck %s
+
+target datalayout = "E-m:a-p:32:32-Fi32-i64:64-n32"
+target triple = "powerpc-ibm-aix7.2.0.0"
+
+%struct.widget = type { i8, i8, i8 }
+
+; CHECK: @global = {{.*}}constant %struct.widget { i8 4, i8 0, i8 0 }, align 8 #0
+ at global = constant %struct.widget { i8 4, i8 0, i8 0 }, align 4 #0
+
+define void @baz() #1 {
+bb:
+ call void @snork(ptr @global)
+ ret void
+}
+
+define void @snork(ptr byval(%struct.widget) %arg) #1 {
+bb:
+ %load = load volatile ptr, ptr null, align 4
+ ret void
+}
+
+attributes #0 = { "toc-data" }
+attributes #1 = { "target-cpu"="pwr7" "target-features"="+altivec,+bpermd,+extdiv,+isa-v206-instructions,+vsx,-aix-shared-lib-tls-model-opt,-aix-small-local-dynamic-tls,-aix-small-local-exec-tls,-crbits,-crypto,-direct-move,-htm,-isa-v207-instructions,-isa-v30-instructions,-power8-vector,-power9-vector,-privileged,-quadword-atomics,-rop-protect,-spe" }
More information about the llvm-commits
mailing list