-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] emit .option directive for functions with target features whi…
…ch differ from module default When function has different attributes from module, emit the .option <attribute> before the function body. This allows non-integrated assemblers to properly assemble the functions (which may contain instructions dependent on the extra target features). Reviewed By: craig.topper, reames Differential Revision: https://reviews.llvm.org/D155155
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,36 @@ | ||
; RUN: llc -mtriple=riscv64 -mcpu=sifive-u74 -verify-machineinstrs < %s | FileCheck %s | ||
|
||
; CHECK: .option push | ||
; CHECK-NEXT: .option arch, +v, +zve32f, +zve32x, +zve64d, +zve64f, +zve64x, +zvl128b, +zvl32b, +zvl64b | ||
define void @test1() "target-features"="+a,+d,+f,+m,+c,+v,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b" { | ||
; CHECK-LABEL: test1 | ||
; CHECK: .option pop | ||
entry: | ||
ret void | ||
} | ||
|
||
; CHECK: .option push | ||
; CHECK-NEXT: .option arch, +experimental-zihintntl | ||
define void @test2() "target-features"="+a,+d,+f,+m,+experimental-zihintntl,+zifencei" { | ||
; CHECK-LABEL: test2 | ||
; CHECK: .option pop | ||
entry: | ||
ret void | ||
} | ||
|
||
; CHECK: .option push | ||
; CHECK-NEXT: .option arch, -a, -d, -f, -m | ||
define void @test3() "target-features"="-a,-d,-f,-m" { | ||
; CHECK-LABEL: test3 | ||
; CHECK: .option pop | ||
entry: | ||
ret void | ||
} | ||
|
||
; CHECK-NOT: .option push | ||
define void @test4() { | ||
; CHECK-LABEL: test4 | ||
; CHECK-NOT: .option pop | ||
entry: | ||
ret void | ||
} |