; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt < %s -passes=newgvn -S | FileCheck %s
define double @func_fast(double %a, double %b) {
; CHECK-LABEL: define double @func_fast
; CHECK-SAME: (double [[A:%.*]], double [[B:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca double, align 8
; CHECK-NEXT: [[ADD:%.*]] = fadd fast double [[B]], 3.000000e+00
; CHECK-NEXT: store double [[ADD]], ptr [[A_ADDR]], align 8
; CHECK-NEXT: ret double [[ADD]]
;
entry:
%a.addr = alloca double, align 8
%add = fadd fast double %b, 3.000000e+00
store double %add, ptr %a.addr, align 8
%load_add = load double, ptr %a.addr, align 8
ret double %load_add
}
define double @func_no_fast(double %a, double %b) {
; CHECK-LABEL: define double @func_no_fast
; CHECK-SAME: (double [[A:%.*]], double [[B:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca double, align 8
; CHECK-NEXT: [[ADD:%.*]] = fadd double [[B]], 3.000000e+00
; CHECK-NEXT: store double [[ADD]], ptr [[A_ADDR]], align 8
; CHECK-NEXT: ret double [[ADD]]
;
entry:
%a.addr = alloca double, align 8
%add = fadd fast double %b, 3.000000e+00
store double %add, ptr %a.addr, align 8
%duplicated_add = fadd double %b, 3.000000e+00
ret double %duplicated_add
}