; LLVM IR from NVIDIA/TensorRT :: plugin/groupNormalizationPlugin (groupNormalizationPlugin)

; 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"

%"class.nvinfer1::DimsExprs" = type { i32, [8 x ptr] }

@.str = external hidden unnamed_addr constant [110 x i8], align 1
@_ZTISt9exception = external constant ptr
@__func__._ZN8nvinfer16plugin24GroupNormalizationPlugin19getOutputDimensionsEiPKNS_9DimsExprsEiRNS_12IExprBuilderE = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: noreturn
declare void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin24GroupNormalizationPlugin19getOutputDimensionsEiPKNS_9DimsExprsEiRNS_12IExprBuilderE(ptr dead_on_unwind noalias writable sret(%"class.nvinfer1::DimsExprs") align 8 %0, ptr noundef nonnull align 8 dereferenceable(136) %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(16) %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !9
  store ptr %5, ptr %11, align 8, !tbaa !5
  %15 = load ptr, ptr %7, align 8
  %16 = load i32, ptr %10, align 4, !tbaa !9
  %17 = icmp eq i32 %16, 3
  br i1 %17, label %35, label %18

18:                                               ; preds = %6
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str, ptr noundef @__func__._ZN8nvinfer16plugin24GroupNormalizationPlugin19getOutputDimensionsEiPKNS_9DimsExprsEiRNS_12IExprBuilderE, i32 noundef 83, i32 noundef 0, ptr noundef @.str.6) #8
          to label %19 unwind label %20

19:                                               ; preds = %18
  unreachable

20:                                               ; preds = %38, %18
  %21 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %12, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %13, align 4
  br label %24

24:                                               ; preds = %20
  %25 = load i32, ptr %13, align 4
  %26 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #9
  %27 = icmp eq i32 %25, %26
  br i1 %27, label %28, label %49

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %29 = load ptr, ptr %12, align 8
  %30 = call ptr @__cxa_begin_catch(ptr %29) #9
  store ptr %30, ptr %14, align 8
  %31 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %32 unwind label %46

32:                                               ; preds = %28
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 72, i1 false)
  %33 = getelementptr inbounds %"class.nvinfer1::DimsExprs", ptr %0, i32 0, i32 0
  %34 = getelementptr inbounds %"class.nvinfer1::DimsExprs", ptr %0, i32 0, i32 1
  invoke void @__cxa_end_catch()
          to label %43 unwind label %46

35:                                               ; preds = %6
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %40, label %38

38:                                               ; preds = %35
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str, ptr noundef @__func__._ZN8nvinfer16plugin24GroupNormalizationPlugin19getOutputDimensionsEiPKNS_9DimsExprsEiRNS_12IExprBuilderE, i32 noundef 84, i32 noundef 0, ptr noundef @.str.7) #8
          to label %39 unwind label %20

39:                                               ; preds = %38
  unreachable

40:                                               ; preds = %35
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.nvinfer1::DimsExprs", ptr %41, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %42, i64 72, i1 false), !tbaa.struct !11
  br label %45

43:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  br label %45

44:                                               ; No predecessors!
  unreachable

45:                                               ; preds = %43, %40
  ret void

46:                                               ; preds = %32, %28
  %47 = landingpad { ptr, i32 }
          catch ptr null
  %48 = extractvalue { ptr, i32 } %47, 0
  call void @__clang_call_terminate(ptr %48) #10
  unreachable

49:                                               ; preds = %24
  %50 = load ptr, ptr %12, align 8
  call void @__clang_call_terminate(ptr %50) #10
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #3

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #4

declare ptr @__cxa_begin_catch(ptr)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

declare void @__cxa_end_catch()

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

attributes #0 = { noreturn "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 #1 = { mustprogress nounwind 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind memory(none) }
attributes #4 = { noinline noreturn nounwind uwtable "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 #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { noreturn }
attributes #9 = { nounwind }
attributes #10 = { noreturn 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 4, !9, i64 8, i64 64, !12}
!12 = !{!7, !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"

%"class.nvinfer1::DimsExprs" = type { i32, [8 x ptr] }

@.str = external hidden unnamed_addr constant [110 x i8], align 1
@_ZTISt9exception = external constant ptr
@__func__._ZN8nvinfer16plugin24GroupNormalizationPlugin19getOutputDimensionsEiPKNS_9DimsExprsEiRNS_12IExprBuilderE = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: noreturn
declare void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin24GroupNormalizationPlugin19getOutputDimensionsEiPKNS_9DimsExprsEiRNS_12IExprBuilderE(ptr dead_on_unwind noalias nocapture writable writeonly sret(%"class.nvinfer1::DimsExprs") align 8 %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(136) %1, i32 noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4, ptr nocapture noundef nonnull readnone align 8 dereferenceable(16) %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = icmp eq i32 %4, 3
  br i1 %7, label %17, label %.invoke

8:                                                ; preds = %.invoke
  %9 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %10 = extractvalue { ptr, i32 } %9, 0
  %11 = extractvalue { ptr, i32 } %9, 1
  %12 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #7
  %13 = icmp eq i32 %11, %12
  br i1 %13, label %14, label %26

14:                                               ; preds = %8
  %15 = tail call ptr @__cxa_begin_catch(ptr %10) #7
  invoke void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %16 unwind label %23

16:                                               ; preds = %14
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %0, i8 0, i64 72, i1 false)
  invoke void @__cxa_end_catch()
          to label %22 unwind label %23

17:                                               ; preds = %6
  %18 = icmp eq i32 %2, 0
  br i1 %18, label %21, label %.invoke

.invoke:                                          ; preds = %6, %17
  %19 = phi i32 [ 84, %17 ], [ 83, %6 ]
  %20 = phi ptr [ @.str.7, %17 ], [ @.str.6, %6 ]
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN8nvinfer16plugin24GroupNormalizationPlugin19getOutputDimensionsEiPKNS_9DimsExprsEiRNS_12IExprBuilderE, i32 noundef %19, i32 noundef 0, ptr noundef nonnull %20) #8
          to label %.cont unwind label %8

.cont:                                            ; preds = %.invoke
  unreachable

21:                                               ; preds = %17
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %3, i64 72, i1 false), !tbaa.struct !5
  br label %22

22:                                               ; preds = %16, %21
  ret void

23:                                               ; preds = %16, %14
  %24 = landingpad { ptr, i32 }
          catch ptr null
  %25 = extractvalue { ptr, i32 } %24, 0
  tail call void @__clang_call_terminate(ptr %25) #9
  unreachable

26:                                               ; preds = %8
  tail call void @__clang_call_terminate(ptr %10) #9
  unreachable
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #3

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #4

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

declare void @__cxa_end_catch() local_unnamed_addr

attributes #0 = { noreturn "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 #1 = { mustprogress nounwind 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nosync nounwind memory(none) }
attributes #4 = { noinline noreturn nounwind uwtable "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 #5 = { inlinehint 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }
attributes #9 = { noreturn 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 = !{i64 0, i64 4, !6, i64 8, i64 64, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!8, !8, i64 0}


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