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
}
|