From 15badfe3bcd8858d9f525bf8b6d3a4a181944a2e Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Sat, 30 Apr 2022 09:06:39 -0400 Subject: [PATCH 01/11] Add a new LLVMArgStorage type --- src/mono/mono/mini/intrinsics.c | 4 + src/mono/mono/mini/mini-amd64.c | 16 + src/mono/mono/mini/mini-llvm.c | 17 + src/mono/mono/mini/mini.h | 2 + src/mono/mono/mini/simd-intrinsics.c | 2 + src/mono/sample/HelloWorld/Program.cs | 29 +- src/mono/sample/HelloWorld/log_llvm.txt | 409 ++++++++++++ src/mono/sample/HelloWorld/log_llvm_add.txt | 407 ++++++++++++ src/mono/sample/HelloWorld/log_llvm_main.txt | 652 +++++++++++++++++++ src/mono/sample/HelloWorld/log_llvm_test.txt | 404 ++++++++++++ src/mono/sample/HelloWorld/log_nollvm.txt | 478 ++++++++++++++ src/mono/sample/HelloWorld/log_v64_llvm.txt | 394 +++++++++++ 12 files changed, 2805 insertions(+), 9 deletions(-) create mode 100644 src/mono/sample/HelloWorld/log_llvm.txt create mode 100644 src/mono/sample/HelloWorld/log_llvm_add.txt create mode 100644 src/mono/sample/HelloWorld/log_llvm_main.txt create mode 100644 src/mono/sample/HelloWorld/log_llvm_test.txt create mode 100644 src/mono/sample/HelloWorld/log_nollvm.txt create mode 100644 src/mono/sample/HelloWorld/log_v64_llvm.txt diff --git a/src/mono/mono/mini/intrinsics.c b/src/mono/mono/mini/intrinsics.c index 25d89f2ddcfe41..09a326a8215a30 100644 --- a/src/mono/mono/mini/intrinsics.c +++ b/src/mono/mono/mini/intrinsics.c @@ -2040,6 +2040,10 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } } } + if (!strcmp(cmethod->name, "Min") && !strcmp(cmethod_klass_name, "Vector128")){ + printf ("mini_emit_inst_for Min\n"); + } + #ifdef MONO_ARCH_SIMD_INTRINSICS if (cfg->opt & MONO_OPT_SIMD) { diff --git a/src/mono/mono/mini/mini-amd64.c b/src/mono/mono/mini/mini-amd64.c index 6b4d0bcdb8dd1c..159313736a235d 100644 --- a/src/mono/mono/mini/mini-amd64.c +++ b/src/mono/mono/mini/mini-amd64.c @@ -2124,6 +2124,14 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) return linfo; } + if (sig_ret->type == MONO_TYPE_GENERICINST) { + MonoClass *klass = mono_class_from_mono_type_internal (sig_ret); + if (!strcmp (m_class_get_name (klass), "Vector128`1")) { + linfo->ret.storage = LLVMArgVtypeInSIMDReg; + break; + } + } + linfo->ret.storage = LLVMArgVtypeInReg; for (j = 0; j < 2; ++j) linfo->ret.pair_storage [j] = arg_storage_to_llvm_arg_storage (cfg, ainfo->pair_storage [j]); @@ -2174,6 +2182,14 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) return linfo; } + if (t->type == MONO_TYPE_GENERICINST) { + MonoClass *klass = mono_class_from_mono_type_internal (t); + if (!strcmp (m_class_get_name (klass), "Vector128`1")) { + linfo->args [i].storage = LLVMArgVtypeInSIMDReg; + break; + } + } + linfo->args [i].storage = LLVMArgVtypeInReg; for (j = 0; j < 2; ++j) linfo->args [i].pair_storage [j] = arg_storage_to_llvm_arg_storage (cfg, ainfo->pair_storage [j]); diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 1b7dae198644cb..6910eff93d93a9 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -3828,6 +3828,9 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) names = g_new (char *, sig->param_count); mono_method_get_param_names (cfg->method, (const char **) names); + if (strstr(ctx->method_name, "test") != NULL) + printf("~~~Reached emit_entry_bb for test\n"); + for (int i = 0; i < sig->param_count; ++i) { LLVMArgInfo *ainfo = &linfo->args [i + sig->hasthis]; int reg = cfg->args [i + sig->hasthis]->dreg; @@ -3858,6 +3861,12 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) emit_args_to_vtype (ctx, builder, ainfo->type, ctx->addresses [reg], ainfo, args); break; } + case LLVMArgVtypeInSIMDReg: { + LLVMValueRef arg = LLVMGetParam (ctx->lmethod, pindex); + + ctx->addresses [reg] = build_alloca (ctx, ainfo->type); + LLVMBuildStore (builder, arg, convert (ctx, ctx->addresses [reg], LLVMPointerType (LLVMTypeOf (arg), 0))); + } case LLVMArgVtypeByVal: { ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, pindex); break; @@ -3949,6 +3958,7 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) switch (ainfo->storage) { case LLVMArgVtypeInReg: + case LLVMArgVtypeInSIMDReg: case LLVMArgVtypeByVal: case LLVMArgAsIArgs: // FIXME: Enabling this fails on windows @@ -4498,6 +4508,10 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, // FIXME: Get rid of the VMOVE break; } + case LLVMArgVtypeInSIMDReg: { + args [pindex] = convert (ctx, LLVMBuildLoad (ctx->builder, addresses [reg], "load_param"), IntPtrType ()); + break; + } case LLVMArgVtypeByVal: g_assert (addresses [reg]); args [pindex] = addresses [reg]; @@ -11598,6 +11612,9 @@ emit_method_inner (EmitContext *ctx) sig = mono_method_signature_internal (cfg->method); ctx->sig = sig; + if (strstr(ctx->method_name, "test") != NULL) + printf("~~~Reached emit_method_inner for test\n"); + linfo = get_llvm_call_info (cfg, sig); ctx->linfo = linfo; if (!ctx_ok (ctx)) diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h index 853b25eef306ba..3d185d49f3d294 100644 --- a/src/mono/mono/mini/mini.h +++ b/src/mono/mono/mini/mini.h @@ -632,6 +632,8 @@ typedef enum { LLVMArgInFPReg, /* Valuetype passed in 1-2 consecutive register */ LLVMArgVtypeInReg, + /* Pass Vector128 in SIMD registers */ + LLVMArgVtypeInSIMDReg, LLVMArgVtypeByVal, LLVMArgVtypeRetAddr, /* On on cinfo->ret */ LLVMArgGSharedVt, diff --git a/src/mono/mono/mini/simd-intrinsics.c b/src/mono/mono/mini/simd-intrinsics.c index db173284e120cc..dc5edc10471fb8 100644 --- a/src/mono/mono/mini/simd-intrinsics.c +++ b/src/mono/mono/mini/simd-intrinsics.c @@ -1026,6 +1026,8 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi case SN_Xor: if (!is_element_type_primitive (fsig->params [0])) return NULL; + if (id == SN_Min) + printf("~~~Reached!~~~\n"); return emit_simd_ins_for_binary_op (cfg, klass, fsig, args, arg0_type, id); case SN_AndNot: #ifdef TARGET_ARM64 diff --git a/src/mono/sample/HelloWorld/Program.cs b/src/mono/sample/HelloWorld/Program.cs index 0a65da4203a6d5..760924e71b51f3 100644 --- a/src/mono/sample/HelloWorld/Program.cs +++ b/src/mono/sample/HelloWorld/Program.cs @@ -1,19 +1,30 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; +using System; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; +using System.Runtime.CompilerServices; +using System.Numerics; namespace HelloWorld { internal class Program { + [MethodImpl(MethodImplOptions.NoInlining)] + private static Vector128 test(Vector128 a, Vector128 b) + { + // return AdvSimd.Multiply(AdvSimd.Subtract(AdvSimd.Add(a, b), c), b); + // return Vector128.Multiply(Vector128.Subtract(Vector128.Add(a, b), c), b); + return Vector128.Add(a,b); + } + private static void Main(string[] args) { - bool isMono = typeof(object).Assembly.GetType("Mono.RuntimeStructs") != null; - Console.WriteLine($"Hello World {(isMono ? "from Mono!" : "from CoreCLR!")}"); - Console.WriteLine(typeof(object).Assembly.FullName); - Console.WriteLine(System.Reflection.Assembly.GetEntryAssembly ()); - Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription); + Vector128 A = Vector128.Create((int)3.1); + Vector128 B = Vector128.Create((int)5.7); + + // Vector128 result = Vector128.Abs(A); + // Vector128 result = AdvSimd.Add(A, B); + var result = test(A, B); + Console.WriteLine(result); } } } diff --git a/src/mono/sample/HelloWorld/log_llvm.txt b/src/mono/sample/HelloWorld/log_llvm.txt new file mode 100644 index 00000000000000..21a70daceefea3 --- /dev/null +++ b/src/mono/sample/HelloWorld/log_llvm.txt @@ -0,0 +1,409 @@ +converting llvm method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +created temp 0 (R16) of type System.Runtime.Intrinsics.Vector128 +creating vars +created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 +created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 +created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 + return : arg R16 <- + arg [0]: arg R17 <- + arg [1]: arg R18 <- + arg [2]: arg R19 <- +creating locals + local [0]: created temp 4 (R20) of type System.Runtime.Intrinsics.Vector128 +locals done +created temp 5 (R21) of type System.IntPtr +vret_addr = arg R21 <- +method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +converting (in B3: stack: 0) IL_0000: nop +converting (in B3: stack: 0) IL_0001: ldarg.0 +converting (in B3: stack: 1) IL_0002: ldarg.1 +converting (in B3: stack: 2) IL_0003: call 0x2b000001 +cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +converting (in B3: stack: 1) IL_0008: stloc.0 +converting (in B3: stack: 0) IL_0009: br.s IL_000b +converting (in B4: stack: 0) IL_000b: ldloc.0 +converting (in B4: stack: 1) IL_000c: ret +REGION BB0 IL_0000 ID_FFFFFFFF +REGION BB2 IL_0000 ID_FFFFFFFF +REGION BB3 IL_0009 ID_FFFFFFFF +REGION BB4 IL_000c ID_FFFFFFFF +REGION BB1 IL_0000 ID_FFFFFFFF +AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] +AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] + xzero R20 <- +AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] + il_seq_point intr il: 0x0 + nop + il_seq_point il: 0x1 + xmove R22 <- R17 + xmove R23 <- R18 + xbinop R24 <- R22 R23 + il_seq_point il: 0x8, nonempty-stack + xmove R20 <- R24 + il_seq_point il: 0x9 + br [B4] +AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] + il_seq_point il: 0xb + xmove R25 <- R20 + il_seq_point intr il: 0xc + move R26 <- R21 + storex_membase [R26] <- R25 + br [B1] +AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] +CCOPY/2: R22 -> R17 +CCOPY/2: R23 -> R18 +CCOPY: R26 -> R21 +CCOPY/2: R25 -> R20 + +HANDLE-GLOBAL-VREGS BLOCK 0: + +HANDLE-GLOBAL-VREGS BLOCK 2: + xzero R20 <- + +HANDLE-GLOBAL-VREGS BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xmove R22 <- R17 + xmove R23 <- R18 + xbinop R24 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + xmove R20 <- R24 + il_seq_point il: 0x9 + br [B4] + +HANDLE-GLOBAL-VREGS BLOCK 4: + il_seq_point il: 0xb + xmove R25 <- R20 + il_seq_point intr il: 0xc + move R26 <- R21 + storex_membase [R21] <- R20 + br [B1] + +HANDLE-GLOBAL-VREGS BLOCK 1: + setret R16 + Reverse copyprop in BB3 on xmove R20 <- R24 +BB0 IN: +BB2 IN: 0 +BB3 IN: 2 +BB4 IN: 3 +BB1 IN: 4 +DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) 0 +BB0(dfn=0) (IDOM=BB-1): BB0 +BB2(dfn=1) (IDOM=BB0): BB0 BB2 +BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 +BB4(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB4 +BB1(dfn=4) (IDOM=BB4): BB0 BB2 BB3 BB4 BB1 +SKIPPING SAFEPOINTS for code compiled with LLVM + +COMPUTE SSA 6 (R27-) + + +LIVENESS: +BLOCK BB0 (BB2, ): +GEN BB0: {} +KILL BB0: {} +BLOCK BB2 (BB3, ): + 1 xzero R20 <- + KILL: R20(4) +GEN BB2: {} +KILL BB2: {4} +BLOCK BB3 (BB4, ): + 1 il_seq_point intr il: 0x0 + 1 il_seq_point il: 0x1 + 1 xbinop R20 <- R17 R18 + GEN: R17(1) + GEN: R18(2) + KILL: R20(4) + 1 il_seq_point il: 0x8, nonempty-stack + 1 il_seq_point il: 0x9 + 1 br [B4] +GEN BB3: {1, 2} +KILL BB3: {4} +BLOCK BB4 (BB1, ): + 1 il_seq_point il: 0xb + 1 il_seq_point intr il: 0xc + 1 storex_membase [R21] <- R20 + GEN: R20(4) + 1 br [B1] +GEN BB4: {4, 5} +KILL BB4: {} +BLOCK BB1 (): + 1 setret R16 + GEN: R16(0) +GEN BB1: {0} +KILL BB1: {} + +ITERATION: +P: BB1(4): IN: BB4 OUT: +P: BB4(3): IN: BB3 OUT:BB1 + LIVE IN BB4: {0, 4, 5} +P: BB3(2): IN: BB2 OUT:BB4 + LIVE IN BB3: {0, 1, 2, 5} +P: BB2(1): IN: BB0 OUT:BB3 + LIVE IN BB2: {0, 1, 2, 5} +P: BB0(0): IN: OUT:BB2 + LIVE IN BB0: {0, 1, 2, 5} +IT: 5 4. +LIVE IN BB1: {0} +LIVE OUT BB1: {} +LIVE IN BB4: {0, 4, 5} +LIVE OUT BB4: {0} +LIVE IN BB3: {0, 1, 2, 5} +LIVE OUT BB3: {0, 4, 5} +LIVE IN BB2: {0, 1, 2, 5} +LIVE OUT BB2: {0, 1, 2, 5} +LIVE IN BB0: {0, 1, 2, 5} +LIVE OUT BB0: {0, 1, 2, 5} +V0: [0x0 - 0x100002] +V1: [0x0 - 0x80006] +V2: [0x0 - 0x80006] +V3: [0x0 - 0x0] +V4: [0x40003 - 0xc0006] +V5: [0x0 - 0xc0006] + +RENAME VARS BLOCK 0: + +RENAME VARS BLOCK 2: + +RENAME VARS BLOCK 3: +created temp 6 (R27) of type System.Runtime.Intrinsics.Vector128 + R20 -> R27 + +RENAME VARS BLOCK 4: + +RENAME VARS BLOCK 1: + +END COMPUTE SSA. + +IR code for method HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) + +BB0 (0) (len: 0): + prev: succ: BB2 + idom: BB-1 + dominators: BB0 + dfrontier: + +BB2 (1) (len: 0): + xzero R20 <- + prev: BB0 succ: BB3 + idom: BB0 + dominators: [BB0] BB2 + dfrontier: + +BB3 (2) (len: 11): + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] + prev: BB2 succ: BB4 + idom: BB2 + dominators: BB0 [BB2] BB3 + dfrontier: + +BB4 (3) (len: 2): + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] + prev: BB3 succ: BB1 + idom: BB3 + dominators: BB0 BB2 [BB3] BB4 + dfrontier: + +BB1 (4) (len: 0): + setret R16 + prev: BB4 succ: + idom: BB4 + dominators: BB0 BB2 BB3 [BB4] BB1 + dfrontier: + + +ABCREM BLOCK 0: + +ABCREM BLOCK 2: + +ABCREM BLOCK 3: + +ABCREM BLOCK 4: + +ABCREM BLOCK 1: + +ABCREM BLOCK/2 0 [dfn 0]... + +ABCREM BLOCK/2 2 [dfn 1]... + xzero R20 <- + +ABCREM BLOCK/2 3 [dfn 2]... + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] + +ABCREM BLOCK/2 4 [dfn 3]... + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] + +ABCREM BLOCK/2 1 [dfn 4]... + setret R16 +BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R20 <- +AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R20 <- +BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +BEFORE LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] +AFTER LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] +BEFORE LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] + setret R16 +AFTER LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] + setret R16 +DUMP BLOCK 0: +DUMP BLOCK 2: + xzero R20 <- +DUMP BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +DUMP BLOCK 4: + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] +DUMP BLOCK 1: + setret R16 + +*** Unoptimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +; ModuleID = 'jit-module-test' +source_filename = "jit-module-test" + +; Function Attrs: noinline uwtable +define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1, <4 x i32>* byval(<4 x i32>) %arg_c) #0 { +BB0: + %2 = alloca <4 x i32>, align 16 + %3 = alloca <4 x i32>, align 16 + %4 = bitcast <4 x i32>* %3 to i8* + %5 = getelementptr i8, i8* %4, i32 0 + %6 = bitcast i8* %5 to i64* + store i64 %arg_a, i64* %6, align 4 + %7 = getelementptr i8, i8* %4, i32 8 + %8 = bitcast i8* %7 to i64* + store i64 %0, i64* %8, align 4 + %simd_vtype = load <4 x i32>, <4 x i32>* %3, align 16 + %9 = bitcast <4 x i32>* %2 to i8* + %10 = getelementptr i8, i8* %9, i32 0 + %11 = bitcast i8* %10 to i64* + store i64 %arg_b, i64* %11, align 4 + %12 = getelementptr i8, i8* %9, i32 8 + %13 = bitcast i8* %12 to i64* + store i64 %1, i64* %13, align 4 + %simd_vtype1 = load <4 x i32>, <4 x i32>* %2, align 16 + %simd_vtype2 = load <4 x i32>, <4 x i32>* %arg_c, align 16 + br label %BB2 + +BB2: ; preds = %BB0 + br label %BB3 + +BB3: ; preds = %BB2 + %14 = icmp slt <4 x i32> %simd_vtype, %simd_vtype1 + %15 = select <4 x i1> %14, <4 x i32> %simd_vtype, <4 x i32> %simd_vtype1 + br label %BB4 + +BB4: ; preds = %BB3 + %16 = add i64 %vret, 0 + %17 = inttoptr i64 %16 to <4 x i32>* + store <4 x i32> %15, <4 x i32>* %17, align 1 + br label %BB1 + +BB1: ; preds = %BB4 + ret void +} + +attributes #0 = { noinline uwtable } + +*** + + +*** Optimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +; ModuleID = 'jit-module-test' +source_filename = "jit-module-test" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" + +; Function Attrs: noinline uwtable +define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1, <4 x i32>* byval(<4 x i32>) %arg_c) #0 { +BB0: + %2 = bitcast i64 %arg_a to <2 x i32> + %.0.vec.expand = shufflevector <2 x i32> %2, <2 x i32> undef, <4 x i32> + %3 = bitcast i64 %0 to <2 x i32> + %.8.vec.expand = shufflevector <2 x i32> %3, <2 x i32> undef, <4 x i32> + %.8.vecblend = shufflevector <4 x i32> %.0.vec.expand, <4 x i32> %.8.vec.expand, <4 x i32> + %4 = bitcast i64 %arg_b to <2 x i32> + %.0.vec.expand6 = shufflevector <2 x i32> %4, <2 x i32> undef, <4 x i32> + %5 = bitcast i64 %1 to <2 x i32> + %.8.vec.expand9 = shufflevector <2 x i32> %5, <2 x i32> undef, <4 x i32> + %.8.vecblend10 = shufflevector <4 x i32> %.0.vec.expand6, <4 x i32> %.8.vec.expand9, <4 x i32> + %6 = icmp slt <4 x i32> %.8.vecblend, %.8.vecblend10 + %7 = select <4 x i1> %6, <4 x i32> %.8.vecblend, <4 x i32> %.8.vecblend10 + %8 = inttoptr i64 %vret to <4 x i32>* + store <4 x i32> %7, <4 x i32>* %8, align 1 + ret void +} + +attributes #0 = { noinline uwtable } + +!mono.function_indexes = !{!0} + +!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", i32 1} + +*** + +CFA: [0] def_cfa: %rsp+0x8 +CFA: [0] offset: pc at cfa-0x8 +LLVM Method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) emitted at 0x10d8bc2c0 to 0x10d8bc2e6 (code length 38) + +*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.44S0Ml: +(__TEXT,__text) section +loWorld_Program_test__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__: +0000000000000000 vmovq %rdx, %xmm0 +0000000000000005 vmovq %rsi, %xmm1 +000000000000000a vpunpcklqdq %xmm0, %xmm1, %xmm0 +000000000000000e vmovq %r8, %xmm1 +0000000000000013 vmovq %rcx, %xmm2 +0000000000000018 vpunpcklqdq %xmm1, %xmm2, %xmm1 +000000000000001c vpminsd %xmm1, %xmm0, %xmm0 +0000000000000021 vmovdqu %xmm0, (%rdi) +0000000000000025 retq +<3, 3, 3, 3> +*** + diff --git a/src/mono/sample/HelloWorld/log_llvm_add.txt b/src/mono/sample/HelloWorld/log_llvm_add.txt new file mode 100644 index 00000000000000..fd92cd89522b8b --- /dev/null +++ b/src/mono/sample/HelloWorld/log_llvm_add.txt @@ -0,0 +1,407 @@ +converting llvm method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +created temp 0 (R16) of type System.Runtime.Intrinsics.Vector128 +creating vars +created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 +created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 +created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 + return : arg R16 <- + arg [0]: arg R17 <- + arg [1]: arg R18 <- + arg [2]: arg R19 <- +creating locals + local [0]: created temp 4 (R20) of type System.Runtime.Intrinsics.Vector128 +locals done +created temp 5 (R21) of type System.IntPtr +vret_addr = arg R21 <- +method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +converting (in B3: stack: 0) IL_0000: nop +converting (in B3: stack: 0) IL_0001: ldarg.0 +converting (in B3: stack: 1) IL_0002: ldarg.1 +converting (in B3: stack: 2) IL_0003: call 0x2b000001 +cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Add (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +converting (in B3: stack: 1) IL_0008: stloc.0 +converting (in B3: stack: 0) IL_0009: br.s IL_000b +converting (in B4: stack: 0) IL_000b: ldloc.0 +converting (in B4: stack: 1) IL_000c: ret +REGION BB0 IL_0000 ID_FFFFFFFF +REGION BB2 IL_0000 ID_FFFFFFFF +REGION BB3 IL_0009 ID_FFFFFFFF +REGION BB4 IL_000c ID_FFFFFFFF +REGION BB1 IL_0000 ID_FFFFFFFF +AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] +AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] + xzero R20 <- +AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] + il_seq_point intr il: 0x0 + nop + il_seq_point il: 0x1 + xmove R22 <- R17 + xmove R23 <- R18 + xbinop R24 <- R22 R23 + il_seq_point il: 0x8, nonempty-stack + xmove R20 <- R24 + il_seq_point il: 0x9 + br [B4] +AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] + il_seq_point il: 0xb + xmove R25 <- R20 + il_seq_point intr il: 0xc + move R26 <- R21 + storex_membase [R26] <- R25 + br [B1] +AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] +CCOPY/2: R22 -> R17 +CCOPY/2: R23 -> R18 +CCOPY: R26 -> R21 +CCOPY/2: R25 -> R20 + +HANDLE-GLOBAL-VREGS BLOCK 0: + +HANDLE-GLOBAL-VREGS BLOCK 2: + xzero R20 <- + +HANDLE-GLOBAL-VREGS BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xmove R22 <- R17 + xmove R23 <- R18 + xbinop R24 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + xmove R20 <- R24 + il_seq_point il: 0x9 + br [B4] + +HANDLE-GLOBAL-VREGS BLOCK 4: + il_seq_point il: 0xb + xmove R25 <- R20 + il_seq_point intr il: 0xc + move R26 <- R21 + storex_membase [R21] <- R20 + br [B1] + +HANDLE-GLOBAL-VREGS BLOCK 1: + setret R16 + Reverse copyprop in BB3 on xmove R20 <- R24 +BB0 IN: +BB2 IN: 0 +BB3 IN: 2 +BB4 IN: 3 +BB1 IN: 4 +DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) 0 +BB0(dfn=0) (IDOM=BB-1): BB0 +BB2(dfn=1) (IDOM=BB0): BB0 BB2 +BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 +BB4(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB4 +BB1(dfn=4) (IDOM=BB4): BB0 BB2 BB3 BB4 BB1 +SKIPPING SAFEPOINTS for code compiled with LLVM + +COMPUTE SSA 6 (R27-) + + +LIVENESS: +BLOCK BB0 (BB2, ): +GEN BB0: {} +KILL BB0: {} +BLOCK BB2 (BB3, ): + 1 xzero R20 <- + KILL: R20(4) +GEN BB2: {} +KILL BB2: {4} +BLOCK BB3 (BB4, ): + 1 il_seq_point intr il: 0x0 + 1 il_seq_point il: 0x1 + 1 xbinop R20 <- R17 R18 + GEN: R17(1) + GEN: R18(2) + KILL: R20(4) + 1 il_seq_point il: 0x8, nonempty-stack + 1 il_seq_point il: 0x9 + 1 br [B4] +GEN BB3: {1, 2} +KILL BB3: {4} +BLOCK BB4 (BB1, ): + 1 il_seq_point il: 0xb + 1 il_seq_point intr il: 0xc + 1 storex_membase [R21] <- R20 + GEN: R20(4) + 1 br [B1] +GEN BB4: {4, 5} +KILL BB4: {} +BLOCK BB1 (): + 1 setret R16 + GEN: R16(0) +GEN BB1: {0} +KILL BB1: {} + +ITERATION: +P: BB1(4): IN: BB4 OUT: +P: BB4(3): IN: BB3 OUT:BB1 + LIVE IN BB4: {0, 4, 5} +P: BB3(2): IN: BB2 OUT:BB4 + LIVE IN BB3: {0, 1, 2, 5} +P: BB2(1): IN: BB0 OUT:BB3 + LIVE IN BB2: {0, 1, 2, 5} +P: BB0(0): IN: OUT:BB2 + LIVE IN BB0: {0, 1, 2, 5} +IT: 5 4. +LIVE IN BB1: {0} +LIVE OUT BB1: {} +LIVE IN BB4: {0, 4, 5} +LIVE OUT BB4: {0} +LIVE IN BB3: {0, 1, 2, 5} +LIVE OUT BB3: {0, 4, 5} +LIVE IN BB2: {0, 1, 2, 5} +LIVE OUT BB2: {0, 1, 2, 5} +LIVE IN BB0: {0, 1, 2, 5} +LIVE OUT BB0: {0, 1, 2, 5} +V0: [0x0 - 0x100002] +V1: [0x0 - 0x80006] +V2: [0x0 - 0x80006] +V3: [0x0 - 0x0] +V4: [0x40003 - 0xc0006] +V5: [0x0 - 0xc0006] + +RENAME VARS BLOCK 0: + +RENAME VARS BLOCK 2: + +RENAME VARS BLOCK 3: +created temp 6 (R27) of type System.Runtime.Intrinsics.Vector128 + R20 -> R27 + +RENAME VARS BLOCK 4: + +RENAME VARS BLOCK 1: + +END COMPUTE SSA. + +IR code for method HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) + +BB0 (0) (len: 0): + prev: succ: BB2 + idom: BB-1 + dominators: BB0 + dfrontier: + +BB2 (1) (len: 0): + xzero R20 <- + prev: BB0 succ: BB3 + idom: BB0 + dominators: [BB0] BB2 + dfrontier: + +BB3 (2) (len: 11): + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] + prev: BB2 succ: BB4 + idom: BB2 + dominators: BB0 [BB2] BB3 + dfrontier: + +BB4 (3) (len: 2): + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] + prev: BB3 succ: BB1 + idom: BB3 + dominators: BB0 BB2 [BB3] BB4 + dfrontier: + +BB1 (4) (len: 0): + setret R16 + prev: BB4 succ: + idom: BB4 + dominators: BB0 BB2 BB3 [BB4] BB1 + dfrontier: + + +ABCREM BLOCK 0: + +ABCREM BLOCK 2: + +ABCREM BLOCK 3: + +ABCREM BLOCK 4: + +ABCREM BLOCK 1: + +ABCREM BLOCK/2 0 [dfn 0]... + +ABCREM BLOCK/2 2 [dfn 1]... + xzero R20 <- + +ABCREM BLOCK/2 3 [dfn 2]... + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] + +ABCREM BLOCK/2 4 [dfn 3]... + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] + +ABCREM BLOCK/2 1 [dfn 4]... + setret R16 +BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R20 <- +AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R20 <- +BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +BEFORE LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] +AFTER LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] +BEFORE LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] + setret R16 +AFTER LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] + setret R16 +DUMP BLOCK 0: +DUMP BLOCK 2: + xzero R20 <- +DUMP BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R27 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +DUMP BLOCK 4: + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R27 + br [B1] +DUMP BLOCK 1: + setret R16 + +*** Unoptimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +; ModuleID = 'jit-module-test' +source_filename = "jit-module-test" + +; Function Attrs: noinline uwtable +define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1, <4 x i32>* byval(<4 x i32>) %arg_c) #0 { +BB0: + %2 = alloca <4 x i32>, align 16 + %3 = alloca <4 x i32>, align 16 + %4 = bitcast <4 x i32>* %3 to i8* + %5 = getelementptr i8, i8* %4, i32 0 + %6 = bitcast i8* %5 to i64* + store i64 %arg_a, i64* %6, align 4 + %7 = getelementptr i8, i8* %4, i32 8 + %8 = bitcast i8* %7 to i64* + store i64 %0, i64* %8, align 4 + %simd_vtype = load <4 x i32>, <4 x i32>* %3, align 16 + %9 = bitcast <4 x i32>* %2 to i8* + %10 = getelementptr i8, i8* %9, i32 0 + %11 = bitcast i8* %10 to i64* + store i64 %arg_b, i64* %11, align 4 + %12 = getelementptr i8, i8* %9, i32 8 + %13 = bitcast i8* %12 to i64* + store i64 %1, i64* %13, align 4 + %simd_vtype1 = load <4 x i32>, <4 x i32>* %2, align 16 + %simd_vtype2 = load <4 x i32>, <4 x i32>* %arg_c, align 16 + br label %BB2 + +BB2: ; preds = %BB0 + br label %BB3 + +BB3: ; preds = %BB2 + %14 = add <4 x i32> %simd_vtype, %simd_vtype1 + br label %BB4 + +BB4: ; preds = %BB3 + %15 = add i64 %vret, 0 + %16 = inttoptr i64 %15 to <4 x i32>* + store <4 x i32> %14, <4 x i32>* %16, align 1 + br label %BB1 + +BB1: ; preds = %BB4 + ret void +} + +attributes #0 = { noinline uwtable } + +*** + + +*** Optimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +; ModuleID = 'jit-module-test' +source_filename = "jit-module-test" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" + +; Function Attrs: noinline uwtable +define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1, <4 x i32>* byval(<4 x i32>) %arg_c) #0 { +BB0: + %2 = bitcast i64 %arg_a to <2 x i32> + %.0.vec.expand = shufflevector <2 x i32> %2, <2 x i32> undef, <4 x i32> + %3 = bitcast i64 %0 to <2 x i32> + %.8.vec.expand = shufflevector <2 x i32> %3, <2 x i32> undef, <4 x i32> + %.8.vecblend = shufflevector <4 x i32> %.0.vec.expand, <4 x i32> %.8.vec.expand, <4 x i32> + %4 = bitcast i64 %arg_b to <2 x i32> + %.0.vec.expand6 = shufflevector <2 x i32> %4, <2 x i32> undef, <4 x i32> + %5 = bitcast i64 %1 to <2 x i32> + %.8.vec.expand9 = shufflevector <2 x i32> %5, <2 x i32> undef, <4 x i32> + %.8.vecblend10 = shufflevector <4 x i32> %.0.vec.expand6, <4 x i32> %.8.vec.expand9, <4 x i32> + %6 = add <4 x i32> %.8.vecblend, %.8.vecblend10 + %7 = inttoptr i64 %vret to <4 x i32>* + store <4 x i32> %6, <4 x i32>* %7, align 1 + ret void +} + +attributes #0 = { noinline uwtable } + +!mono.function_indexes = !{!0} + +!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", i32 1} + +*** + +CFA: [0] def_cfa: %rsp+0x8 +CFA: [0] offset: pc at cfa-0x8 +LLVM Method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) emitted at 0x103ed8290 to 0x103ed82b5 (code length 37) + +*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.gBUhkY: +(__TEXT,__text) section +loWorld_Program_test__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__: +0000000000000000 vmovq %rdx, %xmm0 +0000000000000005 vmovq %rsi, %xmm1 +000000000000000a vpunpcklqdq %xmm0, %xmm1, %xmm0 +000000000000000e vmovq %r8, %xmm1 +0000000000000013 vmovq %rcx, %xmm2 +0000000000000018 vpunpcklqdq %xmm1, %xmm2, %xmm1 +000000000000001c vpaddd %xmm1, %xmm0, %xmm0 +0000000000000020 vmovdqu %xmm0, (%rdi) +0000000000000024 retq +<8, 8, 8, 8> +*** + diff --git a/src/mono/sample/HelloWorld/log_llvm_main.txt b/src/mono/sample/HelloWorld/log_llvm_main.txt new file mode 100644 index 00000000000000..cde64e6f05898a --- /dev/null +++ b/src/mono/sample/HelloWorld/log_llvm_main.txt @@ -0,0 +1,652 @@ +converting llvm method void HelloWorld.Program:Main (string[]) +creating vars +created temp 0 (R16) of type System.Object + arg [0]: arg R16 <- +creating locals + local [0]: created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 + local [1]: created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 + local [2]: created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 +locals done +method to IR HelloWorld.Program:Main (string[]) +converting (in B3: stack: 0) IL_0000: nop +converting (in B3: stack: 0) IL_0001: ldc.i4.3 +converting (in B3: stack: 1) IL_0002: call 0x0a000011 +cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Create (int) +converting (in B3: stack: 1) IL_0007: stloc.0 +converting (in B3: stack: 0) IL_0008: ldc.i4.5 +converting (in B3: stack: 1) IL_0009: call 0x0a000011 +cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Create (int) +converting (in B3: stack: 1) IL_000e: stloc.1 +converting (in B3: stack: 0) IL_000f: ldloc.0 +converting (in B3: stack: 1) IL_0010: ldloc.1 +converting (in B3: stack: 2) IL_0011: call 0x06000001 +cmethod = System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +created temp 4 (R26) of type System.Runtime.Intrinsics.Vector128 +converting (in B3: stack: 1) IL_0016: stloc.2 +converting (in B3: stack: 0) IL_0017: ldloc.2 +converting (in B3: stack: 1) IL_0018: box 0x1b000001 +converting (in B3: stack: 1) IL_001d: call 0x0a000012 +cmethod = void System.Console:WriteLine (object) +converting (in B3: stack: 0) IL_0022: nop +converting (in B3: stack: 0) IL_0023: ret +REGION BB0 IL_0000 ID_FFFFFFFF +REGION BB2 IL_0000 ID_FFFFFFFF +REGION BB3 IL_0023 ID_FFFFFFFF +REGION BB1 IL_0000 ID_FFFFFFFF +AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] +AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] + xzero R17 <- + xzero R18 <- + xzero R19 <- +AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB1(0) ] + il_seq_point intr il: 0x0 + nop + il_seq_point il: 0x1 + iconst R20 <- [3] + expand_i4 R21 <- R20 + il_seq_point il: 0x7, nonempty-stack + xmove R17 <- R21 + il_seq_point il: 0x8 + iconst R22 <- [5] + expand_i4 R23 <- R22 + il_seq_point il: 0xe, nonempty-stack + xmove R18 <- R23 + il_seq_point il: 0xf + xmove R24 <- R17 + xmove R25 <- R18 + outarg_vtretaddr R27 <- R26 + llvm_outarg_vt R28 <- R24 + llvm_outarg_vt R29 <- R25 + vcall R26 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c + il_seq_point il: 0x16, nonempty-stack + xmove R19 <- R26 + il_seq_point il: 0x17 + xmove R30 <- R19 + i8const R31 <- [140406424075320] + iconst R32 <- [32] + move R34 <- R31 + move R35 <- R32 + call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c + storex_membase [R33 + 0x10] <- R30 + move R36 <- R33 + voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c + il_seq_point il: 0x22, nonempty-stack + il_seq_point il: 0x22 + nop + il_seq_point il: 0x23 + br [B1] +AFTER METHOD-TO-IR 1: [IN: BB3(0), OUT: ] +CCOPY/2: R24 -> R17 +CCOPY/2: R25 -> R18 + +HANDLE-GLOBAL-VREGS BLOCK 0: + +HANDLE-GLOBAL-VREGS BLOCK 2: + xzero R17 <- + xzero R18 <- + xzero R19 <- + +HANDLE-GLOBAL-VREGS BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + iconst R20 <- [3] + expand_i4 R21 <- R20 + il_seq_point il: 0x7, nonempty-stack + xmove R17 <- R21 + il_seq_point il: 0x8 + iconst R22 <- [5] + expand_i4 R23 <- R22 + il_seq_point il: 0xe, nonempty-stack + xmove R18 <- R23 + il_seq_point il: 0xf + xmove R24 <- R17 + xmove R25 <- R18 + outarg_vtretaddr R27 <- R26 + llvm_outarg_vt R28 <- R17 + llvm_outarg_vt R29 <- R18 + vcall R26 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c + il_seq_point il: 0x16, nonempty-stack + xmove R19 <- R26 + il_seq_point il: 0x17 + xmove R30 <- R19 + i8const R31 <- [140406424075320] + iconst R32 <- [32] + i8const R34 <- [140406424075320] + iconst R35 <- [32] + call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c + storex_membase [R33 + 0x10] <- R30 + move R36 <- R33 + voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c + il_seq_point il: 0x22, nonempty-stack + il_seq_point il: 0x22 + il_seq_point il: 0x23 + br [B1] + +HANDLE-GLOBAL-VREGS BLOCK 1: +CONVERTED R26(4) TO VREG. + Reverse copyprop in BB3 on xmove R19 <- R26 + Reverse copyprop in BB3 on xmove R18 <- R23 + Reverse copyprop in BB3 on xmove R17 <- R21 +BB0 IN: +BB2 IN: 0 +BB3 IN: 2 +BB1 IN: 3 +DTREE HelloWorld.Program:Main (string[]) 0 +BB0(dfn=0) (IDOM=BB-1): BB0 +BB2(dfn=1) (IDOM=BB0): BB0 BB2 +BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 +BB1(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB1 +SKIPPING SAFEPOINTS for code compiled with LLVM + +COMPUTE SSA 4 (R37-) + + +LIVENESS: +BLOCK BB0 (BB2, ): +GEN BB0: {} +KILL BB0: {} +BLOCK BB2 (BB3, ): + 1 xzero R17 <- + KILL: R17(1) + 1 xzero R18 <- + KILL: R18(2) + 1 xzero R19 <- + KILL: R19(3) +GEN BB2: {} +KILL BB2: {1, 2, 3} +BLOCK BB3 (BB1, ): + 1 il_seq_point intr il: 0x0 + 1 il_seq_point il: 0x1 + 1 iconst R20 <- [3] + 1 expand_i4 R17 <- R20 + KILL: R17(1) + 1 il_seq_point il: 0x7, nonempty-stack + 1 il_seq_point il: 0x8 + 1 iconst R22 <- [5] + 1 expand_i4 R18 <- R22 + KILL: R18(2) + 1 il_seq_point il: 0xe, nonempty-stack + 1 il_seq_point il: 0xf + 1 outarg_vtretaddr R27 <- R26 + 1 llvm_outarg_vt R28 <- R17 + GEN: R17(1) + 1 llvm_outarg_vt R29 <- R18 + GEN: R18(2) + 1 vcall R19 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c + KILL: R19(3) + 1 il_seq_point il: 0x16, nonempty-stack + 1 il_seq_point il: 0x17 + 1 xmove R30 <- R19 + GEN: R19(3) + 1 i8const R34 <- [140406424075320] + 1 iconst R35 <- [32] + 1 call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c + 1 storex_membase [R33 + 0x10] <- R30 + 1 move R36 <- R33 + 1 voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c + 1 il_seq_point il: 0x22, nonempty-stack + 1 il_seq_point il: 0x22 + 1 il_seq_point il: 0x23 + 1 br [B1] +GEN BB3: {} +KILL BB3: {1, 2, 3} +BLOCK BB1 (): +GEN BB1: {} +KILL BB1: {} + +ITERATION: +P: BB1(3): IN: BB3 OUT: +P: BB3(2): IN: BB2 OUT:BB1 + LIVE IN BB3: {} +P: BB2(1): IN: BB0 OUT:BB3 + LIVE IN BB2: {} +P: BB0(0): IN: OUT:BB2 + LIVE IN BB0: {} +IT: 4 3. +LIVE IN BB1: {} +LIVE OUT BB1: {} +LIVE IN BB3: {} +LIVE OUT BB3: {} +LIVE IN BB2: {} +LIVE OUT BB2: {} +LIVE IN BB0: {} +LIVE OUT BB0: {} +V0: [0x0 - 0x0] +V1: [0x40003 - 0x80018] +V2: [0x40005 - 0x8001a] +V3: [0x40007 - 0x80022] + +RENAME VARS BLOCK 0: + +RENAME VARS BLOCK 2: + +RENAME VARS BLOCK 3: +created temp 4 (R37) of type System.Runtime.Intrinsics.Vector128 + R17 -> R37 +created temp 5 (R38) of type System.Runtime.Intrinsics.Vector128 + R18 -> R38 +created temp 6 (R39) of type System.Runtime.Intrinsics.Vector128 + R19 -> R39 + +RENAME VARS BLOCK 1: + +END COMPUTE SSA. + +IR code for method HelloWorld.Program:Main (string[]) + +BB0 (0) (len: 0): + prev: succ: BB2 + idom: BB-1 + dominators: BB0 + dfrontier: + +BB2 (1) (len: 0): + xzero R17 <- + xzero R18 <- + xzero R19 <- + prev: BB0 succ: BB3 + idom: BB0 + dominators: [BB0] BB2 + dfrontier: + +BB3 (2) (len: 36): + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + iconst R20 <- [3] + expand_i4 R37 <- R20 + il_seq_point il: 0x7, nonempty-stack + il_seq_point il: 0x8 + iconst R22 <- [5] + expand_i4 R38 <- R22 + il_seq_point il: 0xe, nonempty-stack + il_seq_point il: 0xf + outarg_vtretaddr R27 <- R26 + llvm_outarg_vt R28 <- R37 + llvm_outarg_vt R29 <- R38 + vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c + il_seq_point il: 0x16, nonempty-stack + il_seq_point il: 0x17 + xmove R30 <- R39 + i8const R34 <- [140406424075320] + iconst R35 <- [32] + call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c + storex_membase [R33 + 0x10] <- R30 + move R36 <- R33 + voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c + il_seq_point il: 0x22, nonempty-stack + il_seq_point il: 0x22 + il_seq_point il: 0x23 + br [B1] + prev: BB2 succ: BB1 + idom: BB2 + dominators: BB0 [BB2] BB3 + dfrontier: + +BB1 (3) (len: 0): + prev: BB3 succ: + idom: BB3 + dominators: BB0 BB2 [BB3] BB1 + dfrontier: + + +ABCREM BLOCK 0: + +ABCREM BLOCK 2: + +ABCREM BLOCK 3: + iconst R20 <- [3] +Summarized variable 20: CONSTANT 3, not-null = 0 + iconst R22 <- [5] +Summarized variable 22: CONSTANT 5, not-null = 0 + outarg_vtretaddr R27 <- R26 +Summarized variable 27: ANY + llvm_outarg_vt R28 <- R37 +Summarized variable 28: ANY + llvm_outarg_vt R29 <- R38 +Summarized variable 29: ANY + i8const R34 <- [140406424075320] +Summarized variable 34: ANY + iconst R35 <- [32] +Summarized variable 35: CONSTANT 32, not-null = 0 + call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c +Summarized variable 33: ANY + move R36 <- R33 +Summarized variable 36: VARIABLE 33, delta 0, not-null = 2 + +ABCREM BLOCK 1: +Added symmetric summarized value for variable variable 36 (to 33): VARIABLE 36, delta 0, not-null = 2 + +ABCREM BLOCK/2 0 [dfn 0]... + +ABCREM BLOCK/2 2 [dfn 1]... + xzero R17 <- + xzero R18 <- + xzero R19 <- + +ABCREM BLOCK/2 3 [dfn 2]... + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + iconst R20 <- [3] + expand_i4 R37 <- R20 + il_seq_point il: 0x7, nonempty-stack + il_seq_point il: 0x8 + iconst R22 <- [5] + expand_i4 R38 <- R22 + il_seq_point il: 0xe, nonempty-stack + il_seq_point il: 0xf + outarg_vtretaddr R27 <- R26 + llvm_outarg_vt R28 <- R37 + llvm_outarg_vt R29 <- R38 + vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c + il_seq_point il: 0x16, nonempty-stack + il_seq_point il: 0x17 + xmove R30 <- R39 + i8const R34 <- [140406424075320] + iconst R35 <- [32] + call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c + storex_membase [R33 + 0x10] <- R30 + move R36 <- R33 + voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c + il_seq_point il: 0x22, nonempty-stack + il_seq_point il: 0x22 + il_seq_point il: 0x23 + br [B1] + +ABCREM BLOCK/2 1 [dfn 3]... +BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R17 <- + xzero R18 <- + xzero R19 <- +AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R17 <- + xzero R18 <- + xzero R19 <- +BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB1(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + iconst R20 <- [3] + expand_i4 R37 <- R20 + il_seq_point il: 0x7, nonempty-stack + il_seq_point il: 0x8 + iconst R22 <- [5] + expand_i4 R38 <- R22 + il_seq_point il: 0xe, nonempty-stack + il_seq_point il: 0xf + outarg_vtretaddr R27 <- R26 + llvm_outarg_vt R28 <- R37 + llvm_outarg_vt R29 <- R38 + vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c + il_seq_point il: 0x16, nonempty-stack + il_seq_point il: 0x17 + xmove R30 <- R39 + i8const R34 <- [140406424075320] + iconst R35 <- [32] + call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c + storex_membase [R33 + 0x10] <- R30 + move R36 <- R33 + voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c + il_seq_point il: 0x22, nonempty-stack + il_seq_point il: 0x22 + il_seq_point il: 0x23 + br [B1] +AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB1(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + iconst R20 <- [3] + expand_i4 R37 <- R20 + il_seq_point il: 0x7, nonempty-stack + il_seq_point il: 0x8 + iconst R22 <- [5] + expand_i4 R38 <- R22 + il_seq_point il: 0xe, nonempty-stack + il_seq_point il: 0xf + ldaddr R27 <- R39 + llvm_outarg_vt R28 <- R37 + llvm_outarg_vt R29 <- R38 + vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c + il_seq_point il: 0x16, nonempty-stack + il_seq_point il: 0x17 + xmove R30 <- R39 + i8const R34 <- [140406424075320] + iconst R35 <- [32] + call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c + storex_membase [R33 + 0x10] <- R30 + move R36 <- R33 + voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c + il_seq_point il: 0x22, nonempty-stack + il_seq_point il: 0x22 + il_seq_point il: 0x23 + br [B1] +BEFORE LOWER-VTYPE-OPTS 1: [IN: BB3(2), OUT: ] +AFTER LOWER-VTYPE-OPTS 1: [IN: BB3(2), OUT: ] +DUMP BLOCK 0: +DUMP BLOCK 2: + xzero R17 <- + xzero R18 <- + xzero R19 <- +DUMP BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + iconst R20 <- [3] + expand_i4 R37 <- R20 + il_seq_point il: 0x7, nonempty-stack + il_seq_point il: 0x8 + iconst R22 <- [5] + expand_i4 R38 <- R22 + il_seq_point il: 0xe, nonempty-stack + il_seq_point il: 0xf + ldaddr R27 <- R39 + llvm_outarg_vt R28 <- R37 + llvm_outarg_vt R29 <- R38 + vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c + il_seq_point il: 0x16, nonempty-stack + il_seq_point il: 0x17 + xmove R30 <- R39 + i8const R34 <- [140406424075320] + iconst R35 <- [32] + call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c + storex_membase [R33 + 0x10] <- R30 + move R36 <- R33 + voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c + il_seq_point il: 0x22, nonempty-stack + il_seq_point il: 0x22 + il_seq_point il: 0x23 + br [B1] +DUMP BLOCK 1: + +*** Unoptimized LLVM IR for HelloWorld.Program:Main (string[]) *** +; ModuleID = 'jit-module-Main' +source_filename = "jit-module-Main" + +@mono_threads_state_poll = global void ()* inttoptr (i64 4382128016 to void ()*) +@"[tramp_687] HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)" = global void (i64, i64, i64, i64, i64)* inttoptr (i64 4382777112 to void (i64, i64, i64, i64, i64)*) +@"[tramp_688] (wrapper alloc) object:AllocSmall (intptr,intptr)" = global i64* (i64, i64)* inttoptr (i64 4382130653 to i64* (i64, i64)*) +@"[tramp_689] System.Console:WriteLine (object)" = global void (i64*)* inttoptr (i64 4382777126 to void (i64*)*) + +; Function Attrs: uwtable +define dso_local monocc void @"HelloWorld.Program:Main (string[])"(i64* %arg_args) #0 gc "coreclr" { +BB0: + %vreg_loc_39 = alloca <4 x i32>, align 16 + %llvm_outarg_vt1 = alloca <4 x i32>, align 16 + %llvm_outarg_vt = alloca <4 x i32>, align 16 + br label %BB2 + +BB2: ; preds = %BB0 + br label %BB3 + +BB3: ; preds = %BB2 + store <4 x i32> , <4 x i32>* %llvm_outarg_vt, align 16 + store <4 x i32> , <4 x i32>* %llvm_outarg_vt1, align 16 + %0 = load void (i64, i64, i64, i64, i64)*, void (i64, i64, i64, i64, i64)** @"[tramp_687] HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", align 8 + %1 = ptrtoint <4 x i32>* %vreg_loc_39 to i64 + %2 = bitcast <4 x i32>* %llvm_outarg_vt to i8* + %3 = getelementptr i8, i8* %2, i32 0 + %4 = bitcast i8* %3 to i64* + %5 = load i64, i64* %4, align 4 + %6 = getelementptr i8, i8* %2, i32 8 + %7 = bitcast i8* %6 to i64* + %8 = load i64, i64* %7, align 4 + %9 = bitcast <4 x i32>* %llvm_outarg_vt1 to i8* + %10 = getelementptr i8, i8* %9, i32 0 + %11 = bitcast i8* %10 to i64* + %12 = load i64, i64* %11, align 4 + %13 = getelementptr i8, i8* %9, i32 8 + %14 = bitcast i8* %13 to i64* + %15 = load i64, i64* %14, align 4 + notail call monocc void %0(i64 %1, i64 %5, i64 %8, i64 %12, i64 %15), !managed_name !0 + %process_call_vtype_ret_addr = load <4 x i32>, <4 x i32>* %vreg_loc_39, align 16 + %16 = load volatile <4 x i32>, <4 x i32>* %vreg_loc_39, align 16 + %17 = load i64* (i64, i64)*, i64* (i64, i64)** @"[tramp_688] (wrapper alloc) object:AllocSmall (intptr,intptr)", align 8 + %18 = notail call monocc noalias nonnull align 8 i64* %17(i64 140406424075320, i64 32), !managed_name !1 + %19 = ptrtoint i64* %18 to i64 + %20 = add i64 %19, 16 + %21 = inttoptr i64 %20 to <4 x i32>* + store <4 x i32> %16, <4 x i32>* %21, align 1 + %22 = load void (i64*)*, void (i64*)** @"[tramp_689] System.Console:WriteLine (object)", align 8 + notail call monocc void %22(i64* %18), !managed_name !2 + br label %BB1 + +BB1: ; preds = %BB3 + ret void +} + +; Function Attrs: noinline nounwind optnone +define void @gc.safepoint_poll() #1 { +gc.safepoint_poll.entry: + %0 = load i64, i64* inttoptr (i64 4453764632 to i64*), align 4 + %1 = icmp eq i64 %0, 0 + br i1 %1, label %gc.safepoint_poll.exit, label %gc.safepoint_poll.poll, !prof !3 + +gc.safepoint_poll.poll: ; preds = %gc.safepoint_poll.entry + %2 = load void ()*, void ()** @mono_threads_state_poll, align 8 + call coldcc void %2() + br label %gc.safepoint_poll.exit + +gc.safepoint_poll.exit: ; preds = %gc.safepoint_poll.poll, %gc.safepoint_poll.entry + ret void +} + +attributes #0 = { uwtable } +attributes #1 = { noinline nounwind optnone } + +!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"} +!1 = !{!"(wrapper alloc) object:AllocSmall (intptr,intptr)"} +!2 = !{!"System.Console:WriteLine (object)"} +!3 = !{!"branch_weights", i32 1000, i32 1} + +*** + + +*** Optimized LLVM IR for HelloWorld.Program:Main (string[]) *** +; ModuleID = 'jit-module-Main' +source_filename = "jit-module-Main" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" + +@mono_threads_state_poll = global void ()* inttoptr (i64 4382128016 to void ()*) +@"[tramp_687] HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)" = global void (i64, i64, i64, i64, i64)* inttoptr (i64 4382777112 to void (i64, i64, i64, i64, i64)*) +@"[tramp_688] (wrapper alloc) object:AllocSmall (intptr,intptr)" = global i64* (i64, i64)* inttoptr (i64 4382130653 to i64* (i64, i64)*) +@"[tramp_689] System.Console:WriteLine (object)" = global void (i64*)* inttoptr (i64 4382777126 to void (i64*)*) + +; Function Attrs: uwtable +define dso_local monocc void @"HelloWorld.Program:Main (string[])"(i64* %arg_args) #0 gc "coreclr" { +BB0: + %vreg_loc_39 = alloca <4 x i32>, align 16 + %0 = load void (i64, i64, i64, i64, i64)*, void (i64, i64, i64, i64, i64)** @"[tramp_687] HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", align 8 + %1 = ptrtoint <4 x i32>* %vreg_loc_39 to i64 + %2 = load i64, i64* inttoptr (i64 4453764632 to i64*), align 4 + %3 = icmp eq i64 %2, 0 + br i1 %3, label %gc.safepoint_poll.exit, label %gc.safepoint_poll.poll.i, !prof !1 + +gc.safepoint_poll.poll.i: ; preds = %BB0 + %4 = load void ()*, void ()** @mono_threads_state_poll, align 8 + call coldcc void %4() #2 + br label %gc.safepoint_poll.exit + +gc.safepoint_poll.exit: ; preds = %BB0, %gc.safepoint_poll.poll.i + notail call monocc void %0(i64 %1, i64 12884901891, i64 12884901891, i64 21474836485, i64 21474836485), !managed_name !2 + %5 = load volatile <4 x i32>, <4 x i32>* %vreg_loc_39, align 16 + %6 = load i64* (i64, i64)*, i64* (i64, i64)** @"[tramp_688] (wrapper alloc) object:AllocSmall (intptr,intptr)", align 8 + %7 = notail call monocc noalias nonnull align 8 i64* %6(i64 140406424075320, i64 32), !managed_name !3 + %8 = ptrtoint i64* %7 to i64 + %9 = add i64 %8, 16 + %10 = inttoptr i64 %9 to <4 x i32>* + store <4 x i32> %5, <4 x i32>* %10, align 8 + %11 = load void (i64*)*, void (i64*)** @"[tramp_689] System.Console:WriteLine (object)", align 8 + notail call monocc void %11(i64* nonnull %7), !managed_name !4 + ret void +} + +; Function Attrs: noinline nounwind optnone +define void @gc.safepoint_poll() #1 { +gc.safepoint_poll.entry: + %0 = load i64, i64* inttoptr (i64 4453764632 to i64*), align 4 + %1 = icmp eq i64 %0, 0 + br i1 %1, label %gc.safepoint_poll.exit, label %gc.safepoint_poll.poll, !prof !1 + +gc.safepoint_poll.poll: ; preds = %gc.safepoint_poll.entry + %2 = load void ()*, void ()** @mono_threads_state_poll, align 8 + call coldcc void %2() + br label %gc.safepoint_poll.exit + +gc.safepoint_poll.exit: ; preds = %gc.safepoint_poll.poll, %gc.safepoint_poll.entry + ret void +} + +attributes #0 = { uwtable } +attributes #1 = { noinline nounwind optnone } +attributes #2 = { nounwind } + +!mono.function_indexes = !{!0} + +!0 = !{!"HelloWorld.Program:Main (string[])", i32 1} +!1 = !{!"branch_weights", i32 1000, i32 1} +!2 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"} +!3 = !{!"(wrapper alloc) object:AllocSmall (intptr,intptr)"} +!4 = !{!"System.Console:WriteLine (object)"} + +*** + +CFA: [0] def_cfa: %rsp+0x8 +CFA: [0] offset: pc at cfa-0x8 +CFA: [4] advance loc +CFA: [4] def_cfa_offset: 0x30 +LLVM Method void HelloWorld.Program:Main (string[]) emitted at 0x1053bdf40 to 0x1053bdfd5 (code length 149) + +*** ASM for HelloWorld.Program:Main (string[]) *** +/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.ZTxSIZ: +(__TEXT,__text) section +loWorld_Program_Main__string___: +0000000000000000 subq $0x28, %rsp +0000000000000004 movabsq $0x600003ee9bc8, %rax +000000000000000e movq (%rax), %r9 +0000000000000011 movabsq $0x109770e18, %rax +000000000000001b cmpq $0x0, (%rax) +000000000000001f jne 0x87 +0000000000000021 leaq 0x10(%rsp), %rdi +0000000000000026 movabsq $0x300000003, %rdx +0000000000000030 movabsq $0x500000005, %rcx +000000000000003a movq %rdx, %rsi +000000000000003d movq %rcx, %r8 +0000000000000040 callq *%r9 +0000000000000043 vmovaps 0x10(%rsp), %xmm0 +0000000000000049 vmovaps %xmm0, (%rsp) +000000000000004e movabsq $0x600003ee9bd0, %rax +0000000000000058 movabsq $0x7fb2eb07fc38, %rdi +0000000000000062 movl $0x20, %esi +0000000000000067 callq *(%rax) +0000000000000069 vmovaps (%rsp), %xmm0 +000000000000006e vmovups %xmm0, 0x10(%rax) +0000000000000073 movabsq $0x600003ee9bd8, %rcx +000000000000007d movq %rax, %rdi +0000000000000080 callq *(%rcx) +0000000000000082 addq $0x28, %rsp +0000000000000086 retq +0000000000000087 movabsq $0x600003ee9bc0, %rax +0000000000000091 callq *(%rax) +0000000000000093 jmp 0x21 +<8, 8, 8, 8> +*** + +~~~Reached emit_entry_bb for test diff --git a/src/mono/sample/HelloWorld/log_llvm_test.txt b/src/mono/sample/HelloWorld/log_llvm_test.txt new file mode 100644 index 00000000000000..6556c993aae672 --- /dev/null +++ b/src/mono/sample/HelloWorld/log_llvm_test.txt @@ -0,0 +1,404 @@ +converting llvm method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +created temp 0 (R16) of type System.Runtime.Intrinsics.Vector128 +creating vars +created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 +created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 + return : arg R16 <- + arg [0]: arg R17 <- + arg [1]: arg R18 <- +creating locals + local [0]: created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 +locals done +created temp 4 (R20) of type System.IntPtr +vret_addr = arg R20 <- +method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +converting (in B3: stack: 0) IL_0000: nop +converting (in B3: stack: 0) IL_0001: ldarg.0 +converting (in B3: stack: 1) IL_0002: ldarg.1 +converting (in B3: stack: 2) IL_0003: call 0x2b000001 +cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Add (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +converting (in B3: stack: 1) IL_0008: stloc.0 +converting (in B3: stack: 0) IL_0009: br.s IL_000b +converting (in B4: stack: 0) IL_000b: ldloc.0 +converting (in B4: stack: 1) IL_000c: ret +REGION BB0 IL_0000 ID_FFFFFFFF +REGION BB2 IL_0000 ID_FFFFFFFF +REGION BB3 IL_0009 ID_FFFFFFFF +REGION BB4 IL_000c ID_FFFFFFFF +REGION BB1 IL_0000 ID_FFFFFFFF +AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] +AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] + xzero R19 <- +AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] + il_seq_point intr il: 0x0 + nop + il_seq_point il: 0x1 + xmove R21 <- R17 + xmove R22 <- R18 + xbinop R23 <- R21 R22 + il_seq_point il: 0x8, nonempty-stack + xmove R19 <- R23 + il_seq_point il: 0x9 + br [B4] +AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] + il_seq_point il: 0xb + xmove R24 <- R19 + il_seq_point intr il: 0xc + move R25 <- R20 + storex_membase [R25] <- R24 + br [B1] +AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] +CCOPY/2: R21 -> R17 +CCOPY/2: R22 -> R18 +CCOPY: R25 -> R20 +CCOPY/2: R24 -> R19 + +HANDLE-GLOBAL-VREGS BLOCK 0: + +HANDLE-GLOBAL-VREGS BLOCK 2: + xzero R19 <- + +HANDLE-GLOBAL-VREGS BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xmove R21 <- R17 + xmove R22 <- R18 + xbinop R23 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + xmove R19 <- R23 + il_seq_point il: 0x9 + br [B4] + +HANDLE-GLOBAL-VREGS BLOCK 4: + il_seq_point il: 0xb + xmove R24 <- R19 + il_seq_point intr il: 0xc + move R25 <- R20 + storex_membase [R20] <- R19 + br [B1] + +HANDLE-GLOBAL-VREGS BLOCK 1: + setret R16 + Reverse copyprop in BB3 on xmove R19 <- R23 +BB0 IN: +BB2 IN: 0 +BB3 IN: 2 +BB4 IN: 3 +BB1 IN: 4 +DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) 0 +BB0(dfn=0) (IDOM=BB-1): BB0 +BB2(dfn=1) (IDOM=BB0): BB0 BB2 +BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 +BB4(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB4 +BB1(dfn=4) (IDOM=BB4): BB0 BB2 BB3 BB4 BB1 +SKIPPING SAFEPOINTS for code compiled with LLVM + +COMPUTE SSA 5 (R26-) + + +LIVENESS: +BLOCK BB0 (BB2, ): +GEN BB0: {} +KILL BB0: {} +BLOCK BB2 (BB3, ): + 1 xzero R19 <- + KILL: R19(3) +GEN BB2: {} +KILL BB2: {3} +BLOCK BB3 (BB4, ): + 1 il_seq_point intr il: 0x0 + 1 il_seq_point il: 0x1 + 1 xbinop R19 <- R17 R18 + GEN: R17(1) + GEN: R18(2) + KILL: R19(3) + 1 il_seq_point il: 0x8, nonempty-stack + 1 il_seq_point il: 0x9 + 1 br [B4] +GEN BB3: {1, 2} +KILL BB3: {3} +BLOCK BB4 (BB1, ): + 1 il_seq_point il: 0xb + 1 il_seq_point intr il: 0xc + 1 storex_membase [R20] <- R19 + GEN: R19(3) + 1 br [B1] +GEN BB4: {3, 4} +KILL BB4: {} +BLOCK BB1 (): + 1 setret R16 + GEN: R16(0) +GEN BB1: {0} +KILL BB1: {} + +ITERATION: +P: BB1(4): IN: BB4 OUT: +P: BB4(3): IN: BB3 OUT:BB1 + LIVE IN BB4: {0, 3, 4} +P: BB3(2): IN: BB2 OUT:BB4 + LIVE IN BB3: {0, 1, 2, 4} +P: BB2(1): IN: BB0 OUT:BB3 + LIVE IN BB2: {0, 1, 2, 4} +P: BB0(0): IN: OUT:BB2 + LIVE IN BB0: {0, 1, 2, 4} +IT: 5 4. +LIVE IN BB1: {0} +LIVE OUT BB1: {} +LIVE IN BB4: {0, 3, 4} +LIVE OUT BB4: {0} +LIVE IN BB3: {0, 1, 2, 4} +LIVE OUT BB3: {0, 3, 4} +LIVE IN BB2: {0, 1, 2, 4} +LIVE OUT BB2: {0, 1, 2, 4} +LIVE IN BB0: {0, 1, 2, 4} +LIVE OUT BB0: {0, 1, 2, 4} +V0: [0x0 - 0x100002] +V1: [0x0 - 0x80006] +V2: [0x0 - 0x80006] +V3: [0x40003 - 0xc0006] +V4: [0x0 - 0xc0006] + +RENAME VARS BLOCK 0: + +RENAME VARS BLOCK 2: + +RENAME VARS BLOCK 3: +created temp 5 (R26) of type System.Runtime.Intrinsics.Vector128 + R19 -> R26 + +RENAME VARS BLOCK 4: + +RENAME VARS BLOCK 1: + +END COMPUTE SSA. + +IR code for method HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) + +BB0 (0) (len: 0): + prev: succ: BB2 + idom: BB-1 + dominators: BB0 + dfrontier: + +BB2 (1) (len: 0): + xzero R19 <- + prev: BB0 succ: BB3 + idom: BB0 + dominators: [BB0] BB2 + dfrontier: + +BB3 (2) (len: 11): + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R26 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] + prev: BB2 succ: BB4 + idom: BB2 + dominators: BB0 [BB2] BB3 + dfrontier: + +BB4 (3) (len: 2): + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R20] <- R26 + br [B1] + prev: BB3 succ: BB1 + idom: BB3 + dominators: BB0 BB2 [BB3] BB4 + dfrontier: + +BB1 (4) (len: 0): + setret R16 + prev: BB4 succ: + idom: BB4 + dominators: BB0 BB2 BB3 [BB4] BB1 + dfrontier: + + +ABCREM BLOCK 0: + +ABCREM BLOCK 2: + +ABCREM BLOCK 3: + +ABCREM BLOCK 4: + +ABCREM BLOCK 1: + +ABCREM BLOCK/2 0 [dfn 0]... + +ABCREM BLOCK/2 2 [dfn 1]... + xzero R19 <- + +ABCREM BLOCK/2 3 [dfn 2]... + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R26 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] + +ABCREM BLOCK/2 4 [dfn 3]... + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R20] <- R26 + br [B1] + +ABCREM BLOCK/2 1 [dfn 4]... + setret R16 +BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R19 <- +AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R19 <- +BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R26 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R26 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +BEFORE LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R20] <- R26 + br [B1] +AFTER LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R20] <- R26 + br [B1] +BEFORE LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] + setret R16 +AFTER LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] + setret R16 +DUMP BLOCK 0: +DUMP BLOCK 2: + xzero R19 <- +DUMP BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R26 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +DUMP BLOCK 4: + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R20] <- R26 + br [B1] +DUMP BLOCK 1: + setret R16 +~~~Reached emit_entry_bb for test + +*** Unoptimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +; ModuleID = 'jit-module-test' +source_filename = "jit-module-test" + +; Function Attrs: noinline uwtable +define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1) #0 { +BB0: + %2 = alloca <4 x i32>, align 16 + %3 = alloca <4 x i32>, align 16 + %4 = bitcast <4 x i32>* %3 to i8* + %5 = getelementptr i8, i8* %4, i32 0 + %6 = bitcast i8* %5 to i64* + store i64 %arg_a, i64* %6, align 4 + %7 = getelementptr i8, i8* %4, i32 8 + %8 = bitcast i8* %7 to i64* + store i64 %0, i64* %8, align 4 + %simd_vtype = load <4 x i32>, <4 x i32>* %3, align 16 + %9 = bitcast <4 x i32>* %2 to i8* + %10 = getelementptr i8, i8* %9, i32 0 + %11 = bitcast i8* %10 to i64* + store i64 %arg_b, i64* %11, align 4 + %12 = getelementptr i8, i8* %9, i32 8 + %13 = bitcast i8* %12 to i64* + store i64 %1, i64* %13, align 4 + %simd_vtype1 = load <4 x i32>, <4 x i32>* %2, align 16 + br label %BB2 + +BB2: ; preds = %BB0 + br label %BB3 + +BB3: ; preds = %BB2 + %14 = add <4 x i32> %simd_vtype, %simd_vtype1 + br label %BB4 + +BB4: ; preds = %BB3 + %15 = add i64 %vret, 0 + %16 = inttoptr i64 %15 to <4 x i32>* + store <4 x i32> %14, <4 x i32>* %16, align 1 + br label %BB1 + +BB1: ; preds = %BB4 + ret void +} + +attributes #0 = { noinline uwtable } + +*** + + +*** Optimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +; ModuleID = 'jit-module-test' +source_filename = "jit-module-test" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" + +; Function Attrs: noinline uwtable +define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1) #0 { +BB0: + %2 = bitcast i64 %arg_a to <2 x i32> + %.0.vec.expand = shufflevector <2 x i32> %2, <2 x i32> undef, <4 x i32> + %3 = bitcast i64 %0 to <2 x i32> + %.8.vec.expand = shufflevector <2 x i32> %3, <2 x i32> undef, <4 x i32> + %.8.vecblend = shufflevector <4 x i32> %.0.vec.expand, <4 x i32> %.8.vec.expand, <4 x i32> + %4 = bitcast i64 %arg_b to <2 x i32> + %.0.vec.expand5 = shufflevector <2 x i32> %4, <2 x i32> undef, <4 x i32> + %5 = bitcast i64 %1 to <2 x i32> + %.8.vec.expand8 = shufflevector <2 x i32> %5, <2 x i32> undef, <4 x i32> + %.8.vecblend9 = shufflevector <4 x i32> %.0.vec.expand5, <4 x i32> %.8.vec.expand8, <4 x i32> + %6 = add <4 x i32> %.8.vecblend, %.8.vecblend9 + %7 = inttoptr i64 %vret to <4 x i32>* + store <4 x i32> %6, <4 x i32>* %7, align 1 + ret void +} + +attributes #0 = { noinline uwtable } + +!mono.function_indexes = !{!0} + +!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", i32 1} + +*** + +CFA: [0] def_cfa: %rsp+0x8 +CFA: [0] offset: pc at cfa-0x8 +LLVM Method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) emitted at 0x10da9e290 to 0x10da9e2b5 (code length 37) + +*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.AZpjcK: +(__TEXT,__text) section +loWorld_Program_test__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__: +0000000000000000 vmovq %rdx, %xmm0 +0000000000000005 vmovq %rsi, %xmm1 +000000000000000a vpunpcklqdq %xmm0, %xmm1, %xmm0 +000000000000000e vmovq %r8, %xmm1 +0000000000000013 vmovq %rcx, %xmm2 +0000000000000018 vpunpcklqdq %xmm1, %xmm2, %xmm1 +000000000000001c vpaddd %xmm1, %xmm0, %xmm0 +0000000000000020 vmovdqu %xmm0, (%rdi) +0000000000000024 retq +<8, 8, 8, 8> +*** + diff --git a/src/mono/sample/HelloWorld/log_nollvm.txt b/src/mono/sample/HelloWorld/log_nollvm.txt new file mode 100644 index 00000000000000..ccf200f5688748 --- /dev/null +++ b/src/mono/sample/HelloWorld/log_nollvm.txt @@ -0,0 +1,478 @@ +converting method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +created temp 0 (R16) of type System.Runtime.Intrinsics.Vector128 +creating vars +created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 +created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 +created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 + return : arg R16 <- + arg [0]: arg R17 <- + arg [1]: arg R18 <- + arg [2]: arg R19 <- +creating locals + local [0]: created temp 4 (R20) of type System.Runtime.Intrinsics.Vector128 +locals done +created temp 5 (R21) of type System.IntPtr +vret_addr = arg R21 <- +method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +converting (in B3: stack: 0) IL_0000: nop +converting (in B3: stack: 0) IL_0001: ldarg.0 +converting (in B3: stack: 1) IL_0002: ldarg.1 +converting (in B3: stack: 2) IL_0003: call 0x2b000001 +cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) +created temp 6 (R24) of type System.Runtime.Intrinsics.Vector128 +converting (in B3: stack: 1) IL_0008: stloc.0 +converting (in B3: stack: 0) IL_0009: br.s IL_000b +converting (in B4: stack: 0) IL_000b: ldloc.0 +converting (in B4: stack: 1) IL_000c: ret +REGION BB0 IL_0000 ID_FFFFFFFF +REGION BB2 IL_0000 ID_FFFFFFFF +REGION BB3 IL_0009 ID_FFFFFFFF +REGION BB4 IL_000c ID_FFFFFFFF +REGION BB1 IL_0000 ID_FFFFFFFF +AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] +AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] + xzero R20 <- +AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] + il_seq_point intr il: 0x0 + nop + il_seq_point il: 0x1 + xmove R22 <- R17 + xmove R23 <- R18 + outarg_vtretaddr R25 <- R24 + outarg_vt R23 + outarg_vt R22 + move R26 <- R25 + vcall R24 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c + il_seq_point il: 0x8, nonempty-stack + xmove R20 <- R24 + il_seq_point il: 0x9 + br [B4] +AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] + il_seq_point il: 0xb + xmove R27 <- R20 + il_seq_point intr il: 0xc + move R28 <- R21 + storex_membase [R28] <- R27 + br [B1] +AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] +CCOPY/2: R23 -> R18 +CCOPY/2: R22 -> R17 +CCOPY: R28 -> R21 +CCOPY/2: R27 -> R20 +block merge triggered 2 -> 3 +br removal triggered 4 -> 1 +br removal triggered 2 -> 4 +block merge triggered 2 -> 4 + +HANDLE-GLOBAL-VREGS BLOCK 0: + +HANDLE-GLOBAL-VREGS BLOCK 2: + xzero R20 <- + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xmove R22 <- R17 + xmove R23 <- R18 + outarg_vtretaddr R25 <- R24 + outarg_vt R18 + outarg_vt R17 + move R26 <- R25 + vcall R24 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c + il_seq_point il: 0x8, nonempty-stack + xmove R20 <- R24 + il_seq_point il: 0x9 + nop + il_seq_point il: 0xb + xmove R27 <- R20 + il_seq_point intr il: 0xc + move R28 <- R21 + storex_membase [R21] <- R20 + nop + +HANDLE-GLOBAL-VREGS BLOCK 1: +CONVERTED R20(4) TO VREG. +CONVERTED R24(6) TO VREG. + Reverse copyprop in BB2 on xmove R20 <- R24 +BB0 IN: +BB2 IN: 0 +BB1 IN: 2 +DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) 0 +BB0(dfn=0) (IDOM=BB-1): BB0 +BB2(dfn=1) (IDOM=BB0): BB0 BB2 +BB1(dfn=2) (IDOM=BB2): BB0 BB2 BB1 +INSERTING SAFEPOINTS +BEFORE SAFEPOINTS 0: [IN: , OUT: BB2(1) ] +BEFORE SAFEPOINTS 2: [IN: BB0(0), OUT: BB1(2) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + outarg_vtretaddr R25 <- R24 + outarg_vt R18 + outarg_vt R17 + move R26 <- R25 + vcall R20 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R20 +BEFORE SAFEPOINTS 1: [IN: BB2(1), OUT: ] +ADDING SAFE POINT TO BB 0 +AFTER SAFEPOINTS 0: [IN: , OUT: BB2(1) ] + i8const R29 <- [4529466904] + gc_safe_point R29 clobbers: c +AFTER SAFEPOINTS 2: [IN: BB0(0), OUT: BB1(2) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + outarg_vtretaddr R25 <- R24 + outarg_vt R18 + outarg_vt R17 + move R26 <- R25 + vcall R20 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R20 +AFTER SAFEPOINTS 1: [IN: BB2(1), OUT: ] +BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] + i8const R29 <- [4529466904] + gc_safe_point R29 clobbers: c +AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] + i8const R29 <- [4529466904] + gc_safe_point R29 clobbers: c +BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB1(2) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + outarg_vtretaddr R25 <- R24 + outarg_vt R18 + outarg_vt R17 + move R26 <- R25 + vcall R20 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R20 +created temp 5 (R20) of type System.Runtime.Intrinsics.Vector128 +AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB1(2) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + ldaddr R25 <- R20 + ldaddr R31 <- R18 + load_membase R32 <- [R31 + 0x0] + move R33 <- R32 + load_membase R34 <- [R31 + 0x8] + move R35 <- R34 + ldaddr R36 <- R17 + load_membase R37 <- [R36 + 0x0] + move R38 <- R37 + load_membase R39 <- [R36 + 0x8] + move R40 <- R39 + move R26 <- R25 + vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + il_seq_point il: 0xb + il_seq_point intr il: 0xc + storex_membase [R21] <- R20 +BEFORE LOWER-VTYPE-OPTS 1: [IN: BB2(1), OUT: ] +AFTER LOWER-VTYPE-OPTS 1: [IN: BB2(1), OUT: ] + +LIVENESS: +BLOCK BB0 (BB2, ): + 1 i8const R29 <- [4529466904] + 1 gc_safe_point R29 clobbers: c +GEN BB0: {} +KILL BB0: {} +BLOCK BB2 (BB1, ): + 1 il_seq_point intr il: 0x0 + 1 il_seq_point il: 0x1 + 1 ldaddr R25 <- R20 + GEN: R20(5) + 1 ldaddr R31 <- R18 + GEN: R18(2) + 1 load_membase R32 <- [R31 + 0x0] + 1 move R33 <- R32 + 1 load_membase R34 <- [R31 + 0x8] + 1 move R35 <- R34 + 1 ldaddr R36 <- R17 + GEN: R17(1) + 1 load_membase R37 <- [R36 + 0x0] + 1 move R38 <- R37 + 1 load_membase R39 <- [R36 + 0x8] + 1 move R40 <- R39 + 1 move R26 <- R25 + 1 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c + 1 il_seq_point il: 0x8, nonempty-stack + 1 il_seq_point il: 0x9 + 1 il_seq_point il: 0xb + 1 il_seq_point intr il: 0xc + 1 storex_membase [R21] <- R20 + GEN: R20(5) +GEN BB2: {1, 2, 4, 5} +KILL BB2: {} +BLOCK BB1 (): +GEN BB1: {} +KILL BB1: {} + +ITERATION: +P: BB1(2): IN: BB2 OUT: +P: BB2(1): IN: BB0 OUT:BB1 + LIVE IN BB2: {1, 2, 4, 5} +P: BB0(0): IN: OUT:BB2 + LIVE IN BB0: {1, 2, 4, 5} +IT: 3 2. +LIVE IN BB1: {} +LIVE OUT BB1: {} +LIVE IN BB2: {1, 2, 4, 5} +LIVE OUT BB2: {} +LIVE IN BB0: {1, 2, 4, 5} +LIVE OUT BB0: {1, 2, 4, 5} +V0: [0x0 - 0x0] +V1: [0x0 - 0x40012] +V2: [0x0 - 0x40008] +V3: [0x0 - 0x0] +V4: [0x0 - 0x40028] +V5: [0x0 - 0x40028] +COSTLY: R4 C1 C1 %r15 +NOT REGVAR: 4 +vret_addr = regoffset R21 <- R5 + 0xfffffffffffffff8 + +SPILL BLOCK 0: + i8const R29 <- [4529466904] + i 29 + 1 i8const R29 <- [4529466904] + gc_safe_point R29 clobbers: c + i -1 29 + 1 gc_safe_point R29 clobbers: c + +SPILL BLOCK 2: + il_seq_point intr il: 0x0 + -1 + 1 il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + -1 + 1 il_seq_point il: 0x1 + ldaddr R25 <- R20 + ii 25 5 + 1 add_imm R25 <- %rbp [-32] clobbers: 1 + ldaddr R31 <- R18 + ii 31 5 + 1 add_imm R31 <- %rbp [-64] clobbers: 1 + load_membase R32 <- [R31 + 0x0] + ii 32 31 + 1 load_membase R32 <- [R31 + 0x0] + move R33 <- R32 + ii 33 32 + 1 move R33 <- R32 + load_membase R34 <- [R31 + 0x8] + ii 34 31 + 1 load_membase R34 <- [R31 + 0x8] + move R35 <- R34 + ii 35 34 + 1 move R35 <- R34 + ldaddr R36 <- R17 + ii 36 5 + 1 add_imm R36 <- %rbp [-48] clobbers: 1 + load_membase R37 <- [R36 + 0x0] + ii 37 36 + 1 load_membase R37 <- [R36 + 0x0] + move R38 <- R37 + ii 38 37 + 1 move R38 <- R37 + load_membase R39 <- [R36 + 0x8] + ii 39 36 + 1 load_membase R39 <- [R36 + 0x8] + move R40 <- R39 + ii 40 39 + 1 move R40 <- R39 + move R26 <- R25 + ii 26 25 + 1 move R26 <- R25 + vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c + -1 + 1 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c + il_seq_point il: 0x8, nonempty-stack + -1 + 1 il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + -1 + 1 il_seq_point il: 0x9 + il_seq_point il: 0xb + -1 + 1 il_seq_point il: 0xb + il_seq_point intr il: 0xc + -1 + 1 il_seq_point intr il: 0xc + storex_membase [R21] <- R20 + xi -1 20 + 0 loadx_membase R41 <- [%rbp + 0xffffffffffffffe0] + 0 load_membase R42 <- [%rbp + 0xfffffffffffffff8] + 1 storex_membase [R42] <- R41 + +SPILL BLOCK 1: + Reverse copyprop in BB2 on move R40 <- R39 + Reverse copyprop in BB2 on move R38 <- R37 + Reverse copyprop in BB2 on move R35 <- R34 + Reverse copyprop in BB2 on move R33 <- R32 +DUMP BLOCK 0: + i8const R29 <- [4529466904] + gc_safe_point R29 clobbers: c +DUMP BLOCK 2: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + add_imm R25 <- %rbp [-32] clobbers: 1 + load_membase R33 <- [%rbp + 0xffffffffffffffc0] + load_membase R35 <- [%rbp + 0xffffffffffffffc8] + load_membase R38 <- [%rbp + 0xffffffffffffffd0] + load_membase R40 <- [%rbp + 0xffffffffffffffd8] + move R26 <- R25 + vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + il_seq_point il: 0xb + il_seq_point intr il: 0xc + loadx_membase R41 <- [%rbp + 0xffffffffffffffe0] + load_membase R42 <- [%rbp + 0xfffffffffffffff8] + storex_membase [R42] <- R41 +DUMP BLOCK 1: + +LOCAL REGALLOC BLOCK 0: + 1 i8const R29 <- [4529466904] + 2 gc_safe_point R29 clobbers: c +liveness: R29 [1 - 1] +processing: 2 gc_safe_point R29 clobbers: c + assigned sreg1 %rax to R29 + 2 gc_safe_point %rax clobbers: c +processing: 1 i8const R29 <- [4529466904] + assigned dreg %rax to dest R29 + freeable %rax (R29) (born in 1) + 1 i8const %rax <- [4529466904] + +LOCAL REGALLOC BLOCK 2: + 1 il_seq_point intr il: 0x0 + 2 il_seq_point il: 0x1 + 3 add_imm R25 <- %rbp [-32] clobbers: 1 + 4 load_membase R33 <- [%rbp + 0xffffffffffffffc0] + 5 load_membase R35 <- [%rbp + 0xffffffffffffffc8] + 6 load_membase R38 <- [%rbp + 0xffffffffffffffd0] + 7 load_membase R40 <- [%rbp + 0xffffffffffffffd8] + 8 move R26 <- R25 + 9 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c + 10 il_seq_point il: 0x8, nonempty-stack + 11 il_seq_point il: 0x9 + 12 il_seq_point il: 0xb + 13 il_seq_point intr il: 0xc + 14 loadx_membase R41 <- [%rbp + 0xffffffffffffffe0] + 15 load_membase R42 <- [%rbp + 0xfffffffffffffff8] + 16 storex_membase [R42] <- R41 +liveness: R25 [3 - 3] +liveness: R26 [8 - 8] +liveness: R33 [4 - 4] +liveness: R35 [5 - 5] +liveness: R38 [6 - 6] +liveness: R40 [7 - 7] +liveness: R41 [14 - 14] +liveness: R42 [15 - 15] +processing: 16 storex_membase [R42] <- R41 + assigned dreg %rax to dest R42 + assigned sreg1 p:xmm0 to R41 + 16 storex_membase [%rax] <- p:xmm0 +processing: 15 load_membase R42 <- [%rbp + 0xfffffffffffffff8] + assigned dreg %rax to dest R42 + freeable %rax (R42) (born in 15) + 15 load_membase %rax <- [%rbp + 0xfffffffffffffff8] +processing: 14 loadx_membase R41 <- [%rbp + 0xffffffffffffffe0] + assigned dreg p:xmm0 to dest R41 + freeable p:xmm0 (R41) (born in 14) + 14 loadx_membase p:xmm0 <- [%rbp + 0xffffffffffffffe0] +processing: 13 il_seq_point intr il: 0xc + 13 il_seq_point intr il: 0xc +processing: 12 il_seq_point il: 0xb + 12 il_seq_point il: 0xb +processing: 11 il_seq_point il: 0x9 + 11 il_seq_point il: 0x9 +processing: 10 il_seq_point il: 0x8, nonempty-stack + 10 il_seq_point il: 0x8, nonempty-stack +processing: 9 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c + assigned arg reg %rdi to R26 + assigned arg reg %rcx to R33 + assigned arg reg %r8 to R35 + assigned arg reg %rsi to R38 + assigned arg reg %rdx to R40 + 9 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c +processing: 8 move R26 <- R25 + assigned dreg %rdi to dest R26 + freeable %rdi (R26) (born in 8) + assigned sreg1 %rdi to R25 + 8 move %rdi <- %rdi +processing: 7 load_membase R40 <- [%rbp + 0xffffffffffffffd8] + assigned dreg %rdx to dest R40 + freeable %rdx (R40) (born in 7) + 7 load_membase %rdx <- [%rbp + 0xffffffffffffffd8] +processing: 6 load_membase R38 <- [%rbp + 0xffffffffffffffd0] + assigned dreg %rsi to dest R38 + freeable %rsi (R38) (born in 6) + 6 load_membase %rsi <- [%rbp + 0xffffffffffffffd0] +processing: 5 load_membase R35 <- [%rbp + 0xffffffffffffffc8] + assigned dreg %r8 to dest R35 + freeable %r8 (R35) (born in 5) + 5 load_membase %r8 <- [%rbp + 0xffffffffffffffc8] +processing: 4 load_membase R33 <- [%rbp + 0xffffffffffffffc0] + assigned dreg %rcx to dest R33 + freeable %rcx (R33) (born in 4) + 4 load_membase %rcx <- [%rbp + 0xffffffffffffffc0] +processing: 3 add_imm R25 <- %rbp [-32] clobbers: 1 + assigned dreg %rdi to dest R25 + freeable %rdi (R25) (born in 3) + need to copy sreg1 %rbp to dreg %rdi + forced copy from %rbp to %rdi + 3 add_imm %rdi <- %rdi [-32] clobbers: 1 +processing: 2 il_seq_point il: 0x1 + 2 il_seq_point il: 0x1 +processing: 1 il_seq_point intr il: 0x0 + 1 il_seq_point intr il: 0x0 +CFA: [0] def_cfa: %rsp+0x8 +CFA: [0] offset: unknown at cfa-0x8 +CFA: [1] def_cfa_offset: 0x10 +CFA: [1] offset: %rbp at cfa-0x10 +CFA: [4] def_cfa_reg: %rbp +Basic block 0 starting at offset 0x1c +Basic block 2 starting at offset 0x3b +Basic block 1 starting at offset 0x6e +CFA: [6f] def_cfa: %rsp+0x8 +Method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) emitted at 0x109be3970 to 0x109be39e0 (code length 112) + +*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** +/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.GY3IZg: +(__TEXT,__text) section +loWorld_Program_test__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__: +0000000000000000 pushq %rbp +0000000000000001 movq %rsp, %rbp +0000000000000004 subq $0x40, %rsp +0000000000000008 movq %rdi, -0x8(%rbp) +000000000000000c movq %rsi, -0x30(%rbp) +0000000000000010 movq %rdx, -0x28(%rbp) +0000000000000014 movq %rcx, -0x40(%rbp) +0000000000000018 movq %r8, -0x38(%rbp) +000000000000001c movabsq $0x10dfa2e18, %rax +0000000000000026 testl $0x1, (%rax) +000000000000002c je 0x3b +000000000000002e movabsq $0x109a0d6b4, %r11 +0000000000000038 callq *%r11 +000000000000003b movq %rbp, %rdi +000000000000003e addq $-0x20, %rdi +0000000000000042 movq -0x40(%rbp), %rcx +0000000000000046 movq -0x38(%rbp), %r8 +000000000000004a movq -0x30(%rbp), %rsi +000000000000004e movq -0x28(%rbp), %rdx +0000000000000052 leaq (%rbp), %rbp +0000000000000056 movabsq $0x109be39e0, %r11 +0000000000000060 callq *%r11 +0000000000000063 movups -0x20(%rbp), %xmm0 +0000000000000067 movq -0x8(%rbp), %rax +000000000000006b movups %xmm0, (%rax) +000000000000006e leave +000000000000006f retq +<3, 3, 3, 3> +*** + diff --git a/src/mono/sample/HelloWorld/log_v64_llvm.txt b/src/mono/sample/HelloWorld/log_v64_llvm.txt new file mode 100644 index 00000000000000..ff3868422b6be8 --- /dev/null +++ b/src/mono/sample/HelloWorld/log_v64_llvm.txt @@ -0,0 +1,394 @@ +converting llvm method System.Runtime.Intrinsics.Vector64`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) +created temp 0 (R16) of type System.Runtime.Intrinsics.Vector64 +creating vars +created temp 1 (R17) of type System.Runtime.Intrinsics.Vector64 +created temp 2 (R18) of type System.Runtime.Intrinsics.Vector64 +created temp 3 (R19) of type System.Runtime.Intrinsics.Vector64 + return : arg R16 <- + arg [0]: arg R17 <- + arg [1]: arg R18 <- + arg [2]: arg R19 <- +creating locals + local [0]: created temp 4 (R20) of type System.Runtime.Intrinsics.Vector64 +locals done +method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) +converting (in B3: stack: 0) IL_0000: nop +converting (in B3: stack: 0) IL_0001: ldarg.0 +converting (in B3: stack: 1) IL_0002: ldarg.1 +converting (in B3: stack: 2) IL_0003: call 0x2b000001 +cmethod = System.Runtime.Intrinsics.Vector64`1 System.Runtime.Intrinsics.Vector64:Min (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) +converting (in B3: stack: 1) IL_0008: stloc.0 +converting (in B3: stack: 0) IL_0009: br.s IL_000b +converting (in B4: stack: 0) IL_000b: ldloc.0 +converting (in B4: stack: 1) IL_000c: ret +REGION BB0 IL_0000 ID_FFFFFFFF +REGION BB2 IL_0000 ID_FFFFFFFF +REGION BB3 IL_0009 ID_FFFFFFFF +REGION BB4 IL_000c ID_FFFFFFFF +REGION BB1 IL_0000 ID_FFFFFFFF +AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] +AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] + xzero R20 <- +AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] + il_seq_point intr il: 0x0 + nop + il_seq_point il: 0x1 + xmove R21 <- R17 + xmove R22 <- R18 + xbinop R23 <- R21 R22 + il_seq_point il: 0x8, nonempty-stack + xmove R20 <- R23 + il_seq_point il: 0x9 + br [B4] +AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] + il_seq_point il: 0xb + xmove R24 <- R20 + il_seq_point intr il: 0xc + xmove R16 <- R24 + br [B1] +AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] +CCOPY/2: R21 -> R17 +CCOPY/2: R22 -> R18 +CCOPY/2: R24 -> R20 + +HANDLE-GLOBAL-VREGS BLOCK 0: + +HANDLE-GLOBAL-VREGS BLOCK 2: + xzero R20 <- + +HANDLE-GLOBAL-VREGS BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xmove R21 <- R17 + xmove R22 <- R18 + xbinop R23 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + xmove R20 <- R23 + il_seq_point il: 0x9 + br [B4] + +HANDLE-GLOBAL-VREGS BLOCK 4: + il_seq_point il: 0xb + xmove R24 <- R20 + il_seq_point intr il: 0xc + xmove R16 <- R20 + br [B1] + +HANDLE-GLOBAL-VREGS BLOCK 1: + setret R16 + Reverse copyprop in BB3 on xmove R20 <- R23 +BB0 IN: +BB2 IN: 0 +BB3 IN: 2 +BB4 IN: 3 +BB1 IN: 4 +DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) 0 +BB0(dfn=0) (IDOM=BB-1): BB0 +BB2(dfn=1) (IDOM=BB0): BB0 BB2 +BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 +BB4(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB4 +BB1(dfn=4) (IDOM=BB4): BB0 BB2 BB3 BB4 BB1 +SKIPPING SAFEPOINTS for code compiled with LLVM + +COMPUTE SSA 5 (R25-) + + +LIVENESS: +BLOCK BB0 (BB2, ): +GEN BB0: {} +KILL BB0: {} +BLOCK BB2 (BB3, ): + 1 xzero R20 <- + KILL: R20(4) +GEN BB2: {} +KILL BB2: {4} +BLOCK BB3 (BB4, ): + 1 il_seq_point intr il: 0x0 + 1 il_seq_point il: 0x1 + 1 xbinop R20 <- R17 R18 + GEN: R17(1) + GEN: R18(2) + KILL: R20(4) + 1 il_seq_point il: 0x8, nonempty-stack + 1 il_seq_point il: 0x9 + 1 br [B4] +GEN BB3: {1, 2} +KILL BB3: {4} +BLOCK BB4 (BB1, ): + 1 il_seq_point il: 0xb + 1 il_seq_point intr il: 0xc + 1 xmove R16 <- R20 + GEN: R20(4) + KILL: R16(0) + 1 br [B1] +GEN BB4: {4} +KILL BB4: {0} +BLOCK BB1 (): + 1 setret R16 + GEN: R16(0) +GEN BB1: {0} +KILL BB1: {} + +ITERATION: +P: BB1(4): IN: BB4 OUT: +P: BB4(3): IN: BB3 OUT:BB1 + LIVE IN BB4: {4} +P: BB3(2): IN: BB2 OUT:BB4 + LIVE IN BB3: {1, 2} +P: BB2(1): IN: BB0 OUT:BB3 + LIVE IN BB2: {1, 2} +P: BB0(0): IN: OUT:BB2 + LIVE IN BB0: {1, 2} +IT: 5 4. +LIVE IN BB1: {0} +LIVE OUT BB1: {} +LIVE IN BB4: {4} +LIVE OUT BB4: {0} +LIVE IN BB3: {1, 2} +LIVE OUT BB3: {4} +LIVE IN BB2: {1, 2} +LIVE OUT BB2: {1, 2} +LIVE IN BB0: {1, 2} +LIVE OUT BB0: {1, 2} +V0: [0x0 - 0x100002] +V1: [0x0 - 0x80006] +V2: [0x0 - 0x80006] +V3: [0x0 - 0x0] +V4: [0x40003 - 0xc0006] + +RENAME VARS BLOCK 0: + +RENAME VARS BLOCK 2: + +RENAME VARS BLOCK 3: +created temp 5 (R25) of type System.Runtime.Intrinsics.Vector64 + R20 -> R25 + +RENAME VARS BLOCK 4: +created temp 6 (R26) of type System.Runtime.Intrinsics.Vector64 + R16 -> R26 + +RENAME VARS BLOCK 1: + +END COMPUTE SSA. + +IR code for method HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) + +BB0 (0) (len: 0): + prev: succ: BB2 + idom: BB-1 + dominators: BB0 + dfrontier: + +BB2 (1) (len: 0): + xzero R20 <- + prev: BB0 succ: BB3 + idom: BB0 + dominators: [BB0] BB2 + dfrontier: + +BB3 (2) (len: 11): + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R25 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] + prev: BB2 succ: BB4 + idom: BB2 + dominators: BB0 [BB2] BB3 + dfrontier: + +BB4 (3) (len: 2): + il_seq_point il: 0xb + il_seq_point intr il: 0xc + xmove R26 <- R25 + br [B1] + prev: BB3 succ: BB1 + idom: BB3 + dominators: BB0 BB2 [BB3] BB4 + dfrontier: + +BB1 (4) (len: 0): + setret R26 + prev: BB4 succ: + idom: BB4 + dominators: BB0 BB2 BB3 [BB4] BB1 + dfrontier: + + +ABCREM BLOCK 0: + +ABCREM BLOCK 2: + +ABCREM BLOCK 3: + +ABCREM BLOCK 4: + +ABCREM BLOCK 1: + +ABCREM BLOCK/2 0 [dfn 0]... + +ABCREM BLOCK/2 2 [dfn 1]... + xzero R20 <- + +ABCREM BLOCK/2 3 [dfn 2]... + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R25 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] + +ABCREM BLOCK/2 4 [dfn 3]... + il_seq_point il: 0xb + il_seq_point intr il: 0xc + xmove R26 <- R25 + br [B1] + +ABCREM BLOCK/2 1 [dfn 4]... + setret R26 +BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] +BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R20 <- +AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] + xzero R20 <- +BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R25 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R25 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +BEFORE LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] + il_seq_point il: 0xb + il_seq_point intr il: 0xc + xmove R26 <- R25 + br [B1] +AFTER LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] + il_seq_point il: 0xb + il_seq_point intr il: 0xc + xmove R26 <- R25 + br [B1] +BEFORE LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] + setret R26 +AFTER LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] + setret R26 +DUMP BLOCK 0: +DUMP BLOCK 2: + xzero R20 <- +DUMP BLOCK 3: + il_seq_point intr il: 0x0 + il_seq_point il: 0x1 + xbinop R25 <- R17 R18 + il_seq_point il: 0x8, nonempty-stack + il_seq_point il: 0x9 + br [B4] +DUMP BLOCK 4: + il_seq_point il: 0xb + il_seq_point intr il: 0xc + xmove R26 <- R25 + br [B1] +DUMP BLOCK 1: + setret R26 + +*** Unoptimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) *** +; ModuleID = 'jit-module-test' +source_filename = "jit-module-test" + +; Function Attrs: noinline uwtable +define dso_local monocc { i64 } @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1)"(i64 %arg_a, i64 %arg_b, i64 %arg_c) #0 { +BB0: + %0 = alloca <2 x i32>, align 8 + %1 = alloca <2 x i32>, align 8 + %2 = alloca <2 x i32>, align 8 + %3 = bitcast <2 x i32>* %2 to i8* + %4 = getelementptr i8, i8* %3, i32 0 + %5 = bitcast i8* %4 to i64* + store i64 %arg_a, i64* %5, align 4 + %simd_vtype = load <2 x i32>, <2 x i32>* %2, align 8 + %6 = bitcast <2 x i32>* %1 to i8* + %7 = getelementptr i8, i8* %6, i32 0 + %8 = bitcast i8* %7 to i64* + store i64 %arg_b, i64* %8, align 4 + %simd_vtype1 = load <2 x i32>, <2 x i32>* %1, align 8 + %9 = bitcast <2 x i32>* %0 to i8* + %10 = getelementptr i8, i8* %9, i32 0 + %11 = bitcast i8* %10 to i64* + store i64 %arg_c, i64* %11, align 4 + %simd_vtype2 = load <2 x i32>, <2 x i32>* %0, align 8 + br label %BB2 + +BB2: ; preds = %BB0 + br label %BB3 + +BB3: ; preds = %BB2 + %12 = icmp slt <2 x i32> %simd_vtype, %simd_vtype1 + %13 = select <2 x i1> %12, <2 x i32> %simd_vtype, <2 x i32> %simd_vtype1 + br label %BB4 + +BB4: ; preds = %BB3 + br label %BB1 + +BB1: ; preds = %BB4 + %14 = bitcast <2 x i32> %13 to <1 x i64> + %15 = extractelement <1 x i64> %14, i32 0 + %setret_simd_vtype_in_reg = insertvalue { i64 } undef, i64 %15, 0 + ret { i64 } %setret_simd_vtype_in_reg +} + +attributes #0 = { noinline uwtable } + +*** + + +*** Optimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) *** +; ModuleID = 'jit-module-test' +source_filename = "jit-module-test" +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" + +; Function Attrs: noinline uwtable +define dso_local monocc { i64 } @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1)"(i64 %arg_a, i64 %arg_b, i64 %arg_c) #0 { +BB0: + %0 = bitcast i64 %arg_a to <2 x i32> + %1 = bitcast i64 %arg_b to <2 x i32> + %2 = icmp slt <2 x i32> %0, %1 + %3 = select <2 x i1> %2, <2 x i32> %0, <2 x i32> %1 + %4 = bitcast <2 x i32> %3 to <1 x i64> + %5 = extractelement <1 x i64> %4, i32 0 + %setret_simd_vtype_in_reg = insertvalue { i64 } undef, i64 %5, 0 + ret { i64 } %setret_simd_vtype_in_reg +} + +attributes #0 = { noinline uwtable } + +!mono.function_indexes = !{!0} + +!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1)", i32 1} + +*** + +CFA: [0] def_cfa: %rsp+0x8 +CFA: [0] offset: pc at cfa-0x8 +LLVM Method System.Runtime.Intrinsics.Vector64`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) emitted at 0x100b98290 to 0x100b982a5 (code length 21) + +*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) *** +/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.pmTEYC: +(__TEXT,__text) section +loWorld_Program_test__System_Runtime_Intrinsics_Vector64_1_int__System_Runtime_Intrinsics_Vector64_1_int__System_Runtime_Intrinsics_Vector64_1_int__: +0000000000000000 vmovq %rdi, %xmm0 +0000000000000005 vmovq %rsi, %xmm1 +000000000000000a vpminsd %xmm1, %xmm0, %xmm0 +000000000000000f vmovq %xmm0, %rax +0000000000000014 retq +<3, 3> +*** + From a069e0e3d0d20b22555b1b2274a7a890a595a3f4 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Tue, 3 May 2022 18:03:08 -0400 Subject: [PATCH 02/11] Fix llvm signature --- src/mono/mono/mini/mini-llvm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 6910eff93d93a9..3722124de4f59d 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -1542,6 +1542,9 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * gboolean vretaddr = FALSE; MonoType *rtype; + if (strstr(ctx->method_name, "test") != NULL) + printf("~~~Reached sig_to_llvm_sig_full for Min\n"); + if (!cinfo) return sig_to_llvm_sig_no_cinfo (ctx, sig); @@ -1696,6 +1699,11 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * } } break; + case LLVMArgVtypeInSIMDReg: { + MonoClass *klass = mono_class_from_mono_type_internal (sig->params [i]); + param_types [pindex ++] = simd_class_to_llvm_type (ctx, klass);; + break; + } case LLVMArgVtypeByVal: param_types [pindex] = type_to_llvm_arg_type (ctx, ainfo->type); if (!ctx_ok (ctx)) @@ -3866,6 +3874,7 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) ctx->addresses [reg] = build_alloca (ctx, ainfo->type); LLVMBuildStore (builder, arg, convert (ctx, ctx->addresses [reg], LLVMPointerType (LLVMTypeOf (arg), 0))); + break; } case LLVMArgVtypeByVal: { ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, pindex); From ffdcc2ac7bd289d0d76730df1f0a60c18b4c22ef Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Wed, 4 May 2022 19:30:56 -0400 Subject: [PATCH 03/11] Fix emit_call --- src/mono/mono/mini/mini-llvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 3722124de4f59d..380e07f9f9506b 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -1543,7 +1543,7 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * MonoType *rtype; if (strstr(ctx->method_name, "test") != NULL) - printf("~~~Reached sig_to_llvm_sig_full for Min\n"); + printf("~~~Reached sig_to_llvm_sig_full for test\n"); if (!cinfo) return sig_to_llvm_sig_no_cinfo (ctx, sig); @@ -4518,7 +4518,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, break; } case LLVMArgVtypeInSIMDReg: { - args [pindex] = convert (ctx, LLVMBuildLoad (ctx->builder, addresses [reg], "load_param"), IntPtrType ()); + args [pindex] = LLVMBuildLoad (ctx->builder, addresses [reg], "load_param"); break; } case LLVMArgVtypeByVal: @@ -12353,6 +12353,7 @@ mono_llvm_emit_call (MonoCompile *cfg, MonoCallInst *call) case LLVMArgVtypeByVal: case LLVMArgVtypeByRef: case LLVMArgVtypeInReg: + case LLVMArgVtypeInSIMDReg: case LLVMArgVtypeAddr: case LLVMArgVtypeAsScalar: case LLVMArgAsIArgs: From 6e42d9113e03faae3da92a022ae3b7c745703479 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 6 May 2022 15:02:15 -0700 Subject: [PATCH 04/11] Enable passing SIMD register on arm64 and clean up debugging stuff --- src/mono/mono/mini/intrinsics.c | 6 +- src/mono/mono/mini/mini-arm64.c | 15 + src/mono/mono/mini/mini-llvm.c | 9 - src/mono/mono/mini/simd-intrinsics.c | 2 - src/mono/sample/HelloWorld/Program.cs | 31 +- src/mono/sample/HelloWorld/log_llvm.txt | 409 ------------ src/mono/sample/HelloWorld/log_llvm_add.txt | 407 ------------ src/mono/sample/HelloWorld/log_llvm_main.txt | 652 ------------------- src/mono/sample/HelloWorld/log_llvm_test.txt | 404 ------------ src/mono/sample/HelloWorld/log_nollvm.txt | 478 -------------- src/mono/sample/HelloWorld/log_v64_llvm.txt | 394 ----------- 11 files changed, 26 insertions(+), 2781 deletions(-) delete mode 100644 src/mono/sample/HelloWorld/log_llvm.txt delete mode 100644 src/mono/sample/HelloWorld/log_llvm_add.txt delete mode 100644 src/mono/sample/HelloWorld/log_llvm_main.txt delete mode 100644 src/mono/sample/HelloWorld/log_llvm_test.txt delete mode 100644 src/mono/sample/HelloWorld/log_nollvm.txt delete mode 100644 src/mono/sample/HelloWorld/log_v64_llvm.txt diff --git a/src/mono/mono/mini/intrinsics.c b/src/mono/mono/mini/intrinsics.c index 09a326a8215a30..a62100b5e0e3d2 100644 --- a/src/mono/mono/mini/intrinsics.c +++ b/src/mono/mono/mini/intrinsics.c @@ -2039,11 +2039,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign return ins; } } - } - if (!strcmp(cmethod->name, "Min") && !strcmp(cmethod_klass_name, "Vector128")){ - printf ("mini_emit_inst_for Min\n"); - } - + } #ifdef MONO_ARCH_SIMD_INTRINSICS if (cfg->opt & MONO_OPT_SIMD) { diff --git a/src/mono/mono/mini/mini-arm64.c b/src/mono/mono/mini/mini-arm64.c index 75a6d5b3adbc14..f1bf765fbe6066 100644 --- a/src/mono/mono/mini/mini-arm64.c +++ b/src/mono/mono/mini/mini-arm64.c @@ -2491,6 +2491,13 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) lainfo->storage = LLVMArgNone; + MonoType *t; + if (i >= sig->hasthis) + t = sig->params [i - sig->hasthis]; + else + t = mono_get_int_type (); + t = mini_type_get_underlying_type (t); + switch (ainfo->storage) { case ArgInIReg: case ArgInFReg: @@ -2515,6 +2522,14 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) break; } case ArgVtypeInIRegs: + if (t->type == MONO_TYPE_GENERICINST) { + MonoClass *klass = mono_class_from_mono_type_internal (t); + if (!strcmp (m_class_get_name (klass), "Vector128`1")) { + lainfo->storage = LLVMArgVtypeInSIMDReg; + break; + } + } + lainfo->storage = LLVMArgAsIArgs; lainfo->nslots = ainfo->nregs; break; diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 380e07f9f9506b..b44b121100919f 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -1542,9 +1542,6 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * gboolean vretaddr = FALSE; MonoType *rtype; - if (strstr(ctx->method_name, "test") != NULL) - printf("~~~Reached sig_to_llvm_sig_full for test\n"); - if (!cinfo) return sig_to_llvm_sig_no_cinfo (ctx, sig); @@ -3836,9 +3833,6 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) names = g_new (char *, sig->param_count); mono_method_get_param_names (cfg->method, (const char **) names); - if (strstr(ctx->method_name, "test") != NULL) - printf("~~~Reached emit_entry_bb for test\n"); - for (int i = 0; i < sig->param_count; ++i) { LLVMArgInfo *ainfo = &linfo->args [i + sig->hasthis]; int reg = cfg->args [i + sig->hasthis]->dreg; @@ -11621,9 +11615,6 @@ emit_method_inner (EmitContext *ctx) sig = mono_method_signature_internal (cfg->method); ctx->sig = sig; - if (strstr(ctx->method_name, "test") != NULL) - printf("~~~Reached emit_method_inner for test\n"); - linfo = get_llvm_call_info (cfg, sig); ctx->linfo = linfo; if (!ctx_ok (ctx)) diff --git a/src/mono/mono/mini/simd-intrinsics.c b/src/mono/mono/mini/simd-intrinsics.c index dc5edc10471fb8..db173284e120cc 100644 --- a/src/mono/mono/mini/simd-intrinsics.c +++ b/src/mono/mono/mini/simd-intrinsics.c @@ -1026,8 +1026,6 @@ emit_sri_vector (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsi case SN_Xor: if (!is_element_type_primitive (fsig->params [0])) return NULL; - if (id == SN_Min) - printf("~~~Reached!~~~\n"); return emit_simd_ins_for_binary_op (cfg, klass, fsig, args, arg0_type, id); case SN_AndNot: #ifdef TARGET_ARM64 diff --git a/src/mono/sample/HelloWorld/Program.cs b/src/mono/sample/HelloWorld/Program.cs index 760924e71b51f3..6d0b31d30dc6f8 100644 --- a/src/mono/sample/HelloWorld/Program.cs +++ b/src/mono/sample/HelloWorld/Program.cs @@ -1,30 +1,19 @@ -using System; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.Arm; -using System.Runtime.CompilerServices; -using System.Numerics; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; namespace HelloWorld { internal class Program { - [MethodImpl(MethodImplOptions.NoInlining)] - private static Vector128 test(Vector128 a, Vector128 b) - { - // return AdvSimd.Multiply(AdvSimd.Subtract(AdvSimd.Add(a, b), c), b); - // return Vector128.Multiply(Vector128.Subtract(Vector128.Add(a, b), c), b); - return Vector128.Add(a,b); - } - private static void Main(string[] args) { - Vector128 A = Vector128.Create((int)3.1); - Vector128 B = Vector128.Create((int)5.7); - - // Vector128 result = Vector128.Abs(A); - // Vector128 result = AdvSimd.Add(A, B); - var result = test(A, B); - Console.WriteLine(result); + bool isMono = typeof(object).Assembly.GetType("Mono.RuntimeStructs") != null; + Console.WriteLine($"Hello World {(isMono ? "from Mono!" : "from CoreCLR!")}"); + Console.WriteLine(typeof(object).Assembly.FullName); + Console.WriteLine(System.Reflection.Assembly.GetEntryAssembly ()); + Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription); } } -} +} \ No newline at end of file diff --git a/src/mono/sample/HelloWorld/log_llvm.txt b/src/mono/sample/HelloWorld/log_llvm.txt deleted file mode 100644 index 21a70daceefea3..00000000000000 --- a/src/mono/sample/HelloWorld/log_llvm.txt +++ /dev/null @@ -1,409 +0,0 @@ -converting llvm method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -created temp 0 (R16) of type System.Runtime.Intrinsics.Vector128 -creating vars -created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 -created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 -created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 - return : arg R16 <- - arg [0]: arg R17 <- - arg [1]: arg R18 <- - arg [2]: arg R19 <- -creating locals - local [0]: created temp 4 (R20) of type System.Runtime.Intrinsics.Vector128 -locals done -created temp 5 (R21) of type System.IntPtr -vret_addr = arg R21 <- -method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -converting (in B3: stack: 0) IL_0000: nop -converting (in B3: stack: 0) IL_0001: ldarg.0 -converting (in B3: stack: 1) IL_0002: ldarg.1 -converting (in B3: stack: 2) IL_0003: call 0x2b000001 -cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -converting (in B3: stack: 1) IL_0008: stloc.0 -converting (in B3: stack: 0) IL_0009: br.s IL_000b -converting (in B4: stack: 0) IL_000b: ldloc.0 -converting (in B4: stack: 1) IL_000c: ret -REGION BB0 IL_0000 ID_FFFFFFFF -REGION BB2 IL_0000 ID_FFFFFFFF -REGION BB3 IL_0009 ID_FFFFFFFF -REGION BB4 IL_000c ID_FFFFFFFF -REGION BB1 IL_0000 ID_FFFFFFFF -AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] -AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] - xzero R20 <- -AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] - il_seq_point intr il: 0x0 - nop - il_seq_point il: 0x1 - xmove R22 <- R17 - xmove R23 <- R18 - xbinop R24 <- R22 R23 - il_seq_point il: 0x8, nonempty-stack - xmove R20 <- R24 - il_seq_point il: 0x9 - br [B4] -AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] - il_seq_point il: 0xb - xmove R25 <- R20 - il_seq_point intr il: 0xc - move R26 <- R21 - storex_membase [R26] <- R25 - br [B1] -AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] -CCOPY/2: R22 -> R17 -CCOPY/2: R23 -> R18 -CCOPY: R26 -> R21 -CCOPY/2: R25 -> R20 - -HANDLE-GLOBAL-VREGS BLOCK 0: - -HANDLE-GLOBAL-VREGS BLOCK 2: - xzero R20 <- - -HANDLE-GLOBAL-VREGS BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xmove R22 <- R17 - xmove R23 <- R18 - xbinop R24 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - xmove R20 <- R24 - il_seq_point il: 0x9 - br [B4] - -HANDLE-GLOBAL-VREGS BLOCK 4: - il_seq_point il: 0xb - xmove R25 <- R20 - il_seq_point intr il: 0xc - move R26 <- R21 - storex_membase [R21] <- R20 - br [B1] - -HANDLE-GLOBAL-VREGS BLOCK 1: - setret R16 - Reverse copyprop in BB3 on xmove R20 <- R24 -BB0 IN: -BB2 IN: 0 -BB3 IN: 2 -BB4 IN: 3 -BB1 IN: 4 -DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) 0 -BB0(dfn=0) (IDOM=BB-1): BB0 -BB2(dfn=1) (IDOM=BB0): BB0 BB2 -BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 -BB4(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB4 -BB1(dfn=4) (IDOM=BB4): BB0 BB2 BB3 BB4 BB1 -SKIPPING SAFEPOINTS for code compiled with LLVM - -COMPUTE SSA 6 (R27-) - - -LIVENESS: -BLOCK BB0 (BB2, ): -GEN BB0: {} -KILL BB0: {} -BLOCK BB2 (BB3, ): - 1 xzero R20 <- - KILL: R20(4) -GEN BB2: {} -KILL BB2: {4} -BLOCK BB3 (BB4, ): - 1 il_seq_point intr il: 0x0 - 1 il_seq_point il: 0x1 - 1 xbinop R20 <- R17 R18 - GEN: R17(1) - GEN: R18(2) - KILL: R20(4) - 1 il_seq_point il: 0x8, nonempty-stack - 1 il_seq_point il: 0x9 - 1 br [B4] -GEN BB3: {1, 2} -KILL BB3: {4} -BLOCK BB4 (BB1, ): - 1 il_seq_point il: 0xb - 1 il_seq_point intr il: 0xc - 1 storex_membase [R21] <- R20 - GEN: R20(4) - 1 br [B1] -GEN BB4: {4, 5} -KILL BB4: {} -BLOCK BB1 (): - 1 setret R16 - GEN: R16(0) -GEN BB1: {0} -KILL BB1: {} - -ITERATION: -P: BB1(4): IN: BB4 OUT: -P: BB4(3): IN: BB3 OUT:BB1 - LIVE IN BB4: {0, 4, 5} -P: BB3(2): IN: BB2 OUT:BB4 - LIVE IN BB3: {0, 1, 2, 5} -P: BB2(1): IN: BB0 OUT:BB3 - LIVE IN BB2: {0, 1, 2, 5} -P: BB0(0): IN: OUT:BB2 - LIVE IN BB0: {0, 1, 2, 5} -IT: 5 4. -LIVE IN BB1: {0} -LIVE OUT BB1: {} -LIVE IN BB4: {0, 4, 5} -LIVE OUT BB4: {0} -LIVE IN BB3: {0, 1, 2, 5} -LIVE OUT BB3: {0, 4, 5} -LIVE IN BB2: {0, 1, 2, 5} -LIVE OUT BB2: {0, 1, 2, 5} -LIVE IN BB0: {0, 1, 2, 5} -LIVE OUT BB0: {0, 1, 2, 5} -V0: [0x0 - 0x100002] -V1: [0x0 - 0x80006] -V2: [0x0 - 0x80006] -V3: [0x0 - 0x0] -V4: [0x40003 - 0xc0006] -V5: [0x0 - 0xc0006] - -RENAME VARS BLOCK 0: - -RENAME VARS BLOCK 2: - -RENAME VARS BLOCK 3: -created temp 6 (R27) of type System.Runtime.Intrinsics.Vector128 - R20 -> R27 - -RENAME VARS BLOCK 4: - -RENAME VARS BLOCK 1: - -END COMPUTE SSA. - -IR code for method HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) - -BB0 (0) (len: 0): - prev: succ: BB2 - idom: BB-1 - dominators: BB0 - dfrontier: - -BB2 (1) (len: 0): - xzero R20 <- - prev: BB0 succ: BB3 - idom: BB0 - dominators: [BB0] BB2 - dfrontier: - -BB3 (2) (len: 11): - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] - prev: BB2 succ: BB4 - idom: BB2 - dominators: BB0 [BB2] BB3 - dfrontier: - -BB4 (3) (len: 2): - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] - prev: BB3 succ: BB1 - idom: BB3 - dominators: BB0 BB2 [BB3] BB4 - dfrontier: - -BB1 (4) (len: 0): - setret R16 - prev: BB4 succ: - idom: BB4 - dominators: BB0 BB2 BB3 [BB4] BB1 - dfrontier: - - -ABCREM BLOCK 0: - -ABCREM BLOCK 2: - -ABCREM BLOCK 3: - -ABCREM BLOCK 4: - -ABCREM BLOCK 1: - -ABCREM BLOCK/2 0 [dfn 0]... - -ABCREM BLOCK/2 2 [dfn 1]... - xzero R20 <- - -ABCREM BLOCK/2 3 [dfn 2]... - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] - -ABCREM BLOCK/2 4 [dfn 3]... - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] - -ABCREM BLOCK/2 1 [dfn 4]... - setret R16 -BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R20 <- -AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R20 <- -BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -BEFORE LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] -AFTER LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] -BEFORE LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] - setret R16 -AFTER LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] - setret R16 -DUMP BLOCK 0: -DUMP BLOCK 2: - xzero R20 <- -DUMP BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -DUMP BLOCK 4: - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] -DUMP BLOCK 1: - setret R16 - -*** Unoptimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -; ModuleID = 'jit-module-test' -source_filename = "jit-module-test" - -; Function Attrs: noinline uwtable -define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1, <4 x i32>* byval(<4 x i32>) %arg_c) #0 { -BB0: - %2 = alloca <4 x i32>, align 16 - %3 = alloca <4 x i32>, align 16 - %4 = bitcast <4 x i32>* %3 to i8* - %5 = getelementptr i8, i8* %4, i32 0 - %6 = bitcast i8* %5 to i64* - store i64 %arg_a, i64* %6, align 4 - %7 = getelementptr i8, i8* %4, i32 8 - %8 = bitcast i8* %7 to i64* - store i64 %0, i64* %8, align 4 - %simd_vtype = load <4 x i32>, <4 x i32>* %3, align 16 - %9 = bitcast <4 x i32>* %2 to i8* - %10 = getelementptr i8, i8* %9, i32 0 - %11 = bitcast i8* %10 to i64* - store i64 %arg_b, i64* %11, align 4 - %12 = getelementptr i8, i8* %9, i32 8 - %13 = bitcast i8* %12 to i64* - store i64 %1, i64* %13, align 4 - %simd_vtype1 = load <4 x i32>, <4 x i32>* %2, align 16 - %simd_vtype2 = load <4 x i32>, <4 x i32>* %arg_c, align 16 - br label %BB2 - -BB2: ; preds = %BB0 - br label %BB3 - -BB3: ; preds = %BB2 - %14 = icmp slt <4 x i32> %simd_vtype, %simd_vtype1 - %15 = select <4 x i1> %14, <4 x i32> %simd_vtype, <4 x i32> %simd_vtype1 - br label %BB4 - -BB4: ; preds = %BB3 - %16 = add i64 %vret, 0 - %17 = inttoptr i64 %16 to <4 x i32>* - store <4 x i32> %15, <4 x i32>* %17, align 1 - br label %BB1 - -BB1: ; preds = %BB4 - ret void -} - -attributes #0 = { noinline uwtable } - -*** - - -*** Optimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -; ModuleID = 'jit-module-test' -source_filename = "jit-module-test" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" - -; Function Attrs: noinline uwtable -define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1, <4 x i32>* byval(<4 x i32>) %arg_c) #0 { -BB0: - %2 = bitcast i64 %arg_a to <2 x i32> - %.0.vec.expand = shufflevector <2 x i32> %2, <2 x i32> undef, <4 x i32> - %3 = bitcast i64 %0 to <2 x i32> - %.8.vec.expand = shufflevector <2 x i32> %3, <2 x i32> undef, <4 x i32> - %.8.vecblend = shufflevector <4 x i32> %.0.vec.expand, <4 x i32> %.8.vec.expand, <4 x i32> - %4 = bitcast i64 %arg_b to <2 x i32> - %.0.vec.expand6 = shufflevector <2 x i32> %4, <2 x i32> undef, <4 x i32> - %5 = bitcast i64 %1 to <2 x i32> - %.8.vec.expand9 = shufflevector <2 x i32> %5, <2 x i32> undef, <4 x i32> - %.8.vecblend10 = shufflevector <4 x i32> %.0.vec.expand6, <4 x i32> %.8.vec.expand9, <4 x i32> - %6 = icmp slt <4 x i32> %.8.vecblend, %.8.vecblend10 - %7 = select <4 x i1> %6, <4 x i32> %.8.vecblend, <4 x i32> %.8.vecblend10 - %8 = inttoptr i64 %vret to <4 x i32>* - store <4 x i32> %7, <4 x i32>* %8, align 1 - ret void -} - -attributes #0 = { noinline uwtable } - -!mono.function_indexes = !{!0} - -!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", i32 1} - -*** - -CFA: [0] def_cfa: %rsp+0x8 -CFA: [0] offset: pc at cfa-0x8 -LLVM Method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) emitted at 0x10d8bc2c0 to 0x10d8bc2e6 (code length 38) - -*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.44S0Ml: -(__TEXT,__text) section -loWorld_Program_test__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__: -0000000000000000 vmovq %rdx, %xmm0 -0000000000000005 vmovq %rsi, %xmm1 -000000000000000a vpunpcklqdq %xmm0, %xmm1, %xmm0 -000000000000000e vmovq %r8, %xmm1 -0000000000000013 vmovq %rcx, %xmm2 -0000000000000018 vpunpcklqdq %xmm1, %xmm2, %xmm1 -000000000000001c vpminsd %xmm1, %xmm0, %xmm0 -0000000000000021 vmovdqu %xmm0, (%rdi) -0000000000000025 retq -<3, 3, 3, 3> -*** - diff --git a/src/mono/sample/HelloWorld/log_llvm_add.txt b/src/mono/sample/HelloWorld/log_llvm_add.txt deleted file mode 100644 index fd92cd89522b8b..00000000000000 --- a/src/mono/sample/HelloWorld/log_llvm_add.txt +++ /dev/null @@ -1,407 +0,0 @@ -converting llvm method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -created temp 0 (R16) of type System.Runtime.Intrinsics.Vector128 -creating vars -created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 -created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 -created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 - return : arg R16 <- - arg [0]: arg R17 <- - arg [1]: arg R18 <- - arg [2]: arg R19 <- -creating locals - local [0]: created temp 4 (R20) of type System.Runtime.Intrinsics.Vector128 -locals done -created temp 5 (R21) of type System.IntPtr -vret_addr = arg R21 <- -method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -converting (in B3: stack: 0) IL_0000: nop -converting (in B3: stack: 0) IL_0001: ldarg.0 -converting (in B3: stack: 1) IL_0002: ldarg.1 -converting (in B3: stack: 2) IL_0003: call 0x2b000001 -cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Add (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -converting (in B3: stack: 1) IL_0008: stloc.0 -converting (in B3: stack: 0) IL_0009: br.s IL_000b -converting (in B4: stack: 0) IL_000b: ldloc.0 -converting (in B4: stack: 1) IL_000c: ret -REGION BB0 IL_0000 ID_FFFFFFFF -REGION BB2 IL_0000 ID_FFFFFFFF -REGION BB3 IL_0009 ID_FFFFFFFF -REGION BB4 IL_000c ID_FFFFFFFF -REGION BB1 IL_0000 ID_FFFFFFFF -AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] -AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] - xzero R20 <- -AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] - il_seq_point intr il: 0x0 - nop - il_seq_point il: 0x1 - xmove R22 <- R17 - xmove R23 <- R18 - xbinop R24 <- R22 R23 - il_seq_point il: 0x8, nonempty-stack - xmove R20 <- R24 - il_seq_point il: 0x9 - br [B4] -AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] - il_seq_point il: 0xb - xmove R25 <- R20 - il_seq_point intr il: 0xc - move R26 <- R21 - storex_membase [R26] <- R25 - br [B1] -AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] -CCOPY/2: R22 -> R17 -CCOPY/2: R23 -> R18 -CCOPY: R26 -> R21 -CCOPY/2: R25 -> R20 - -HANDLE-GLOBAL-VREGS BLOCK 0: - -HANDLE-GLOBAL-VREGS BLOCK 2: - xzero R20 <- - -HANDLE-GLOBAL-VREGS BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xmove R22 <- R17 - xmove R23 <- R18 - xbinop R24 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - xmove R20 <- R24 - il_seq_point il: 0x9 - br [B4] - -HANDLE-GLOBAL-VREGS BLOCK 4: - il_seq_point il: 0xb - xmove R25 <- R20 - il_seq_point intr il: 0xc - move R26 <- R21 - storex_membase [R21] <- R20 - br [B1] - -HANDLE-GLOBAL-VREGS BLOCK 1: - setret R16 - Reverse copyprop in BB3 on xmove R20 <- R24 -BB0 IN: -BB2 IN: 0 -BB3 IN: 2 -BB4 IN: 3 -BB1 IN: 4 -DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) 0 -BB0(dfn=0) (IDOM=BB-1): BB0 -BB2(dfn=1) (IDOM=BB0): BB0 BB2 -BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 -BB4(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB4 -BB1(dfn=4) (IDOM=BB4): BB0 BB2 BB3 BB4 BB1 -SKIPPING SAFEPOINTS for code compiled with LLVM - -COMPUTE SSA 6 (R27-) - - -LIVENESS: -BLOCK BB0 (BB2, ): -GEN BB0: {} -KILL BB0: {} -BLOCK BB2 (BB3, ): - 1 xzero R20 <- - KILL: R20(4) -GEN BB2: {} -KILL BB2: {4} -BLOCK BB3 (BB4, ): - 1 il_seq_point intr il: 0x0 - 1 il_seq_point il: 0x1 - 1 xbinop R20 <- R17 R18 - GEN: R17(1) - GEN: R18(2) - KILL: R20(4) - 1 il_seq_point il: 0x8, nonempty-stack - 1 il_seq_point il: 0x9 - 1 br [B4] -GEN BB3: {1, 2} -KILL BB3: {4} -BLOCK BB4 (BB1, ): - 1 il_seq_point il: 0xb - 1 il_seq_point intr il: 0xc - 1 storex_membase [R21] <- R20 - GEN: R20(4) - 1 br [B1] -GEN BB4: {4, 5} -KILL BB4: {} -BLOCK BB1 (): - 1 setret R16 - GEN: R16(0) -GEN BB1: {0} -KILL BB1: {} - -ITERATION: -P: BB1(4): IN: BB4 OUT: -P: BB4(3): IN: BB3 OUT:BB1 - LIVE IN BB4: {0, 4, 5} -P: BB3(2): IN: BB2 OUT:BB4 - LIVE IN BB3: {0, 1, 2, 5} -P: BB2(1): IN: BB0 OUT:BB3 - LIVE IN BB2: {0, 1, 2, 5} -P: BB0(0): IN: OUT:BB2 - LIVE IN BB0: {0, 1, 2, 5} -IT: 5 4. -LIVE IN BB1: {0} -LIVE OUT BB1: {} -LIVE IN BB4: {0, 4, 5} -LIVE OUT BB4: {0} -LIVE IN BB3: {0, 1, 2, 5} -LIVE OUT BB3: {0, 4, 5} -LIVE IN BB2: {0, 1, 2, 5} -LIVE OUT BB2: {0, 1, 2, 5} -LIVE IN BB0: {0, 1, 2, 5} -LIVE OUT BB0: {0, 1, 2, 5} -V0: [0x0 - 0x100002] -V1: [0x0 - 0x80006] -V2: [0x0 - 0x80006] -V3: [0x0 - 0x0] -V4: [0x40003 - 0xc0006] -V5: [0x0 - 0xc0006] - -RENAME VARS BLOCK 0: - -RENAME VARS BLOCK 2: - -RENAME VARS BLOCK 3: -created temp 6 (R27) of type System.Runtime.Intrinsics.Vector128 - R20 -> R27 - -RENAME VARS BLOCK 4: - -RENAME VARS BLOCK 1: - -END COMPUTE SSA. - -IR code for method HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) - -BB0 (0) (len: 0): - prev: succ: BB2 - idom: BB-1 - dominators: BB0 - dfrontier: - -BB2 (1) (len: 0): - xzero R20 <- - prev: BB0 succ: BB3 - idom: BB0 - dominators: [BB0] BB2 - dfrontier: - -BB3 (2) (len: 11): - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] - prev: BB2 succ: BB4 - idom: BB2 - dominators: BB0 [BB2] BB3 - dfrontier: - -BB4 (3) (len: 2): - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] - prev: BB3 succ: BB1 - idom: BB3 - dominators: BB0 BB2 [BB3] BB4 - dfrontier: - -BB1 (4) (len: 0): - setret R16 - prev: BB4 succ: - idom: BB4 - dominators: BB0 BB2 BB3 [BB4] BB1 - dfrontier: - - -ABCREM BLOCK 0: - -ABCREM BLOCK 2: - -ABCREM BLOCK 3: - -ABCREM BLOCK 4: - -ABCREM BLOCK 1: - -ABCREM BLOCK/2 0 [dfn 0]... - -ABCREM BLOCK/2 2 [dfn 1]... - xzero R20 <- - -ABCREM BLOCK/2 3 [dfn 2]... - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] - -ABCREM BLOCK/2 4 [dfn 3]... - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] - -ABCREM BLOCK/2 1 [dfn 4]... - setret R16 -BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R20 <- -AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R20 <- -BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -BEFORE LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] -AFTER LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] -BEFORE LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] - setret R16 -AFTER LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] - setret R16 -DUMP BLOCK 0: -DUMP BLOCK 2: - xzero R20 <- -DUMP BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R27 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -DUMP BLOCK 4: - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R27 - br [B1] -DUMP BLOCK 1: - setret R16 - -*** Unoptimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -; ModuleID = 'jit-module-test' -source_filename = "jit-module-test" - -; Function Attrs: noinline uwtable -define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1, <4 x i32>* byval(<4 x i32>) %arg_c) #0 { -BB0: - %2 = alloca <4 x i32>, align 16 - %3 = alloca <4 x i32>, align 16 - %4 = bitcast <4 x i32>* %3 to i8* - %5 = getelementptr i8, i8* %4, i32 0 - %6 = bitcast i8* %5 to i64* - store i64 %arg_a, i64* %6, align 4 - %7 = getelementptr i8, i8* %4, i32 8 - %8 = bitcast i8* %7 to i64* - store i64 %0, i64* %8, align 4 - %simd_vtype = load <4 x i32>, <4 x i32>* %3, align 16 - %9 = bitcast <4 x i32>* %2 to i8* - %10 = getelementptr i8, i8* %9, i32 0 - %11 = bitcast i8* %10 to i64* - store i64 %arg_b, i64* %11, align 4 - %12 = getelementptr i8, i8* %9, i32 8 - %13 = bitcast i8* %12 to i64* - store i64 %1, i64* %13, align 4 - %simd_vtype1 = load <4 x i32>, <4 x i32>* %2, align 16 - %simd_vtype2 = load <4 x i32>, <4 x i32>* %arg_c, align 16 - br label %BB2 - -BB2: ; preds = %BB0 - br label %BB3 - -BB3: ; preds = %BB2 - %14 = add <4 x i32> %simd_vtype, %simd_vtype1 - br label %BB4 - -BB4: ; preds = %BB3 - %15 = add i64 %vret, 0 - %16 = inttoptr i64 %15 to <4 x i32>* - store <4 x i32> %14, <4 x i32>* %16, align 1 - br label %BB1 - -BB1: ; preds = %BB4 - ret void -} - -attributes #0 = { noinline uwtable } - -*** - - -*** Optimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -; ModuleID = 'jit-module-test' -source_filename = "jit-module-test" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" - -; Function Attrs: noinline uwtable -define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1, <4 x i32>* byval(<4 x i32>) %arg_c) #0 { -BB0: - %2 = bitcast i64 %arg_a to <2 x i32> - %.0.vec.expand = shufflevector <2 x i32> %2, <2 x i32> undef, <4 x i32> - %3 = bitcast i64 %0 to <2 x i32> - %.8.vec.expand = shufflevector <2 x i32> %3, <2 x i32> undef, <4 x i32> - %.8.vecblend = shufflevector <4 x i32> %.0.vec.expand, <4 x i32> %.8.vec.expand, <4 x i32> - %4 = bitcast i64 %arg_b to <2 x i32> - %.0.vec.expand6 = shufflevector <2 x i32> %4, <2 x i32> undef, <4 x i32> - %5 = bitcast i64 %1 to <2 x i32> - %.8.vec.expand9 = shufflevector <2 x i32> %5, <2 x i32> undef, <4 x i32> - %.8.vecblend10 = shufflevector <4 x i32> %.0.vec.expand6, <4 x i32> %.8.vec.expand9, <4 x i32> - %6 = add <4 x i32> %.8.vecblend, %.8.vecblend10 - %7 = inttoptr i64 %vret to <4 x i32>* - store <4 x i32> %6, <4 x i32>* %7, align 1 - ret void -} - -attributes #0 = { noinline uwtable } - -!mono.function_indexes = !{!0} - -!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", i32 1} - -*** - -CFA: [0] def_cfa: %rsp+0x8 -CFA: [0] offset: pc at cfa-0x8 -LLVM Method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) emitted at 0x103ed8290 to 0x103ed82b5 (code length 37) - -*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.gBUhkY: -(__TEXT,__text) section -loWorld_Program_test__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__: -0000000000000000 vmovq %rdx, %xmm0 -0000000000000005 vmovq %rsi, %xmm1 -000000000000000a vpunpcklqdq %xmm0, %xmm1, %xmm0 -000000000000000e vmovq %r8, %xmm1 -0000000000000013 vmovq %rcx, %xmm2 -0000000000000018 vpunpcklqdq %xmm1, %xmm2, %xmm1 -000000000000001c vpaddd %xmm1, %xmm0, %xmm0 -0000000000000020 vmovdqu %xmm0, (%rdi) -0000000000000024 retq -<8, 8, 8, 8> -*** - diff --git a/src/mono/sample/HelloWorld/log_llvm_main.txt b/src/mono/sample/HelloWorld/log_llvm_main.txt deleted file mode 100644 index cde64e6f05898a..00000000000000 --- a/src/mono/sample/HelloWorld/log_llvm_main.txt +++ /dev/null @@ -1,652 +0,0 @@ -converting llvm method void HelloWorld.Program:Main (string[]) -creating vars -created temp 0 (R16) of type System.Object - arg [0]: arg R16 <- -creating locals - local [0]: created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 - local [1]: created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 - local [2]: created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 -locals done -method to IR HelloWorld.Program:Main (string[]) -converting (in B3: stack: 0) IL_0000: nop -converting (in B3: stack: 0) IL_0001: ldc.i4.3 -converting (in B3: stack: 1) IL_0002: call 0x0a000011 -cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Create (int) -converting (in B3: stack: 1) IL_0007: stloc.0 -converting (in B3: stack: 0) IL_0008: ldc.i4.5 -converting (in B3: stack: 1) IL_0009: call 0x0a000011 -cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Create (int) -converting (in B3: stack: 1) IL_000e: stloc.1 -converting (in B3: stack: 0) IL_000f: ldloc.0 -converting (in B3: stack: 1) IL_0010: ldloc.1 -converting (in B3: stack: 2) IL_0011: call 0x06000001 -cmethod = System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -created temp 4 (R26) of type System.Runtime.Intrinsics.Vector128 -converting (in B3: stack: 1) IL_0016: stloc.2 -converting (in B3: stack: 0) IL_0017: ldloc.2 -converting (in B3: stack: 1) IL_0018: box 0x1b000001 -converting (in B3: stack: 1) IL_001d: call 0x0a000012 -cmethod = void System.Console:WriteLine (object) -converting (in B3: stack: 0) IL_0022: nop -converting (in B3: stack: 0) IL_0023: ret -REGION BB0 IL_0000 ID_FFFFFFFF -REGION BB2 IL_0000 ID_FFFFFFFF -REGION BB3 IL_0023 ID_FFFFFFFF -REGION BB1 IL_0000 ID_FFFFFFFF -AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] -AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] - xzero R17 <- - xzero R18 <- - xzero R19 <- -AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB1(0) ] - il_seq_point intr il: 0x0 - nop - il_seq_point il: 0x1 - iconst R20 <- [3] - expand_i4 R21 <- R20 - il_seq_point il: 0x7, nonempty-stack - xmove R17 <- R21 - il_seq_point il: 0x8 - iconst R22 <- [5] - expand_i4 R23 <- R22 - il_seq_point il: 0xe, nonempty-stack - xmove R18 <- R23 - il_seq_point il: 0xf - xmove R24 <- R17 - xmove R25 <- R18 - outarg_vtretaddr R27 <- R26 - llvm_outarg_vt R28 <- R24 - llvm_outarg_vt R29 <- R25 - vcall R26 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c - il_seq_point il: 0x16, nonempty-stack - xmove R19 <- R26 - il_seq_point il: 0x17 - xmove R30 <- R19 - i8const R31 <- [140406424075320] - iconst R32 <- [32] - move R34 <- R31 - move R35 <- R32 - call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c - storex_membase [R33 + 0x10] <- R30 - move R36 <- R33 - voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c - il_seq_point il: 0x22, nonempty-stack - il_seq_point il: 0x22 - nop - il_seq_point il: 0x23 - br [B1] -AFTER METHOD-TO-IR 1: [IN: BB3(0), OUT: ] -CCOPY/2: R24 -> R17 -CCOPY/2: R25 -> R18 - -HANDLE-GLOBAL-VREGS BLOCK 0: - -HANDLE-GLOBAL-VREGS BLOCK 2: - xzero R17 <- - xzero R18 <- - xzero R19 <- - -HANDLE-GLOBAL-VREGS BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - iconst R20 <- [3] - expand_i4 R21 <- R20 - il_seq_point il: 0x7, nonempty-stack - xmove R17 <- R21 - il_seq_point il: 0x8 - iconst R22 <- [5] - expand_i4 R23 <- R22 - il_seq_point il: 0xe, nonempty-stack - xmove R18 <- R23 - il_seq_point il: 0xf - xmove R24 <- R17 - xmove R25 <- R18 - outarg_vtretaddr R27 <- R26 - llvm_outarg_vt R28 <- R17 - llvm_outarg_vt R29 <- R18 - vcall R26 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c - il_seq_point il: 0x16, nonempty-stack - xmove R19 <- R26 - il_seq_point il: 0x17 - xmove R30 <- R19 - i8const R31 <- [140406424075320] - iconst R32 <- [32] - i8const R34 <- [140406424075320] - iconst R35 <- [32] - call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c - storex_membase [R33 + 0x10] <- R30 - move R36 <- R33 - voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c - il_seq_point il: 0x22, nonempty-stack - il_seq_point il: 0x22 - il_seq_point il: 0x23 - br [B1] - -HANDLE-GLOBAL-VREGS BLOCK 1: -CONVERTED R26(4) TO VREG. - Reverse copyprop in BB3 on xmove R19 <- R26 - Reverse copyprop in BB3 on xmove R18 <- R23 - Reverse copyprop in BB3 on xmove R17 <- R21 -BB0 IN: -BB2 IN: 0 -BB3 IN: 2 -BB1 IN: 3 -DTREE HelloWorld.Program:Main (string[]) 0 -BB0(dfn=0) (IDOM=BB-1): BB0 -BB2(dfn=1) (IDOM=BB0): BB0 BB2 -BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 -BB1(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB1 -SKIPPING SAFEPOINTS for code compiled with LLVM - -COMPUTE SSA 4 (R37-) - - -LIVENESS: -BLOCK BB0 (BB2, ): -GEN BB0: {} -KILL BB0: {} -BLOCK BB2 (BB3, ): - 1 xzero R17 <- - KILL: R17(1) - 1 xzero R18 <- - KILL: R18(2) - 1 xzero R19 <- - KILL: R19(3) -GEN BB2: {} -KILL BB2: {1, 2, 3} -BLOCK BB3 (BB1, ): - 1 il_seq_point intr il: 0x0 - 1 il_seq_point il: 0x1 - 1 iconst R20 <- [3] - 1 expand_i4 R17 <- R20 - KILL: R17(1) - 1 il_seq_point il: 0x7, nonempty-stack - 1 il_seq_point il: 0x8 - 1 iconst R22 <- [5] - 1 expand_i4 R18 <- R22 - KILL: R18(2) - 1 il_seq_point il: 0xe, nonempty-stack - 1 il_seq_point il: 0xf - 1 outarg_vtretaddr R27 <- R26 - 1 llvm_outarg_vt R28 <- R17 - GEN: R17(1) - 1 llvm_outarg_vt R29 <- R18 - GEN: R18(2) - 1 vcall R19 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c - KILL: R19(3) - 1 il_seq_point il: 0x16, nonempty-stack - 1 il_seq_point il: 0x17 - 1 xmove R30 <- R19 - GEN: R19(3) - 1 i8const R34 <- [140406424075320] - 1 iconst R35 <- [32] - 1 call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c - 1 storex_membase [R33 + 0x10] <- R30 - 1 move R36 <- R33 - 1 voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c - 1 il_seq_point il: 0x22, nonempty-stack - 1 il_seq_point il: 0x22 - 1 il_seq_point il: 0x23 - 1 br [B1] -GEN BB3: {} -KILL BB3: {1, 2, 3} -BLOCK BB1 (): -GEN BB1: {} -KILL BB1: {} - -ITERATION: -P: BB1(3): IN: BB3 OUT: -P: BB3(2): IN: BB2 OUT:BB1 - LIVE IN BB3: {} -P: BB2(1): IN: BB0 OUT:BB3 - LIVE IN BB2: {} -P: BB0(0): IN: OUT:BB2 - LIVE IN BB0: {} -IT: 4 3. -LIVE IN BB1: {} -LIVE OUT BB1: {} -LIVE IN BB3: {} -LIVE OUT BB3: {} -LIVE IN BB2: {} -LIVE OUT BB2: {} -LIVE IN BB0: {} -LIVE OUT BB0: {} -V0: [0x0 - 0x0] -V1: [0x40003 - 0x80018] -V2: [0x40005 - 0x8001a] -V3: [0x40007 - 0x80022] - -RENAME VARS BLOCK 0: - -RENAME VARS BLOCK 2: - -RENAME VARS BLOCK 3: -created temp 4 (R37) of type System.Runtime.Intrinsics.Vector128 - R17 -> R37 -created temp 5 (R38) of type System.Runtime.Intrinsics.Vector128 - R18 -> R38 -created temp 6 (R39) of type System.Runtime.Intrinsics.Vector128 - R19 -> R39 - -RENAME VARS BLOCK 1: - -END COMPUTE SSA. - -IR code for method HelloWorld.Program:Main (string[]) - -BB0 (0) (len: 0): - prev: succ: BB2 - idom: BB-1 - dominators: BB0 - dfrontier: - -BB2 (1) (len: 0): - xzero R17 <- - xzero R18 <- - xzero R19 <- - prev: BB0 succ: BB3 - idom: BB0 - dominators: [BB0] BB2 - dfrontier: - -BB3 (2) (len: 36): - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - iconst R20 <- [3] - expand_i4 R37 <- R20 - il_seq_point il: 0x7, nonempty-stack - il_seq_point il: 0x8 - iconst R22 <- [5] - expand_i4 R38 <- R22 - il_seq_point il: 0xe, nonempty-stack - il_seq_point il: 0xf - outarg_vtretaddr R27 <- R26 - llvm_outarg_vt R28 <- R37 - llvm_outarg_vt R29 <- R38 - vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c - il_seq_point il: 0x16, nonempty-stack - il_seq_point il: 0x17 - xmove R30 <- R39 - i8const R34 <- [140406424075320] - iconst R35 <- [32] - call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c - storex_membase [R33 + 0x10] <- R30 - move R36 <- R33 - voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c - il_seq_point il: 0x22, nonempty-stack - il_seq_point il: 0x22 - il_seq_point il: 0x23 - br [B1] - prev: BB2 succ: BB1 - idom: BB2 - dominators: BB0 [BB2] BB3 - dfrontier: - -BB1 (3) (len: 0): - prev: BB3 succ: - idom: BB3 - dominators: BB0 BB2 [BB3] BB1 - dfrontier: - - -ABCREM BLOCK 0: - -ABCREM BLOCK 2: - -ABCREM BLOCK 3: - iconst R20 <- [3] -Summarized variable 20: CONSTANT 3, not-null = 0 - iconst R22 <- [5] -Summarized variable 22: CONSTANT 5, not-null = 0 - outarg_vtretaddr R27 <- R26 -Summarized variable 27: ANY - llvm_outarg_vt R28 <- R37 -Summarized variable 28: ANY - llvm_outarg_vt R29 <- R38 -Summarized variable 29: ANY - i8const R34 <- [140406424075320] -Summarized variable 34: ANY - iconst R35 <- [32] -Summarized variable 35: CONSTANT 32, not-null = 0 - call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c -Summarized variable 33: ANY - move R36 <- R33 -Summarized variable 36: VARIABLE 33, delta 0, not-null = 2 - -ABCREM BLOCK 1: -Added symmetric summarized value for variable variable 36 (to 33): VARIABLE 36, delta 0, not-null = 2 - -ABCREM BLOCK/2 0 [dfn 0]... - -ABCREM BLOCK/2 2 [dfn 1]... - xzero R17 <- - xzero R18 <- - xzero R19 <- - -ABCREM BLOCK/2 3 [dfn 2]... - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - iconst R20 <- [3] - expand_i4 R37 <- R20 - il_seq_point il: 0x7, nonempty-stack - il_seq_point il: 0x8 - iconst R22 <- [5] - expand_i4 R38 <- R22 - il_seq_point il: 0xe, nonempty-stack - il_seq_point il: 0xf - outarg_vtretaddr R27 <- R26 - llvm_outarg_vt R28 <- R37 - llvm_outarg_vt R29 <- R38 - vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c - il_seq_point il: 0x16, nonempty-stack - il_seq_point il: 0x17 - xmove R30 <- R39 - i8const R34 <- [140406424075320] - iconst R35 <- [32] - call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c - storex_membase [R33 + 0x10] <- R30 - move R36 <- R33 - voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c - il_seq_point il: 0x22, nonempty-stack - il_seq_point il: 0x22 - il_seq_point il: 0x23 - br [B1] - -ABCREM BLOCK/2 1 [dfn 3]... -BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R17 <- - xzero R18 <- - xzero R19 <- -AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R17 <- - xzero R18 <- - xzero R19 <- -BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB1(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - iconst R20 <- [3] - expand_i4 R37 <- R20 - il_seq_point il: 0x7, nonempty-stack - il_seq_point il: 0x8 - iconst R22 <- [5] - expand_i4 R38 <- R22 - il_seq_point il: 0xe, nonempty-stack - il_seq_point il: 0xf - outarg_vtretaddr R27 <- R26 - llvm_outarg_vt R28 <- R37 - llvm_outarg_vt R29 <- R38 - vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c - il_seq_point il: 0x16, nonempty-stack - il_seq_point il: 0x17 - xmove R30 <- R39 - i8const R34 <- [140406424075320] - iconst R35 <- [32] - call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c - storex_membase [R33 + 0x10] <- R30 - move R36 <- R33 - voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c - il_seq_point il: 0x22, nonempty-stack - il_seq_point il: 0x22 - il_seq_point il: 0x23 - br [B1] -AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB1(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - iconst R20 <- [3] - expand_i4 R37 <- R20 - il_seq_point il: 0x7, nonempty-stack - il_seq_point il: 0x8 - iconst R22 <- [5] - expand_i4 R38 <- R22 - il_seq_point il: 0xe, nonempty-stack - il_seq_point il: 0xf - ldaddr R27 <- R39 - llvm_outarg_vt R28 <- R37 - llvm_outarg_vt R29 <- R38 - vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c - il_seq_point il: 0x16, nonempty-stack - il_seq_point il: 0x17 - xmove R30 <- R39 - i8const R34 <- [140406424075320] - iconst R35 <- [32] - call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c - storex_membase [R33 + 0x10] <- R30 - move R36 <- R33 - voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c - il_seq_point il: 0x22, nonempty-stack - il_seq_point il: 0x22 - il_seq_point il: 0x23 - br [B1] -BEFORE LOWER-VTYPE-OPTS 1: [IN: BB3(2), OUT: ] -AFTER LOWER-VTYPE-OPTS 1: [IN: BB3(2), OUT: ] -DUMP BLOCK 0: -DUMP BLOCK 2: - xzero R17 <- - xzero R18 <- - xzero R19 <- -DUMP BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - iconst R20 <- [3] - expand_i4 R37 <- R20 - il_seq_point il: 0x7, nonempty-stack - il_seq_point il: 0x8 - iconst R22 <- [5] - expand_i4 R38 <- R22 - il_seq_point il: 0xe, nonempty-stack - il_seq_point il: 0xf - ldaddr R27 <- R39 - llvm_outarg_vt R28 <- R37 - llvm_outarg_vt R29 <- R38 - vcall R39 <- [System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rax <- R28] [%rax <- R29] clobbers: c - il_seq_point il: 0x16, nonempty-stack - il_seq_point il: 0x17 - xmove R30 <- R39 - i8const R34 <- [140406424075320] - iconst R35 <- [32] - call R33 <- [(wrapper alloc) object object:AllocSmall (intptr,intptr)] [%rax <- R34] [%rax <- R35] clobbers: c - storex_membase [R33 + 0x10] <- R30 - move R36 <- R33 - voidcall [void System.Console:WriteLine (object)] [%rax <- R36] clobbers: c - il_seq_point il: 0x22, nonempty-stack - il_seq_point il: 0x22 - il_seq_point il: 0x23 - br [B1] -DUMP BLOCK 1: - -*** Unoptimized LLVM IR for HelloWorld.Program:Main (string[]) *** -; ModuleID = 'jit-module-Main' -source_filename = "jit-module-Main" - -@mono_threads_state_poll = global void ()* inttoptr (i64 4382128016 to void ()*) -@"[tramp_687] HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)" = global void (i64, i64, i64, i64, i64)* inttoptr (i64 4382777112 to void (i64, i64, i64, i64, i64)*) -@"[tramp_688] (wrapper alloc) object:AllocSmall (intptr,intptr)" = global i64* (i64, i64)* inttoptr (i64 4382130653 to i64* (i64, i64)*) -@"[tramp_689] System.Console:WriteLine (object)" = global void (i64*)* inttoptr (i64 4382777126 to void (i64*)*) - -; Function Attrs: uwtable -define dso_local monocc void @"HelloWorld.Program:Main (string[])"(i64* %arg_args) #0 gc "coreclr" { -BB0: - %vreg_loc_39 = alloca <4 x i32>, align 16 - %llvm_outarg_vt1 = alloca <4 x i32>, align 16 - %llvm_outarg_vt = alloca <4 x i32>, align 16 - br label %BB2 - -BB2: ; preds = %BB0 - br label %BB3 - -BB3: ; preds = %BB2 - store <4 x i32> , <4 x i32>* %llvm_outarg_vt, align 16 - store <4 x i32> , <4 x i32>* %llvm_outarg_vt1, align 16 - %0 = load void (i64, i64, i64, i64, i64)*, void (i64, i64, i64, i64, i64)** @"[tramp_687] HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", align 8 - %1 = ptrtoint <4 x i32>* %vreg_loc_39 to i64 - %2 = bitcast <4 x i32>* %llvm_outarg_vt to i8* - %3 = getelementptr i8, i8* %2, i32 0 - %4 = bitcast i8* %3 to i64* - %5 = load i64, i64* %4, align 4 - %6 = getelementptr i8, i8* %2, i32 8 - %7 = bitcast i8* %6 to i64* - %8 = load i64, i64* %7, align 4 - %9 = bitcast <4 x i32>* %llvm_outarg_vt1 to i8* - %10 = getelementptr i8, i8* %9, i32 0 - %11 = bitcast i8* %10 to i64* - %12 = load i64, i64* %11, align 4 - %13 = getelementptr i8, i8* %9, i32 8 - %14 = bitcast i8* %13 to i64* - %15 = load i64, i64* %14, align 4 - notail call monocc void %0(i64 %1, i64 %5, i64 %8, i64 %12, i64 %15), !managed_name !0 - %process_call_vtype_ret_addr = load <4 x i32>, <4 x i32>* %vreg_loc_39, align 16 - %16 = load volatile <4 x i32>, <4 x i32>* %vreg_loc_39, align 16 - %17 = load i64* (i64, i64)*, i64* (i64, i64)** @"[tramp_688] (wrapper alloc) object:AllocSmall (intptr,intptr)", align 8 - %18 = notail call monocc noalias nonnull align 8 i64* %17(i64 140406424075320, i64 32), !managed_name !1 - %19 = ptrtoint i64* %18 to i64 - %20 = add i64 %19, 16 - %21 = inttoptr i64 %20 to <4 x i32>* - store <4 x i32> %16, <4 x i32>* %21, align 1 - %22 = load void (i64*)*, void (i64*)** @"[tramp_689] System.Console:WriteLine (object)", align 8 - notail call monocc void %22(i64* %18), !managed_name !2 - br label %BB1 - -BB1: ; preds = %BB3 - ret void -} - -; Function Attrs: noinline nounwind optnone -define void @gc.safepoint_poll() #1 { -gc.safepoint_poll.entry: - %0 = load i64, i64* inttoptr (i64 4453764632 to i64*), align 4 - %1 = icmp eq i64 %0, 0 - br i1 %1, label %gc.safepoint_poll.exit, label %gc.safepoint_poll.poll, !prof !3 - -gc.safepoint_poll.poll: ; preds = %gc.safepoint_poll.entry - %2 = load void ()*, void ()** @mono_threads_state_poll, align 8 - call coldcc void %2() - br label %gc.safepoint_poll.exit - -gc.safepoint_poll.exit: ; preds = %gc.safepoint_poll.poll, %gc.safepoint_poll.entry - ret void -} - -attributes #0 = { uwtable } -attributes #1 = { noinline nounwind optnone } - -!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"} -!1 = !{!"(wrapper alloc) object:AllocSmall (intptr,intptr)"} -!2 = !{!"System.Console:WriteLine (object)"} -!3 = !{!"branch_weights", i32 1000, i32 1} - -*** - - -*** Optimized LLVM IR for HelloWorld.Program:Main (string[]) *** -; ModuleID = 'jit-module-Main' -source_filename = "jit-module-Main" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" - -@mono_threads_state_poll = global void ()* inttoptr (i64 4382128016 to void ()*) -@"[tramp_687] HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)" = global void (i64, i64, i64, i64, i64)* inttoptr (i64 4382777112 to void (i64, i64, i64, i64, i64)*) -@"[tramp_688] (wrapper alloc) object:AllocSmall (intptr,intptr)" = global i64* (i64, i64)* inttoptr (i64 4382130653 to i64* (i64, i64)*) -@"[tramp_689] System.Console:WriteLine (object)" = global void (i64*)* inttoptr (i64 4382777126 to void (i64*)*) - -; Function Attrs: uwtable -define dso_local monocc void @"HelloWorld.Program:Main (string[])"(i64* %arg_args) #0 gc "coreclr" { -BB0: - %vreg_loc_39 = alloca <4 x i32>, align 16 - %0 = load void (i64, i64, i64, i64, i64)*, void (i64, i64, i64, i64, i64)** @"[tramp_687] HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", align 8 - %1 = ptrtoint <4 x i32>* %vreg_loc_39 to i64 - %2 = load i64, i64* inttoptr (i64 4453764632 to i64*), align 4 - %3 = icmp eq i64 %2, 0 - br i1 %3, label %gc.safepoint_poll.exit, label %gc.safepoint_poll.poll.i, !prof !1 - -gc.safepoint_poll.poll.i: ; preds = %BB0 - %4 = load void ()*, void ()** @mono_threads_state_poll, align 8 - call coldcc void %4() #2 - br label %gc.safepoint_poll.exit - -gc.safepoint_poll.exit: ; preds = %BB0, %gc.safepoint_poll.poll.i - notail call monocc void %0(i64 %1, i64 12884901891, i64 12884901891, i64 21474836485, i64 21474836485), !managed_name !2 - %5 = load volatile <4 x i32>, <4 x i32>* %vreg_loc_39, align 16 - %6 = load i64* (i64, i64)*, i64* (i64, i64)** @"[tramp_688] (wrapper alloc) object:AllocSmall (intptr,intptr)", align 8 - %7 = notail call monocc noalias nonnull align 8 i64* %6(i64 140406424075320, i64 32), !managed_name !3 - %8 = ptrtoint i64* %7 to i64 - %9 = add i64 %8, 16 - %10 = inttoptr i64 %9 to <4 x i32>* - store <4 x i32> %5, <4 x i32>* %10, align 8 - %11 = load void (i64*)*, void (i64*)** @"[tramp_689] System.Console:WriteLine (object)", align 8 - notail call monocc void %11(i64* nonnull %7), !managed_name !4 - ret void -} - -; Function Attrs: noinline nounwind optnone -define void @gc.safepoint_poll() #1 { -gc.safepoint_poll.entry: - %0 = load i64, i64* inttoptr (i64 4453764632 to i64*), align 4 - %1 = icmp eq i64 %0, 0 - br i1 %1, label %gc.safepoint_poll.exit, label %gc.safepoint_poll.poll, !prof !1 - -gc.safepoint_poll.poll: ; preds = %gc.safepoint_poll.entry - %2 = load void ()*, void ()** @mono_threads_state_poll, align 8 - call coldcc void %2() - br label %gc.safepoint_poll.exit - -gc.safepoint_poll.exit: ; preds = %gc.safepoint_poll.poll, %gc.safepoint_poll.entry - ret void -} - -attributes #0 = { uwtable } -attributes #1 = { noinline nounwind optnone } -attributes #2 = { nounwind } - -!mono.function_indexes = !{!0} - -!0 = !{!"HelloWorld.Program:Main (string[])", i32 1} -!1 = !{!"branch_weights", i32 1000, i32 1} -!2 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"} -!3 = !{!"(wrapper alloc) object:AllocSmall (intptr,intptr)"} -!4 = !{!"System.Console:WriteLine (object)"} - -*** - -CFA: [0] def_cfa: %rsp+0x8 -CFA: [0] offset: pc at cfa-0x8 -CFA: [4] advance loc -CFA: [4] def_cfa_offset: 0x30 -LLVM Method void HelloWorld.Program:Main (string[]) emitted at 0x1053bdf40 to 0x1053bdfd5 (code length 149) - -*** ASM for HelloWorld.Program:Main (string[]) *** -/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.ZTxSIZ: -(__TEXT,__text) section -loWorld_Program_Main__string___: -0000000000000000 subq $0x28, %rsp -0000000000000004 movabsq $0x600003ee9bc8, %rax -000000000000000e movq (%rax), %r9 -0000000000000011 movabsq $0x109770e18, %rax -000000000000001b cmpq $0x0, (%rax) -000000000000001f jne 0x87 -0000000000000021 leaq 0x10(%rsp), %rdi -0000000000000026 movabsq $0x300000003, %rdx -0000000000000030 movabsq $0x500000005, %rcx -000000000000003a movq %rdx, %rsi -000000000000003d movq %rcx, %r8 -0000000000000040 callq *%r9 -0000000000000043 vmovaps 0x10(%rsp), %xmm0 -0000000000000049 vmovaps %xmm0, (%rsp) -000000000000004e movabsq $0x600003ee9bd0, %rax -0000000000000058 movabsq $0x7fb2eb07fc38, %rdi -0000000000000062 movl $0x20, %esi -0000000000000067 callq *(%rax) -0000000000000069 vmovaps (%rsp), %xmm0 -000000000000006e vmovups %xmm0, 0x10(%rax) -0000000000000073 movabsq $0x600003ee9bd8, %rcx -000000000000007d movq %rax, %rdi -0000000000000080 callq *(%rcx) -0000000000000082 addq $0x28, %rsp -0000000000000086 retq -0000000000000087 movabsq $0x600003ee9bc0, %rax -0000000000000091 callq *(%rax) -0000000000000093 jmp 0x21 -<8, 8, 8, 8> -*** - -~~~Reached emit_entry_bb for test diff --git a/src/mono/sample/HelloWorld/log_llvm_test.txt b/src/mono/sample/HelloWorld/log_llvm_test.txt deleted file mode 100644 index 6556c993aae672..00000000000000 --- a/src/mono/sample/HelloWorld/log_llvm_test.txt +++ /dev/null @@ -1,404 +0,0 @@ -converting llvm method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -created temp 0 (R16) of type System.Runtime.Intrinsics.Vector128 -creating vars -created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 -created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 - return : arg R16 <- - arg [0]: arg R17 <- - arg [1]: arg R18 <- -creating locals - local [0]: created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 -locals done -created temp 4 (R20) of type System.IntPtr -vret_addr = arg R20 <- -method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -converting (in B3: stack: 0) IL_0000: nop -converting (in B3: stack: 0) IL_0001: ldarg.0 -converting (in B3: stack: 1) IL_0002: ldarg.1 -converting (in B3: stack: 2) IL_0003: call 0x2b000001 -cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Add (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -converting (in B3: stack: 1) IL_0008: stloc.0 -converting (in B3: stack: 0) IL_0009: br.s IL_000b -converting (in B4: stack: 0) IL_000b: ldloc.0 -converting (in B4: stack: 1) IL_000c: ret -REGION BB0 IL_0000 ID_FFFFFFFF -REGION BB2 IL_0000 ID_FFFFFFFF -REGION BB3 IL_0009 ID_FFFFFFFF -REGION BB4 IL_000c ID_FFFFFFFF -REGION BB1 IL_0000 ID_FFFFFFFF -AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] -AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] - xzero R19 <- -AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] - il_seq_point intr il: 0x0 - nop - il_seq_point il: 0x1 - xmove R21 <- R17 - xmove R22 <- R18 - xbinop R23 <- R21 R22 - il_seq_point il: 0x8, nonempty-stack - xmove R19 <- R23 - il_seq_point il: 0x9 - br [B4] -AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] - il_seq_point il: 0xb - xmove R24 <- R19 - il_seq_point intr il: 0xc - move R25 <- R20 - storex_membase [R25] <- R24 - br [B1] -AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] -CCOPY/2: R21 -> R17 -CCOPY/2: R22 -> R18 -CCOPY: R25 -> R20 -CCOPY/2: R24 -> R19 - -HANDLE-GLOBAL-VREGS BLOCK 0: - -HANDLE-GLOBAL-VREGS BLOCK 2: - xzero R19 <- - -HANDLE-GLOBAL-VREGS BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xmove R21 <- R17 - xmove R22 <- R18 - xbinop R23 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - xmove R19 <- R23 - il_seq_point il: 0x9 - br [B4] - -HANDLE-GLOBAL-VREGS BLOCK 4: - il_seq_point il: 0xb - xmove R24 <- R19 - il_seq_point intr il: 0xc - move R25 <- R20 - storex_membase [R20] <- R19 - br [B1] - -HANDLE-GLOBAL-VREGS BLOCK 1: - setret R16 - Reverse copyprop in BB3 on xmove R19 <- R23 -BB0 IN: -BB2 IN: 0 -BB3 IN: 2 -BB4 IN: 3 -BB1 IN: 4 -DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) 0 -BB0(dfn=0) (IDOM=BB-1): BB0 -BB2(dfn=1) (IDOM=BB0): BB0 BB2 -BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 -BB4(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB4 -BB1(dfn=4) (IDOM=BB4): BB0 BB2 BB3 BB4 BB1 -SKIPPING SAFEPOINTS for code compiled with LLVM - -COMPUTE SSA 5 (R26-) - - -LIVENESS: -BLOCK BB0 (BB2, ): -GEN BB0: {} -KILL BB0: {} -BLOCK BB2 (BB3, ): - 1 xzero R19 <- - KILL: R19(3) -GEN BB2: {} -KILL BB2: {3} -BLOCK BB3 (BB4, ): - 1 il_seq_point intr il: 0x0 - 1 il_seq_point il: 0x1 - 1 xbinop R19 <- R17 R18 - GEN: R17(1) - GEN: R18(2) - KILL: R19(3) - 1 il_seq_point il: 0x8, nonempty-stack - 1 il_seq_point il: 0x9 - 1 br [B4] -GEN BB3: {1, 2} -KILL BB3: {3} -BLOCK BB4 (BB1, ): - 1 il_seq_point il: 0xb - 1 il_seq_point intr il: 0xc - 1 storex_membase [R20] <- R19 - GEN: R19(3) - 1 br [B1] -GEN BB4: {3, 4} -KILL BB4: {} -BLOCK BB1 (): - 1 setret R16 - GEN: R16(0) -GEN BB1: {0} -KILL BB1: {} - -ITERATION: -P: BB1(4): IN: BB4 OUT: -P: BB4(3): IN: BB3 OUT:BB1 - LIVE IN BB4: {0, 3, 4} -P: BB3(2): IN: BB2 OUT:BB4 - LIVE IN BB3: {0, 1, 2, 4} -P: BB2(1): IN: BB0 OUT:BB3 - LIVE IN BB2: {0, 1, 2, 4} -P: BB0(0): IN: OUT:BB2 - LIVE IN BB0: {0, 1, 2, 4} -IT: 5 4. -LIVE IN BB1: {0} -LIVE OUT BB1: {} -LIVE IN BB4: {0, 3, 4} -LIVE OUT BB4: {0} -LIVE IN BB3: {0, 1, 2, 4} -LIVE OUT BB3: {0, 3, 4} -LIVE IN BB2: {0, 1, 2, 4} -LIVE OUT BB2: {0, 1, 2, 4} -LIVE IN BB0: {0, 1, 2, 4} -LIVE OUT BB0: {0, 1, 2, 4} -V0: [0x0 - 0x100002] -V1: [0x0 - 0x80006] -V2: [0x0 - 0x80006] -V3: [0x40003 - 0xc0006] -V4: [0x0 - 0xc0006] - -RENAME VARS BLOCK 0: - -RENAME VARS BLOCK 2: - -RENAME VARS BLOCK 3: -created temp 5 (R26) of type System.Runtime.Intrinsics.Vector128 - R19 -> R26 - -RENAME VARS BLOCK 4: - -RENAME VARS BLOCK 1: - -END COMPUTE SSA. - -IR code for method HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) - -BB0 (0) (len: 0): - prev: succ: BB2 - idom: BB-1 - dominators: BB0 - dfrontier: - -BB2 (1) (len: 0): - xzero R19 <- - prev: BB0 succ: BB3 - idom: BB0 - dominators: [BB0] BB2 - dfrontier: - -BB3 (2) (len: 11): - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R26 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] - prev: BB2 succ: BB4 - idom: BB2 - dominators: BB0 [BB2] BB3 - dfrontier: - -BB4 (3) (len: 2): - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R20] <- R26 - br [B1] - prev: BB3 succ: BB1 - idom: BB3 - dominators: BB0 BB2 [BB3] BB4 - dfrontier: - -BB1 (4) (len: 0): - setret R16 - prev: BB4 succ: - idom: BB4 - dominators: BB0 BB2 BB3 [BB4] BB1 - dfrontier: - - -ABCREM BLOCK 0: - -ABCREM BLOCK 2: - -ABCREM BLOCK 3: - -ABCREM BLOCK 4: - -ABCREM BLOCK 1: - -ABCREM BLOCK/2 0 [dfn 0]... - -ABCREM BLOCK/2 2 [dfn 1]... - xzero R19 <- - -ABCREM BLOCK/2 3 [dfn 2]... - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R26 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] - -ABCREM BLOCK/2 4 [dfn 3]... - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R20] <- R26 - br [B1] - -ABCREM BLOCK/2 1 [dfn 4]... - setret R16 -BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R19 <- -AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R19 <- -BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R26 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R26 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -BEFORE LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R20] <- R26 - br [B1] -AFTER LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R20] <- R26 - br [B1] -BEFORE LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] - setret R16 -AFTER LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] - setret R16 -DUMP BLOCK 0: -DUMP BLOCK 2: - xzero R19 <- -DUMP BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R26 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -DUMP BLOCK 4: - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R20] <- R26 - br [B1] -DUMP BLOCK 1: - setret R16 -~~~Reached emit_entry_bb for test - -*** Unoptimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -; ModuleID = 'jit-module-test' -source_filename = "jit-module-test" - -; Function Attrs: noinline uwtable -define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1) #0 { -BB0: - %2 = alloca <4 x i32>, align 16 - %3 = alloca <4 x i32>, align 16 - %4 = bitcast <4 x i32>* %3 to i8* - %5 = getelementptr i8, i8* %4, i32 0 - %6 = bitcast i8* %5 to i64* - store i64 %arg_a, i64* %6, align 4 - %7 = getelementptr i8, i8* %4, i32 8 - %8 = bitcast i8* %7 to i64* - store i64 %0, i64* %8, align 4 - %simd_vtype = load <4 x i32>, <4 x i32>* %3, align 16 - %9 = bitcast <4 x i32>* %2 to i8* - %10 = getelementptr i8, i8* %9, i32 0 - %11 = bitcast i8* %10 to i64* - store i64 %arg_b, i64* %11, align 4 - %12 = getelementptr i8, i8* %9, i32 8 - %13 = bitcast i8* %12 to i64* - store i64 %1, i64* %13, align 4 - %simd_vtype1 = load <4 x i32>, <4 x i32>* %2, align 16 - br label %BB2 - -BB2: ; preds = %BB0 - br label %BB3 - -BB3: ; preds = %BB2 - %14 = add <4 x i32> %simd_vtype, %simd_vtype1 - br label %BB4 - -BB4: ; preds = %BB3 - %15 = add i64 %vret, 0 - %16 = inttoptr i64 %15 to <4 x i32>* - store <4 x i32> %14, <4 x i32>* %16, align 1 - br label %BB1 - -BB1: ; preds = %BB4 - ret void -} - -attributes #0 = { noinline uwtable } - -*** - - -*** Optimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -; ModuleID = 'jit-module-test' -source_filename = "jit-module-test" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" - -; Function Attrs: noinline uwtable -define dso_local monocc void @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)"(i64 %vret, i64 %arg_a, i64 %0, i64 %arg_b, i64 %1) #0 { -BB0: - %2 = bitcast i64 %arg_a to <2 x i32> - %.0.vec.expand = shufflevector <2 x i32> %2, <2 x i32> undef, <4 x i32> - %3 = bitcast i64 %0 to <2 x i32> - %.8.vec.expand = shufflevector <2 x i32> %3, <2 x i32> undef, <4 x i32> - %.8.vecblend = shufflevector <4 x i32> %.0.vec.expand, <4 x i32> %.8.vec.expand, <4 x i32> - %4 = bitcast i64 %arg_b to <2 x i32> - %.0.vec.expand5 = shufflevector <2 x i32> %4, <2 x i32> undef, <4 x i32> - %5 = bitcast i64 %1 to <2 x i32> - %.8.vec.expand8 = shufflevector <2 x i32> %5, <2 x i32> undef, <4 x i32> - %.8.vecblend9 = shufflevector <4 x i32> %.0.vec.expand5, <4 x i32> %.8.vec.expand8, <4 x i32> - %6 = add <4 x i32> %.8.vecblend, %.8.vecblend9 - %7 = inttoptr i64 %vret to <4 x i32>* - store <4 x i32> %6, <4 x i32>* %7, align 1 - ret void -} - -attributes #0 = { noinline uwtable } - -!mono.function_indexes = !{!0} - -!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)", i32 1} - -*** - -CFA: [0] def_cfa: %rsp+0x8 -CFA: [0] offset: pc at cfa-0x8 -LLVM Method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) emitted at 0x10da9e290 to 0x10da9e2b5 (code length 37) - -*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.AZpjcK: -(__TEXT,__text) section -loWorld_Program_test__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__: -0000000000000000 vmovq %rdx, %xmm0 -0000000000000005 vmovq %rsi, %xmm1 -000000000000000a vpunpcklqdq %xmm0, %xmm1, %xmm0 -000000000000000e vmovq %r8, %xmm1 -0000000000000013 vmovq %rcx, %xmm2 -0000000000000018 vpunpcklqdq %xmm1, %xmm2, %xmm1 -000000000000001c vpaddd %xmm1, %xmm0, %xmm0 -0000000000000020 vmovdqu %xmm0, (%rdi) -0000000000000024 retq -<8, 8, 8, 8> -*** - diff --git a/src/mono/sample/HelloWorld/log_nollvm.txt b/src/mono/sample/HelloWorld/log_nollvm.txt deleted file mode 100644 index ccf200f5688748..00000000000000 --- a/src/mono/sample/HelloWorld/log_nollvm.txt +++ /dev/null @@ -1,478 +0,0 @@ -converting method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -created temp 0 (R16) of type System.Runtime.Intrinsics.Vector128 -creating vars -created temp 1 (R17) of type System.Runtime.Intrinsics.Vector128 -created temp 2 (R18) of type System.Runtime.Intrinsics.Vector128 -created temp 3 (R19) of type System.Runtime.Intrinsics.Vector128 - return : arg R16 <- - arg [0]: arg R17 <- - arg [1]: arg R18 <- - arg [2]: arg R19 <- -creating locals - local [0]: created temp 4 (R20) of type System.Runtime.Intrinsics.Vector128 -locals done -created temp 5 (R21) of type System.IntPtr -vret_addr = arg R21 <- -method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -converting (in B3: stack: 0) IL_0000: nop -converting (in B3: stack: 0) IL_0001: ldarg.0 -converting (in B3: stack: 1) IL_0002: ldarg.1 -converting (in B3: stack: 2) IL_0003: call 0x2b000001 -cmethod = System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) -created temp 6 (R24) of type System.Runtime.Intrinsics.Vector128 -converting (in B3: stack: 1) IL_0008: stloc.0 -converting (in B3: stack: 0) IL_0009: br.s IL_000b -converting (in B4: stack: 0) IL_000b: ldloc.0 -converting (in B4: stack: 1) IL_000c: ret -REGION BB0 IL_0000 ID_FFFFFFFF -REGION BB2 IL_0000 ID_FFFFFFFF -REGION BB3 IL_0009 ID_FFFFFFFF -REGION BB4 IL_000c ID_FFFFFFFF -REGION BB1 IL_0000 ID_FFFFFFFF -AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] -AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] - xzero R20 <- -AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] - il_seq_point intr il: 0x0 - nop - il_seq_point il: 0x1 - xmove R22 <- R17 - xmove R23 <- R18 - outarg_vtretaddr R25 <- R24 - outarg_vt R23 - outarg_vt R22 - move R26 <- R25 - vcall R24 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c - il_seq_point il: 0x8, nonempty-stack - xmove R20 <- R24 - il_seq_point il: 0x9 - br [B4] -AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] - il_seq_point il: 0xb - xmove R27 <- R20 - il_seq_point intr il: 0xc - move R28 <- R21 - storex_membase [R28] <- R27 - br [B1] -AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] -CCOPY/2: R23 -> R18 -CCOPY/2: R22 -> R17 -CCOPY: R28 -> R21 -CCOPY/2: R27 -> R20 -block merge triggered 2 -> 3 -br removal triggered 4 -> 1 -br removal triggered 2 -> 4 -block merge triggered 2 -> 4 - -HANDLE-GLOBAL-VREGS BLOCK 0: - -HANDLE-GLOBAL-VREGS BLOCK 2: - xzero R20 <- - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xmove R22 <- R17 - xmove R23 <- R18 - outarg_vtretaddr R25 <- R24 - outarg_vt R18 - outarg_vt R17 - move R26 <- R25 - vcall R24 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c - il_seq_point il: 0x8, nonempty-stack - xmove R20 <- R24 - il_seq_point il: 0x9 - nop - il_seq_point il: 0xb - xmove R27 <- R20 - il_seq_point intr il: 0xc - move R28 <- R21 - storex_membase [R21] <- R20 - nop - -HANDLE-GLOBAL-VREGS BLOCK 1: -CONVERTED R20(4) TO VREG. -CONVERTED R24(6) TO VREG. - Reverse copyprop in BB2 on xmove R20 <- R24 -BB0 IN: -BB2 IN: 0 -BB1 IN: 2 -DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) 0 -BB0(dfn=0) (IDOM=BB-1): BB0 -BB2(dfn=1) (IDOM=BB0): BB0 BB2 -BB1(dfn=2) (IDOM=BB2): BB0 BB2 BB1 -INSERTING SAFEPOINTS -BEFORE SAFEPOINTS 0: [IN: , OUT: BB2(1) ] -BEFORE SAFEPOINTS 2: [IN: BB0(0), OUT: BB1(2) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - outarg_vtretaddr R25 <- R24 - outarg_vt R18 - outarg_vt R17 - move R26 <- R25 - vcall R20 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R20 -BEFORE SAFEPOINTS 1: [IN: BB2(1), OUT: ] -ADDING SAFE POINT TO BB 0 -AFTER SAFEPOINTS 0: [IN: , OUT: BB2(1) ] - i8const R29 <- [4529466904] - gc_safe_point R29 clobbers: c -AFTER SAFEPOINTS 2: [IN: BB0(0), OUT: BB1(2) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - outarg_vtretaddr R25 <- R24 - outarg_vt R18 - outarg_vt R17 - move R26 <- R25 - vcall R20 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R20 -AFTER SAFEPOINTS 1: [IN: BB2(1), OUT: ] -BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] - i8const R29 <- [4529466904] - gc_safe_point R29 clobbers: c -AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] - i8const R29 <- [4529466904] - gc_safe_point R29 clobbers: c -BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB1(2) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - outarg_vtretaddr R25 <- R24 - outarg_vt R18 - outarg_vt R17 - move R26 <- R25 - vcall R20 <- [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] clobbers: c - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R20 -created temp 5 (R20) of type System.Runtime.Intrinsics.Vector128 -AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB1(2) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - ldaddr R25 <- R20 - ldaddr R31 <- R18 - load_membase R32 <- [R31 + 0x0] - move R33 <- R32 - load_membase R34 <- [R31 + 0x8] - move R35 <- R34 - ldaddr R36 <- R17 - load_membase R37 <- [R36 + 0x0] - move R38 <- R37 - load_membase R39 <- [R36 + 0x8] - move R40 <- R39 - move R26 <- R25 - vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - il_seq_point il: 0xb - il_seq_point intr il: 0xc - storex_membase [R21] <- R20 -BEFORE LOWER-VTYPE-OPTS 1: [IN: BB2(1), OUT: ] -AFTER LOWER-VTYPE-OPTS 1: [IN: BB2(1), OUT: ] - -LIVENESS: -BLOCK BB0 (BB2, ): - 1 i8const R29 <- [4529466904] - 1 gc_safe_point R29 clobbers: c -GEN BB0: {} -KILL BB0: {} -BLOCK BB2 (BB1, ): - 1 il_seq_point intr il: 0x0 - 1 il_seq_point il: 0x1 - 1 ldaddr R25 <- R20 - GEN: R20(5) - 1 ldaddr R31 <- R18 - GEN: R18(2) - 1 load_membase R32 <- [R31 + 0x0] - 1 move R33 <- R32 - 1 load_membase R34 <- [R31 + 0x8] - 1 move R35 <- R34 - 1 ldaddr R36 <- R17 - GEN: R17(1) - 1 load_membase R37 <- [R36 + 0x0] - 1 move R38 <- R37 - 1 load_membase R39 <- [R36 + 0x8] - 1 move R40 <- R39 - 1 move R26 <- R25 - 1 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c - 1 il_seq_point il: 0x8, nonempty-stack - 1 il_seq_point il: 0x9 - 1 il_seq_point il: 0xb - 1 il_seq_point intr il: 0xc - 1 storex_membase [R21] <- R20 - GEN: R20(5) -GEN BB2: {1, 2, 4, 5} -KILL BB2: {} -BLOCK BB1 (): -GEN BB1: {} -KILL BB1: {} - -ITERATION: -P: BB1(2): IN: BB2 OUT: -P: BB2(1): IN: BB0 OUT:BB1 - LIVE IN BB2: {1, 2, 4, 5} -P: BB0(0): IN: OUT:BB2 - LIVE IN BB0: {1, 2, 4, 5} -IT: 3 2. -LIVE IN BB1: {} -LIVE OUT BB1: {} -LIVE IN BB2: {1, 2, 4, 5} -LIVE OUT BB2: {} -LIVE IN BB0: {1, 2, 4, 5} -LIVE OUT BB0: {1, 2, 4, 5} -V0: [0x0 - 0x0] -V1: [0x0 - 0x40012] -V2: [0x0 - 0x40008] -V3: [0x0 - 0x0] -V4: [0x0 - 0x40028] -V5: [0x0 - 0x40028] -COSTLY: R4 C1 C1 %r15 -NOT REGVAR: 4 -vret_addr = regoffset R21 <- R5 + 0xfffffffffffffff8 - -SPILL BLOCK 0: - i8const R29 <- [4529466904] - i 29 - 1 i8const R29 <- [4529466904] - gc_safe_point R29 clobbers: c - i -1 29 - 1 gc_safe_point R29 clobbers: c - -SPILL BLOCK 2: - il_seq_point intr il: 0x0 - -1 - 1 il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - -1 - 1 il_seq_point il: 0x1 - ldaddr R25 <- R20 - ii 25 5 - 1 add_imm R25 <- %rbp [-32] clobbers: 1 - ldaddr R31 <- R18 - ii 31 5 - 1 add_imm R31 <- %rbp [-64] clobbers: 1 - load_membase R32 <- [R31 + 0x0] - ii 32 31 - 1 load_membase R32 <- [R31 + 0x0] - move R33 <- R32 - ii 33 32 - 1 move R33 <- R32 - load_membase R34 <- [R31 + 0x8] - ii 34 31 - 1 load_membase R34 <- [R31 + 0x8] - move R35 <- R34 - ii 35 34 - 1 move R35 <- R34 - ldaddr R36 <- R17 - ii 36 5 - 1 add_imm R36 <- %rbp [-48] clobbers: 1 - load_membase R37 <- [R36 + 0x0] - ii 37 36 - 1 load_membase R37 <- [R36 + 0x0] - move R38 <- R37 - ii 38 37 - 1 move R38 <- R37 - load_membase R39 <- [R36 + 0x8] - ii 39 36 - 1 load_membase R39 <- [R36 + 0x8] - move R40 <- R39 - ii 40 39 - 1 move R40 <- R39 - move R26 <- R25 - ii 26 25 - 1 move R26 <- R25 - vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c - -1 - 1 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c - il_seq_point il: 0x8, nonempty-stack - -1 - 1 il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - -1 - 1 il_seq_point il: 0x9 - il_seq_point il: 0xb - -1 - 1 il_seq_point il: 0xb - il_seq_point intr il: 0xc - -1 - 1 il_seq_point intr il: 0xc - storex_membase [R21] <- R20 - xi -1 20 - 0 loadx_membase R41 <- [%rbp + 0xffffffffffffffe0] - 0 load_membase R42 <- [%rbp + 0xfffffffffffffff8] - 1 storex_membase [R42] <- R41 - -SPILL BLOCK 1: - Reverse copyprop in BB2 on move R40 <- R39 - Reverse copyprop in BB2 on move R38 <- R37 - Reverse copyprop in BB2 on move R35 <- R34 - Reverse copyprop in BB2 on move R33 <- R32 -DUMP BLOCK 0: - i8const R29 <- [4529466904] - gc_safe_point R29 clobbers: c -DUMP BLOCK 2: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - add_imm R25 <- %rbp [-32] clobbers: 1 - load_membase R33 <- [%rbp + 0xffffffffffffffc0] - load_membase R35 <- [%rbp + 0xffffffffffffffc8] - load_membase R38 <- [%rbp + 0xffffffffffffffd0] - load_membase R40 <- [%rbp + 0xffffffffffffffd8] - move R26 <- R25 - vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - il_seq_point il: 0xb - il_seq_point intr il: 0xc - loadx_membase R41 <- [%rbp + 0xffffffffffffffe0] - load_membase R42 <- [%rbp + 0xfffffffffffffff8] - storex_membase [R42] <- R41 -DUMP BLOCK 1: - -LOCAL REGALLOC BLOCK 0: - 1 i8const R29 <- [4529466904] - 2 gc_safe_point R29 clobbers: c -liveness: R29 [1 - 1] -processing: 2 gc_safe_point R29 clobbers: c - assigned sreg1 %rax to R29 - 2 gc_safe_point %rax clobbers: c -processing: 1 i8const R29 <- [4529466904] - assigned dreg %rax to dest R29 - freeable %rax (R29) (born in 1) - 1 i8const %rax <- [4529466904] - -LOCAL REGALLOC BLOCK 2: - 1 il_seq_point intr il: 0x0 - 2 il_seq_point il: 0x1 - 3 add_imm R25 <- %rbp [-32] clobbers: 1 - 4 load_membase R33 <- [%rbp + 0xffffffffffffffc0] - 5 load_membase R35 <- [%rbp + 0xffffffffffffffc8] - 6 load_membase R38 <- [%rbp + 0xffffffffffffffd0] - 7 load_membase R40 <- [%rbp + 0xffffffffffffffd8] - 8 move R26 <- R25 - 9 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c - 10 il_seq_point il: 0x8, nonempty-stack - 11 il_seq_point il: 0x9 - 12 il_seq_point il: 0xb - 13 il_seq_point intr il: 0xc - 14 loadx_membase R41 <- [%rbp + 0xffffffffffffffe0] - 15 load_membase R42 <- [%rbp + 0xfffffffffffffff8] - 16 storex_membase [R42] <- R41 -liveness: R25 [3 - 3] -liveness: R26 [8 - 8] -liveness: R33 [4 - 4] -liveness: R35 [5 - 5] -liveness: R38 [6 - 6] -liveness: R40 [7 - 7] -liveness: R41 [14 - 14] -liveness: R42 [15 - 15] -processing: 16 storex_membase [R42] <- R41 - assigned dreg %rax to dest R42 - assigned sreg1 p:xmm0 to R41 - 16 storex_membase [%rax] <- p:xmm0 -processing: 15 load_membase R42 <- [%rbp + 0xfffffffffffffff8] - assigned dreg %rax to dest R42 - freeable %rax (R42) (born in 15) - 15 load_membase %rax <- [%rbp + 0xfffffffffffffff8] -processing: 14 loadx_membase R41 <- [%rbp + 0xffffffffffffffe0] - assigned dreg p:xmm0 to dest R41 - freeable p:xmm0 (R41) (born in 14) - 14 loadx_membase p:xmm0 <- [%rbp + 0xffffffffffffffe0] -processing: 13 il_seq_point intr il: 0xc - 13 il_seq_point intr il: 0xc -processing: 12 il_seq_point il: 0xb - 12 il_seq_point il: 0xb -processing: 11 il_seq_point il: 0x9 - 11 il_seq_point il: 0x9 -processing: 10 il_seq_point il: 0x8, nonempty-stack - 10 il_seq_point il: 0x8, nonempty-stack -processing: 9 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c - assigned arg reg %rdi to R26 - assigned arg reg %rcx to R33 - assigned arg reg %r8 to R35 - assigned arg reg %rsi to R38 - assigned arg reg %rdx to R40 - 9 vcall2 [System.Runtime.Intrinsics.Vector128`1 System.Runtime.Intrinsics.Vector128:Min (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1)] [%rdi <- R26] [%rcx <- R33] [%r8 <- R35] [%rsi <- R38] [%rdx <- R40] clobbers: c -processing: 8 move R26 <- R25 - assigned dreg %rdi to dest R26 - freeable %rdi (R26) (born in 8) - assigned sreg1 %rdi to R25 - 8 move %rdi <- %rdi -processing: 7 load_membase R40 <- [%rbp + 0xffffffffffffffd8] - assigned dreg %rdx to dest R40 - freeable %rdx (R40) (born in 7) - 7 load_membase %rdx <- [%rbp + 0xffffffffffffffd8] -processing: 6 load_membase R38 <- [%rbp + 0xffffffffffffffd0] - assigned dreg %rsi to dest R38 - freeable %rsi (R38) (born in 6) - 6 load_membase %rsi <- [%rbp + 0xffffffffffffffd0] -processing: 5 load_membase R35 <- [%rbp + 0xffffffffffffffc8] - assigned dreg %r8 to dest R35 - freeable %r8 (R35) (born in 5) - 5 load_membase %r8 <- [%rbp + 0xffffffffffffffc8] -processing: 4 load_membase R33 <- [%rbp + 0xffffffffffffffc0] - assigned dreg %rcx to dest R33 - freeable %rcx (R33) (born in 4) - 4 load_membase %rcx <- [%rbp + 0xffffffffffffffc0] -processing: 3 add_imm R25 <- %rbp [-32] clobbers: 1 - assigned dreg %rdi to dest R25 - freeable %rdi (R25) (born in 3) - need to copy sreg1 %rbp to dreg %rdi - forced copy from %rbp to %rdi - 3 add_imm %rdi <- %rdi [-32] clobbers: 1 -processing: 2 il_seq_point il: 0x1 - 2 il_seq_point il: 0x1 -processing: 1 il_seq_point intr il: 0x0 - 1 il_seq_point intr il: 0x0 -CFA: [0] def_cfa: %rsp+0x8 -CFA: [0] offset: unknown at cfa-0x8 -CFA: [1] def_cfa_offset: 0x10 -CFA: [1] offset: %rbp at cfa-0x10 -CFA: [4] def_cfa_reg: %rbp -Basic block 0 starting at offset 0x1c -Basic block 2 starting at offset 0x3b -Basic block 1 starting at offset 0x6e -CFA: [6f] def_cfa: %rsp+0x8 -Method System.Runtime.Intrinsics.Vector128`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) emitted at 0x109be3970 to 0x109be39e0 (code length 112) - -*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1,System.Runtime.Intrinsics.Vector128`1) *** -/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.GY3IZg: -(__TEXT,__text) section -loWorld_Program_test__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__System_Runtime_Intrinsics_Vector128_1_int__: -0000000000000000 pushq %rbp -0000000000000001 movq %rsp, %rbp -0000000000000004 subq $0x40, %rsp -0000000000000008 movq %rdi, -0x8(%rbp) -000000000000000c movq %rsi, -0x30(%rbp) -0000000000000010 movq %rdx, -0x28(%rbp) -0000000000000014 movq %rcx, -0x40(%rbp) -0000000000000018 movq %r8, -0x38(%rbp) -000000000000001c movabsq $0x10dfa2e18, %rax -0000000000000026 testl $0x1, (%rax) -000000000000002c je 0x3b -000000000000002e movabsq $0x109a0d6b4, %r11 -0000000000000038 callq *%r11 -000000000000003b movq %rbp, %rdi -000000000000003e addq $-0x20, %rdi -0000000000000042 movq -0x40(%rbp), %rcx -0000000000000046 movq -0x38(%rbp), %r8 -000000000000004a movq -0x30(%rbp), %rsi -000000000000004e movq -0x28(%rbp), %rdx -0000000000000052 leaq (%rbp), %rbp -0000000000000056 movabsq $0x109be39e0, %r11 -0000000000000060 callq *%r11 -0000000000000063 movups -0x20(%rbp), %xmm0 -0000000000000067 movq -0x8(%rbp), %rax -000000000000006b movups %xmm0, (%rax) -000000000000006e leave -000000000000006f retq -<3, 3, 3, 3> -*** - diff --git a/src/mono/sample/HelloWorld/log_v64_llvm.txt b/src/mono/sample/HelloWorld/log_v64_llvm.txt deleted file mode 100644 index ff3868422b6be8..00000000000000 --- a/src/mono/sample/HelloWorld/log_v64_llvm.txt +++ /dev/null @@ -1,394 +0,0 @@ -converting llvm method System.Runtime.Intrinsics.Vector64`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) -created temp 0 (R16) of type System.Runtime.Intrinsics.Vector64 -creating vars -created temp 1 (R17) of type System.Runtime.Intrinsics.Vector64 -created temp 2 (R18) of type System.Runtime.Intrinsics.Vector64 -created temp 3 (R19) of type System.Runtime.Intrinsics.Vector64 - return : arg R16 <- - arg [0]: arg R17 <- - arg [1]: arg R18 <- - arg [2]: arg R19 <- -creating locals - local [0]: created temp 4 (R20) of type System.Runtime.Intrinsics.Vector64 -locals done -method to IR HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) -converting (in B3: stack: 0) IL_0000: nop -converting (in B3: stack: 0) IL_0001: ldarg.0 -converting (in B3: stack: 1) IL_0002: ldarg.1 -converting (in B3: stack: 2) IL_0003: call 0x2b000001 -cmethod = System.Runtime.Intrinsics.Vector64`1 System.Runtime.Intrinsics.Vector64:Min (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) -converting (in B3: stack: 1) IL_0008: stloc.0 -converting (in B3: stack: 0) IL_0009: br.s IL_000b -converting (in B4: stack: 0) IL_000b: ldloc.0 -converting (in B4: stack: 1) IL_000c: ret -REGION BB0 IL_0000 ID_FFFFFFFF -REGION BB2 IL_0000 ID_FFFFFFFF -REGION BB3 IL_0009 ID_FFFFFFFF -REGION BB4 IL_000c ID_FFFFFFFF -REGION BB1 IL_0000 ID_FFFFFFFF -AFTER METHOD-TO-IR 0: [IN: , OUT: BB2(0) ] -AFTER METHOD-TO-IR 2: [IN: BB0(0), OUT: BB3(0) ] - xzero R20 <- -AFTER METHOD-TO-IR 3: [IN: BB2(0), OUT: BB4(0) ] - il_seq_point intr il: 0x0 - nop - il_seq_point il: 0x1 - xmove R21 <- R17 - xmove R22 <- R18 - xbinop R23 <- R21 R22 - il_seq_point il: 0x8, nonempty-stack - xmove R20 <- R23 - il_seq_point il: 0x9 - br [B4] -AFTER METHOD-TO-IR 4: [IN: BB3(0), OUT: BB1(0) ] - il_seq_point il: 0xb - xmove R24 <- R20 - il_seq_point intr il: 0xc - xmove R16 <- R24 - br [B1] -AFTER METHOD-TO-IR 1: [IN: BB4(0), OUT: ] -CCOPY/2: R21 -> R17 -CCOPY/2: R22 -> R18 -CCOPY/2: R24 -> R20 - -HANDLE-GLOBAL-VREGS BLOCK 0: - -HANDLE-GLOBAL-VREGS BLOCK 2: - xzero R20 <- - -HANDLE-GLOBAL-VREGS BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xmove R21 <- R17 - xmove R22 <- R18 - xbinop R23 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - xmove R20 <- R23 - il_seq_point il: 0x9 - br [B4] - -HANDLE-GLOBAL-VREGS BLOCK 4: - il_seq_point il: 0xb - xmove R24 <- R20 - il_seq_point intr il: 0xc - xmove R16 <- R20 - br [B1] - -HANDLE-GLOBAL-VREGS BLOCK 1: - setret R16 - Reverse copyprop in BB3 on xmove R20 <- R23 -BB0 IN: -BB2 IN: 0 -BB3 IN: 2 -BB4 IN: 3 -BB1 IN: 4 -DTREE HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) 0 -BB0(dfn=0) (IDOM=BB-1): BB0 -BB2(dfn=1) (IDOM=BB0): BB0 BB2 -BB3(dfn=2) (IDOM=BB2): BB0 BB2 BB3 -BB4(dfn=3) (IDOM=BB3): BB0 BB2 BB3 BB4 -BB1(dfn=4) (IDOM=BB4): BB0 BB2 BB3 BB4 BB1 -SKIPPING SAFEPOINTS for code compiled with LLVM - -COMPUTE SSA 5 (R25-) - - -LIVENESS: -BLOCK BB0 (BB2, ): -GEN BB0: {} -KILL BB0: {} -BLOCK BB2 (BB3, ): - 1 xzero R20 <- - KILL: R20(4) -GEN BB2: {} -KILL BB2: {4} -BLOCK BB3 (BB4, ): - 1 il_seq_point intr il: 0x0 - 1 il_seq_point il: 0x1 - 1 xbinop R20 <- R17 R18 - GEN: R17(1) - GEN: R18(2) - KILL: R20(4) - 1 il_seq_point il: 0x8, nonempty-stack - 1 il_seq_point il: 0x9 - 1 br [B4] -GEN BB3: {1, 2} -KILL BB3: {4} -BLOCK BB4 (BB1, ): - 1 il_seq_point il: 0xb - 1 il_seq_point intr il: 0xc - 1 xmove R16 <- R20 - GEN: R20(4) - KILL: R16(0) - 1 br [B1] -GEN BB4: {4} -KILL BB4: {0} -BLOCK BB1 (): - 1 setret R16 - GEN: R16(0) -GEN BB1: {0} -KILL BB1: {} - -ITERATION: -P: BB1(4): IN: BB4 OUT: -P: BB4(3): IN: BB3 OUT:BB1 - LIVE IN BB4: {4} -P: BB3(2): IN: BB2 OUT:BB4 - LIVE IN BB3: {1, 2} -P: BB2(1): IN: BB0 OUT:BB3 - LIVE IN BB2: {1, 2} -P: BB0(0): IN: OUT:BB2 - LIVE IN BB0: {1, 2} -IT: 5 4. -LIVE IN BB1: {0} -LIVE OUT BB1: {} -LIVE IN BB4: {4} -LIVE OUT BB4: {0} -LIVE IN BB3: {1, 2} -LIVE OUT BB3: {4} -LIVE IN BB2: {1, 2} -LIVE OUT BB2: {1, 2} -LIVE IN BB0: {1, 2} -LIVE OUT BB0: {1, 2} -V0: [0x0 - 0x100002] -V1: [0x0 - 0x80006] -V2: [0x0 - 0x80006] -V3: [0x0 - 0x0] -V4: [0x40003 - 0xc0006] - -RENAME VARS BLOCK 0: - -RENAME VARS BLOCK 2: - -RENAME VARS BLOCK 3: -created temp 5 (R25) of type System.Runtime.Intrinsics.Vector64 - R20 -> R25 - -RENAME VARS BLOCK 4: -created temp 6 (R26) of type System.Runtime.Intrinsics.Vector64 - R16 -> R26 - -RENAME VARS BLOCK 1: - -END COMPUTE SSA. - -IR code for method HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) - -BB0 (0) (len: 0): - prev: succ: BB2 - idom: BB-1 - dominators: BB0 - dfrontier: - -BB2 (1) (len: 0): - xzero R20 <- - prev: BB0 succ: BB3 - idom: BB0 - dominators: [BB0] BB2 - dfrontier: - -BB3 (2) (len: 11): - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R25 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] - prev: BB2 succ: BB4 - idom: BB2 - dominators: BB0 [BB2] BB3 - dfrontier: - -BB4 (3) (len: 2): - il_seq_point il: 0xb - il_seq_point intr il: 0xc - xmove R26 <- R25 - br [B1] - prev: BB3 succ: BB1 - idom: BB3 - dominators: BB0 BB2 [BB3] BB4 - dfrontier: - -BB1 (4) (len: 0): - setret R26 - prev: BB4 succ: - idom: BB4 - dominators: BB0 BB2 BB3 [BB4] BB1 - dfrontier: - - -ABCREM BLOCK 0: - -ABCREM BLOCK 2: - -ABCREM BLOCK 3: - -ABCREM BLOCK 4: - -ABCREM BLOCK 1: - -ABCREM BLOCK/2 0 [dfn 0]... - -ABCREM BLOCK/2 2 [dfn 1]... - xzero R20 <- - -ABCREM BLOCK/2 3 [dfn 2]... - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R25 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] - -ABCREM BLOCK/2 4 [dfn 3]... - il_seq_point il: 0xb - il_seq_point intr il: 0xc - xmove R26 <- R25 - br [B1] - -ABCREM BLOCK/2 1 [dfn 4]... - setret R26 -BEFORE LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -AFTER LOWER-VTYPE-OPTS 0: [IN: , OUT: BB2(1) ] -BEFORE LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R20 <- -AFTER LOWER-VTYPE-OPTS 2: [IN: BB0(0), OUT: BB3(2) ] - xzero R20 <- -BEFORE LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R25 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -AFTER LOWER-VTYPE-OPTS 3: [IN: BB2(1), OUT: BB4(3) ] - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R25 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -BEFORE LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] - il_seq_point il: 0xb - il_seq_point intr il: 0xc - xmove R26 <- R25 - br [B1] -AFTER LOWER-VTYPE-OPTS 4: [IN: BB3(2), OUT: BB1(4) ] - il_seq_point il: 0xb - il_seq_point intr il: 0xc - xmove R26 <- R25 - br [B1] -BEFORE LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] - setret R26 -AFTER LOWER-VTYPE-OPTS 1: [IN: BB4(3), OUT: ] - setret R26 -DUMP BLOCK 0: -DUMP BLOCK 2: - xzero R20 <- -DUMP BLOCK 3: - il_seq_point intr il: 0x0 - il_seq_point il: 0x1 - xbinop R25 <- R17 R18 - il_seq_point il: 0x8, nonempty-stack - il_seq_point il: 0x9 - br [B4] -DUMP BLOCK 4: - il_seq_point il: 0xb - il_seq_point intr il: 0xc - xmove R26 <- R25 - br [B1] -DUMP BLOCK 1: - setret R26 - -*** Unoptimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) *** -; ModuleID = 'jit-module-test' -source_filename = "jit-module-test" - -; Function Attrs: noinline uwtable -define dso_local monocc { i64 } @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1)"(i64 %arg_a, i64 %arg_b, i64 %arg_c) #0 { -BB0: - %0 = alloca <2 x i32>, align 8 - %1 = alloca <2 x i32>, align 8 - %2 = alloca <2 x i32>, align 8 - %3 = bitcast <2 x i32>* %2 to i8* - %4 = getelementptr i8, i8* %3, i32 0 - %5 = bitcast i8* %4 to i64* - store i64 %arg_a, i64* %5, align 4 - %simd_vtype = load <2 x i32>, <2 x i32>* %2, align 8 - %6 = bitcast <2 x i32>* %1 to i8* - %7 = getelementptr i8, i8* %6, i32 0 - %8 = bitcast i8* %7 to i64* - store i64 %arg_b, i64* %8, align 4 - %simd_vtype1 = load <2 x i32>, <2 x i32>* %1, align 8 - %9 = bitcast <2 x i32>* %0 to i8* - %10 = getelementptr i8, i8* %9, i32 0 - %11 = bitcast i8* %10 to i64* - store i64 %arg_c, i64* %11, align 4 - %simd_vtype2 = load <2 x i32>, <2 x i32>* %0, align 8 - br label %BB2 - -BB2: ; preds = %BB0 - br label %BB3 - -BB3: ; preds = %BB2 - %12 = icmp slt <2 x i32> %simd_vtype, %simd_vtype1 - %13 = select <2 x i1> %12, <2 x i32> %simd_vtype, <2 x i32> %simd_vtype1 - br label %BB4 - -BB4: ; preds = %BB3 - br label %BB1 - -BB1: ; preds = %BB4 - %14 = bitcast <2 x i32> %13 to <1 x i64> - %15 = extractelement <1 x i64> %14, i32 0 - %setret_simd_vtype_in_reg = insertvalue { i64 } undef, i64 %15, 0 - ret { i64 } %setret_simd_vtype_in_reg -} - -attributes #0 = { noinline uwtable } - -*** - - -*** Optimized LLVM IR for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) *** -; ModuleID = 'jit-module-test' -source_filename = "jit-module-test" -target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" - -; Function Attrs: noinline uwtable -define dso_local monocc { i64 } @"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1)"(i64 %arg_a, i64 %arg_b, i64 %arg_c) #0 { -BB0: - %0 = bitcast i64 %arg_a to <2 x i32> - %1 = bitcast i64 %arg_b to <2 x i32> - %2 = icmp slt <2 x i32> %0, %1 - %3 = select <2 x i1> %2, <2 x i32> %0, <2 x i32> %1 - %4 = bitcast <2 x i32> %3 to <1 x i64> - %5 = extractelement <1 x i64> %4, i32 0 - %setret_simd_vtype_in_reg = insertvalue { i64 } undef, i64 %5, 0 - ret { i64 } %setret_simd_vtype_in_reg -} - -attributes #0 = { noinline uwtable } - -!mono.function_indexes = !{!0} - -!0 = !{!"HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1)", i32 1} - -*** - -CFA: [0] def_cfa: %rsp+0x8 -CFA: [0] offset: pc at cfa-0x8 -LLVM Method System.Runtime.Intrinsics.Vector64`1 HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) emitted at 0x100b98290 to 0x100b982a5 (code length 21) - -*** ASM for HelloWorld.Program:test (System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1,System.Runtime.Intrinsics.Vector64`1) *** -/var/folders/9q/30znkg553fb1vt7_qnx2v0040000gn/T/.pmTEYC: -(__TEXT,__text) section -loWorld_Program_test__System_Runtime_Intrinsics_Vector64_1_int__System_Runtime_Intrinsics_Vector64_1_int__System_Runtime_Intrinsics_Vector64_1_int__: -0000000000000000 vmovq %rdi, %xmm0 -0000000000000005 vmovq %rsi, %xmm1 -000000000000000a vpminsd %xmm1, %xmm0, %xmm0 -000000000000000f vmovq %xmm0, %rax -0000000000000014 retq -<3, 3> -*** - From 93da3545b2ff9ad526bd358a60e462221fc0bda2 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 6 May 2022 15:04:08 -0700 Subject: [PATCH 05/11] Clean up unnecessary format change --- src/mono/mono/mini/intrinsics.c | 2 +- src/mono/sample/HelloWorld/Program.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/intrinsics.c b/src/mono/mono/mini/intrinsics.c index a62100b5e0e3d2..25d89f2ddcfe41 100644 --- a/src/mono/mono/mini/intrinsics.c +++ b/src/mono/mono/mini/intrinsics.c @@ -2039,7 +2039,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign return ins; } } - } + } #ifdef MONO_ARCH_SIMD_INTRINSICS if (cfg->opt & MONO_OPT_SIMD) { diff --git a/src/mono/sample/HelloWorld/Program.cs b/src/mono/sample/HelloWorld/Program.cs index 6d0b31d30dc6f8..0a65da4203a6d5 100644 --- a/src/mono/sample/HelloWorld/Program.cs +++ b/src/mono/sample/HelloWorld/Program.cs @@ -16,4 +16,4 @@ private static void Main(string[] args) Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription); } } -} \ No newline at end of file +} From 6d2c7d5e526e13ab32de04026404691b53524710 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Sat, 7 May 2022 10:57:00 -0700 Subject: [PATCH 06/11] Update code after rebase --- src/mono/mono/mini/mini-llvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 73d40e97be3663..e8e69ee93c0336 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -3900,8 +3900,8 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) case LLVMArgVtypeInSIMDReg: { LLVMValueRef arg = LLVMGetParam (ctx->lmethod, pindex); - ctx->addresses [reg] = build_alloca (ctx, ainfo->type); - LLVMBuildStore (builder, arg, convert (ctx, ctx->addresses [reg], LLVMPointerType (LLVMTypeOf (arg), 0))); + ctx->addresses [reg] = build_alloca_address (ctx, ainfo->type); + LLVMBuildStore (builder, arg, convert (ctx, ctx->addresses [reg]->value, LLVMPointerType (LLVMTypeOf (arg), 0))); break; } case LLVMArgVtypeByVal: { @@ -4551,7 +4551,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, break; } case LLVMArgVtypeInSIMDReg: { - args [pindex] = LLVMBuildLoad (ctx->builder, addresses [reg], "load_param"); + args [pindex] = LLVMBuildLoad2 (ctx->builder, addresses [reg]->type, addresses [reg]->value, "load_param"); break; } case LLVMArgVtypeByVal: From 3086bfa7e973682a10d7311777ea4d69951e06b5 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Mon, 9 May 2022 16:38:07 -0400 Subject: [PATCH 07/11] Only use SIMD register when element type is primitive type --- src/mono/mono/mini/mini-amd64.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/mono/mono/mini/mini-amd64.c b/src/mono/mono/mini/mini-amd64.c index 159313736a235d..6b43b2e0c0c1bf 100644 --- a/src/mono/mono/mini/mini-amd64.c +++ b/src/mono/mono/mini/mini-amd64.c @@ -2124,14 +2124,6 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) return linfo; } - if (sig_ret->type == MONO_TYPE_GENERICINST) { - MonoClass *klass = mono_class_from_mono_type_internal (sig_ret); - if (!strcmp (m_class_get_name (klass), "Vector128`1")) { - linfo->ret.storage = LLVMArgVtypeInSIMDReg; - break; - } - } - linfo->ret.storage = LLVMArgVtypeInReg; for (j = 0; j < 2; ++j) linfo->ret.pair_storage [j] = arg_storage_to_llvm_arg_storage (cfg, ainfo->pair_storage [j]); @@ -2185,8 +2177,12 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) if (t->type == MONO_TYPE_GENERICINST) { MonoClass *klass = mono_class_from_mono_type_internal (t); if (!strcmp (m_class_get_name (klass), "Vector128`1")) { - linfo->args [i].storage = LLVMArgVtypeInSIMDReg; - break; + MonoType *element_type = mono_class_get_context (klass)->class_inst->type_argv [0];; + if (MONO_TYPE_IS_VECTOR_PRIMITIVE(element_type)) + { + linfo->args [i].storage = LLVMArgVtypeInSIMDReg; + break; + } } } From 5383b558501d72e02fb750ce593520aa94e3220b Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Mon, 16 May 2022 09:52:21 -0400 Subject: [PATCH 08/11] Disable SIMD intrinsics for generic sharing, since it doesn't work at all. --- src/mono/mono/mini/mini-generic-sharing.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mono/mono/mini/mini-generic-sharing.c b/src/mono/mono/mini/mini-generic-sharing.c index af34a2d8779f93..97beb22c3ac57e 100644 --- a/src/mono/mono/mini/mini-generic-sharing.c +++ b/src/mono/mono/mini/mini-generic-sharing.c @@ -3566,6 +3566,18 @@ mono_method_is_generic_sharable_full (MonoMethod *method, gboolean allow_type_va } } } + + MonoMethodSignature *sig = mono_method_signature_internal (inflated->declaring); + for (int i = 0; i < sig->param_count; ++i) { + MonoType *t = sig->params [i]; + if (t->type == MONO_TYPE_GENERICINST) { + MonoClass *klass = mono_class_from_mono_type_internal (t); + if (!strcmp (m_class_get_name (klass), "Vector128`1")) { + if (t->data.generic_class->context.class_inst->is_open) + return FALSE; + } + } + } } if (mono_class_is_ginst (method->klass)) { From 91d196bb334861ed9e802a5bace8de41421901f9 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Mon, 16 May 2022 10:48:18 -0400 Subject: [PATCH 09/11] Check if element type is primitive on arm64 --- src/mono/mono/mini/mini-arm64.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/mini-arm64.c b/src/mono/mono/mini/mini-arm64.c index 20c01e5bf917fc..607eac26992533 100644 --- a/src/mono/mono/mini/mini-arm64.c +++ b/src/mono/mono/mini/mini-arm64.c @@ -2525,8 +2525,12 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) if (t->type == MONO_TYPE_GENERICINST) { MonoClass *klass = mono_class_from_mono_type_internal (t); if (!strcmp (m_class_get_name (klass), "Vector128`1")) { - lainfo->storage = LLVMArgVtypeInSIMDReg; - break; + MonoType *element_type = mono_class_get_context (klass)->class_inst->type_argv [0];; + if (MONO_TYPE_IS_VECTOR_PRIMITIVE(element_type)) + { + lainfo->storage = LLVMArgVtypeInSIMDReg; + break; + } } } From b9b17677860b83a47b507cdaaae63ed5f30e6c78 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Tue, 24 May 2022 18:16:18 -0400 Subject: [PATCH 10/11] Not using SIMD register when it is full aot --- src/mono/mono/mini/mini-amd64.c | 12 ++++-------- src/mono/mono/mini/mini-arm64.c | 12 ++++-------- src/mono/mono/mini/mini-generic-sharing.c | 11 ----------- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/mono/mono/mini/mini-amd64.c b/src/mono/mono/mini/mini-amd64.c index 6b43b2e0c0c1bf..8b2cb946eb9fd5 100644 --- a/src/mono/mono/mini/mini-amd64.c +++ b/src/mono/mono/mini/mini-amd64.c @@ -2174,15 +2174,11 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) return linfo; } - if (t->type == MONO_TYPE_GENERICINST) { + if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot) { MonoClass *klass = mono_class_from_mono_type_internal (t); - if (!strcmp (m_class_get_name (klass), "Vector128`1")) { - MonoType *element_type = mono_class_get_context (klass)->class_inst->type_argv [0];; - if (MONO_TYPE_IS_VECTOR_PRIMITIVE(element_type)) - { - linfo->args [i].storage = LLVMArgVtypeInSIMDReg; - break; - } + if (m_class_is_simd_type (klass)) { + linfo->args [i].storage = LLVMArgVtypeInSIMDReg; + break; } } diff --git a/src/mono/mono/mini/mini-arm64.c b/src/mono/mono/mini/mini-arm64.c index 607eac26992533..d40d2b0c33c43a 100644 --- a/src/mono/mono/mini/mini-arm64.c +++ b/src/mono/mono/mini/mini-arm64.c @@ -2522,15 +2522,11 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) break; } case ArgVtypeInIRegs: - if (t->type == MONO_TYPE_GENERICINST) { + if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot) { MonoClass *klass = mono_class_from_mono_type_internal (t); - if (!strcmp (m_class_get_name (klass), "Vector128`1")) { - MonoType *element_type = mono_class_get_context (klass)->class_inst->type_argv [0];; - if (MONO_TYPE_IS_VECTOR_PRIMITIVE(element_type)) - { - lainfo->storage = LLVMArgVtypeInSIMDReg; - break; - } + if (m_class_is_simd_type (klass)) { + lainfo->storage = LLVMArgVtypeInSIMDReg; + break; } } diff --git a/src/mono/mono/mini/mini-generic-sharing.c b/src/mono/mono/mini/mini-generic-sharing.c index 97beb22c3ac57e..6f9140c284e051 100644 --- a/src/mono/mono/mini/mini-generic-sharing.c +++ b/src/mono/mono/mini/mini-generic-sharing.c @@ -3567,17 +3567,6 @@ mono_method_is_generic_sharable_full (MonoMethod *method, gboolean allow_type_va } } - MonoMethodSignature *sig = mono_method_signature_internal (inflated->declaring); - for (int i = 0; i < sig->param_count; ++i) { - MonoType *t = sig->params [i]; - if (t->type == MONO_TYPE_GENERICINST) { - MonoClass *klass = mono_class_from_mono_type_internal (t); - if (!strcmp (m_class_get_name (klass), "Vector128`1")) { - if (t->data.generic_class->context.class_inst->is_open) - return FALSE; - } - } - } } if (mono_class_is_ginst (method->klass)) { From 3425bdf5c42b20ffe91db365bdbf1304b8255bf7 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Thu, 26 May 2022 12:40:50 -0400 Subject: [PATCH 11/11] Address review feedbacks --- src/mono/mono/mini/mini-amd64.c | 2 +- src/mono/mono/mini/mini-arm64.c | 2 +- src/mono/mono/mini/mini-generic-sharing.c | 1 - src/mono/mono/mini/mini-llvm.c | 4 ++-- src/mono/mono/mini/mini.h | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mono/mono/mini/mini-amd64.c b/src/mono/mono/mini/mini-amd64.c index 8b2cb946eb9fd5..57530cccf56bcf 100644 --- a/src/mono/mono/mini/mini-amd64.c +++ b/src/mono/mono/mini/mini-amd64.c @@ -2174,7 +2174,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) return linfo; } - if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot) { + if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot && !sig->pinvoke) { MonoClass *klass = mono_class_from_mono_type_internal (t); if (m_class_is_simd_type (klass)) { linfo->args [i].storage = LLVMArgVtypeInSIMDReg; diff --git a/src/mono/mono/mini/mini-arm64.c b/src/mono/mono/mini/mini-arm64.c index d40d2b0c33c43a..625108729015b9 100644 --- a/src/mono/mono/mini/mini-arm64.c +++ b/src/mono/mono/mini/mini-arm64.c @@ -2522,7 +2522,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) break; } case ArgVtypeInIRegs: - if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot) { + if ((t->type == MONO_TYPE_GENERICINST) && !cfg->full_aot && !sig->pinvoke) { MonoClass *klass = mono_class_from_mono_type_internal (t); if (m_class_is_simd_type (klass)) { lainfo->storage = LLVMArgVtypeInSIMDReg; diff --git a/src/mono/mono/mini/mini-generic-sharing.c b/src/mono/mono/mini/mini-generic-sharing.c index 6f9140c284e051..af34a2d8779f93 100644 --- a/src/mono/mono/mini/mini-generic-sharing.c +++ b/src/mono/mono/mini/mini-generic-sharing.c @@ -3566,7 +3566,6 @@ mono_method_is_generic_sharable_full (MonoMethod *method, gboolean allow_type_va } } } - } if (mono_class_is_ginst (method->klass)) { diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index ce69be8f2338dd..5b092a92f01aa7 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -1740,7 +1740,7 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * break; case LLVMArgVtypeInSIMDReg: { MonoClass *klass = mono_class_from_mono_type_internal (sig->params [i]); - param_types [pindex ++] = simd_class_to_llvm_type (ctx, klass);; + param_types [pindex ++] = simd_class_to_llvm_type (ctx, klass); break; } case LLVMArgVtypeByVal: @@ -3931,7 +3931,7 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) LLVMValueRef arg = LLVMGetParam (ctx->lmethod, pindex); ctx->addresses [reg] = build_alloca_address (ctx, ainfo->type); - LLVMBuildStore (builder, arg, convert (ctx, ctx->addresses [reg]->value, LLVMPointerType (LLVMTypeOf (arg), 0))); + LLVMBuildStore (builder, arg, build_ptr_cast (builder, ctx->addresses [reg]->value, pointer_type(LLVMTypeOf (arg)))); break; } case LLVMArgVtypeByVal: { diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h index 3d185d49f3d294..f9a9a51aa96216 100644 --- a/src/mono/mono/mini/mini.h +++ b/src/mono/mono/mini/mini.h @@ -632,7 +632,7 @@ typedef enum { LLVMArgInFPReg, /* Valuetype passed in 1-2 consecutive register */ LLVMArgVtypeInReg, - /* Pass Vector128 in SIMD registers */ + /* Pass vector types in SIMD registers */ LLVMArgVtypeInSIMDReg, LLVMArgVtypeByVal, LLVMArgVtypeRetAddr, /* On on cinfo->ret */