From e107cfaafc84cb9043eba4739ac64892638becf4 Mon Sep 17 00:00:00 2001 From: ZhouGuangyuan Date: Fri, 14 Aug 2026 02:39:00 +0800 Subject: [PATCH 1/2] cmd/compile: separate entry argument maps from stack growth --- doc/goallc-llvm-goobj.md | 37 ++++---- src/cmd/compile/internal/ssa/ssa2llvm.go | 21 +++-- src/cmd/internal/testdir/llvm_abi_test.go | 66 ++++++++++++-- src/cmd/internal/testdir/llvm_test.go | 88 +++++++++++++++++++ src/cmd/llvmplugin/CMakeLists.txt | 15 +++- src/cmd/llvmplugin/GoALLCStackMapPrinter.cpp | 58 ++++++------ src/cmd/llvmplugin/README.md | 52 +++++------ src/cmd/llvmplugin/testdata/aarch64-frame.ll | 2 +- .../testdata/aggregate-call-result-goobj.ll | 2 +- src/cmd/llvmplugin/testdata/aggregate-cfg.ll | 22 ++--- .../testdata/aggregate-conditional-stage-b.ll | 2 +- .../testdata/aggregate-fixed-vector.ll | 2 +- .../testdata/aggregate-loop-stage-b.ll | 2 +- .../aggregate-scalable-vector-unsupported.ll | 2 +- .../testdata/aggregate-scalarization.ll | 32 +++---- src/cmd/llvmplugin/testdata/alloca-derived.ll | 2 +- .../alloca-pointer-dynamic-unsupported.ll | 2 +- .../alloca-pointer-lifetime-ambiguous.ll | 2 +- .../alloca-pointer-lifetime-unsupported.ll | 16 ++-- .../alloca-pointer-nonentry-unsupported.ll | 2 +- .../alloca-pointer-realigned-unsupported.ll | 2 +- .../testdata/alloca-pointer-roots.ll | 40 ++++----- .../alloca-pointer-select-unsupported.ll | 2 +- .../alloca-pointer-vector-unsupported.ll | 2 +- .../alloca-pointer-volatile-unsupported.ll | 2 +- .../alloca-ptrmap-malformed-bad-kind.ll | 3 +- .../alloca-ptrmap-malformed-bad-length.ll | 3 +- .../alloca-ptrmap-malformed-duplicate.ll | 3 +- .../alloca-ptrmap-malformed-non-direct.ll | 3 +- .../alloca-ptrmap-malformed-overlap.ll | 3 +- .../alloca-ptrmap-malformed-padding.ll | 3 +- .../alloca-ptrmap-malformed-truncated.ll | 3 +- .../testdata/alloca-zero-pointer-array.ll | 2 +- .../testdata/branch-safepoints-relocation.ll | 2 +- .../testdata/conditional-relocation.ll | 4 +- src/cmd/llvmplugin/testdata/defer-edge.ll | 6 +- .../derived-pointer-rematerialization.ll | 10 +-- .../testdata/function-marker-inline.ll | 4 +- .../llvmplugin/testdata/gc-leaf-markers.ll | 2 +- .../llvmplugin/testdata/indirect-callee.ll | 2 +- .../testdata/invalid-gc-leaf-definition.ll | 2 +- .../testdata/irreducible-relocation.ll | 2 +- src/cmd/llvmplugin/testdata/live-aggregate.ll | 2 +- .../llvmplugin/testdata/loop-relocation.ll | 2 +- src/cmd/llvmplugin/testdata/multiple-calls.ll | 2 +- .../llvmplugin/testdata/nest-param-attr.ll | 2 +- .../testdata/open-defer-incomplete.ll | 4 +- src/cmd/llvmplugin/testdata/open-defer.ll | 4 +- .../testdata/pointer-address-observation.ll | 2 +- .../sequential-conditional-relocation.ll | 2 +- src/cmd/llvmplugin/testdata/statepoint.ll | 28 ++++-- .../testdata/supported-param-attrs.ll | 2 +- .../llvmplugin/testdata/unsupported-invoke.ll | 2 +- .../testdata/unsupported-param-attr.ll | 2 +- test/codegen/statepoint.go | 3 +- test/llvm_tests.json | 2 +- 56 files changed, 381 insertions(+), 210 deletions(-) diff --git a/doc/goallc-llvm-goobj.md b/doc/goallc-llvm-goobj.md index 260d28956f7a98..96f727264b9336 100644 --- a/doc/goallc-llvm-goobj.md +++ b/doc/goallc-llvm-goobj.md @@ -171,10 +171,10 @@ use 的 local 不生成 LLVM 栈槽,避免无意义地增大 frame。 GoObj stack growth、SP 恢复和当前 stack-map 路径只支持编译期固定 frame。 因此 amd64 和 arm64 GoObj target 对 variable-sized `alloca` 都确定性报错, -不能把动态栈分配交给 LLVM 通用 lowering。当前 GoObj writer 的 args/locals -pointer maps 仍为空;本实现只保证现有固定栈槽的 dominance、frame placement -和 stack-growth 约束,不代表已经支持完整 precise-GC stack maps、goroutine、 -defer 或 panic unwind。 +不能把动态栈分配交给 LLVM 通用 lowering。当前 GoObj writer 已为所有 GoObj Go +函数生成类型推导的入口 ArgsPointerMaps,并为已支持的普通 statepoint 和固定 +`alloca` 生成 LocalsPointerMaps;这仍不代表已经支持完整 precise-GC stack maps、 +goroutine、defer 或 panic unwind。 对应回归包括: @@ -273,9 +273,10 @@ pass plugin 默认从 `llc` 所属 LLVM payload 的 wrapper 覆盖的 compile action 重新编译。 插件的功能性源码和测试位于 Go 仓库 -`src/cmd/llvmplugin`,不放入 LLVM 源码树。LLVM 只提供通用的 -`-load-pass-plugin` 和 pre-codegen callback;GoALLC statepoint rewrite 及其 -pass 顺序都应继续在这个 Go-owned 工程中实现。当前 +`src/cmd/llvmplugin`,不放入 LLVM 源码树。LLVM 提供通用的 +`-load-pass-plugin`、pre-codegen callback,以及 GoObj 对 Machine StackMaps +的对象格式适配;GoALLC statepoint rewrite 及其 pass 顺序都应继续在这个 +Go-owned 工程中实现。当前 `runPreCodeGenPipeline` 调用 Go-owned statepoint pass:它对 Go ABI 函数执行 CFG 逆向数据流活跃性分析,为普通调用分配稳定 callsite ID,生成 `gc.statepoint` / `gc.relocate`,并识别 `gc-leaf-function`。受管指针分类当前 @@ -285,21 +286,21 @@ aggregate、`invoke`、`musttail` 和非 leaf inline asm fail closed。未来 compile 进程内集成 LLVM 时直接复用该 core 入口,不经过 plugin adapter。 机器位置不通过修改 LLVM 通用 `StackMaps.cpp` 截获。SSA→LLVM IR 前端为 Go ABI -函数声明 `gc "goallc"` 和 `go-stack-growth-statepoint`,插件只负责注册对应的 -GC strategy 与 `GCMetadataPrinter::emitStackMaps`,并消费这些前端标记。在 +函数声明 `gc "goallc"`;GoObj Go 函数默认采用原生 Go 的可扩栈策略,只有 +`go-nosplit`、`go-systemstack` 这样的例外策略需要额外属性。插件负责注册对应的 +GC strategy、执行 statepoint rewrite 并消费这些前端标记。在 LLVM GoObj AsmPrinter 模块收尾阶段 读取标准 `FnInfos/CSInfos`,跳过 statepoint 的 CC、flags 和 deopt 前缀后,把 原始 GC locations 写入 MCContext。GoObj writer 在最终 layout 后完成 SP 校验、`Direct`/`Indirect` 解释、LocalsPointerMaps 和 PCDATA_StackMapIndex -编码。GoALLC 要求 StackMaps 记录 CALL 起点;map 从 CALL 开始。前端添加的 -`go-stack-growth-statepoint` 属性使 LLVM 在 PEI 阶段把 -`runtime.morestack` 调用生成为物理 MIR `STATEPOINT`。其 deopt 和 GC alloca -区为空,GC pointer 区则记录类型推导出的入口参数 home。它从 morestack CALL -起点选择入口 ArgsPointerMaps 和空 locals bitmap,因此普通调用与栈增长调用 -走同一 Machine StackMaps 链路,且不依赖 return PC 反推调用范围。已有 -Machine `STATEPOINT` 但缺少该前端属性时, -LLVM target lowering 会 fail closed;不再使用 slow-path reset label 兼容普通 -morestack CALL。GoObj 先写索引 0 的 +编码。GoALLC 要求 StackMaps 记录 CALL 起点;map 从 CALL 开始。LLVM target +formal lowering 为每个 GoObj Go 函数推导入口参数 home,并用一个独立、零字节的 +`EntryArgsStackMapID` 表达函数级 ArgsPointerMaps;该记录不是调用点,不生成 +PCDATA。非 nosplit 函数在 PEI 阶段额外把 `runtime.morestack` 调用生成为物理、 +root-free 的 `StackGrowthStatepointID`,从 CALL 起点选择入口 ArgsPointerMaps 和 +空 locals bitmap。nosplit 函数不得包含这个 statepoint。这样普通调用与栈增长 +调用仍走同一 Machine StackMaps 链路,且不依赖 return PC 反推调用范围,同时 +函数级入口图不再伪装成 morestack 调用。GoObj 先写索引 0 的 `PCDATA_UnsafePoint`(当前恒为 safe 的 `-1`),再写索引 1 的 `PCDATA_StackMapIndex`;不能只写后一张表,否则 linker 会把它误认成索引 0。 `Direct SP+offset` 是栈地址本身,不表示该 slot 存有 pointer,因此不会设置 diff --git a/src/cmd/compile/internal/ssa/ssa2llvm.go b/src/cmd/compile/internal/ssa/ssa2llvm.go index fb221d6c1c844f..1939d5c9ce8774 100644 --- a/src/cmd/compile/internal/ssa/ssa2llvm.go +++ b/src/cmd/compile/internal/ssa/ssa2llvm.go @@ -70,7 +70,8 @@ const goABI0SymbolSuffix = "" const goResultsTupleAttr = "go_results_tuple" const goGCStrategy = "goallc" const goGCLeafFunctionAttr = "gc-leaf-function" -const goStackGrowthStatepointAttr = "go-stack-growth-statepoint" +const goNoSplitAttr = "go-nosplit" +const goSystemStackAttr = "go-systemstack" const goAsyncUnsafeAttr = "go-async-unsafe" const goWriteBarrierIntrinsic = "llvm.go.gc.write.barrier" const goDeferEdgeIntrinsic = "llvm.go.defer.edge" @@ -3087,10 +3088,20 @@ func LLVMCompile(f *Func) { } } FCtxt.LF.AddFunctionAttr(GlobalCtxt.CreateStringAttribute(goAsyncUnsafeAttr, "")) - // TODO(goallc): Once LLVM lowering propagates the compiler's precise - // morestack policy, attach this only to functions whose prologue can grow - // the Go stack. - FCtxt.LF.AddFunctionAttr(GlobalCtxt.CreateStringAttribute(goStackGrowthStatepointAttr, "")) + // A //go:nosplit function must not acquire that late morestack edge. Besides + // violating the runtime's nosplit call graph, it would expose a safepoint the + // frontend deliberately prohibited. Give target frame lowering the source + // policy directly instead of asking it to infer a pragma from GoObj metadata. + if f.NoSplit { + FCtxt.LF.AddFunctionAttr(GlobalCtxt.CreateStringAttribute(goNoSplitAttr, "")) + } + // Native Go gives //go:systemstack functions a distinct stack-growth + // prologue: it checks g.stackguard1 and calls runtime.morestackc. Carry the + // source pragma through AttrCFunc so target frame lowering cannot silently + // use the ordinary goroutine stack-growth protocol for runtime code. + if f.OwnAux.Fn.CFunc() { + FCtxt.LF.AddFunctionAttr(GlobalCtxt.CreateStringAttribute(goSystemStackAttr, "")) + } FCtxt.LF.AddFunctionAttr(GlobalCtxt.CreateStringAttribute(llvmFramePointerAttr, llvmFramePointerNonLeaf)) if sig.HasClosureContext { FCtxt.ClosureContext = FCtxt.LF.Param(sig.ClosureContextIndex) diff --git a/src/cmd/internal/testdir/llvm_abi_test.go b/src/cmd/internal/testdir/llvm_abi_test.go index 61992380646584..beb40a4d1f1fd6 100644 --- a/src/cmd/internal/testdir/llvm_abi_test.go +++ b/src/cmd/internal/testdir/llvm_abi_test.go @@ -22,14 +22,29 @@ import ( type llvmABIDocument struct { Members []struct { GoObject *struct { - Symbols []llvmABISymbol `json:"symbols"` + Symbols []llvmABISymbol `json:"symbols"` + References []llvmABISymbol `json:"references"` } `json:"go_object"` } `json:"members"` } -type llvmABISymbol struct { +type llvmABIReference struct { + PkgKind string `json:"pkg_kind"` + SymIndex uint32 `json:"sym_index"` Name string `json:"name"` - ABI uint16 `json:"abi"` +} + +type llvmABISymbol struct { + Class string `json:"class"` + ClassIndex uint32 `json:"class_index"` + Name string `json:"name"` + ABI uint16 `json:"abi"` + Flags uint64 `json:"flags"` + FlagNames []string `json:"flag_names"` + Relocations []struct { + Type string `json:"type"` + Target llvmABIReference `json:"target"` + } `json:"relocations"` Function *struct { Info *struct { Args uint32 `json:"args"` @@ -132,12 +147,14 @@ func runLLVMAArch64ABIDifferentialTest(t *testing.T, gorootTestDir string) { []byte("define goabiinternal"), []byte(`"go_results_tuple"`), []byte(`gc "goallc"`), - []byte(`"go-stack-growth-statepoint"`), } { if !bytes.Contains(ir, needle) { t.Fatalf("GoALLC IR does not contain %q", needle) } } + if bytes.Contains(ir, []byte(`"go-stack-growth-statepoint"`)) { + t.Fatal("GoALLC IR still contains the obsolete stack-growth attribute") + } opt := llvmToolPath(t, "opt", "GOALLC_OPT") runLLVMABICommand(t, ir, opt, "-passes=verify", "-disable-output") @@ -248,7 +265,7 @@ func runLLVMAArch64ABIDifferentialTest(t *testing.T, gorootTestDir string) { // homes in LocalsPointerMaps through locals-only alloca records. goallcArgsMaps: [][]int{{2, 4, 18}, {2}}, nativeStackMaps: []int32{-1, 0, -1}, - goallcStackMaps: []int32{-1, 1, -1}, + goallcStackMaps: []int32{-1, 1, -1, 1}, goallcQueryMaps: [][]int{{2, 4, 18}, {2}, {2}, {2}, {2}}, }, { @@ -347,7 +364,8 @@ func runLLVMAArch64ABIDifferentialTest(t *testing.T, gorootTestDir string) { nativeArgsMaps: [][]int{{4}, nil}, goallcArgsMaps: [][]int{{4}, nil, nil}, nativeStackMaps: []int32{-1, 0, 1, -1}, - goallcStackMaps: []int32{-1, 1, 2, -1, 2}, + goallcStackMaps: []int32{-1, 1, -1, 2}, + goallcQueryMaps: [][]int{{4}, nil, nil, nil}, }, } for _, tc := range cases { @@ -955,6 +973,42 @@ func findLLVMABISymbol(t *testing.T, document llvmABIDocument, name string) llvm return llvmABISymbol{} } +func llvmABIRelocationTargetName(document llvmABIDocument, target llvmABIReference) string { + if target.Name != "" || target.PkgKind != "none" { + return target.Name + } + for _, member := range document.Members { + if member.GoObject == nil { + continue + } + var nonpackageDefinitions uint32 + for _, symbol := range member.GoObject.Symbols { + if symbol.Class == "nonpackage" && symbol.ClassIndex >= nonpackageDefinitions { + nonpackageDefinitions = symbol.ClassIndex + 1 + } + } + if target.SymIndex < nonpackageDefinitions { + continue + } + classIndex := target.SymIndex - nonpackageDefinitions + for _, reference := range member.GoObject.References { + if reference.Class == "nonpackage_reference" && reference.ClassIndex == classIndex { + return reference.Name + } + } + } + return "" +} + +func llvmABIHasRelocationTo(document llvmABIDocument, symbol llvmABISymbol, name string) bool { + for _, relocation := range symbol.Relocations { + if llvmABIRelocationTargetName(document, relocation.Target) == name { + return true + } + } + return false +} + func checkLLVMABISymbol(t *testing.T, backend string, symbol llvmABISymbol, tc llvmABICase) { t.Helper() if symbol.ABI != 1 { diff --git a/src/cmd/internal/testdir/llvm_test.go b/src/cmd/internal/testdir/llvm_test.go index 353951f1004078..bce90e99057d5f 100644 --- a/src/cmd/internal/testdir/llvm_test.go +++ b/src/cmd/internal/testdir/llvm_test.go @@ -15,7 +15,9 @@ import ( "os/exec" "path" "path/filepath" + "regexp" "runtime" + "slices" "sort" "strings" "sync" @@ -189,6 +191,7 @@ func runLLVMInfrastructureTests(t *testing.T, common testCommon) { runLLVMCallerStateTest(t, common.gorootTestDir) }) t.Run("getg-abi0-fail-closed", runLLVMGetGABI0FailClosedTest) + t.Run("nosplit", runLLVMNoSplitTest) t.Run("writebarrier-helpers", runLLVMWriteBarrierHelperTest) t.Run("compile-only-regressions", func(t *testing.T) { for _, name := range []string{"cmp.go", "typeparam/issue47684c.go"} { @@ -200,6 +203,91 @@ func runLLVMInfrastructureTests(t *testing.T, common testCommon) { t.Run("writebarrier-ir", runLLVMWriteBarrierIRTests) } +func runLLVMNoSplitTest(t *testing.T) { + t.Helper() + dir := t.TempDir() + source := filepath.Join(dir, "nosplit.go") + program := `package p + +func use(*[32]uintptr) + +//go:nosplit +//go:noinline +func NoSplit(pointer *int) *int { + var words [32]uintptr + use(&words) + return pointer +} + +//go:noinline +func Split(pointer *int) *int { + var words [32]uintptr + use(&words) + return pointer +} +` + if err := os.WriteFile(source, []byte(program), 0o666); err != nil { + t.Fatal(err) + } + archive := filepath.Join(dir, "nosplit.a") + runLLVMABICommand(t, nil, goTool, "tool", "compile", + "-p=p", "-enablellvm", "-llvmironly", "-o", archive, source) + ir, err := os.ReadFile(archive + ".ll") + if err != nil { + t.Fatal(err) + } + attributeLine := func(name string) []byte { + definition := regexp.MustCompile(`(?m)^define goabiinternal .*@` + regexp.QuoteMeta(name) + `\([^\n]*\) #([0-9]+)`).FindSubmatch(ir) + if definition == nil { + t.Fatalf("LLVM IR has no attributed definition for %s\n%s", name, ir) + } + pattern := regexp.MustCompile(`(?m)^attributes #` + string(definition[1]) + ` = \{.*$`) + line := pattern.Find(ir) + if line == nil { + t.Fatalf("LLVM IR has no attribute group for %s\n%s", name, ir) + } + return line + } + noSplitAttrs := attributeLine("p.NoSplit") + if !bytes.Contains(noSplitAttrs, []byte(`"go-nosplit"`)) || + !bytes.Contains(noSplitAttrs, []byte(`noinline`)) { + t.Fatalf("LLVM nosplit attributes do not select the nosplit prologue policy: %s", noSplitAttrs) + } + splitAttrs := attributeLine("p.Split") + if bytes.Contains(splitAttrs, []byte(`"go-nosplit"`)) { + t.Fatalf("LLVM split attributes do not select the stack-growth prologue policy: %s", splitAttrs) + } + if bytes.Contains(ir, []byte(`"go-stack-growth-statepoint"`)) { + t.Fatal("LLVM IR still contains the obsolete stack-growth attribute") + } + + llc := llvmToolPath(t, "llc", "GOALLC_LLC") + plugin := llvmABIPassPlugin(t, llc) + object := filepath.Join(dir, "nosplit.o") + runLLVMABICommand(t, nil, llc, "-load-pass-plugin="+plugin, + "-verify-machineinstrs", "-filetype=obj", "-o", object, archive+".ll") + document := readLLVMABIObject(t, object) + noSplit := findLLVMABISymbol(t, document, "p.NoSplit") + if !slices.Contains(noSplit.FlagNames, "nosplit") { + t.Fatalf("p.NoSplit GoObj flags %v do not contain nosplit", noSplit.FlagNames) + } + if llvmABIHasRelocationTo(document, noSplit, "runtime.morestack_noctxt") { + t.Fatal("p.NoSplit unexpectedly calls runtime.morestack_noctxt") + } + noSplitArgs := llvmABIArgsPointerBitmaps(t, noSplit) + if len(noSplitArgs) == 0 || !slices.Equal(noSplitArgs[0], []int{0}) { + t.Fatalf("p.NoSplit entry ArgsPointerMaps = %v, want pointer bit 0", noSplitArgs) + } + split := findLLVMABISymbol(t, document, "p.Split") + if !llvmABIHasRelocationTo(document, split, "runtime.morestack_noctxt") { + t.Fatal("p.Split has no runtime.morestack_noctxt relocation") + } + splitArgs := llvmABIArgsPointerBitmaps(t, split) + if len(splitArgs) == 0 || !slices.Equal(splitArgs[0], []int{0}) { + t.Fatalf("p.Split entry ArgsPointerMaps = %v, want pointer bit 0", splitArgs) + } +} + func runLLVMGetGABI0FailClosedTest(t *testing.T) { t.Helper() dir := t.TempDir() diff --git a/src/cmd/llvmplugin/CMakeLists.txt b/src/cmd/llvmplugin/CMakeLists.txt index c91bb6715e6b24..214205fe1df5c5 100644 --- a/src/cmd/llvmplugin/CMakeLists.txt +++ b/src/cmd/llvmplugin/CMakeLists.txt @@ -21,9 +21,9 @@ add_definitions(${LLVM_DEFINITIONS}) include_directories(SYSTEM ${LLVM_INCLUDE_DIRS}) add_llvm_pass_plugin(GoALLCStatepoints + GoALLCStackMapPrinter.cpp GoALLCInlineAnchors.cpp GoALLCPreCodeGen.cpp - GoALLCStackMapPrinter.cpp GoALLCStatepoints.cpp GoALLCStatepointPlugin.cpp ) @@ -252,7 +252,7 @@ if(BUILD_TESTING) ) set_tests_properties(GoALLCStatepoints.FrontendMarkersPreserved PROPERTIES PASS_REGULAR_EXPRESSION - "go-stack-growth-statepoint" + "gc \"goallc\"" ) foreach(GOALLC_DEBUG_TARGET IN ITEMS X86 AArch64) @@ -505,6 +505,17 @@ if(BUILD_TESTING) DEPENDS GoALLCStatepoints.DebugInline${GOALLC_DEBUG_TARGET}GoObj ) endforeach() + goallc_add_filecheck_test( + GoALLCStatepoints.GoObjStackMaps + "${CMAKE_CURRENT_SOURCE_DIR}/testdata/statepoint.ll" + OBJVIEW-TEXT + "${GOALLC_OBJVIEW_EXECUTABLE}" -format=text + "${CMAKE_CURRENT_BINARY_DIR}/statepoint.goobj" + ) + set_tests_properties(GoALLCStatepoints.GoObjStackMaps PROPERTIES + DEPENDS GoALLCStatepoints.GoObj + ) + goallc_add_filecheck_test( GoALLCStatepoints.DeferEdgeObjView "${CMAKE_CURRENT_SOURCE_DIR}/testdata/defer-edge.ll" diff --git a/src/cmd/llvmplugin/GoALLCStackMapPrinter.cpp b/src/cmd/llvmplugin/GoALLCStackMapPrinter.cpp index d8e88ffc55df66..fd29cd6131238e 100644 --- a/src/cmd/llvmplugin/GoALLCStackMapPrinter.cpp +++ b/src/cmd/llvmplugin/GoALLCStackMapPrinter.cpp @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/BinaryFormat/GoObj.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/GCMetadataPrinter.h" -#include "llvm/CodeGen/GoCallingConv.h" #include "llvm/CodeGen/StackMaps.h" #include "llvm/MC/MCContext.h" #include "llvm/Support/ErrorHandling.h" @@ -56,8 +56,7 @@ static GCMetadataPrinterRegistry::Add "GoALLC GoObj Machine StackMaps bridge"); bool GoALLCStackMapPrinter::emitStackMaps(StackMaps &SM, AsmPrinter &AP) { - // Other object formats can continue to use LLVM's standard stackmap - // serialization while the GoObj bridge is being brought up. + // Other object formats continue to use LLVM's standard stackmap format. if (!AP.OutContext.isGoObj()) return false; @@ -71,31 +70,37 @@ bool GoALLCStackMapPrinter::emitStackMaps(StackMaps &SM, AsmPrinter &AP) { for (uint64_t I = 0; I != Info.RecordCount; ++I) { if (Callsite == Callsites.end()) report_fatal_error( - "GoALLC statepoint function record count exceeds callsites"); + "GoALLC stackmap function record count exceeds callsites"); - // LLVM's statepoint parser flattens CC, flags, deopt count, deopt - // operands, GC base/derived pairs, and GC allocas into Locations. The - // first three entries and the deopt operands are not GC roots. const StackMaps::CallsiteInfo &CSI = *Callsite++; - if (CSI.Locations.size() < 3) - report_fatal_error("malformed GoALLC statepoint location list"); - (void)getNonnegativeConstant(CSI.Locations[0], "calling convention"); - (void)getNonnegativeConstant(CSI.Locations[1], "flags"); - uint64_t NumDeopts = - getNonnegativeConstant(CSI.Locations[2], "deopt count"); - if (NumDeopts > CSI.Locations.size() - 3) - report_fatal_error("malformed GoALLC statepoint deopt operands"); - if (NumDeopts > std::numeric_limits::max()) - report_fatal_error("GoALLC statepoint has too many deopt operands"); - - MCContext::GoObjStackMapEntry Entry{CSI.CSOffsetExpr, CSI.ID, - CSI.IsIndirectCall, Info.StackSize, + const bool IsEntryArgs = CSI.ID == GoObj::EntryArgsStackMapID; + uint64_t NumDeopts = 0; + ArrayRef Locations = CSI.Locations; + if (!IsEntryArgs) { + // Statepoint records start with the calling convention, flags, deopt + // count, and then the deopt operands. EntryArgsStackMapID is a plain + // STACKMAP whose locations are only function argument pointer homes. + if (Locations.size() < 3) + report_fatal_error("malformed GoALLC statepoint location list"); + (void)getNonnegativeConstant(Locations[0], "calling convention"); + (void)getNonnegativeConstant(Locations[1], "flags"); + NumDeopts = getNonnegativeConstant(Locations[2], "deopt count"); + if (NumDeopts > Locations.size() - 3) + report_fatal_error("malformed GoALLC statepoint deopt operands"); + if (NumDeopts > std::numeric_limits::max()) + report_fatal_error("GoALLC statepoint has too many deopt operands"); + Locations = Locations.drop_front(3); + } + + MCContext::GoObjStackMapEntry Entry{CSI.CSOffsetExpr, + CSI.ID, + CSI.IsIndirectCall, + Info.StackSize, PointerSize, static_cast(NumDeopts), {}}; - Entry.Locations.reserve(CSI.Locations.size() - 3); - for (const StackMaps::Location &Location : - ArrayRef(CSI.Locations).drop_front(3)) { + Entry.Locations.reserve(Locations.size()); + for (const StackMaps::Location &Location : Locations) { auto Type = convertLocationType(Location.Type); int64_t Offset = Location.Offset; if (Location.Type == StackMaps::Location::Constant || @@ -107,8 +112,7 @@ bool GoALLCStackMapPrinter::emitStackMaps(StackMaps &SM, AsmPrinter &AP) { Type = MCContext::GoObjStackMapLocation::Constant; Offset = *Constant; } - Entry.Locations.push_back( - {Type, Location.Size, Location.Reg, Offset}); + Entry.Locations.push_back({Type, Location.Size, Location.Reg, Offset}); } AP.OutContext.addGoObjSymbolStackMapEntry(Function, std::move(Entry)); } @@ -116,7 +120,7 @@ bool GoALLCStackMapPrinter::emitStackMaps(StackMaps &SM, AsmPrinter &AP) { if (Callsite != Callsites.end()) report_fatal_error( - "GoALLC statepoint callsites exceed function record counts"); + "GoALLC stackmap callsites exceed function record counts"); SM.reset(); return true; diff --git a/src/cmd/llvmplugin/README.md b/src/cmd/llvmplugin/README.md index 1b7b0b954f0095..65b52a2e85161c 100644 --- a/src/cmd/llvmplugin/README.md +++ b/src/cmd/llvmplugin/README.md @@ -12,9 +12,11 @@ future in-process `cmd/compile` integration can call the same pipeline without going through `llc`. The SSA-to-LLVM lowering owns the function-level contract: Go ABI definitions -carry `gc "goallc"` and the `go-stack-growth-statepoint` attribute. Loading this -plugin registers the named GC strategy and its metadata printer; the rewrite -pass consumes the frontend markers rather than adding them. +carry `gc "goallc"`, and only source-level exceptions to the native Go stack +policy need target attributes such as `go-nosplit` or `go-systemstack`. Loading +this plugin registers the named GC strategy and the no-op metadata-printer +marker required by AsmPrinter; the rewrite pass consumes the frontend markers +rather than adding them. GoObj stack-map adaptation lives in LLVM core. Entry argument pointer maps do not use an IR marker or intrinsic. After LLVM optimization and inlining, target formal-argument lowering recursively derives @@ -156,7 +158,7 @@ constants in Machine StackMaps. For `gc "goallc"`, a static alloca used only as a deopt layout carrier is not implicitly promoted to a GC root; explicit `gc-live` is the activity signal. The resulting `gc.relocate(alloca)` is `NoRelocate` and rematerializes the same frame index, so no root spill is -created. The Go-owned StackMaps bridge retains the deopt prefix and resolves +created. LLVM's GoObj StackMaps bridge retains the deopt prefix and resolves both inline constants and `ConstantIndex` values. The GoObj writer strictly parses the suffix and maps every layout with a matching direct `gc-live` alloca plus bitmap bit to that callsite's `LocalsPointerMaps`. An unmatched layout is @@ -231,28 +233,28 @@ non-trivial implementation block is copied verbatim, it must live in a separately attributed source file retaining LLVM's Apache-2.0-with-exception notice; BSD-only Go source files should not silently absorb copied code. -`GoALLCStackMapPrinter.cpp` is the Go-owned boundary between LLVM Machine -StackMaps and GoObj. It uses the standard -`AsmPrinter -> GCMetadataPrinter::emitStackMaps` hook, retains deopt and GC -locations in `MCContext`, and resolves StackMaps constant-pool indexes without -adding a parallel serializer. LLVM's generic `StackMaps.cpp` only exposes the -constant resolver; it has no GoALLC grammar or GoObj policy. LLVM records GoObj -statepoint callsites at the CALL +The Go-owned metadata printer is the boundary between Machine StackMaps and +GoObj. It retains deopt and GC locations in LLVM's `MCContext` and resolves +StackMaps constant-pool indexes without adding a parallel serializer; LLVM's +GoObj writer remains responsible for final object-format serialization. LLVM +records GoObj statepoint callsites at the CALL start, matching Go's `PCDATA_StackMapIndex` convention without a command-line -mode. The frontend's stack-growth attribute -asks LLVM to express the late-generated `runtime.morestack` call as a physical -MIR `STATEPOINT` with empty deopt and GC-alloca sections. Before frame -allocation, AArch64 formal lowering maps every type-derived input pointer word -onto the existing fixed home reserved for that ABI input. Frame lowering encodes -those homes in the morestack statepoint's GC pointer section as indirect -`SP+offset` locations with base-equals-derived pairs; it never asks the -statepoint machinery to allocate another spill. The GoObj writer recognizes -the stack-growth ID, interprets those offsets in the entry-SP geometry, and -selects pair 0: non-empty `EntryArgs` when present and empty locals. Ordinary -and stack-growth calls use the same Machine StackMaps pipeline without relying -on a return-PC convention. GoObj functions that already contain a Machine -`STATEPOINT` but lack the frontend stack-growth attribute fail closed; there is -no slow-path reset-label fallback for a raw morestack call. +mode. GoObj Go functions use native Go's split-stack policy by default: unless +`go-nosplit` is present, target frame lowering expresses the late-generated +`runtime.morestack` call as an ordinary ABI0 MIR call. Before frame allocation, +formal lowering maps each live type-derived input pointer word onto the existing +fixed home reserved for that ABI input. It still reserves and saves complete ABI +homes for an unused formal so a morestack retry preserves the register +assignment, but does not scan a word that LLVM callers may replace with poison. +Frame lowering records the live homes in a separate zero-byte +`EntryArgsStackMapID` record for every GoObj Go function. This is function +metadata rather than a callsite. The GoObj writer uses it as pair 0: non-empty +`EntryArgs` when present and empty locals, and initializes +`PCDATA_StackMapIndex` to 0. AsmPrinter's PCSP stream has already resolved the +Machine CFG; every transition back to the entry stack depth selects map 0. This +covers the pre-frame morestack path without identifying `runtime.morestack` by +name or manufacturing a statepoint. An ordinary statepoint selects its actual +live map and overrides a same-PC entry-depth transition. GoObj emits the currently constant safe `PCDATA_UnsafePoint` table first and the statepoint-derived `PCDATA_StackMapIndex` table second, as required by their Go ABI indexes 0 and 1. diff --git a/src/cmd/llvmplugin/testdata/aarch64-frame.ll b/src/cmd/llvmplugin/testdata/aarch64-frame.ll index a2e202b7ea6fc2..148506f6ca6135 100644 --- a/src/cmd/llvmplugin/testdata/aarch64-frame.ll +++ b/src/cmd/llvmplugin/testdata/aarch64-frame.ll @@ -136,4 +136,4 @@ entry: ret i64 %regarg } -attributes #0 = { "frame-pointer"="non-leaf" "go-stack-growth-statepoint" } +attributes #0 = { "frame-pointer"="non-leaf" } diff --git a/src/cmd/llvmplugin/testdata/aggregate-call-result-goobj.ll b/src/cmd/llvmplugin/testdata/aggregate-call-result-goobj.ll index bf3ce623032a98..8814b4d72a1aab 100644 --- a/src/cmd/llvmplugin/testdata/aggregate-call-result-goobj.ll +++ b/src/cmd/llvmplugin/testdata/aggregate-call-result-goobj.ll @@ -69,7 +69,7 @@ declare goabiinternal void @leaf_consume_pair(%pair) #0 define goabiinternal ptr @aggregate_call_result_goobj( ptr %seed, i1 %take_call) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %value = call goabiinternal %pair @make_pair(ptr %seed, i64 17) br i1 %take_call, label %call, label %skip diff --git a/src/cmd/llvmplugin/testdata/aggregate-cfg.ll b/src/cmd/llvmplugin/testdata/aggregate-cfg.ll index 30b98fd1942fd4..4e2b94bb6e59da 100644 --- a/src/cmd/llvmplugin/testdata/aggregate-cfg.ll +++ b/src/cmd/llvmplugin/testdata/aggregate-cfg.ll @@ -62,7 +62,7 @@ declare goabiinternal void @leaf_consume_pair(%pair) #0 define goabiinternal ptr @aggregate_diamond_call_skip( i1 %take_call, %pair %value) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br i1 %take_call, label %call, label %skip @@ -81,7 +81,7 @@ merge: define goabiinternal ptr @aggregate_branch_safepoints( i1 %take_left, %pair %value) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br i1 %take_left, label %left, label %right @@ -101,7 +101,7 @@ merge: define goabiinternal ptr @aggregate_sequential_conditional( i1 %take_first, i1 %take_second, %pair %value) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br i1 %take_first, label %first_call, label %first_skip @@ -130,7 +130,7 @@ second_merge: define goabiinternal ptr @aggregate_natural_loop( i32 %count, %pair %value) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br label %header @@ -149,7 +149,7 @@ exit: define goabiinternal ptr @aggregate_irreducible( i1 %enter_b, i1 %leave_a, i1 %leave_b, %pair %value) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br i1 %enter_b, label %b, label %a @@ -168,7 +168,7 @@ exit: define goabiinternal ptr @aggregate_phi_edge_use( i1 %take_call, %pair %value) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br i1 %take_call, label %call, label %skip @@ -189,7 +189,7 @@ merge: define goabiinternal ptr @aggregate_phi_duplicate_edge( i32 %which, %pair %value) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: call goabiinternal void @safepoint() switch i32 %which, label %merge [ @@ -206,7 +206,7 @@ merge: define goabiinternal ptr @aggregate_call_result_conditional( ptr %seed, i1 %take_call) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %value = call goabiinternal %pair @make_pair(ptr %seed, i64 7) br i1 %take_call, label %call, label %skip @@ -226,7 +226,7 @@ merge: define goabiinternal ptr @aggregate_call_result_loop( ptr %seed, i32 %count) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %value = call goabiinternal %pair @make_pair(ptr %seed, i64 11) br label %header @@ -246,7 +246,7 @@ exit: define goabiinternal ptr @aggregate_call_result_irreducible( ptr %seed, i1 %enter_b, i1 %leave_a, i1 %leave_b) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %value = call goabiinternal %pair @make_pair(ptr %seed, i64 13) br i1 %enter_b, label %b, label %a @@ -265,7 +265,7 @@ exit: } define goabiinternal ptr @aggregate_multiple_safepoints(%pair %value) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: call goabiinternal void @safepoint() call goabiinternal void @safepoint() diff --git a/src/cmd/llvmplugin/testdata/aggregate-conditional-stage-b.ll b/src/cmd/llvmplugin/testdata/aggregate-conditional-stage-b.ll index 6c059d34e3f95a..ce42b9425bfcf4 100644 --- a/src/cmd/llvmplugin/testdata/aggregate-conditional-stage-b.ll +++ b/src/cmd/llvmplugin/testdata/aggregate-conditional-stage-b.ll @@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal ptr @aggregate_conditional_relocation(i1 %take_call, %pair %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @aggregate_conditional_relocation(i1 %take_call, %pair %value) gc "goallc" { entry: br i1 %take_call, label %call, label %skip diff --git a/src/cmd/llvmplugin/testdata/aggregate-fixed-vector.ll b/src/cmd/llvmplugin/testdata/aggregate-fixed-vector.ll index 56a9222dfc6542..4ea420f13110cb 100644 --- a/src/cmd/llvmplugin/testdata/aggregate-fixed-vector.ll +++ b/src/cmd/llvmplugin/testdata/aggregate-fixed-vector.ll @@ -2,7 +2,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal ptr @fixed_vector(ptr %source) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @fixed_vector(ptr %source) gc "goallc" { entry: %value = load <2 x ptr>, ptr %source, align 8 call goabiinternal void @safepoint() diff --git a/src/cmd/llvmplugin/testdata/aggregate-loop-stage-b.ll b/src/cmd/llvmplugin/testdata/aggregate-loop-stage-b.ll index 53216f66bd2d13..2cbd66a25159b7 100644 --- a/src/cmd/llvmplugin/testdata/aggregate-loop-stage-b.ll +++ b/src/cmd/llvmplugin/testdata/aggregate-loop-stage-b.ll @@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal ptr @aggregate_loop_relocation(i1 %take_call, i1 %again, %pair %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @aggregate_loop_relocation(i1 %take_call, i1 %again, %pair %value) gc "goallc" { entry: br label %header diff --git a/src/cmd/llvmplugin/testdata/aggregate-scalable-vector-unsupported.ll b/src/cmd/llvmplugin/testdata/aggregate-scalable-vector-unsupported.ll index 44f7936209cbb1..2d36d129a1d385 100644 --- a/src/cmd/llvmplugin/testdata/aggregate-scalable-vector-unsupported.ll +++ b/src/cmd/llvmplugin/testdata/aggregate-scalable-vector-unsupported.ll @@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal ptr @scalable_vector(ptr %source) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @scalable_vector(ptr %source) gc "goallc" { entry: %value = load , ptr %source, align 8 call goabiinternal void @safepoint() diff --git a/src/cmd/llvmplugin/testdata/aggregate-scalarization.ll b/src/cmd/llvmplugin/testdata/aggregate-scalarization.ll index 48df3f3718e39a..01da4f405e8374 100644 --- a/src/cmd/llvmplugin/testdata/aggregate-scalarization.ll +++ b/src/cmd/llvmplugin/testdata/aggregate-scalarization.ll @@ -59,14 +59,14 @@ declare goabiinternal void @leaf_consume_pair(%pair) #0 declare goabiinternal void @leaf_consume_nested(%nested) #0 declare goabiinternal void @leaf_consume_vector_pair(%vector_pair) #0 -define goabiinternal ptr @pair_across_call(%pair %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @pair_across_call(%pair %value) gc "goallc" { entry: call goabiinternal void @safepoint() %pointer = extractvalue %pair %value, 0 ret ptr %pointer } -define goabiinternal ptr @triple_across_call(%triple %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @triple_across_call(%triple %value) gc "goallc" { entry: call goabiinternal void @safepoint() %first = extractvalue %triple %value, 1 @@ -76,14 +76,14 @@ entry: ret ptr %result } -define goabiinternal void @nested_across_call(%nested %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @nested_across_call(%nested %value) gc "goallc" { entry: call goabiinternal void @safepoint() call goabiinternal void @leaf_consume_nested(%nested %value) ret void } -define goabiinternal ptr @fixed_vector_across_call(ptr %source) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @fixed_vector_across_call(ptr %source) gc "goallc" { entry: %value = load <2 x ptr>, ptr %source, align 8 call goabiinternal void @safepoint() @@ -91,7 +91,7 @@ entry: ret ptr %result } -define goabiinternal ptr @nested_fixed_vector_across_call(ptr %source, i64 %number) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @nested_fixed_vector_across_call(ptr %source, i64 %number) gc "goallc" { entry: %vector.value = load <2 x ptr>, ptr %source, align 8 %with_vector = insertvalue %vector_pair poison, <2 x ptr> %vector.value, 0 @@ -103,7 +103,7 @@ entry: ret ptr %result } -define goabiinternal ptr @insertvalue_across_call(ptr %pointer, i64 %number) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @insertvalue_across_call(ptr %pointer, i64 %number) gc "goallc" { entry: %with_pointer = insertvalue %pair zeroinitializer, ptr %pointer, 0 %value = insertvalue %pair %with_pointer, i64 %number, 1 @@ -117,7 +117,7 @@ entry: ; pointer roots for poison leaves. Those leaves can be overwritten after the ; safepoint without ever being observed, as happens while reflect.Value is ; assembled for a later call. -define goabiinternal ptr @partial_insertvalue_across_call(ptr %pointer, i64 %number) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @partial_insertvalue_across_call(ptr %pointer, i64 %number) gc "goallc" { entry: %partial = insertvalue %reflect_value poison, ptr %pointer, 0 call goabiinternal void @safepoint() @@ -127,7 +127,7 @@ entry: ret ptr %leaf } -define goabiinternal ptr @phi_across_call(i1 %choose, %pair %left_value, %pair %right_value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @phi_across_call(i1 %choose, %pair %left_value, %pair %right_value) gc "goallc" { entry: br i1 %choose, label %left, label %right @@ -144,7 +144,7 @@ merge: ret ptr %result } -define goabiinternal ptr @select_across_call(i1 %choose, %pair %left_value, %pair %right_value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @select_across_call(i1 %choose, %pair %left_value, %pair %right_value) gc "goallc" { entry: %value = select i1 %choose, %pair %left_value, %pair %right_value call goabiinternal void @safepoint() @@ -152,7 +152,7 @@ entry: ret ptr %result } -define goabiinternal ptr @phi_edge_use(%pair %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @phi_edge_use(%pair %value) gc "goallc" { entry: call goabiinternal void @safepoint() br label %merge @@ -163,7 +163,7 @@ merge: ret ptr %result } -define goabiinternal ptr @multiple_calls(%pair %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @multiple_calls(%pair %value) gc "goallc" { entry: call goabiinternal void @safepoint() call goabiinternal void @safepoint() @@ -171,7 +171,7 @@ entry: ret ptr %result } -define goabiinternal ptr @aggregate_call_result(ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @aggregate_call_result(ptr %pointer) gc "goallc" { entry: %value = call goabiinternal %pair @make_pair(ptr %pointer, i64 7) call goabiinternal void @safepoint() @@ -179,13 +179,13 @@ entry: ret ptr %result } -define goabiinternal void @aggregate_current_call_argument(%pair %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @aggregate_current_call_argument(%pair %value) gc "goallc" { entry: call goabiinternal void @consume_pair(%pair %value) ret void } -define goabiinternal void @aggregate_load_store(ptr %source, ptr %destination) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @aggregate_load_store(ptr %source, ptr %destination) gc "goallc" { entry: %value = load %pair, ptr %source, align 8 call goabiinternal void @safepoint() @@ -193,7 +193,7 @@ entry: ret void } -define goabiinternal ptr @alloca_derived_leaf(i64 %number) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @alloca_derived_leaf(i64 %number) gc "goallc" { entry: %slot = alloca i64, align 8 store i64 %number, ptr %slot, align 8 @@ -203,7 +203,7 @@ entry: ret ptr %result } -define goabiinternal void @frozen_aggregate() "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @frozen_aggregate() gc "goallc" { entry: %value = freeze %pair poison call goabiinternal void @safepoint() diff --git a/src/cmd/llvmplugin/testdata/alloca-derived.ll b/src/cmd/llvmplugin/testdata/alloca-derived.ll index 24073270dc22a6..d6bcd985d96d9d 100644 --- a/src/cmd/llvmplugin/testdata/alloca-derived.ll +++ b/src/cmd/llvmplugin/testdata/alloca-derived.ll @@ -2,7 +2,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() -define goabiinternal i64 @selected_stack_address_live_across_call(i1 %choose_a) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal i64 @selected_stack_address_live_across_call(i1 %choose_a) gc "goallc" { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-dynamic-unsupported.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-dynamic-unsupported.ll index b59d10421aa11e..c8df1c47743dc0 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-dynamic-unsupported.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-dynamic-unsupported.ll @@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal void @dynamic_pointer_alloca(i64 %count) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @dynamic_pointer_alloca(i64 %count) gc "goallc" { entry: %slot = alloca ptr, i64 %count, align 8 call goabiinternal void @safepoint() diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-lifetime-ambiguous.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-lifetime-ambiguous.ll index 4eeaed12b2b48f..030c6d5e399730 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-lifetime-ambiguous.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-lifetime-ambiguous.ll @@ -4,7 +4,7 @@ declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) declare void @llvm.fake.use(...) declare goabiinternal void @safepoint() -define goabiinternal void @path_local_pointer_alloca_lifetime(i1 %start) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @path_local_pointer_alloca_lifetime(i1 %start) gc "goallc" { entry: %slot = alloca ptr, align 8 br i1 %start, label %live, label %join diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-lifetime-unsupported.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-lifetime-unsupported.ll index 511f8e20fbf6b0..7e9691262844b2 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-lifetime-unsupported.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-lifetime-unsupported.ll @@ -89,7 +89,7 @@ declare goabiinternal void @safepoint() declare goabiinternal void @observe(ptr) declare goabiinternal void @observe_slice({ ptr, i64, i64 }) -define goabiinternal void @locals_pointer_alloca_with_lifetime() "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @locals_pointer_alloca_with_lifetime() gc "goallc" { entry: %slot = alloca ptr, align 8 call goabiinternal void @safepoint() @@ -101,7 +101,7 @@ entry: ret void } -define goabiinternal void @stack_object_alloca_with_lifetime() "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @stack_object_alloca_with_lifetime() gc "goallc" { entry: %slot = alloca ptr, align 8 call goabiinternal void @safepoint() @@ -112,7 +112,7 @@ entry: ret void } -define goabiinternal void @loop_reinitialized_pointer_alloca(i1 %again) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @loop_reinitialized_pointer_alloca(i1 %again) gc "goallc" { entry: %slot = alloca ptr, align 8 br label %loop @@ -129,7 +129,7 @@ exit: ret void } -define goabiinternal void @preinitialized_pointer_alloca() "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @preinitialized_pointer_alloca() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 call void @llvm.lifetime.start.p0(i64 16, ptr %slot) @@ -140,7 +140,7 @@ entry: } define goabiinternal void @store_initialized_pointer_alloca( - ptr %first, ptr %second) "go-stack-growth-statepoint" gc "goallc" { + ptr %first, ptr %second) gc "goallc" { entry: %slot = alloca %pointer_gap, align 8 call void @llvm.lifetime.start.p0(i64 24, ptr %slot) @@ -154,7 +154,7 @@ entry: } define goabiinternal void @partially_stored_pointer_alloca( - ptr %first, ptr %second) "go-stack-growth-statepoint" gc "goallc" { + ptr %first, ptr %second) gc "goallc" { entry: %slot = alloca %pointer_gap, align 8 call void @llvm.lifetime.start.p0(i64 24, ptr %slot) @@ -168,7 +168,7 @@ entry: } define goabiinternal void @phi_edge_pointer_alloca( - i1 %use_stack, ptr %other) "go-stack-growth-statepoint" gc "goallc" { + i1 %use_stack, ptr %other) gc "goallc" { entry: %slot = alloca ptr, align 8 br i1 %use_stack, label %initialize, label %external @@ -188,7 +188,7 @@ merge: ret void } -define goabiinternal void @hoisted_aggregate_pointer_alloca() "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @hoisted_aggregate_pointer_alloca() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 %slice = insertvalue { ptr, i64, i64 } poison, ptr %slot, 0 diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-nonentry-unsupported.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-nonentry-unsupported.ll index d9e8e78af24960..470f8bbe569779 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-nonentry-unsupported.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-nonentry-unsupported.ll @@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() define goabiinternal void @nonentry_pointer_alloca( - i1 %allocate) "go-stack-growth-statepoint" gc "goallc" { + i1 %allocate) gc "goallc" { entry: call goabiinternal void @safepoint() br i1 %allocate, label %allocate.block, label %exit diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-realigned-unsupported.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-realigned-unsupported.ll index 38b61897e42496..d1ada39373384e 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-realigned-unsupported.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-realigned-unsupported.ll @@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal void @realigned_pointer_alloca() "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @realigned_pointer_alloca() gc "goallc" { entry: %slot = alloca ptr, align 32 call goabiinternal void @safepoint() diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-roots.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-roots.ll index 4ee65b76db5794..e89c46dbebca71 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-roots.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-roots.ll @@ -132,7 +132,7 @@ declare goabiinternal i64 @readonly_pointer_slot(ptr readonly) memory(read) declare goabiinternal i64 @readnone_callee() memory(none) declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) -define goabiinternal ptr @pointer_slot(ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @pointer_slot(ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr %pointer, ptr %slot, align 8 @@ -143,7 +143,7 @@ entry: } define goabiinternal ptr @nested_whole_aggregate( - ptr %first, ptr %second, ptr %third) "go-stack-growth-statepoint" gc "goallc" { + ptr %first, ptr %second, ptr %third) gc "goallc" { entry: ; The optimized use graph contains only direct memory operations, so this ; must use fixed homes and remain eligible for SROA. @@ -159,7 +159,7 @@ entry: } define goabiinternal ptr @alloca_call_skip( - i1 %take_call, ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + i1 %take_call, ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr %pointer, ptr %slot, align 8 @@ -175,7 +175,7 @@ merge: } define goabiinternal ptr @alloca_multiple_calls( - ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr %pointer, ptr %slot, align 8 @@ -186,7 +186,7 @@ entry: } define goabiinternal ptr @alloca_partial_initialization() - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: ; Each field is initialized from a different safepointing call. The plugin ; must zero the whole object before the first call so the complete bitmap is @@ -204,7 +204,7 @@ entry: } define goabiinternal ptr @alloca_loop( - i1 %again, ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + i1 %again, ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr %pointer, ptr %slot, align 8 @@ -220,7 +220,7 @@ exit: } define goabiinternal ptr @alloca_gep_address_across_call( - ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + ptr %pointer) gc "goallc" { entry: %slot = alloca %pointer_field, align 8 %field = getelementptr inbounds %pointer_field, ptr %slot, i32 0, i32 1 @@ -231,7 +231,7 @@ entry: } define goabiinternal void @alloca_direct_address_across_calls() - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr null, ptr %slot, align 8 @@ -242,7 +242,7 @@ entry: } define goabiinternal void @argument_home_address_across_calls(ptr %pointer) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: ; This canonical parameter alloca becomes the argument's fixed ABI home. ; Its last callsite has no direct gc-live base, so the function also needs @@ -257,7 +257,7 @@ entry: } define goabiinternal void @argument_aggregate_home_address_across_calls( - %nested %value) "go-stack-growth-statepoint" gc "goallc" { + %nested %value) gc "goallc" { entry: ; The split aggregate parameter still has one complete fixed home and one ; argp-relative StackObject covering all ABI pieces and padding. @@ -271,7 +271,7 @@ entry: } define goabiinternal void @alloca_gep_value_across_calls() - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %slot = alloca %pointer_field, align 8 %field = getelementptr inbounds %pointer_field, ptr %slot, i32 0, i32 1 @@ -283,7 +283,7 @@ entry: } define goabiinternal void @alloca_pointer_free_address_across_calls() - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %slot = alloca i64, align 8 store i64 0, ptr %slot, align 8 @@ -294,7 +294,7 @@ entry: } define goabiinternal ptr @alloca_address_passed_to_callee( - ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + ptr %pointer) gc "goallc" { entry: ; The structural call use makes the address observable. %slot = alloca ptr, align 8 @@ -305,7 +305,7 @@ entry: } define goabiinternal void @alloca_marker_free_at_safepoint( - ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr null, ptr %slot, align 8 @@ -315,7 +315,7 @@ entry: } define goabiinternal ptr @alloca_high_bitmap_word( - ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + ptr %pointer) gc "goallc" { entry: %slot = alloca %high_bitmap, align 8 %field = getelementptr inbounds %high_bitmap, ptr %slot, i32 0, i32 1 @@ -326,7 +326,7 @@ entry: } define goabiinternal ptr @alloca_multiple_records( - ptr %first, ptr %second) "go-stack-growth-statepoint" gc "goallc" { + ptr %first, ptr %second) gc "goallc" { entry: %left = alloca ptr, align 8 %right = alloca ptr, align 8 @@ -338,7 +338,7 @@ entry: } define goabiinternal ptr @alloca_select_same_base( - i1 %choose, ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + i1 %choose, ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 %same = getelementptr inbounds i8, ptr %slot, i64 0 @@ -350,7 +350,7 @@ entry: } define goabiinternal ptr @alloca_nocapture_writable( - ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr %pointer, ptr %slot, align 8 @@ -360,7 +360,7 @@ entry: } define goabiinternal ptr @alloca_escaped_before_unknown_write( - ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr %pointer, ptr %slot, align 8 @@ -371,7 +371,7 @@ entry: } define goabiinternal i64 @alloca_readonly_and_readnone( - ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { + ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store ptr %pointer, ptr %slot, align 8 diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-select-unsupported.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-select-unsupported.ll index c66e005c806494..cdff2808f1629d 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-select-unsupported.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-select-unsupported.ll @@ -3,7 +3,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() define goabiinternal void @select_different_pointer_allocas( - i1 %choose) "go-stack-growth-statepoint" gc "goallc" { + i1 %choose) gc "goallc" { entry: %left = alloca ptr, align 8 %right = alloca ptr, align 8 diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-vector-unsupported.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-vector-unsupported.ll index ccc415570ef502..efcae4508f524c 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-vector-unsupported.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-vector-unsupported.ll @@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal void @pointer_vector_alloca() "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @pointer_vector_alloca() gc "goallc" { entry: %slot = alloca <2 x ptr>, align 8 call goabiinternal void @safepoint() diff --git a/src/cmd/llvmplugin/testdata/alloca-pointer-volatile-unsupported.ll b/src/cmd/llvmplugin/testdata/alloca-pointer-volatile-unsupported.ll index 65bb822e37b1de..a271948d165312 100644 --- a/src/cmd/llvmplugin/testdata/alloca-pointer-volatile-unsupported.ll +++ b/src/cmd/llvmplugin/testdata/alloca-pointer-volatile-unsupported.ll @@ -2,7 +2,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal void @volatile_pointer_alloca(ptr %pointer) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @volatile_pointer_alloca(ptr %pointer) gc "goallc" { entry: %slot = alloca ptr, align 8 store volatile ptr %pointer, ptr %slot, align 8 diff --git a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-bad-kind.ll b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-bad-kind.ll index 103ec3196b83fb..cf85824fb9d4e4 100644 --- a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-bad-kind.ll +++ b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-bad-kind.ll @@ -3,11 +3,10 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...) -define goabiinternal void @test() #0 gc "goallc" { +define goabiinternal void @test() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 store [2 x ptr] zeroinitializer, ptr %slot, align 8 %statepoint = call goabiinternal token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 1, i32 0, ptr elementtype(void ()) @callee, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i64 1195461697, i64 15, i64 1, i64 1347703373, i64 11, ptr %slot, i64 0, i64 16, i64 8, i64 8, i64 2, i64 64, i64 1, i64 3, i64 1095519299, i64 15), "gc-live"(ptr %slot) ] ret void } -attributes #0 = { "go-stack-growth-statepoint" } diff --git a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-bad-length.ll b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-bad-length.ll index b040f5b94c29d7..68487e456e8a54 100644 --- a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-bad-length.ll +++ b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-bad-length.ll @@ -3,11 +3,10 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...) -define goabiinternal void @test() #0 gc "goallc" { +define goabiinternal void @test() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 store [2 x ptr] zeroinitializer, ptr %slot, align 8 %statepoint = call goabiinternal token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 1, i32 0, ptr elementtype(void ()) @callee, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i64 1195461697, i64 14, i64 1, i64 1095520067, i64 11, ptr %slot, i64 0, i64 16, i64 8, i64 8, i64 2, i64 64, i64 1, i64 3, i64 1095519299, i64 15), "gc-live"(ptr %slot) ] ret void } -attributes #0 = { "go-stack-growth-statepoint" } diff --git a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-duplicate.ll b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-duplicate.ll index a62444f1b208b2..9935a0788dbf7b 100644 --- a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-duplicate.ll +++ b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-duplicate.ll @@ -3,11 +3,10 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...) -define goabiinternal void @test() #0 gc "goallc" { +define goabiinternal void @test() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 store [2 x ptr] zeroinitializer, ptr %slot, align 8 %statepoint = call goabiinternal token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 1, i32 0, ptr elementtype(void ()) @callee, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i64 1195461697, i64 26, i64 2, i64 1095520067, i64 11, ptr %slot, i64 0, i64 16, i64 8, i64 8, i64 2, i64 64, i64 1, i64 3, i64 1095520067, i64 11, ptr %slot, i64 0, i64 16, i64 8, i64 8, i64 2, i64 64, i64 1, i64 3, i64 1095519299, i64 26), "gc-live"(ptr %slot) ] ret void } -attributes #0 = { "go-stack-growth-statepoint" } diff --git a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-non-direct.ll b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-non-direct.ll index 40f13094dc8bfb..9721ff56160d79 100644 --- a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-non-direct.ll +++ b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-non-direct.ll @@ -3,11 +3,10 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...) -define goabiinternal void @test() #0 gc "goallc" { +define goabiinternal void @test() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 store [2 x ptr] zeroinitializer, ptr %slot, align 8 %statepoint = call goabiinternal token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 1, i32 0, ptr elementtype(void ()) @callee, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i64 1195461697, i64 15, i64 1, i64 1095520067, i64 11, i64 0, i64 0, i64 8, i64 8, i64 8, i64 1, i64 64, i64 1, i64 1, i64 1095519299, i64 15), "gc-live"(ptr %slot) ] ret void } -attributes #0 = { "go-stack-growth-statepoint" } diff --git a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-overlap.ll b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-overlap.ll index 2ee72172006279..544d75dfddd824 100644 --- a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-overlap.ll +++ b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-overlap.ll @@ -3,11 +3,10 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...) -define goabiinternal void @test() #0 gc "goallc" { +define goabiinternal void @test() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 store [2 x ptr] zeroinitializer, ptr %slot, align 8 %statepoint = call goabiinternal token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 1, i32 0, ptr elementtype(void ()) @callee, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i64 1195461697, i64 26, i64 2, i64 1095520067, i64 11, ptr %slot, i64 0, i64 8, i64 8, i64 8, i64 1, i64 64, i64 1, i64 1, i64 1095520067, i64 11, ptr %slot, i64 0, i64 16, i64 8, i64 8, i64 2, i64 64, i64 1, i64 3, i64 1095519299, i64 26), "gc-live"(ptr %slot) ] ret void } -attributes #0 = { "go-stack-growth-statepoint" } diff --git a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-padding.ll b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-padding.ll index 33c98ae023adc5..7a49b46a587adf 100644 --- a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-padding.ll +++ b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-padding.ll @@ -3,11 +3,10 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...) -define goabiinternal void @test() #0 gc "goallc" { +define goabiinternal void @test() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 store [2 x ptr] zeroinitializer, ptr %slot, align 8 %statepoint = call goabiinternal token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 1, i32 0, ptr elementtype(void ()) @callee, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i64 1195461697, i64 15, i64 1, i64 1095520067, i64 11, ptr %slot, i64 0, i64 8, i64 8, i64 8, i64 1, i64 64, i64 1, i64 3, i64 1095519299, i64 15), "gc-live"(ptr %slot) ] ret void } -attributes #0 = { "go-stack-growth-statepoint" } diff --git a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-truncated.ll b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-truncated.ll index c8adc37247705f..1a4cbde8e27059 100644 --- a/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-truncated.ll +++ b/src/cmd/llvmplugin/testdata/alloca-ptrmap-malformed-truncated.ll @@ -3,11 +3,10 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...) -define goabiinternal void @test() #0 gc "goallc" { +define goabiinternal void @test() gc "goallc" { entry: %slot = alloca [2 x ptr], align 8 store [2 x ptr] zeroinitializer, ptr %slot, align 8 %statepoint = call goabiinternal token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 1, i32 0, ptr elementtype(void ()) @callee, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i64 1195461697, i64 15, i64 1, i64 1095520067), "gc-live"(ptr %slot) ] ret void } -attributes #0 = { "go-stack-growth-statepoint" } diff --git a/src/cmd/llvmplugin/testdata/alloca-zero-pointer-array.ll b/src/cmd/llvmplugin/testdata/alloca-zero-pointer-array.ll index bf0ae1fbeb7131..42720029f9fc9b 100644 --- a/src/cmd/llvmplugin/testdata/alloca-zero-pointer-array.ll +++ b/src/cmd/llvmplugin/testdata/alloca-zero-pointer-array.ll @@ -3,7 +3,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() define goabiinternal void @zero_length_pointer_array() - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %slot = alloca [0 x ptr], align 8 call goabiinternal void @safepoint() diff --git a/src/cmd/llvmplugin/testdata/branch-safepoints-relocation.ll b/src/cmd/llvmplugin/testdata/branch-safepoints-relocation.ll index 862f84459f5ed2..05419ab311f681 100644 --- a/src/cmd/llvmplugin/testdata/branch-safepoints-relocation.ll +++ b/src/cmd/llvmplugin/testdata/branch-safepoints-relocation.ll @@ -3,7 +3,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @left_callee() declare goabiinternal void @right_callee() -define goabiinternal i64 @branch_safepoints(ptr %p, i1 %take_left) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal i64 @branch_safepoints(ptr %p, i1 %take_left) gc "goallc" { entry: br i1 %take_left, label %left, label %right diff --git a/src/cmd/llvmplugin/testdata/conditional-relocation.ll b/src/cmd/llvmplugin/testdata/conditional-relocation.ll index 0bb179b01533f1..3afac0e8c5a6e4 100644 --- a/src/cmd/llvmplugin/testdata/conditional-relocation.ll +++ b/src/cmd/llvmplugin/testdata/conditional-relocation.ll @@ -29,7 +29,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() -define goabiinternal i64 @conditional_safepoint(ptr %p, i1 %take_call) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal i64 @conditional_safepoint(ptr %p, i1 %take_call) gc "goallc" { entry: br i1 %take_call, label %call, label %skip @@ -49,7 +49,7 @@ merge: define goabiinternal i64 @conditional_phi_edge_use( ptr %p, ptr %q, i1 %take_call) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br i1 %take_call, label %call, label %skip diff --git a/src/cmd/llvmplugin/testdata/defer-edge.ll b/src/cmd/llvmplugin/testdata/defer-edge.ll index 43a620ce678feb..1ce15e46817819 100644 --- a/src/cmd/llvmplugin/testdata/defer-edge.ll +++ b/src/cmd/llvmplugin/testdata/defer-edge.ll @@ -26,7 +26,7 @@ declare goabiinternal void @runtime.panicmem() declare void @llvm.go.defer.edge() declare void @llvm.lifetime.start.p0(ptr captures(none)) -define goabiinternal void @defer_edge() #0 gc "goallc" { +define goabiinternal void @defer_edge() gc "goallc" { entry: call goabiinternal void @runtime.deferproc() callbr void @llvm.go.defer.edge() to label %normal [label %recover] @@ -39,7 +39,7 @@ recover: ret void } -define goabiinternal ptr @defer_result(ptr %pointer) #0 gc "goallc" { +define goabiinternal ptr @defer_result(ptr %pointer) gc "goallc" { entry: %result = alloca ptr, align 8, !goallc.defer_result !1 call void @llvm.lifetime.start.p0(ptr %result) @@ -63,7 +63,5 @@ entry: ret void } -attributes #0 = { "go-stack-growth-statepoint" } - !0 = !{i8 23, i8 0} !1 = !{} diff --git a/src/cmd/llvmplugin/testdata/derived-pointer-rematerialization.ll b/src/cmd/llvmplugin/testdata/derived-pointer-rematerialization.ll index 31ce288dcef9f2..0ce9c23b6663d0 100644 --- a/src/cmd/llvmplugin/testdata/derived-pointer-rematerialization.ll +++ b/src/cmd/llvmplugin/testdata/derived-pointer-rematerialization.ll @@ -29,7 +29,7 @@ declare goabiinternal void @callee() ; above the source nil guard. The non-heap value null+96 must not become a Go ; GC root at the intervening safepoint. define goabiinternal i1 @hoisted_null_offset(ptr %base) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %derived = getelementptr i8, ptr %base, i64 96 call goabiinternal void @callee() @@ -42,7 +42,7 @@ entry: ; Rebuild the full address-expression chain from the relocated base, not from ; an independently relocated interior pointer. define goabiinternal i8 @derived_chain(ptr %base) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %field = getelementptr i8, ptr %base, i64 16 %element = getelementptr i8, ptr %field, i64 8 @@ -55,7 +55,7 @@ entry: ; a safepoint: the merge must select the rebuilt address on that path and the ; original address on the other path. define goabiinternal i8 @conditional_derived(ptr %base, i1 %take_call) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %derived = getelementptr i8, ptr %base, i64 32 br i1 %take_call, label %call, label %skip @@ -76,7 +76,7 @@ merge: ; derived pointer. Relocate the vector base as one value, then rebuild the ; vector GEP instead of exposing its interior-pointer lanes as Go GC roots. define goabiinternal <2 x ptr> @derived_vector(<2 x ptr> %base) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %derived = getelementptr i8, <2 x ptr> %base, <2 x i64> @@ -88,7 +88,7 @@ entry: ; base. Keep that scalar base live and rebuild the vector result after it is ; relocated. define goabiinternal <2 x ptr> @derived_vector_from_scalar(ptr %base) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %derived = getelementptr i8, ptr %base, <2 x i64> diff --git a/src/cmd/llvmplugin/testdata/function-marker-inline.ll b/src/cmd/llvmplugin/testdata/function-marker-inline.ll index 2b2ab0831dbee4..be07f764e500f7 100644 --- a/src/cmd/llvmplugin/testdata/function-marker-inline.ll +++ b/src/cmd/llvmplugin/testdata/function-marker-inline.ll @@ -14,14 +14,14 @@ target triple = "x86_64-unknown-linux-goobj" declare void @llvm.sideeffect() define internal goabiinternal void @callee() - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: call void @llvm.sideeffect(), !goobj.marker_reloc !0 ret void } define goabiinternal void @caller() - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: call goabiinternal void @callee() ret void diff --git a/src/cmd/llvmplugin/testdata/gc-leaf-markers.ll b/src/cmd/llvmplugin/testdata/gc-leaf-markers.ll index b0db0b1d0111b7..64d9c7c1e5e288 100644 --- a/src/cmd/llvmplugin/testdata/gc-leaf-markers.ll +++ b/src/cmd/llvmplugin/testdata/gc-leaf-markers.ll @@ -3,7 +3,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee_leaf() "gc-leaf-function" declare goabiinternal void @callsite_leaf() -define goabiinternal void @leaf_calls() "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @leaf_calls() gc "goallc" { entry: call goabiinternal void @callee_leaf() call goabiinternal void @callsite_leaf() "gc-leaf-function" diff --git a/src/cmd/llvmplugin/testdata/indirect-callee.ll b/src/cmd/llvmplugin/testdata/indirect-callee.ll index 5f58bd365ad177..652172f1e88554 100644 --- a/src/cmd/llvmplugin/testdata/indirect-callee.ll +++ b/src/cmd/llvmplugin/testdata/indirect-callee.ll @@ -54,4 +54,4 @@ entry: ret void } -attributes #0 = { "frame-pointer"="non-leaf" "go-stack-growth-statepoint" } +attributes #0 = { "frame-pointer"="non-leaf" } diff --git a/src/cmd/llvmplugin/testdata/invalid-gc-leaf-definition.ll b/src/cmd/llvmplugin/testdata/invalid-gc-leaf-definition.ll index e5807484c08e41..542bf9bfbca0f0 100644 --- a/src/cmd/llvmplugin/testdata/invalid-gc-leaf-definition.ll +++ b/src/cmd/llvmplugin/testdata/invalid-gc-leaf-definition.ll @@ -8,4 +8,4 @@ entry: ret void } -attributes #0 = { "gc-leaf-function" "go-stack-growth-statepoint" } +attributes #0 = { "gc-leaf-function" } diff --git a/src/cmd/llvmplugin/testdata/irreducible-relocation.ll b/src/cmd/llvmplugin/testdata/irreducible-relocation.ll index f8e74a22e5d6d8..ca7e378a7edc6a 100644 --- a/src/cmd/llvmplugin/testdata/irreducible-relocation.ll +++ b/src/cmd/llvmplugin/testdata/irreducible-relocation.ll @@ -4,7 +4,7 @@ declare goabiinternal void @callee() define goabiinternal i64 @irreducible_relocation( ptr %p, i1 %enter_b, i1 %leave_a, i1 %leave_b) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br i1 %enter_b, label %b, label %a diff --git a/src/cmd/llvmplugin/testdata/live-aggregate.ll b/src/cmd/llvmplugin/testdata/live-aggregate.ll index 96f4e9d4517a80..de743e0d94decf 100644 --- a/src/cmd/llvmplugin/testdata/live-aggregate.ll +++ b/src/cmd/llvmplugin/testdata/live-aggregate.ll @@ -2,7 +2,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @callee() -define goabiinternal ptr @live_pointer_aggregate({ ptr, i64 } %value) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal ptr @live_pointer_aggregate({ ptr, i64 } %value) gc "goallc" { entry: call goabiinternal void @callee() %pointer = extractvalue { ptr, i64 } %value, 0 diff --git a/src/cmd/llvmplugin/testdata/loop-relocation.ll b/src/cmd/llvmplugin/testdata/loop-relocation.ll index 5b0293f8f37791..bdc6b1b0b0105c 100644 --- a/src/cmd/llvmplugin/testdata/loop-relocation.ll +++ b/src/cmd/llvmplugin/testdata/loop-relocation.ll @@ -4,7 +4,7 @@ declare goabiinternal void @callee() define goabiinternal i64 @loop_relocation( ptr %p, i1 %take_call, i1 %again) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br label %header diff --git a/src/cmd/llvmplugin/testdata/multiple-calls.ll b/src/cmd/llvmplugin/testdata/multiple-calls.ll index 8b560a5e6c2345..28cf6ee264676b 100644 --- a/src/cmd/llvmplugin/testdata/multiple-calls.ll +++ b/src/cmd/llvmplugin/testdata/multiple-calls.ll @@ -39,7 +39,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @first_callee() declare goabiinternal void @second_callee() -define goabiinternal i64 @different_pointer_sets_across_calls(ptr %p, ptr %q) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal i64 @different_pointer_sets_across_calls(ptr %p, ptr %q) gc "goallc" { entry: call goabiinternal void @first_callee() %first = load i64, ptr %p, align 8 diff --git a/src/cmd/llvmplugin/testdata/nest-param-attr.ll b/src/cmd/llvmplugin/testdata/nest-param-attr.ll index 52bc3bbe2f9130..5fbce840c5a7e2 100644 --- a/src/cmd/llvmplugin/testdata/nest-param-attr.ll +++ b/src/cmd/llvmplugin/testdata/nest-param-attr.ll @@ -2,7 +2,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @closure_callee(ptr nest) -define goabiinternal void @nest_param_attr(ptr %context) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @nest_param_attr(ptr %context) gc "goallc" { entry: call goabiinternal void @closure_callee(ptr nest %context) ret void diff --git a/src/cmd/llvmplugin/testdata/open-defer-incomplete.ll b/src/cmd/llvmplugin/testdata/open-defer-incomplete.ll index 31b9109d085c40..08c8a5d26cc1a3 100644 --- a/src/cmd/llvmplugin/testdata/open-defer-incomplete.ll +++ b/src/cmd/llvmplugin/testdata/open-defer-incomplete.ll @@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal void @open_defer_missing_slots() #0 gc "goallc" { +define goabiinternal void @open_defer_missing_slots() gc "goallc" { entry: %bits = alloca i8, align 1, !goallc.open_defer_bits !0 store volatile i8 0, ptr %bits, align 1 @@ -12,6 +12,4 @@ entry: ret void } -attributes #0 = { "go-stack-growth-statepoint" } - !0 = !{} diff --git a/src/cmd/llvmplugin/testdata/open-defer.ll b/src/cmd/llvmplugin/testdata/open-defer.ll index e66d1650026fb6..422d75c9cd2760 100644 --- a/src/cmd/llvmplugin/testdata/open-defer.ll +++ b/src/cmd/llvmplugin/testdata/open-defer.ll @@ -30,7 +30,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @safepoint() -define goabiinternal ptr @open_defer(ptr %value) #0 gc "goallc" { +define goabiinternal ptr @open_defer(ptr %value) gc "goallc" { entry: %bits = alloca i8, align 1, !goallc.open_defer_bits !0 %slots = alloca [2 x ptr], align 8, !goallc.open_defer_slots !1 @@ -47,7 +47,5 @@ entry: ret ptr %result } -attributes #0 = { "go-stack-growth-statepoint" } - !0 = !{} !1 = !{i32 2} diff --git a/src/cmd/llvmplugin/testdata/pointer-address-observation.ll b/src/cmd/llvmplugin/testdata/pointer-address-observation.ll index e41f84427b50b9..b098de3333a6d4 100644 --- a/src/cmd/llvmplugin/testdata/pointer-address-observation.ll +++ b/src/cmd/llvmplugin/testdata/pointer-address-observation.ll @@ -14,7 +14,7 @@ declare i64 @llvm.go.pointer.address.i64.p0(ptr) declare goabiinternal void @callee() define goabiinternal i1 @observe(ptr %pointer) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: %before = call i64 @llvm.go.pointer.address.i64.p0(ptr %pointer) call goabiinternal void @callee() diff --git a/src/cmd/llvmplugin/testdata/sequential-conditional-relocation.ll b/src/cmd/llvmplugin/testdata/sequential-conditional-relocation.ll index 59d8c591cc1c10..5b3e59fb11964a 100644 --- a/src/cmd/llvmplugin/testdata/sequential-conditional-relocation.ll +++ b/src/cmd/llvmplugin/testdata/sequential-conditional-relocation.ll @@ -5,7 +5,7 @@ declare goabiinternal void @second_callee() define goabiinternal i64 @sequential_conditional_safepoints( ptr %p, i1 %take_first, i1 %take_second) - "go-stack-growth-statepoint" gc "goallc" { + gc "goallc" { entry: br i1 %take_first, label %first_call, label %first_skip diff --git a/src/cmd/llvmplugin/testdata/statepoint.ll b/src/cmd/llvmplugin/testdata/statepoint.ll index 9178dd6c4f21a7..c6488f95522ffb 100644 --- a/src/cmd/llvmplugin/testdata/statepoint.ll +++ b/src/cmd/llvmplugin/testdata/statepoint.ll @@ -1,17 +1,30 @@ target triple = "x86_64-unknown-linux-goobj" +; The plugin owns the Machine StackMaps to GoObj bridge. The entry STACKMAP +; supplies map 0, while the statepoint supplies the live locals map selected at +; the ordinary call. The morestack path returns to the entry map. +; OBJVIEW-TEXT-LABEL: TEXT pointer_live_across_call +; OBJVIEW-TEXT: FUNCDATA_ArgsPointerMaps count=2 bits=1 map[0]=1 map[1]=0 +; OBJVIEW-TEXT-NEXT: FUNCDATA_LocalsPointerMaps count=2 bits=1 map[0]=0 map[1]=1 +; OBJVIEW-TEXT-NEXT: entry safepoint map[0] ArgsPointerMaps=1 LocalsPointerMaps=0 +; OBJVIEW-TEXT: PCDATA_StackMapIndex=-1 +; OBJVIEW-TEXT: PCDATA_StackMapIndex=1(ArgsPointerMaps=0 LocalsPointerMaps=1) +; OBJVIEW-TEXT-NEXT: {{.*}}ordinary safepoint{{.*}}map[1] ArgsPointerMaps=0 LocalsPointerMaps=1 +; OBJVIEW-TEXT: PCDATA_StackMapIndex=-1 +; OBJVIEW-TEXT: {{.*}}stack-growth safepoint{{.*}}map[0] ArgsPointerMaps=1 LocalsPointerMaps=0 + declare goabiinternal void @callee() declare goabiinternal void @leaf_callee() #0 declare goabiinternal ptr @make_pointer() -define goabiinternal i64 @pointer_live_across_call(ptr %p) #1 gc "goallc" { +define goabiinternal i64 @pointer_live_across_call(ptr %p) gc "goallc" { entry: call goabiinternal void @callee() %value = load i64, ptr %p, align 8 ret i64 %value } -define goabiinternal i64 @stack_address_live_across_call() #1 gc "goallc" { +define goabiinternal i64 @stack_address_live_across_call() gc "goallc" { entry: %slot = alloca i64, align 8 store i64 42, ptr %slot, align 8 @@ -20,13 +33,13 @@ entry: ret i64 %value } -define goabiinternal void @explicit_leaf_call() #1 gc "goallc" { +define goabiinternal void @explicit_leaf_call() gc "goallc" { entry: call goabiinternal void @leaf_callee() ret void } -define goabiinternal i64 @pointer_live_across_two_calls(ptr %p) #1 gc "goallc" { +define goabiinternal i64 @pointer_live_across_two_calls(ptr %p) gc "goallc" { entry: call goabiinternal void @callee() call goabiinternal void @callee() @@ -34,7 +47,7 @@ entry: ret i64 %value } -define goabiinternal i64 @pointer_live_into_cfg(ptr %p, i1 %take_left) #1 gc "goallc" { +define goabiinternal i64 @pointer_live_into_cfg(ptr %p, i1 %take_left) gc "goallc" { entry: call goabiinternal void @callee() br i1 %take_left, label %left, label %right @@ -52,7 +65,7 @@ done: ret i64 %value } -define goabiinternal ptr @call_result_live_across_call() #1 gc "goallc" { +define goabiinternal ptr @call_result_live_across_call() gc "goallc" { entry: %pointer = call goabiinternal ptr @make_pointer() call goabiinternal void @callee() @@ -62,7 +75,7 @@ entry: ; Function block layout is intentionally different from CFG dominance. The ; safepoint in %use is visited before the pointer-producing call in %define, ; but its liveness set contains that call result. -define goabiinternal ptr @out_of_layout_call_result() #1 gc "goallc" { +define goabiinternal ptr @out_of_layout_call_result() gc "goallc" { entry: br label %define @@ -76,4 +89,3 @@ define: } attributes #0 = { "gc-leaf-function" } -attributes #1 = { "go-stack-growth-statepoint" } diff --git a/src/cmd/llvmplugin/testdata/supported-param-attrs.ll b/src/cmd/llvmplugin/testdata/supported-param-attrs.ll index a1fb5f2f3fcbd1..cdd741ddc3e7fb 100644 --- a/src/cmd/llvmplugin/testdata/supported-param-attrs.ll +++ b/src/cmd/llvmplugin/testdata/supported-param-attrs.ll @@ -8,4 +8,4 @@ entry: ret void } -attributes #0 = { "frame-pointer"="non-leaf" "go-stack-growth-statepoint" } +attributes #0 = { "frame-pointer"="non-leaf" } diff --git a/src/cmd/llvmplugin/testdata/unsupported-invoke.ll b/src/cmd/llvmplugin/testdata/unsupported-invoke.ll index 8c65eba7e923df..6e84d2eb71cadc 100644 --- a/src/cmd/llvmplugin/testdata/unsupported-invoke.ll +++ b/src/cmd/llvmplugin/testdata/unsupported-invoke.ll @@ -4,7 +4,7 @@ declare goabiinternal void @callee() declare i32 @__gxx_personality_v0(...) define goabiinternal void @unsupported_invoke() - "go-stack-growth-statepoint" gc "goallc" + gc "goallc" personality ptr @__gxx_personality_v0 { entry: invoke goabiinternal void @callee() diff --git a/src/cmd/llvmplugin/testdata/unsupported-param-attr.ll b/src/cmd/llvmplugin/testdata/unsupported-param-attr.ll index c1911175b6bb68..1898ce3c354129 100644 --- a/src/cmd/llvmplugin/testdata/unsupported-param-attr.ll +++ b/src/cmd/llvmplugin/testdata/unsupported-param-attr.ll @@ -2,7 +2,7 @@ target triple = "x86_64-unknown-linux-goobj" declare goabiinternal void @unsupported_callee(ptr noalias) -define goabiinternal void @unsupported_param_attr(ptr %context) "go-stack-growth-statepoint" gc "goallc" { +define goabiinternal void @unsupported_param_attr(ptr %context) gc "goallc" { entry: call goabiinternal void @unsupported_callee(ptr noalias %context) ret void diff --git a/test/codegen/statepoint.go b/test/codegen/statepoint.go index 3cbae7970769f5..026c0e98151013 100644 --- a/test/codegen/statepoint.go +++ b/test/codegen/statepoint.go @@ -19,7 +19,8 @@ import "unsafe" // LLVM-NOT: llvm.experimental.stackmap // LLVM-LABEL: define goabiinternal i64 @codegen.goABIStatepointAttributes( // LLVM-SAME: i64 %x) #[[ATTRS:[0-9]+]] gc "goallc" {{.*}}{ -// LLVM: attributes #[[ATTRS]] = { {{.*}}"frame-pointer"="non-leaf"{{.*}}"go-stack-growth-statepoint"{{.*}} } +// LLVM: attributes #[[ATTRS]] = { {{.*}}"frame-pointer"="non-leaf"{{.*}} } +// LLVM-NOT: go-stack-growth-statepoint func goABIStatepointAttributes(x int) int { return x + 1 } diff --git a/test/llvm_tests.json b/test/llvm_tests.json index 30bae97d1e85ca..0642a9880bac4b 100644 --- a/test/llvm_tests.json +++ b/test/llvm_tests.json @@ -72,7 +72,7 @@ "codegen/shortcircuit.go": "empty-interface extraction and concrete type comparison", "codegen/smallintiface.go": "small scalar boxing through runtime.staticuint64s", "codegen/spills.go": "integer and floating-point values preserved across calls", - "codegen/statepoint.go": "frontend-owned Go GC strategy and stack-growth statepoint function markers", + "codegen/statepoint.go": "frontend-owned Go GC strategy and nosplit-only stack-growth policy", "codegen/structs.go": "typed struct initialization and zeroing", "codegen/type_descriptor.go": "compiler-owned runtime type descriptor data and GoObj metadata", "codegen/type_descriptor_kinds.go": "all runtime type descriptor layouts and variable descriptor data", From 0c9d14d07808bca218c80d2b949fa51d7c4840fe Mon Sep 17 00:00:00 2001 From: ZhouGuangyuan Date: Sat, 15 Aug 2026 13:05:15 +0800 Subject: [PATCH 2/2] ci: update pinned GoALLC LLVM payload --- .github/workflows/goallc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/goallc.yml b/.github/workflows/goallc.yml index 29b9b2df2f096a..c99944909f4aef 100644 --- a/.github/workflows/goallc.yml +++ b/.github/workflows/goallc.yml @@ -25,8 +25,8 @@ concurrency: cancel-in-progress: true env: - PINNED_LLVM_RELEASE: goallc-llvm23.1.0-20260814T092516Z - PINNED_LLVM_REVISION: 3710742685729c697378ab13a456484e5693aba9 + PINNED_LLVM_RELEASE: goallc-llvm23.1.0-20260815T075241Z + PINNED_LLVM_REVISION: 9bd4c90aca1584de810fd081bc1fd6a0cce602dd jobs: llvm-payload: