Skip to content

Commit

Permalink
Revert genCall register trash changes from CFG PR
Browse files Browse the repository at this point in the history
Revert these particular fragments back to what they were before CFG.
This should fix outerloop but I will need to take a closer look tomorrow
as this particular code is not right for the CFG validator.

Fix dotnet#65395
  • Loading branch information
jakobbotsch committed Feb 15, 2022
1 parent ec965b5 commit 8e981cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
21 changes: 9 additions & 12 deletions src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3189,18 +3189,15 @@ void CodeGen::genCall(GenTreeCall* call)
genPendingCallLabel = nullptr;
}

#ifdef DEBUG
// Killed registers should no longer contain any GC pointers.
regMaskTP killMask = RBM_CALLEE_TRASH;
if (call->IsHelperCall())
{
CorInfoHelpFunc helpFunc = compiler->eeGetHelperNum(call->gtCallMethHnd);
killMask = compiler->compHelperCallKillSet(helpFunc);
}

assert((gcInfo.gcRegGCrefSetCur & killMask) == 0);
assert((gcInfo.gcRegByrefSetCur & killMask) == 0);
#endif
// Update GC info:
// All Callee arg registers are trashed and no longer contain any GC pointers.
// TODO-Bug?: As a matter of fact shouldn't we be killing all of callee trashed regs here?
// For now we will assert that other than arg regs gc ref/byref set doesn't contain any other
// registers from RBM_CALLEE_TRASH
assert((gcInfo.gcRegGCrefSetCur & (RBM_CALLEE_TRASH & ~RBM_ARG_REGS)) == 0);
assert((gcInfo.gcRegByrefSetCur & (RBM_CALLEE_TRASH & ~RBM_ARG_REGS)) == 0);
gcInfo.gcRegGCrefSetCur &= ~RBM_ARG_REGS;
gcInfo.gcRegByrefSetCur &= ~RBM_ARG_REGS;

var_types returnType = call->TypeGet();
if (returnType != TYP_VOID)
Expand Down
21 changes: 9 additions & 12 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5279,18 +5279,15 @@ void CodeGen::genCall(GenTreeCall* call)
genPendingCallLabel = nullptr;
}

#ifdef DEBUG
// Killed registers should no longer contain any GC pointers.
regMaskTP killMask = RBM_CALLEE_TRASH;
if (call->IsHelperCall())
{
CorInfoHelpFunc helpFunc = compiler->eeGetHelperNum(call->gtCallMethHnd);
killMask = compiler->compHelperCallKillSet(helpFunc);
}

assert((gcInfo.gcRegGCrefSetCur & killMask) == 0);
assert((gcInfo.gcRegByrefSetCur & killMask) == 0);
#endif
// Update GC info:
// All Callee arg registers are trashed and no longer contain any GC pointers.
// TODO-XArch-Bug?: As a matter of fact shouldn't we be killing all of callee trashed regs here?
// For now we will assert that other than arg regs gc ref/byref set doesn't contain any other
// registers from RBM_CALLEE_TRASH.
assert((gcInfo.gcRegGCrefSetCur & (RBM_CALLEE_TRASH & ~RBM_ARG_REGS)) == 0);
assert((gcInfo.gcRegByrefSetCur & (RBM_CALLEE_TRASH & ~RBM_ARG_REGS)) == 0);
gcInfo.gcRegGCrefSetCur &= ~RBM_ARG_REGS;
gcInfo.gcRegByrefSetCur &= ~RBM_ARG_REGS;

var_types returnType = call->TypeGet();
if (returnType != TYP_VOID)
Expand Down

0 comments on commit 8e981cc

Please sign in to comment.