diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp index f3e4fe5db1c25a..921341e995e5a4 100644 --- a/src/coreclr/jit/codegencommon.cpp +++ b/src/coreclr/jit/codegencommon.cpp @@ -1789,9 +1789,12 @@ void CodeGen::genEmitCallWithCurrentGC(EmitCallParams& params) if (retBuf != nullptr) { GenTree* node = retBuf->GetNode(); - assert(node->OperIsPutArg()); +#if HAS_FIXED_REGISTER_SET + assert(node->OperIsPutArg()); node = node->gtGetOp1()->gtSkipReloadOrCopy(); +#endif + if (!node->OperIs(GT_LCL_ADDR)) { return; diff --git a/src/coreclr/jit/codegenwasm.cpp b/src/coreclr/jit/codegenwasm.cpp index 40b7e5a41b1291..18995ab417850d 100644 --- a/src/coreclr/jit/codegenwasm.cpp +++ b/src/coreclr/jit/codegenwasm.cpp @@ -2441,9 +2441,15 @@ void CodeGen::genCodeForLclFld(GenTreeLclFld* tree) { assert(tree->OperIs(GT_LCL_FLD)); LclVarDsc* varDsc = m_compiler->lvaGetDesc(tree); + var_types type = tree->TypeGet(); + + if (type == TYP_SIMD16) + { + NYI_WASM_SIMD("SIMD16 local field load"); + } GetEmitter()->emitIns_I(INS_local_get, EA_PTRSIZE, GetFramePointerRegIndex()); - GetEmitter()->emitIns_S(ins_Load(tree->TypeGet()), emitTypeSize(tree), tree->GetLclNum(), tree->GetLclOffs()); + GetEmitter()->emitIns_S(ins_Load(type), emitTypeSize(tree), tree->GetLclNum(), tree->GetLclOffs()); WasmProduceReg(tree); } @@ -2465,6 +2471,11 @@ void CodeGen::genCodeForLclVar(GenTreeLclVar* tree) if (!varDsc->lvIsRegCandidate()) { var_types type = varDsc->GetRegisterType(tree); + if (type == TYP_SIMD16) + { + NYI_WASM_SIMD("SIMD16 local load"); + } + GetEmitter()->emitIns_I(INS_local_get, EA_PTRSIZE, GetFramePointerRegIndex()); GetEmitter()->emitIns_S(ins_Load(type), emitTypeSize(type), tree->GetLclNum(), 0); WasmProduceReg(tree); @@ -2549,8 +2560,13 @@ void CodeGen::genCodeForIndir(GenTreeIndir* tree) { assert(tree->OperIs(GT_IND)); - var_types type = tree->TypeGet(); - instruction ins = ins_Load(type); + var_types type = tree->TypeGet(); + if (type == TYP_SIMD16) + { + NYI_WASM_SIMD("SIMD16 indirect load"); + } + + instruction ins = ins_Load(type); genConsumeAddress(tree->Addr()); @@ -3571,6 +3587,11 @@ void CodeGen::genLoadLocalIntoReg(regNumber targetReg, unsigned lclNum) { LclVarDsc* varDsc = m_compiler->lvaGetDesc(lclNum); var_types type = varDsc->GetRegisterType(); + if (type == TYP_SIMD16) + { + NYI_WASM_SIMD("SIMD16 local load"); + } + GetEmitter()->emitIns_I(INS_local_get, EA_PTRSIZE, GetFramePointerRegIndex()); GetEmitter()->emitIns_S(ins_Load(type), emitTypeSize(type), lclNum, 0); GetEmitter()->emitIns_I(INS_local_set, emitTypeSize(type), WasmRegToIndex(targetReg)); diff --git a/src/coreclr/jit/flowgraph.cpp b/src/coreclr/jit/flowgraph.cpp index 3f09ac4fba8406..e9871277f3e788 100644 --- a/src/coreclr/jit/flowgraph.cpp +++ b/src/coreclr/jit/flowgraph.cpp @@ -7982,6 +7982,27 @@ void FlowGraphTryRegions::AddMultipleEntryRegionEdges(ArrayStack& edg // And an edge from method entry to dest. FlowEdge* const entryDestEdge = m_compiler->fgAddRefPred(destBlock, m_compiler->fgFirstBB); edges.Push(entryDestEdge); + + // If the dest is not reachable within the try, then we need to also add + // a temporary edge from the try header to the dest to create the SCC. + // Since we've pruned away dead blocks, any other pred edge suffices to + // establish reachability. + // + bool isReachableInTry = false; + for (FlowEdge* const predEdge : destBlock->PredEdges()) + { + if (predEdge != edge) + { + isReachableInTry = true; + break; + } + } + + if (!isReachableInTry) + { + FlowEdge* const headerDestEdge = m_compiler->fgAddRefPred(destBlock, headerBlock); + edges.Push(headerDestEdge); + } } } } diff --git a/src/coreclr/jit/layout.h b/src/coreclr/jit/layout.h index 42d4ce2917e2d9..73eb9ddbdf9a35 100644 --- a/src/coreclr/jit/layout.h +++ b/src/coreclr/jit/layout.h @@ -202,7 +202,7 @@ class ClassLayout case 8: return TYP_LONG; #endif -#ifdef FEATURE_SIMD +#if defined(FEATURE_SIMD) && !defined(TARGET_WASM) // TODO: check TYP_SIMD12 profitability, // it will need additional support in `BuildStoreLoc`. case 16: