Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a05f76f
Add module flag
mingmingl-llvm Oct 7, 2025
f68b06f
[nfc][StaticDataLayout]Add helper functions to tell the eligibility s…
mingmingl-llvm Oct 7, 2025
331888b
save irrelevant change for the next PR to make this one focused
mingmingl-llvm Oct 7, 2025
c56b792
Get rid of section prefix validation in codegen.
mingmingl-llvm Oct 7, 2025
dcb9f00
resolve comments
mingmingl-llvm Oct 7, 2025
3565bc0
add test coverage
mingmingl-llvm Oct 8, 2025
905b80f
simplify test
mingmingl-llvm Oct 8, 2025
95292a6
test coverage for the subsequent patch https://github.com/llvm/llvm-p…
mingmingl-llvm Oct 8, 2025
64be09f
Revert "test coverage for the subsequent patch https://github.com/llv…
mingmingl-llvm Oct 8, 2025
4a90c77
add a minial test case for subsequent PRs to expand on
mingmingl-llvm Oct 8, 2025
3b2f494
Merge branch 'users/mingmingl-llvm/sdpi' into users/mingmingl-llvm/se…
mingmingl-llvm Oct 9, 2025
f9c6266
one liner fix in test
mingmingl-llvm Oct 9, 2025
58bb098
Merge branch 'users/mingmingl-llvm/sdpi' into users/mingmingl-llvm/se…
mingmingl-llvm Oct 9, 2025
90ac67d
test coverage
mingmingl-llvm Oct 9, 2025
34b47c9
simplify switch-break to if-continue
mingmingl-llvm Oct 10, 2025
3756370
Merge branch 'main' into users/mingmingl-llvm/module
mingmingl-llvm Oct 10, 2025
b880ee3
rebase on top of pre-commit test in https://github.com/llvm/llvm-proj…
mingmingl-llvm Oct 10, 2025
41f3d6a
rebase for pre-commit test case in https://github.com/llvm/llvm-proje…
mingmingl-llvm Oct 10, 2025
c6c5311
Merge branch 'main' into users/mingmingl-llvm/setsectionprefix
mingmingl-llvm Oct 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions llvm/lib/CodeGen/StaticDataAnnotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,8 @@ bool StaticDataAnnotator::runOnModule(Module &M) {
if (!llvm::memprof::IsAnnotationOK(GV))
continue;

// The implementation below assumes prior passes don't set section prefixes,
// and specifically do 'assign' rather than 'update'. So report error if a
// section prefix is already set.
if (auto maybeSectionPrefix = GV.getSectionPrefix();
maybeSectionPrefix && !maybeSectionPrefix->empty())
llvm::report_fatal_error("Global variable " + GV.getName() +
" already has a section prefix " +
*maybeSectionPrefix);

StringRef SectionPrefix = SDPI->getConstantSectionPrefix(&GV, PSI);
if (SectionPrefix.empty())
continue;

// setSectionPrefix returns true if the section prefix is updated.
Changed |= GV.setSectionPrefix(SectionPrefix);
}

Expand Down
13 changes: 6 additions & 7 deletions llvm/test/CodeGen/X86/global-variable-partition-with-dap.ll
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

;; A minimal test case. llc will crash if global variables already has a section
;; prefix. Subsequent PRs will expand on this test case to test the hotness
;; reconciliation implementation.

; RUN: not llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic \
;; A minimal test case. Subsequent PRs will expand on this test case
;; (e.g., with more functions, variables and profiles) and test the hotness
;; reconcillation implementation.
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic \
; RUN: -partition-static-data-sections=true \
; RUN: -data-sections=true -unique-section-names=false \
; RUN: %s -o - 2>&1 | FileCheck %s --check-prefix=ERR
; RUN: %s -o - 2>&1 | FileCheck %s --check-prefix=IR

; ERR: Global variable hot_bss already has a section prefix hot
; IR: .section .bss.hot.,"aw"

@hot_bss = internal global i32 0, !section_prefix !17

Expand Down
Loading