; LLVM IR from NVIDIA/TensorRT :: plugin/leakyReluPlugin (lReluPlugin)

; 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::plugin::LReLU" = type { %"class.nvinfer1::pluginInternal::BasePlugin", float, i32 }
%"class.nvinfer1::pluginInternal::BasePlugin" = type { %"class.nvinfer1::IPluginV2", %"class.std::__cxx11::basic_string" }
%"class.nvinfer1::IPluginV2" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.nvinfer1::Dims64" = type { i32, [8 x i64] }

@.str = external hidden unnamed_addr constant [88 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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

declare void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef, ptr noundef, i32 noundef) #1

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

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

21:                                               ; preds = %8
  %22 = load i32, ptr %15, align 4, !tbaa !13
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %26, label %24

24:                                               ; preds = %21, %8
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.7, ptr noundef @.str, i32 noundef 84)
          to label %25 unwind label %63

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25, %21
  %27 = getelementptr inbounds %"class.nvinfer1::plugin::LReLU", ptr %18, i32 0, i32 2
  %28 = load i32, ptr %27, align 4, !tbaa !15
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %32, label %30

30:                                               ; preds = %26
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.8, ptr noundef @.str, i32 noundef 85)
          to label %31 unwind label %63

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31, %26
  %33 = load i32, ptr %13, align 4, !tbaa !9
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %37, label %35

35:                                               ; preds = %32
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef @.str.9, ptr noundef @.str, i32 noundef 86)
          to label %36 unwind label %63

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %59, %37
  %39 = load i32, ptr %17, align 4, !tbaa !9
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %40, i64 0
  %42 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !23
  %44 = icmp slt i32 %39, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %62

46:                                               ; preds = %38
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %47, i64 0
  %49 = getelementptr inbounds %"class.nvinfer1::Dims64", ptr %48, i32 0, i32 1
  %50 = load i32, ptr %17, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [8 x i64], ptr %49, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !25
  %54 = getelementptr inbounds %"class.nvinfer1::plugin::LReLU", ptr %18, i32 0, i32 2
  %55 = load i32, ptr %54, align 4, !tbaa !15
  %56 = sext i32 %55 to i64
  %57 = mul nsw i64 %56, %53
  %58 = trunc i64 %57 to i32
  store i32 %58, ptr %54, align 4, !tbaa !15
  br label %59

59:                                               ; preds = %46
  %60 = load i32, ptr %17, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %17, align 4, !tbaa !9
  br label %38, !llvm.loop !26

62:                                               ; preds = %45
  ret void

