; LLVM IR from ermig1979/Simd :: src/Test/TestFloat16.ll (ZN4Test24DifferenceSum16fAutoTestEfRKNS_5FuncSES2_PFvPKfS4_mPfE)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@_ZN4Test1WE = external global i32, align 4
@_ZN4Test1HE = external global i32, align 4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Test24DifferenceSum16fAutoTestEifRKNS_5FuncSES2_PFvPKfS4_mPfE(i32 noundef, float noundef, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Test24DifferenceSum16fAutoTestEfRKNS_5FuncSES2_PFvPKfS4_mPfE(float noundef %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef %3) #1 {
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  store float %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #2
  store i8 1, ptr %9, align 1, !tbaa !11
  %10 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %11 = trunc i8 %10 to i1
  br i1 %11, label %12, label %21

12:                                               ; preds = %4
  %13 = load i32, ptr @_ZN4Test1WE, align 4, !tbaa !15
  %14 = load i32, ptr @_ZN4Test1HE, align 4, !tbaa !15
  %15 = mul nsw i32 %13, %14
  %16 = load float, ptr %5, align 4, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !9
  %18 = load ptr, ptr %7, align 8, !tbaa !9
  %19 = load ptr, ptr %8, align 8, !tbaa !9
  %20 = call noundef zeroext i1 @_ZN4Test24DifferenceSum16fAutoTestEifRKNS_5FuncSES2_PFvPKfS4_mPfE(i32 noundef %15, float noundef %16, ptr noundef nonnull align 8 dereferenceable(40) %17, ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef %19)
  br label %21

21:                                               ; preds = %12, %4
  %22 = phi i1 [ false, %4 ], [ %20, %12 ]
  %23 = zext i1 %22 to i8
  store i8 %23, ptr %9, align 1, !tbaa !11
  %24 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %25 = trunc i8 %24 to i1
  br i1 %25, label %26, label %36

26:                                               ; preds = %21
  %27 = load i32, ptr @_ZN4Test1WE, align 4, !tbaa !15
  %28 = load i32, ptr @_ZN4Test1HE, align 4, !tbaa !15
  %29 = mul nsw i32 %27, %28
  %30 = sub nsw i32 %29, 9
  %31 = load float, ptr %5, align 4, !tbaa !5
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = load ptr, ptr %7, align 8, !tbaa !9
  %34 = load ptr, ptr %8, align 8, !tbaa !9
  %35 = call noundef zeroext i1 @_ZN4Test24DifferenceSum16fAutoTestEifRKNS_5FuncSES2_PFvPKfS4_mPfE(i32 noundef %30, float noundef %31, ptr noundef nonnull align 8 dereferenceable(40) %32, ptr noundef nonnull align 8 dereferenceable(40) %33, ptr noundef %34)
  br label %36

36:                                               ; preds = %26, %21
  %37 = phi i1 [ false, %21 ], [ %35, %26 ]
  %38 = zext i1 %37 to i8
  store i8 %38, ptr %9, align 1, !tbaa !11
  %39 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %40 = trunc i8 %39 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  ret i1 %40
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@_ZN4Test1WE = external local_unnamed_addr global i32, align 4
@_ZN4Test1HE = external local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Test24DifferenceSum16fAutoTestEifRKNS_5FuncSES2_PFvPKfS4_mPfE(i32 noundef, float noundef, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Test24DifferenceSum16fAutoTestEfRKNS_5FuncSES2_PFvPKfS4_mPfE(float noundef %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = load i32, ptr @_ZN4Test1WE, align 4, !tbaa !5
  %6 = load i32, ptr @_ZN4Test1HE, align 4, !tbaa !5
  %7 = mul nsw i32 %6, %5
  %8 = tail call noundef zeroext i1 @_ZN4Test24DifferenceSum16fAutoTestEifRKNS_5FuncSES2_PFvPKfS4_mPfE(i32 noundef %7, float noundef %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef %3)
  br i1 %8, label %9, label %15

9:                                                ; preds = %4
  %10 = load i32, ptr @_ZN4Test1WE, align 4, !tbaa !5
  %11 = load i32, ptr @_ZN4Test1HE, align 4, !tbaa !5
  %12 = mul nsw i32 %11, %10
  %13 = add nsw i32 %12, -9
  %14 = tail call noundef zeroext i1 @_ZN4Test24DifferenceSum16fAutoTestEifRKNS_5FuncSES2_PFvPKfS4_mPfE(i32 noundef %13, float noundef %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef %3)
  br label %15

15:                                               ; preds = %9, %4
  %16 = phi i1 [ false, %4 ], [ %14, %9 ]
  ret i1 %16
}

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass