File: commute.ll

package info (click to toggle)
llvm-toolchain-5.0 1:5.0.1-2~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 553,688 kB
  • sloc: cpp: 2,878,786; ansic: 584,110; asm: 246,252; python: 124,751; objc: 106,925; sh: 21,542; lisp: 8,628; pascal: 5,885; ml: 5,544; perl: 5,312; makefile: 2,208; cs: 2,022; xml: 686; php: 212; csh: 117
file content (67 lines) | stat: -rw-r--r-- 1,523 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
; RUN: opt < %s -S -early-cse | FileCheck %s
; RUN: opt < %s -S -basicaa -early-cse-memssa | FileCheck %s

; CHECK-LABEL: @test1(
define void @test1(float %A, float %B, float* %PA, float* %PB) {
  ; CHECK-NEXT: fadd
  ; CHECK-NEXT: store
  ; CHECK-NEXT: store
  ; CHECK-NEXT: ret
  %C = fadd float %A, %B
  store float %C, float* %PA
  %D = fadd float %B, %A
  store float %D, float* %PB
  ret void
}

; CHECK-LABEL: @test2(
define void @test2(float %A, float %B, i1* %PA, i1* %PB) {
  ; CHECK-NEXT: fcmp
  ; CHECK-NEXT: store
  ; CHECK-NEXT: store
  ; CHECK-NEXT: ret
  %C = fcmp oeq float %A, %B
  store i1 %C, i1* %PA
  %D = fcmp oeq float %B, %A
  store i1 %D, i1* %PB
  ret void
}

; CHECK-LABEL: @test3(
define void @test3(float %A, float %B, i1* %PA, i1* %PB) {
  ; CHECK-NEXT: fcmp
  ; CHECK-NEXT: store
  ; CHECK-NEXT: store
  ; CHECK-NEXT: ret
  %C = fcmp uge float %A, %B
  store i1 %C, i1* %PA
  %D = fcmp ule float %B, %A
  store i1 %D, i1* %PB
  ret void
}

; CHECK-LABEL: @test4(
define void @test4(i32 %A, i32 %B, i1* %PA, i1* %PB) {
  ; CHECK-NEXT: icmp
  ; CHECK-NEXT: store
  ; CHECK-NEXT: store
  ; CHECK-NEXT: ret
  %C = icmp eq i32 %A, %B
  store i1 %C, i1* %PA
  %D = icmp eq i32 %B, %A
  store i1 %D, i1* %PB
  ret void
}

; CHECK-LABEL: @test5(
define void @test5(i32 %A, i32 %B, i1* %PA, i1* %PB) {
  ; CHECK-NEXT: icmp
  ; CHECK-NEXT: store
  ; CHECK-NEXT: store
  ; CHECK-NEXT: ret
  %C = icmp sgt i32 %A, %B
  store i1 %C, i1* %PA
  %D = icmp slt i32 %B, %A
  store i1 %D, i1* %PB
  ret void
}