Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/coreclr/jit/async.cpp
Original file line number Diff line number Diff line change
@@ -356,6 +356,7 @@ PhaseStatus AsyncTransformation::Run()

m_comp->lvaComputeRefCounts(true, false);
m_comp->fgLocalVarLiveness();
INDEBUG(m_comp->mostRecentlyActivePhase = PHASE_ASYNC);
VarSetOps::AssignNoCopy(m_comp, m_comp->compCurLife, VarSetOps::MakeEmpty(m_comp));
}

@@ -1123,7 +1124,7 @@ void AsyncTransformation::FillInDataOnSuspension(const jitstd::vector<LiveLocalI
if (dsc->IsImplicitByRef())
{
GenTree* baseAddr = m_comp->gtNewLclvNode(inf.LclNum, dsc->TypeGet());
value = m_comp->gtNewBlkIndir(dsc->GetLayout(), baseAddr, GTF_IND_NONFAULTING);
value = m_comp->gtNewLoadValueNode(dsc->GetLayout(), baseAddr, GTF_IND_NONFAULTING);
}
else
{
@@ -1138,7 +1139,7 @@ void AsyncTransformation::FillInDataOnSuspension(const jitstd::vector<LiveLocalI
// This is to heap, but all GC refs are nulled out already, so we can skip the write barrier.
// TODO-CQ: Backend does not care about GTF_IND_TGT_NOT_HEAP for STORE_BLK.
store =
m_comp->gtNewStoreBlkNode(dsc->GetLayout(), addr, value, GTF_IND_NONFAULTING | GTF_IND_TGT_NOT_HEAP);
m_comp->gtNewStoreValueNode(dsc->GetLayout(), addr, value, GTF_IND_NONFAULTING | GTF_IND_TGT_NOT_HEAP);
}
else
{
@@ -1312,7 +1313,7 @@ void AsyncTransformation::RestoreFromDataOnResumption(unsigned
GenTree* value;
if ((dsc->TypeGet() == TYP_STRUCT) || dsc->IsImplicitByRef())
{
value = m_comp->gtNewBlkIndir(dsc->GetLayout(), addr, GTF_IND_NONFAULTING);
value = m_comp->gtNewLoadValueNode(dsc->GetLayout(), addr, GTF_IND_NONFAULTING);
}
else
{
@@ -1323,8 +1324,8 @@ void AsyncTransformation::RestoreFromDataOnResumption(unsigned
if (dsc->IsImplicitByRef())
{
GenTree* baseAddr = m_comp->gtNewLclvNode(inf.LclNum, dsc->TypeGet());
store = m_comp->gtNewStoreBlkNode(dsc->GetLayout(), baseAddr, value,
GTF_IND_NONFAULTING | GTF_IND_TGT_NOT_HEAP);
store = m_comp->gtNewStoreValueNode(dsc->GetLayout(), baseAddr, value,
GTF_IND_NONFAULTING | GTF_IND_TGT_NOT_HEAP);
}
else
{
@@ -1537,7 +1538,7 @@ void AsyncTransformation::CopyReturnValueOnResumption(GenTreeCall*

assert(callDefInfo.DefinitionNode != nullptr);
LclVarDsc* resultLcl = m_comp->lvaGetDesc(callDefInfo.DefinitionNode);
assert((resultLcl->TypeGet() == TYP_STRUCT) == (call->gtReturnType == TYP_STRUCT));
assert(varTypeIsStruct(resultLcl) == varTypeIsStruct(call->gtReturnType));

// TODO-TP: We can use liveness to avoid generating a lot of this IR.
if (call->gtReturnType == TYP_STRUCT)
@@ -1546,7 +1547,7 @@ void AsyncTransformation::CopyReturnValueOnResumption(GenTreeCall*
{
GenTree* resultOffsetNode = m_comp->gtNewIconNode((ssize_t)resultOffset, TYP_I_IMPL);
GenTree* resultAddr = m_comp->gtNewOperNode(GT_ADD, TYP_BYREF, resultBase, resultOffsetNode);
GenTree* resultData = m_comp->gtNewBlkIndir(layout.ReturnStructLayout, resultAddr, resultIndirFlags);
GenTree* resultData = m_comp->gtNewLoadValueNode(layout.ReturnStructLayout, resultAddr, resultIndirFlags);
GenTree* storeResult;
if ((callDefInfo.DefinitionNode->GetLclOffs() == 0) &&
ClassLayout::AreCompatible(resultLcl->GetLayout(), layout.ReturnStructLayout))
2 changes: 1 addition & 1 deletion src/tests/async/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

<PropertyGroup>
<RunAnalyzers>true</RunAnalyzers>
<NoWarn>$(NoWarn);xUnit1013</NoWarn>
<NoWarn>$(NoWarn);xUnit1013;CS1998</NoWarn>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<Features>$(Features);runtime-async=on</Features>
</PropertyGroup>
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
using System.Runtime.CompilerServices;
using Xunit;

#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
#pragma warning disable SYSLIB5007 // 'System.Runtime.CompilerServices.AsyncHelpers' is for evaluation purposes only

public class Async2FibonacciWithYields
Original file line number Diff line number Diff line change
@@ -115,7 +115,6 @@ private static async Task<long> Run(string type)

return 0;
}
#pragma warning disable CS1998

[System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task<long> AsyncCallingAsync()
1 change: 0 additions & 1 deletion src/tests/async/pgo/pgo.cs
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ internal static async Task<int> AsyncEntryPoint()

private class AggregateSum : I<int>
{
#pragma warning disable CS1998
public async Task<int> Aggregate(int a, int b) => a + b;
}

Loading
Oops, something went wrong.