-
-
Save alexanderkyte/aad21daf120b3c9eff78783cf2bfe79a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MethodImpl(MethodImplOptions.NoInlining)] | |
private static int SpanIndexOfInner (Span<byte> span) | |
{ | |
byte ByteLF = (byte)'\n'; | |
return span.IndexOf(ByteLF); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define hidden monocc i32 @SpanCrash_MainClass_SpanIndexOfInner_System_Span_1_byte(%"System.Span`1<byte>"* byval %arg_span) #5 gc "mono" { | |
BB0: | |
%0 = alloca i8, align 1 | |
%1 = alloca %"System.Span`1<byte>", align 8 | |
%2 = alloca %"System.Span`1<byte>", align 8 | |
%3 = alloca %"System.Span`1<byte>", align 8 | |
%4 = alloca %"System.Span`1<byte>", align 8 | |
%5 = alloca %"System.Span`1<byte>", align 8 | |
br label %INIT_BB1 | |
INIT_BB1: ; preds = %BB0 | |
%is_inited = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @mono_inited, i32 0, i32 0) | |
%6 = call i8 @llvm.expect.i8(i8 %is_inited, i8 1) | |
%7 = icmp eq i8 %6, 0 | |
br i1 %7, label %NOTINITED_BB3, label %INITED_BB2 | |
INITED_BB2: ; preds = %NOTINITED_BB3, %INIT_BB1 | |
br label %BB3 | |
BB3: ; preds = %INITED_BB2 | |
br label %BB2 | |
BB2: ; preds = %BB3 | |
%8 = bitcast %"System.Span`1<byte>"* %arg_span to i8* | |
%9 = bitcast %"System.Span`1<byte>"* %1 to i8* | |
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %9, i8* %8, i32 24, i32 0, i1 false) | |
store i8 10, i8* %0 | |
br label %BB8 | |
BB8: ; preds = %BB2 | |
%TYPE_FROM_HANDLE_30 = load i64*, i64** getelementptr inbounds ([0 x i64*], [0 x i64*]* bitcast (%MONO_GOT_SpanCrash.exe* @mono_aot_SpanCrash_llvm_got to [0 x i64*]*), i32 0, i32 30), !invariant.load !14 | |
%TYPE_FROM_HANDLE_31 = load i64*, i64** getelementptr inbounds ([0 x i64*], [0 x i64*]* bitcast (%MONO_GOT_SpanCrash.exe* @mono_aot_SpanCrash_llvm_got to [0 x i64*]*), i32 0, i32 31), !invariant.load !14 | |
%10 = icmp eq i64* %TYPE_FROM_HANDLE_30, %TYPE_FROM_HANDLE_31 | |
%t29 = zext i1 %10 to i32 | |
%11 = icmp eq i32 %t29, 0 | |
br i1 %11, label %BB10, label %BB11 | |
BB10: ; preds = %BB8 | |
%TYPE_FROM_HANDLE_301 = load i64*, i64** getelementptr inbounds ([0 x i64*], [0 x i64*]* bitcast (%MONO_GOT_SpanCrash.exe* @mono_aot_SpanCrash_llvm_got to [0 x i64*]*), i32 0, i32 30), !invariant.load !14 | |
%TYPE_FROM_HANDLE_32 = load i64*, i64** getelementptr inbounds ([0 x i64*], [0 x i64*]* bitcast (%MONO_GOT_SpanCrash.exe* @mono_aot_SpanCrash_llvm_got to [0 x i64*]*), i32 0, i32 32), !invariant.load !14 | |
%12 = icmp eq i64* %TYPE_FROM_HANDLE_301, %TYPE_FROM_HANDLE_32 | |
%t55 = zext i1 %12 to i32 | |
%13 = icmp eq i32 %t55, 0 | |
br i1 %13, label %BB12, label %BB13 | |
BB11: ; preds = %BB8 | |
%14 = bitcast %"System.Span`1<byte>"* %1 to i8* | |
%15 = bitcast %"System.Span`1<byte>"* %3 to i8* | |
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %15, i8* %14, i32 24, i32 0, i1 false) | |
%16 = notail call monocc i64* @p_1_plt_System_Runtime_InteropServices_MemoryMarshal_GetReference_byte_System_Span_1_byte_llvm(%"System.Span`1<byte>"* byval %3) | |
%17 = load volatile i8, i8* %0 | |
%18 = zext i8 %17 to i32 | |
%19 = bitcast %"System.Span`1<byte>"* %1 to i32* | |
%20 = getelementptr i32, i32* %19, i32 4 | |
%t48 = load volatile i32, i32* %20 | |
%21 = notail call monocc i32 @p_4_plt_System_SpanHelpers_IndexOf_byte__byte_int_llvm(i64* %16, i32 %18, i32 %t48) | |
br label %BB7 | |
BB12: ; preds = %BB10 | |
%22 = bitcast %"System.Span`1<byte>"* %1 to i8* | |
%23 = bitcast %"System.Span`1<byte>"* %5 to i8* | |
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %23, i8* %22, i32 24, i32 0, i1 false) | |
%24 = notail call monocc i64* @p_1_plt_System_Runtime_InteropServices_MemoryMarshal_GetReference_byte_System_Span_1_byte_llvm(%"System.Span`1<byte>"* byval %5) | |
%25 = load volatile i8, i8* %0 | |
%26 = zext i8 %25 to i32 | |
%27 = bitcast %"System.Span`1<byte>"* %1 to i32* | |
%28 = getelementptr i32, i32* %27, i32 4 | |
%t88 = load volatile i32, i32* %28 | |
%29 = notail call monocc i32 @p_2_plt_System_SpanHelpers_IndexOf_byte_byte__byte_int_llvm(i64* %24, i32 %26, i32 %t88) | |
br label %BB7 | |
BB13: ; preds = %BB10 | |
%30 = bitcast %"System.Span`1<byte>"* %1 to i8* | |
%31 = bitcast %"System.Span`1<byte>"* %4 to i8* | |
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %31, i8* %30, i32 24, i32 0, i1 false) | |
%32 = notail call monocc i64* @p_1_plt_System_Runtime_InteropServices_MemoryMarshal_GetReference_byte_System_Span_1_byte_llvm(%"System.Span`1<byte>"* byval %4) | |
%33 = bitcast i8* %0 to i16* | |
%34 = load i16, i16* %33 | |
%35 = zext i16 %34 to i32 | |
%36 = bitcast %"System.Span`1<byte>"* %1 to i32* | |
%37 = getelementptr i32, i32* %36, i32 4 | |
%t74 = load volatile i32, i32* %37 | |
%38 = notail call monocc i32 @p_3_plt_System_SpanHelpers_IndexOf_char__char_int_llvm(i64* %32, i32 %35, i32 %t74) | |
br label %BB7 | |
BB7: ; preds = %BB13, %BB12, %BB11 | |
%39 = phi i32 [ %21, %BB11 ], [ %38, %BB13 ], [ %29, %BB12 ] | |
br label %BB4 | |
BB4: ; preds = %BB7 | |
br label %BB1 | |
BB1: ; preds = %BB4 | |
ret i32 %39 | |
NOTINITED_BB3: ; preds = %INIT_BB1 | |
call monocc void @mono_aot_SpanCrashinit_method(i32 0) | |
br label %INITED_BB2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment