1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=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 ptr @Rf_gpptr(...)
13 define void @Rf_GReset() {
14 ; CHECK-LABEL: @Rf_GReset(
16 ; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr @d, align 8
17 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> <double poison, double undef>, double [[TMP0]], i32 0
18 ; CHECK-NEXT: [[TMP2:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, [[TMP1]]
19 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq ptr inttoptr (i64 115 to ptr), @Rf_gpptr
20 ; CHECK-NEXT: br i1 [[CMP2]], label [[IF_THEN:%.*]], label [[IF_END7:%.*]]
22 ; CHECK-NEXT: [[TMP3:%.*]] = fsub <2 x double> [[TMP2]], undef
23 ; CHECK-NEXT: [[TMP4:%.*]] = fdiv <2 x double> [[TMP3]], undef
24 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[TMP4]], i32 0
25 ; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x double> [[TMP4]], i32 1
26 ; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt double [[TMP6]], [[TMP5]]
27 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN6:%.*]], label [[IF_END7]]
29 ; CHECK-NEXT: br label [[IF_END7]]
31 ; CHECK-NEXT: ret void
34 %sub = fsub double -0.000000e+00, undef
35 %0 = load double, ptr @d, align 8
36 %sub1 = fsub double -0.000000e+00, %0
37 %cmp2 = icmp eq ptr inttoptr (i64 115 to ptr), @Rf_gpptr
38 br i1 %cmp2, label %if.then, label %if.end7
40 if.then: ; preds = %entry
41 %sub2 = fsub double %sub, undef
42 %div.i = fdiv double %sub2, undef
43 %sub4 = fsub double %sub1, undef
44 %div.i16 = fdiv double %sub4, undef
45 %cmp = fcmp ogt double %div.i, %div.i16
46 br i1 %cmp, label %if.then6, label %if.end7
48 if.then6: ; preds = %if.then
51 if.end7: ; preds = %if.then6, %if.then, %entry
52 %g.0 = phi double [ 0.000000e+00, %if.then6 ], [ %sub, %if.then ], [ %sub, %entry ]
56 define void @Rf_GReset_unary_fneg() {
57 ; CHECK-LABEL: @Rf_GReset_unary_fneg(
59 ; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr @d, align 8
60 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> <double poison, double undef>, double [[TMP0]], i32 0
61 ; CHECK-NEXT: [[TMP2:%.*]] = fneg <2 x double> [[TMP1]]
62 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq ptr inttoptr (i64 115 to ptr), @Rf_gpptr
63 ; CHECK-NEXT: br i1 [[CMP2]], label [[IF_THEN:%.*]], label [[IF_END7:%.*]]
65 ; CHECK-NEXT: [[TMP3:%.*]] = fsub <2 x double> [[TMP2]], undef
66 ; CHECK-NEXT: [[TMP4:%.*]] = fdiv <2 x double> [[TMP3]], undef
67 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[TMP4]], i32 0
68 ; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x double> [[TMP4]], i32 1
69 ; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt double [[TMP6]], [[TMP5]]
70 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN6:%.*]], label [[IF_END7]]
72 ; CHECK-NEXT: br label [[IF_END7]]
74 ; CHECK-NEXT: ret void
77 %sub = fneg double undef
78 %0 = load double, ptr @d, align 8
79 %sub1 = fneg double %0
80 %cmp2 = icmp eq ptr inttoptr (i64 115 to ptr), @Rf_gpptr
81 br i1 %cmp2, label %if.then, label %if.end7
83 if.then: ; preds = %entry
84 %sub2 = fsub double %sub, undef
85 %div.i = fdiv double %sub2, undef
86 %sub4 = fsub double %sub1, undef
87 %div.i16 = fdiv double %sub4, undef
88 %cmp = fcmp ogt double %div.i, %div.i16
89 br i1 %cmp, label %if.then6, label %if.end7
91 if.then6: ; preds = %if.then
94 if.end7: ; preds = %if.then6, %if.then, %entry
95 %g.0 = phi double [ 0.000000e+00, %if.then6 ], [ %sub, %if.then ], [ %sub, %entry ]