-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[RISCV] Use 'riscv-isa' module flag to set ELF flags and attributes. #85155
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; RUN: llc -mtriple=riscv32 %s -o - | FileCheck %s --check-prefix=RV32 | ||
; RUN: llc -mtriple=riscv64 %s -o - | FileCheck %s --check-prefix=RV64 | ||
|
||
; Test generation of ELF attribute from module metadata | ||
|
||
; RV32: .attribute 5, "rv32i2p1_m2p0_zba1p0" | ||
; RV64: .attribute 5, "rv64i2p1_m2p0_zba1p0" | ||
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to double check that we don't need to test the merging w/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My intent was that this test is what would happen in that case. I can add an llvm-lto2 test for the merging if reviewers want. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don’t think that’s necessary. I’m pretty sure you’re right and this is equivalent. |
||
|
||
define i32 @addi(i32 %a) { | ||
%1 = add i32 %a, 1 | ||
ret i32 %1 | ||
} | ||
|
||
!llvm.module.flags = !{!0} | ||
|
||
!0 = !{i32 6, !"riscv-isa", !1} | ||
!1 = !{!"rv64i2p1_m2p0", !"rv64i2p1_zba1p0"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; RUN: llc -mtriple=riscv32 -filetype=obj < %s | llvm-readelf -h - | FileCheck -check-prefixes=FLAGS %s | ||
|
||
; FLAGS: Flags: 0x11, RVC, TSO | ||
|
||
define i32 @addi(i32 %a) { | ||
%1 = add i32 %a, 1 | ||
ret i32 %1 | ||
} | ||
|
||
!llvm.module.flags = !{!0} | ||
|
||
!0 = !{i32 6, !"riscv-isa", !1} | ||
!1 = !{!"rv64i2p1_c2p0_ztso0p1"} |
Uh oh!
There was an error while loading. Please reload this page.