; LLVM IR from NVIDIA/TensorRT :: plugin/skipLayerNormPlugin (skipLayerNormInt8InterleavedPlugin)

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

%"struct.nvinfer1::DynamicPluginTensorDesc" = type { %"struct.nvinfer1::PluginTensorDesc", %"class.nvinfer1::Dims64", %"class.nvinfer1::Dims64", %"class.nvinfer1::Dims64" }
%"struct.nvinfer1::PluginTensorDesc" = type { %"class.nvinfer1::Dims64", i32, i32, float }
%"class.nvinfer1::Dims64" = type { i32, [8 x i64] }

@.str = external hidden unnamed_addr constant [115 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.17 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@__func__._ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii = external hidden unnamed_addr constant [26 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [41 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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) #3

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

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) #3

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii(ptr noundef nonnull align 8 dereferenceable(193) %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  %16 = load ptr, ptr %7, align 8
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %36, label %19

19:                                               ; preds = %5
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str, ptr noundef @__func__._ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii, i32 noundef 387, i32 noundef 0, ptr noundef @.str.25) #6
          to label %20 unwind label %21

20:                                               ; preds = %19
  unreachable

21:                                               ; preds = %60, %49, %39, %19
  %22 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %12, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %13, align 4
  br label %25

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

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

33:                                               ; preds = %29
  invoke void @__cxa_end_catch()
          to label %34 unwind label %81

34:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %35

35:                                               ; preds = %34
  store i1 false, ptr %6, align 1
  br label %79

36:                                               ; preds = %5
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = icmp eq i32 %37, 2
  br i1 %38, label %41, label %39

39:                                               ; preds = %36
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str, ptr noundef @__func__._ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii, i32 noundef 388, i32 noundef 0, ptr noundef @.str.18) #6
          to label %40 unwind label %21

40:                                               ; preds = %39
  unreachable

41:                                               ; preds = %36
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %16, i64 16
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds ptr, ptr %44, i64 8
  %46 = load ptr, ptr %45, align 8
  %47 = call noundef i32 %46(ptr noundef nonnull align 8 dereferenceable(8) %43) #7
  %48 = icmp eq i32 %42, %47
  br i1 %48, label %51, label %49

49:                                               ; preds = %41
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str, ptr noundef @__func__._ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii, i32 noundef 389, i32 noundef 0, ptr noundef @.str.17) #6
          to label %50 unwind label %21

50:                                               ; preds = %49
  unreachable

51:                                               ; preds = %41
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = icmp sge i32 %52, 0
  br i1 %53, label %54, label %60

54:                                               ; preds = %51
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = add nsw i32 %56, %57
  %59 = icmp slt i32 %55, %58
  br i1 %59, label %62, label %60

60:                                               ; preds = %54, %51
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef @.str, ptr noundef @__func__._ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii, i32 noundef 390, i32 noundef 0, ptr noundef @.str.26) #6
          to label %61 unwind label %21

61:                                               ; preds = %60
  unreachable

62:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %63, i64 %65
  %67 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %66, i32 0, i32 0
  store ptr %67, ptr %14, align 8, !tbaa !5
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 8, !tbaa !13
  %71 = icmp eq i32 %70, 2
  br i1 %71, label %72, label %77

72:                                               ; preds = %62
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.nvinfer1::PluginTensorDesc", ptr %73, i32 0, i32 2
  %75 = load i32, ptr %74, align 4, !tbaa !19
  %76 = icmp eq i32 %75, 5
  br label %77

77:                                               ; preds = %72, %62
  %78 = phi i1 [ false, %62 ], [ %76, %72 ]
  store i1 %78, ptr %6, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %79

79:                                               ; preds = %77, %35
  %80 = load i1, ptr %6, align 1
  ret i1 %80

81:                                               ; preds = %33, %29
  %82 = landingpad { ptr, i32 }
          catch ptr null
  %83 = extractvalue { ptr, i32 } %82, 0
  call void @__clang_call_terminate(ptr %83) #8
  unreachable

84:                                               ; preds = %25
  %85 = load ptr, ptr %12, align 8
  call void @__clang_call_terminate(ptr %85) #8
  unreachable
}

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 = { nounwind memory(none) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { noreturn }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !16, i64 72}
!14 = !{!"_ZTSN8nvinfer116PluginTensorDescE", !15, i64 0, !16, i64 72, !17, i64 76, !18, i64 80}
!15 = !{!"_ZTSN8nvinfer16Dims64E", !10, i64 0, !7, i64 8}
!16 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!17 = !{!"_ZTSN8nvinfer112TensorFormatE", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!14, !17, i64 76}


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

