-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Put large common blocks into .lbss for the medium and large code models #161483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ssijaric-nv
wants to merge
3
commits into
llvm:main
Choose a base branch
from
ssijaric-nv:largecomm_x86-64
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+206
−6
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
; RUN: llc -filetype=asm -code-model=medium %s --large-data-threshold=65636 -o - | FileCheck %s --check-prefix=CHECKASM-MEDIUM | ||
; RUN: llc -filetype=asm -code-model=large %s -o - | FileCheck %s --check-prefix=CHECKASM-LARGE | ||
; RUN: llc -filetype=asm -code-model=medium %s --large-data-threshold=65636 -o - | llvm-mc -triple x86_64-linux-gnu -filetype=obj - | llvm-readelf -s - | FileCheck %s --check-prefix=CHECKOBJ-MEDIUM | ||
; RUN: llc -filetype=asm -code-model=large %s -o - | llvm-mc -triple x86_64-linux-gnu -filetype=obj - | llvm-readelf -s - | FileCheck %s --check-prefix=CHECKOBJ-LARGE | ||
|
||
; CHECKASM-MEDIUM: .section .lbss,"awl",@nobits | ||
; CHECKASM-MEDIUM-NEXT: .type __BLNK__,@object # @__BLNK__ | ||
; CHECKASM-MEDIUM-NEXT: .largecomm __BLNK__,48394093832,8 | ||
; CHECKASM-MEDIUM-NEXT: .type ccc_,@object # @ccc_ | ||
; CHECKASM-MEDIUM-NEXT: .comm ccc_,8,8 | ||
|
||
; CHECKASM-LARGE: .section .lbss,"awl",@nobits | ||
; CHECKASM-LARGE-NEXT: .type __BLNK__,@object # @__BLNK__ | ||
; CHECKASM-LARGE-NEXT: .largecomm __BLNK__,48394093832,8 | ||
; CHECKASM-LARGE-NEXT: .type ccc_,@object # @ccc_ | ||
; CHECKASM-LARGE-NEXT: .largecomm ccc_,8,8 | ||
|
||
; CHECKOBJ-MEDIUM: 8 OBJECT GLOBAL DEFAULT COM ccc_ | ||
; CHECKOBJ-MEDIUM: 48394093832 OBJECT GLOBAL DEFAULT LARGE_COMMON __BLNK | ||
|
||
; CHECKOBJ-LARGE: 8 OBJECT GLOBAL DEFAULT LARGE_COMMON ccc_ | ||
; CHECKOBJ-LARGE: 48394093832 OBJECT GLOBAL DEFAULT LARGE_COMMON __BLNK__ | ||
|
||
source_filename = "FIRModule" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
@__BLNK__ = common global [48394093832 x i8] zeroinitializer, align 8 | ||
@ccc_ = common global [8 x i8] zeroinitializer, align 8 | ||
@_QFECn1 = internal constant i32 77777 | ||
@_QFECn2 = internal constant i32 77777 | ||
|
||
define void @_QQmain() #0 { | ||
store double 1.000000e+00, ptr @ccc_, align 8 | ||
store double 2.000000e+00, ptr getelementptr inbounds nuw (i8, ptr @__BLNK__, i64 61600176), align 8 | ||
ret void | ||
} | ||
|
||
declare void @_FortranAProgramStart(i32, ptr, ptr, ptr) #1 | ||
|
||
declare void @_FortranAProgramEndStatement() #1 | ||
|
||
define i32 @main(i32 %0, ptr %1, ptr %2) #0 { | ||
call void @_FortranAProgramStart(i32 %0, ptr %1, ptr %2, ptr null) | ||
call void @_QQmain() | ||
call void @_FortranAProgramEndStatement() | ||
ret i32 0 | ||
} | ||
|
||
attributes #0 = { "frame-pointer"="all" "target-cpu"="x86-64" } | ||
attributes #1 = { "frame-pointer"="all" } | ||
|
||
!llvm.ident = !{!0} | ||
!llvm.module.flags = !{!1, !2, !3} | ||
|
||
!0 = !{!"flang version 22.0.0 (https://github.com/llvm/llvm-project.git e1afe25356b8d2ee14f5f88bdb6c2a1526ed14ef)"} | ||
!1 = !{i32 2, !"Debug Info Version", i32 3} | ||
!2 = !{i32 8, !"PIC Level", i32 2} | ||
!3 = !{i32 7, !"PIE Level", i32 2} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect to see explicit llvm-readobj tests (i.e. located under test/tools/llvm-readobj) for the new code in ELFDumper.cpp, testing its behaviour. This likely would require yaml2obj support and should be in its own PR (together with the functional llvm-readobj changes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jh7370. I'll create a separate PR for the llvm-readobj change and add the tests.