1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt < %s -passes=newgvn -S | FileCheck %s
4 define double @func_fast(double %a, double %b) {
5 ; CHECK-LABEL: define double @func_fast
6 ; CHECK-SAME: (double [[A:%.*]], double [[B:%.*]]) {
8 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca double, align 8
9 ; CHECK-NEXT: [[ADD:%.*]] = fadd fast double [[B]], 3.000000e+00
10 ; CHECK-NEXT: store double [[ADD]], ptr [[A_ADDR]], align 8
11 ; CHECK-NEXT: ret double [[ADD]]
14 %a.addr = alloca double, align 8
15 %add = fadd fast double %b, 3.000000e+00
16 store double %add, ptr %a.addr, align 8
17 %load_add = load double, ptr %a.addr, align 8
21 define double @func_no_fast(double %a, double %b) {
22 ; CHECK-LABEL: define double @func_no_fast
23 ; CHECK-SAME: (double [[A:%.*]], double [[B:%.*]]) {
25 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca double, align 8
26 ; CHECK-NEXT: [[ADD:%.*]] = fadd double [[B]], 3.000000e+00
27 ; CHECK-NEXT: store double [[ADD]], ptr [[A_ADDR]], align 8
28 ; CHECK-NEXT: ret double [[ADD]]
31 %a.addr = alloca double, align 8
32 %add = fadd fast double %b, 3.000000e+00
33 store double %add, ptr %a.addr, align 8
34 %duplicated_add = fadd double %b, 3.000000e+00
35 ret double %duplicated_add