%"struct.nvinfer1::DynamicPluginTensorDesc" = type { %"struct.nvinfer1::PluginTensorDesc", %"class.nvinfer1::Dims64", %"class.nvinfer1::Dims64", %"class.nvinfer1::Dims64" }
%"struct.nvinfer1::PluginTensorDesc" = type { %"class.nvinfer1::Dims64", i32, i32, float }
%"class.nvinfer1::Dims64" = type { i32, [8 x i64] }

@.str = external hidden unnamed_addr constant [115 x i8], align 1
@_ZTISt9exception = external constant ptr
@.str.17 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@__func__._ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii = external hidden unnamed_addr constant [26 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [41 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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 #3

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii(ptr noundef nonnull align 8 dereferenceable(193) %0, i32 noundef %1, ptr noundef readonly %2, i32 noundef %3, i32 noundef %4) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %.invoke, label %15

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

12:                                               ; preds = %6
  %13 = tail call ptr @__cxa_begin_catch(ptr %8) #5
  invoke void @_ZN8nvinfer16plugin11caughtErrorERKSt9exception(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %14 unwind label %41

14:                                               ; preds = %12
  invoke void @__cxa_end_catch()
          to label %40 unwind label %41

15:                                               ; preds = %5
  %16 = icmp eq i32 %3, 2
  br i1 %16, label %17, label %.invoke

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 64
  %21 = load ptr, ptr %20, align 8
  %22 = tail call noundef i32 %21(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %23 = icmp eq i32 %22, %4
  br i1 %23, label %24, label %.invoke

24:                                               ; preds = %17
  %25 = icmp sgt i32 %1, -1
  %26 = add nsw i32 %4, 2
  %27 = icmp sgt i32 %26, %1
  %or.cond = select i1 %25, i1 %27, i1 false
  br i1 %or.cond, label %30, label %.invoke

.invoke:                                          ; preds = %5, %24, %17, %15
  %28 = phi i32 [ 388, %15 ], [ 389, %17 ], [ 390, %24 ], [ 387, %5 ]
  %29 = phi ptr [ @.str.18, %15 ], [ @.str.17, %17 ], [ @.str.26, %24 ], [ @.str.25, %5 ]
  invoke void @_ZN8nvinfer16plugin16throwPluginErrorEPKcS2_iiS2_(ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN8nvinfer16plugin4bert34SkipLayerNormInterleavedPluginBase25supportsFormatCombinationEiPKNS_23DynamicPluginTensorDescEii, i32 noundef %28, i32 noundef 0, ptr noundef nonnull %29) #6
          to label %.cont unwind label %6

.cont:                                            ; preds = %.invoke
  unreachable

30:                                               ; preds = %24
  %31 = zext nneg i32 %1 to i64
  %32 = getelementptr inbounds %"struct.nvinfer1::DynamicPluginTensorDesc", ptr %2, i64 %31
  %33 = getelementptr inbounds i8, ptr %32, i64 72
  %34 = load i32, ptr %33, align 8, !tbaa !8
  %35 = icmp eq i32 %34, 2
  br i1 %35, label %36, label %40

36:                                               ; preds = %30
  %37 = getelementptr inbounds i8, ptr %32, i64 76
  %38 = load i32, ptr %37, align 4, !tbaa !16
  %39 = icmp eq i32 %38, 5
  br label %40

40:                                               ; preds = %30, %36, %14
  %.0 = phi i1 [ false, %14 ], [ false, %30 ], [ %39, %36 ]
  ret i1 %.0

41:                                               ; preds = %14, %12
  %42 = landingpad { ptr, i32 }
          catch ptr null
  %43 = extractvalue { ptr, i32 } %42, 0
  tail call void @__clang_call_terminate(ptr %43) #7
  unreachable

44:                                               ; preds = %6
  tail call void @__clang_call_terminate(ptr %8) #7
  unreachable
}

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 = { nofree nosync nounwind memory(none) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn }
attributes #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 72}
!9 = !{!"_ZTSN8nvinfer116PluginTensorDescE", !10, i64 0, !13, i64 72, !14, i64 76, !15, i64 80}
!10 = !{!"_ZTSN8nvinfer16Dims64E", !11, i64 0, !12, i64 8}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"_ZTSN8nvinfer18DataTypeE", !12, i64 0}
!14 = !{!"_ZTSN8nvinfer112TensorFormatE", !12, i64 0}
!15 = !{!"float", !12, i64 0}
!16 = !{!9, !14, i64 76}


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