-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Patchpoint] Add immarg attributes to patchpoint arguments (#97276)
- Loading branch information
1 parent
731a683
commit bc8a5d1
Showing
3 changed files
with
72 additions
and
2 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
35 changes: 35 additions & 0 deletions
35
llvm/test/Transforms/SimplifyCFG/patchpoint-invalid-sink.ll
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,35 @@ | ||
; RUN: opt -passes='simplifycfg<sink-common-insts>' -S %s | FileCheck %s | ||
|
||
declare void @personalityFn() | ||
|
||
define void @test(i1 %c) personality ptr @personalityFn { | ||
; CHECK-LABEL: define void @test | ||
; CHECK-LABEL: entry: | ||
; CHECK-NEXT: br i1 %c, label %taken, label %untaken | ||
; CHECK-LABEL: taken: | ||
; CHECK-NEXT: invoke void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 1, i32 0, ptr null, i32 0) | ||
; CHECK-LABEL: untaken: | ||
; CHECK-NEXT: invoke void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 2, i32 0, ptr null, i32 0) | ||
; CHECK-LABEL: end: | ||
; CHECK-NEXT: ret void | ||
entry: | ||
br i1 %c, label %taken, label %untaken | ||
|
||
taken: | ||
invoke void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 1, i32 0, ptr null, i32 0) | ||
to label %end unwind label %unwind | ||
|
||
untaken: | ||
invoke void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 2, i32 0, ptr null, i32 0) | ||
to label %end unwind label %unwind | ||
|
||
end: | ||
ret void | ||
|
||
unwind: | ||
%0 = landingpad { ptr, i32 } | ||
cleanup | ||
br label %end | ||
} | ||
|
||
declare void @llvm.experimental.patchpoint.void(i64 immarg, i32 immarg, ptr, i32 immarg, ...) |
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