1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=instcombine -S %s | FileCheck %s
4 @g1 = external global i16
5 @g2 = external global i16
7 define float @patatino() {
8 ; CHECK-LABEL: @patatino(
9 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr getelementptr inbounds (i8, ptr @g2, i64 2), @g1
10 ; CHECK-NEXT: [[FMUL:%.*]] = uitofp i1 [[CMP]] to float
11 ; CHECK-NEXT: ret float [[FMUL]]
13 %cmp = icmp eq ptr getelementptr inbounds (i16, ptr @g2, i64 1), @g1
14 %uitofp1 = uitofp i1 %cmp to float
15 %uitofp2 = uitofp i1 %cmp to float
16 %fmul = fmul float %uitofp1, %uitofp2
17 %call = call float @fabsf(float %fmul)
21 declare float @fabsf(float)