1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes='sroa<preserve-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-PRESERVE-CFG
3 ; RUN: opt < %s -passes='sroa<modify-cfg>' -S | FileCheck %s --check-prefixes=CHECK,CHECK-MODIFY-CFG
5 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
7 define float @_Z8stdclampfff(float %x, float %lo, float %hi) {
8 ; CHECK-LABEL: @_Z8stdclampfff(
10 ; CHECK-NEXT: [[I4:%.*]] = alloca float, align 4
11 ; CHECK-NEXT: store float [[HI:%.*]], ptr [[I4]], align 4
12 ; CHECK-NEXT: [[I5:%.*]] = fcmp fast olt float [[X:%.*]], [[LO:%.*]]
13 ; CHECK-NEXT: [[I6:%.*]] = fcmp fast olt float [[HI]], [[X]]
14 ; CHECK-NEXT: [[I9_SROA_SPECULATE_LOAD_FALSE_SROA_SPECULATE_LOAD_TRUE:%.*]] = load float, ptr [[I4]], align 4
15 ; CHECK-NEXT: [[I9_SROA_SPECULATE_LOAD_FALSE_SROA_SPECULATED:%.*]] = select i1 [[I6]], float [[I9_SROA_SPECULATE_LOAD_FALSE_SROA_SPECULATE_LOAD_TRUE]], float [[X]]
16 ; CHECK-NEXT: [[I9_SROA_SPECULATED:%.*]] = select i1 [[I5]], float [[LO]], float [[I9_SROA_SPECULATE_LOAD_FALSE_SROA_SPECULATED]]
17 ; CHECK-NEXT: ret float [[I9_SROA_SPECULATED]]
20 %i = alloca float, align 4
21 %i3 = alloca float, align 4
22 %i4 = alloca float, align 4
23 store float %x, ptr %i, align 4
24 store float %lo, ptr %i3, align 4
25 store float %hi, ptr %i4, align 4
26 %i5 = fcmp fast olt float %x, %lo
27 %i6 = fcmp fast olt float %hi, %x
28 %i7 = select i1 %i6, ptr %i4, ptr %i
29 %i8 = select i1 %i5, ptr %i3, ptr %i7
30 %i9 = load float, ptr %i8, align 4
33 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
34 ; CHECK-MODIFY-CFG: {{.*}}
35 ; CHECK-PRESERVE-CFG: {{.*}}