1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -sroa -S | FileCheck %s
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
6 define float @_Z8stdclampfff(float %x, float %lo, float %hi) {
7 ; CHECK-LABEL: @_Z8stdclampfff(
9 ; CHECK-NEXT: [[I4:%.*]] = alloca float, align 4
10 ; CHECK-NEXT: store float [[HI:%.*]], float* [[I4]], align 4
11 ; CHECK-NEXT: [[I5:%.*]] = fcmp fast olt float [[X:%.*]], [[LO:%.*]]
12 ; CHECK-NEXT: [[I6:%.*]] = fcmp fast olt float [[HI]], [[X]]
13 ; CHECK-NEXT: [[I9_SROA_SPECULATE_LOAD_FALSE_SROA_SPECULATE_LOAD_TRUE:%.*]] = load float, float* [[I4]], align 4
14 ; CHECK-NEXT: [[I9_SROA_SPECULATE_LOAD_FALSE_SROA_SPECULATED:%.*]] = select i1 [[I6]], float [[I9_SROA_SPECULATE_LOAD_FALSE_SROA_SPECULATE_LOAD_TRUE]], float [[X]]
15 ; CHECK-NEXT: [[I9_SROA_SPECULATED:%.*]] = select i1 [[I5]], float [[LO]], float [[I9_SROA_SPECULATE_LOAD_FALSE_SROA_SPECULATED]]
16 ; CHECK-NEXT: ret float [[I9_SROA_SPECULATED]]
19 %i = alloca float, align 4
20 %i3 = alloca float, align 4
21 %i4 = alloca float, align 4
22 store float %x, float* %i, align 4
23 store float %lo, float* %i3, align 4
24 store float %hi, float* %i4, align 4
25 %i5 = fcmp fast olt float %x, %lo
26 %i6 = fcmp fast olt float %hi, %x
27 %i7 = select i1 %i6, float* %i4, float* %i
28 %i8 = select i1 %i5, float* %i3, float* %i7
29 %i9 = load float, float* %i8, align 4