1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -S -data-layout="E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64" | FileCheck %s
4 define void @PR35618(ptr %st1, ptr %st2) {
5 ; CHECK-LABEL: @PR35618(
6 ; CHECK-NEXT: [[Y1:%.*]] = alloca double, align 8
7 ; CHECK-NEXT: [[Z1:%.*]] = alloca double, align 8
8 ; CHECK-NEXT: [[LD1:%.*]] = load double, ptr [[Y1]], align 8
9 ; CHECK-NEXT: [[LD2:%.*]] = load double, ptr [[Z1]], align 8
10 ; CHECK-NEXT: [[TMP10:%.*]] = fcmp olt double [[LD1]], [[LD2]]
11 ; CHECK-NEXT: [[TMP12_V:%.*]] = select i1 [[TMP10]], double [[LD1]], double [[LD2]]
12 ; CHECK-NEXT: store double [[TMP12_V]], ptr [[ST1:%.*]], align 8
13 ; CHECK-NEXT: store double [[TMP12_V]], ptr [[ST2:%.*]], align 8
14 ; CHECK-NEXT: ret void
18 %ld1 = load double, ptr %y1
19 %ld2 = load double, ptr %z1
20 %tmp10 = fcmp olt double %ld1, %ld2
21 %sel = select i1 %tmp10, ptr %y1, ptr %z1
22 %tmp12 = load i64, ptr %sel
23 store i64 %tmp12, ptr %st1
24 store i64 %tmp12, ptr %st2