File: reduce-operands-skip-token.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.4-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,236,516 kB
  • sloc: cpp: 7,619,569; ansic: 1,433,956; asm: 1,058,748; python: 252,181; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,585; awk: 3,523; javascript: 2,272; xml: 892; fortran: 770
file content (27 lines) | stat: -rw-r--r-- 1,113 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
; Check token values are correctly handled by operands-skip

; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-skip --test FileCheck --test-arg --check-prefix=INTERESTING --test-arg %s --test-arg --input-file %s -o %t
; RUN: FileCheck -check-prefix=RESULT %s < %t

; INTERESTING-LABEL: define void @tokens(
; INTERESTING: call void @llvm.token.consumer

; RESULT-LABEL: define void @tokens(ptr %ptr) {
; RESULT-NEXT: %token = call token @llvm.token.producer()
; RESULT-NEXT:store i32 0, ptr %ptr, align 4
; RESULT-NEXT:%chain = call token @llvm.token.chain(token %token)
; RESULT-NEXT:call void @llvm.token.consumer(token %token)
; RESULT-NEXT:store i32 1, ptr %ptr, align 4
; RESULT-NEXT:ret void
define void @tokens(ptr %ptr) {
  %token = call token @llvm.token.producer()
  store i32 0, ptr %ptr
  %chain = call token @llvm.token.chain(token %token)
  call void @llvm.token.consumer(token %chain) ; -> rewrite to use %token directly
  store i32 1, ptr %ptr
  ret void
}

declare token @llvm.token.producer()
declare token @llvm.token.chain(token)
declare void @llvm.token.consumer(token)