File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 1+ ; Check no invalid reduction caused by introducing a token typed
2+ ; function argument
3+
4+ ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-to-args --test FileCheck --test-arg --check-prefix=INTERESTING --test-arg %s --test-arg --input-file %s -o %t
5+ ; RUN: FileCheck -check-prefix=RESULT %s < %t
6+
7+ ; INTERESTING-LABEL: define void @tokens(
8+ ; INTERESTING: call void @llvm.token.consumer
9+
10+ ; RESULT-LABEL: define void @tokens(ptr %local.ptr) {
11+ ; RESULT-NEXT: %local.ptr1 = alloca i32, align 4
12+ ; RESULT-NEXT: %token = call token @llvm.token.producer()
13+ ; RESULT-NEXT: store i32 0, ptr %local.ptr, align 4
14+ ; RESULT-NEXT: call void @llvm.token.consumer(token %token)
15+ ; RESULT-NEXT: store i32 1, ptr %local.ptr, align 4
16+ ; RESULT-NEXT: ret void
17+ define void @tokens () {
18+ %local.ptr = alloca i32
19+ %token = call token @llvm.token.producer ()
20+ store i32 0 , ptr %local.ptr
21+ call void @llvm.token.consumer (token %token )
22+ store i32 1 , ptr %local.ptr
23+ ret void
24+ }
25+
26+ declare token @llvm.token.producer ()
27+ declare void @llvm.token.consumer (token)
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ static bool canReduceUse(Use &Op) {
3636 return false ;
3737
3838 // Don't pass labels/metadata as arguments.
39- if (Ty->isLabelTy () || Ty->isMetadataTy ())
39+ if (Ty->isLabelTy () || Ty->isMetadataTy () || Ty-> isTokenTy () )
4040 return false ;
4141
4242 // No need to replace values that are already arguments.
You can’t perform that action at this time.
0 commit comments