-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[RISCV] Exclude LPAD in machine outliner #157220
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 7 commits
92afeb7
8b75b85
936bcca
96f1bc0
a2ce049
ab76d0f
1580617
1e8eb67
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 |
|---|---|---|
|
|
@@ -148,6 +148,15 @@ def isNonZeroLoadImmediate | |
| CheckNot<CheckImmOperand<2, 0>> | ||
| ]>>>; | ||
|
|
||
| // Returns true if this is LPAD (auipc with rd = x0) | ||
|
||
| def isLPAD | ||
| : TIIPredicate<"isLPAD", | ||
| MCReturnStatement<CheckAll<[ | ||
| CheckOpcode<[AUIPC]>, | ||
| CheckIsRegOperand<0>, | ||
| CheckRegOperand<0, X0>, | ||
| ]>>>; | ||
|
|
||
| def ignoresVXRM | ||
| : TIIPredicate<"ignoresVXRM", | ||
| MCOpcodeSwitchStatement< | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc -mtriple riscv64 -mattr=+experimental-zicfilp < %s | FileCheck %s --check-prefixes=CHECK | ||
| ; RUN: llc -mtriple riscv32 -mattr=+experimental-zicfilp < %s | FileCheck %s --check-prefixes=CHECK | ||
|
||
|
|
||
| define i16 @test1(i16 %x) #0 { | ||
| ; CHECK-LABEL: test1: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lpad 0 | ||
| ; CHECK-NEXT: tail OUTLINED_FUNCTION_0 | ||
| entry: | ||
| %y = add i16 5, %x | ||
| %z = mul i16 4, %y | ||
| ret i16 %z | ||
| } | ||
|
|
||
| define i16 @test2(i16 %x) #0 { | ||
| ; CHECK-LABEL: test2: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lpad 0 | ||
| ; CHECK-NEXT: tail OUTLINED_FUNCTION_0 | ||
| entry: | ||
| %y = add i16 5, %x | ||
| %z = mul i16 4, %y | ||
| ret i16 %z | ||
| } | ||
|
|
||
| define i16 @test3(i16 %x) #0 { | ||
| ; CHECK-LABEL: test3: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lpad 0 | ||
| ; CHECK-NEXT: tail OUTLINED_FUNCTION_0 | ||
| entry: | ||
| %y = add i16 5, %x | ||
| %z = mul i16 4, %y | ||
| ret i16 %z | ||
| } | ||
|
|
||
| define i16 @test4(i16 %x) #0 { | ||
| ; CHECK-LABEL: test4: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lpad 0 | ||
| ; CHECK-NEXT: tail OUTLINED_FUNCTION_0 | ||
| entry: | ||
| %y = add i16 5, %x | ||
| %z = mul i16 4, %y | ||
| ret i16 %z | ||
| } | ||
|
|
||
| define i16 @main(i16 %x) #0 { | ||
| ; CHECK-LABEL: main: | ||
| ; CHECK: # %bb.0: # %entry | ||
| ; CHECK-NEXT: lpad 0 | ||
| ; CHECK-NEXT: tail OUTLINED_FUNCTION_0 | ||
| entry: | ||
| %y = add i16 5, %x | ||
| %z = mul i16 4, %y | ||
| ret i16 %z | ||
| } | ||
|
|
||
| attributes #0 = { minsize } | ||
|
|
||
| !llvm.module.flags = !{!0, !1} | ||
|
|
||
| !0 = !{i32 8, !"cf-protection-branch", i32 1} | ||
| !1 = !{i32 1, !"cf-branch-label-scheme", !"unlabeled"} | ||
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.
This comment is also redundant.