1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7 | FileCheck %s
4 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx10.8.0"
7 %struct.GPar.0.16.26 = type { [0 x double], double }
9 @d = external global double, align 8
11 declare %struct.GPar.0.16.26* @Rf_gpptr(...)
13 define void @Rf_GReset() {
14 ; CHECK-LABEL: @Rf_GReset(
16 ; CHECK-NEXT: [[TMP0:%.*]] = load double, double* @d, align 8
17 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> undef, double [[TMP0]], i32 1
18 ; CHECK-NEXT: [[TMP2:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[TMP1]]
19 ; CHECK-NEXT: br i1 icmp eq (%struct.GPar.0.16.26* (...)* inttoptr (i64 115 to %struct.GPar.0.16.26* (...)*), %struct.GPar.0.16.26* (...)* @Rf_gpptr), label [[IF_THEN:%.*]], label [[IF_END7:%.*]]
21 ; CHECK-NEXT: [[TMP3:%.*]] = fsub <2 x double> [[TMP2]], undef
22 ; CHECK-NEXT: [[TMP4:%.*]] = fdiv <2 x double> [[TMP3]], undef
23 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[TMP4]], i32 0
24 ; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x double> [[TMP4]], i32 1
25 ; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt double [[TMP5]], [[TMP6]]
26 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN6:%.*]], label [[IF_END7]]
28 ; CHECK-NEXT: br label [[IF_END7]]
30 ; CHECK-NEXT: ret void
33 %sub = fsub double -0.000000e+00, undef
34 %0 = load double, double* @d, align 8
35 %sub1 = fsub double -0.000000e+00, %0
36 br i1 icmp eq (%struct.GPar.0.16.26* (...)* inttoptr (i64 115 to %struct.GPar.0.16.26* (...)*), %struct.GPar.0.16.26* (...)* @Rf_gpptr), label %if.then, label %if.end7
38 if.then: ; preds = %entry
39 %sub2 = fsub double %sub, undef
40 %div.i = fdiv double %sub2, undef
41 %sub4 = fsub double %sub1, undef
42 %div.i16 = fdiv double %sub4, undef
43 %cmp = fcmp ogt double %div.i, %div.i16
44 br i1 %cmp, label %if.then6, label %if.end7
46 if.then6: ; preds = %if.then
49 if.end7: ; preds = %if.then6, %if.then, %entry
50 %g.0 = phi double [ 0.000000e+00, %if.then6 ], [ %sub, %if.then ], [ %sub, %entry ]
54 define void @Rf_GReset_unary_fneg() {
55 ; CHECK-LABEL: @Rf_GReset_unary_fneg(
57 ; CHECK-NEXT: [[TMP0:%.*]] = load double, double* @d, align 8
58 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> undef, double [[TMP0]], i32 1
59 ; CHECK-NEXT: [[TMP2:%.*]] = fneg <2 x double> [[TMP1]]
60 ; CHECK-NEXT: br i1 icmp eq (%struct.GPar.0.16.26* (...)* inttoptr (i64 115 to %struct.GPar.0.16.26* (...)*), %struct.GPar.0.16.26* (...)* @Rf_gpptr), label [[IF_THEN:%.*]], label [[IF_END7:%.*]]
62 ; CHECK-NEXT: [[TMP3:%.*]] = fsub <2 x double> [[TMP2]], undef
63 ; CHECK-NEXT: [[TMP4:%.*]] = fdiv <2 x double> [[TMP3]], undef
64 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[TMP4]], i32 0
65 ; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x double> [[TMP4]], i32 1
66 ; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt double [[TMP5]], [[TMP6]]
67 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN6:%.*]], label [[IF_END7]]
69 ; CHECK-NEXT: br label [[IF_END7]]
71 ; CHECK-NEXT: ret void
74 %sub = fneg double undef
75 %0 = load double, double* @d, align 8
76 %sub1 = fneg double %0
77 br i1 icmp eq (%struct.GPar.0.16.26* (...)* inttoptr (i64 115 to %struct.GPar.0.16.26* (...)*), %struct.GPar.0.16.26* (...)* @Rf_gpptr), label %if.then, label %if.end7
79 if.then: ; preds = %entry
80 %sub2 = fsub double %sub, undef
81 %div.i = fdiv double %sub2, undef
82 %sub4 = fsub double %sub1, undef
83 %div.i16 = fdiv double %sub4, undef
84 %cmp = fcmp ogt double %div.i, %div.i16
85 br i1 %cmp, label %if.then6, label %if.end7
87 if.then6: ; preds = %if.then
90 if.end7: ; preds = %if.then6, %if.then, %entry
91 %g.0 = phi double [ 0.000000e+00, %if.then6 ], [ %sub, %if.then ], [ %sub, %entry ]