63:                                               ; preds = %35, %30, %24
  %64 = landingpad { ptr, i32 }
          catch ptr null
  %65 = extractvalue { ptr, i32 } %64, 0
  call void @__clang_call_terminate(ptr %65) #5
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = { 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"_ZTSN8nvinfer18DataTypeE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN8nvinfer112TensorFormatE", !7, i64 0}
!15 = !{!16, !10, i64 44}
!16 = !{!"_ZTSN8nvinfer16plugin5LReLUE", !17, i64 0, !22, i64 40, !10, i64 44}
!17 = !{!"_ZTSN8nvinfer114pluginInternal10BasePluginE", !18, i64 0, !19, i64 8}
!18 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"float", !7, i64 0}
!23 = !{!24, !10, i64 0}
!24 = !{!"_ZTSN8nvinfer16Dims64E", !10, i64 0, !7, i64 8}
!25 = !{!21, !21, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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

@.str = external hidden unnamed_addr constant [88 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1

declare i32 @__gxx_personality_v0(...)

declare void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8nvinfer16plugin5LReLU19configureWithFormatEPKNS_6Dims64EiS4_iNS_8DataTypeENS_12TensorFormatEi(ptr nocapture noundef nonnull align 8 dereferenceable(48) %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr nocapture noundef readnone %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %9 = or i32 %6, %5
  %or.cond = icmp eq i32 %9, 0
  br i1 %or.cond, label %11, label %10

10:                                               ; preds = %8
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str, i32 noundef 84)
          to label %11 unwind label %64

11:                                               ; preds = %10, %8
  %12 = getelementptr inbounds i8, ptr %0, i64 44
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = icmp eq i32 %13, 1
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str, i32 noundef 85)
          to label %16 unwind label %64

16:                                               ; preds = %15, %11
  %17 = icmp eq i32 %4, 1
  br i1 %17, label %19, label %18

18:                                               ; preds = %16
  invoke void @_ZN8nvinfer16plugin15reportAssertionEPKcS2_i(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str, i32 noundef 86)
          to label %19 unwind label %64

19:                                               ; preds = %18, %16
  %20 = load i32, ptr %1, align 8, !tbaa !17
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %29

.lr.ph:                                           ; preds = %19
  %.promoted = load i32, ptr %12, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %1, i64 8
  %wide.trip.count = zext nneg i32 %20 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %23 = icmp ult i32 %20, 8
  br i1 %23, label %._crit_edge.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483640
  br label %30

._crit_edge.unr-lcssa:                            ; preds = %30, %.lr.ph
  %.lcssa.ph = phi i32 [ poison, %.lr.ph ], [ %63, %30 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.7, %30 ]
  %.unr = phi i32 [ %.promoted, %.lr.ph ], [ %63, %30 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.unr-lcssa ]
  %24 = phi i32 [ %28, %.epil.preheader ], [ %.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.unr-lcssa ]
  %25 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv.epil
  %26 = load i64, ptr %25, align 8, !tbaa !19
  %27 = trunc i64 %26 to i32
  %28 = mul i32 %24, %27
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !20

._crit_edge:                                      ; preds = %.epil.preheader, %._crit_edge.unr-lcssa
  %.lcssa = phi i32 [ %.lcssa.ph, %._crit_edge.unr-lcssa ], [ %28, %.epil.preheader ]
  store i32 %.lcssa, ptr %12, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %._crit_edge, %19
  ret void

30:                                               ; preds = %30, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.7, %30 ]
  %31 = phi i32 [ %.promoted, %.lr.ph.new ], [ %63, %30 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.7, %30 ]
  %32 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv
  %33 = load i64, ptr %32, align 8, !tbaa !19
  %34 = trunc i64 %33 to i32
  %35 = mul i32 %31, %34
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %36 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv.next
  %37 = load i64, ptr %36, align 8, !tbaa !19
  %38 = trunc i64 %37 to i32
  %39 = mul i32 %35, %38
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %40 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv.next.1
  %41 = load i64, ptr %40, align 8, !tbaa !19
  %42 = trunc i64 %41 to i32
  %43 = mul i32 %39, %42
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %44 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv.next.2
  %45 = load i64, ptr %44, align 8, !tbaa !19
  %46 = trunc i64 %45 to i32
  %47 = mul i32 %43, %46
  %indvars.iv.next.3 = or disjoint i64 %indvars.iv, 4
  %48 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv.next.3
  %49 = load i64, ptr %48, align 8, !tbaa !19
  %50 = trunc i64 %49 to i32
  %51 = mul i32 %47, %50
  %indvars.iv.next.4 = or disjoint i64 %indvars.iv, 5
  %52 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv.next.4
  %53 = load i64, ptr %52, align 8, !tbaa !19
  %54 = trunc i64 %53 to i32
  %55 = mul i32 %51, %54
  %indvars.iv.next.5 = or disjoint i64 %indvars.iv, 6
  %56 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv.next.5
  %57 = load i64, ptr %56, align 8, !tbaa !19
  %58 = trunc i64 %57 to i32
  %59 = mul i32 %55, %58
  %indvars.iv.next.6 = or disjoint i64 %indvars.iv, 7
  %60 = getelementptr inbounds [8 x i64], ptr %22, i64 0, i64 %indvars.iv.next.6
  %61 = load i64, ptr %60, align 8, !tbaa !19
  %62 = trunc i64 %61 to i32
  %63 = mul i32 %59, %62
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge.unr-lcssa, label %30, !llvm.loop !22

64:                                               ; preds = %18, %15, %10
  %65 = landingpad { ptr, i32 }
          catch ptr null
  %66 = extractvalue { ptr, i32 } %65, 0
  tail call void @__clang_call_terminate(ptr %66) #3
  unreachable
}

attributes #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 #1 = { 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 #2 = { 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 #3 = { 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, !16, i64 44}
!6 = !{!"_ZTSN8nvinfer16plugin5LReLUE", !7, i64 0, !15, i64 40, !16, i64 44}
!7 = !{!"_ZTSN8nvinfer114pluginInternal10BasePluginE", !8, i64 0, !9, i64 8}
!8 = !{!"_ZTSN8nvinfer19IPluginV2E"}
!9 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !10, i64 0, !14, i64 8, !12, i64 16}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"float", !12, i64 0}
!16 = !{!"int", !12, i64 0}
!17 = !{!18, !16, i64 0}
!18 = !{!"_ZTSN8nvinfer16Dims64E", !16, i64 0, !12, i64 8}
!19 = !{!14, !14, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass