File: reordering-basic.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (58 lines) | stat: -rw-r--r-- 2,000 bytes parent folder | download | duplicates (6)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes=normalize < %s | FileCheck %s

define double @foo(double %a0, double %a1) {
; CHECK-LABEL: define double @foo(
; CHECK-SAME: double [[A0:%.*]], double [[A1:%.*]]) {
; CHECK-NEXT:  [[BB17254:.*:]]
; CHECK-NEXT:    %"vl93562([[A0]], 2.000000e+00)" = fmul double [[A0]], 2.000000e+00
; CHECK-NEXT:    %"op95858(vl93562)" = fmul double 6.000000e+00, %"vl93562([[A0]], 2.000000e+00)"
; CHECK-NEXT:    [[A:%.*]] = fmul double [[A0]], [[A1]]
; CHECK-NEXT:    [[C:%.*]] = fmul double 6.000000e+00, [[A]]
; CHECK-NEXT:    ret double %"op95858(vl93562)"
;
entry:
  %a = fmul double %a0, %a1
  %b = fmul double %a0, 2.000000e+00
  %c = fmul double %a, 6.000000e+00
  %d = fmul double %b, 6.000000e+00
  ret double %d
}

declare double @bir()

declare double @bar()

define double @baz(double %x) {
; CHECK-LABEL: define double @baz(
; CHECK-SAME: double [[A0:%.*]]) {
; CHECK-NEXT:  [[BB76951:.*:]]
; CHECK-NEXT:    [[IFCOND:%.*]] = fcmp one double [[A0]], 0.000000e+00
; CHECK-NEXT:    br i1 [[IFCOND]], label %[[BB91455:.*]], label %[[BB914551:.*]]
; CHECK:       [[BB91455]]:
; CHECK-NEXT:    %"vl15001bir()" = call double @bir()
; CHECK-NEXT:    br label %[[BB17254:.*]]
; CHECK:       [[BB914551]]:
; CHECK-NEXT:    %"vl69719bar()" = call double @bar()
; CHECK-NEXT:    br label %[[BB17254]]
; CHECK:       [[BB17254]]:
; CHECK-NEXT:    %"op19734(vl15001, vl69719)" = phi double [ %"vl15001bir()", %[[BB91455]] ], [ %"vl69719bar()", %[[BB914551]] ]
; CHECK-NEXT:    ret double %"op19734(vl15001, vl69719)"
;
entry:
  %ifcond = fcmp one double %x, 0.000000e+00
  br i1 %ifcond, label %then, label %else

then:       ; preds = %entry
  %calltmp = call double @bir()
  br label %ifcont

else:       ; preds = %entry
  %calltmp1 = call double @bar()
  br label %ifcont

ifcont:     ; preds = %else, %then
  %iftmp = phi double [ %calltmp, %then ], [ %calltmp1, %else ]
  ret double %iftmp
}