Skip to content

Commit

Permalink
Fix some flag uses (dotnet#34969)
Browse files Browse the repository at this point in the history
* Fix some flag uses
  • Loading branch information
CarolEidt authored Apr 15, 2020
1 parent b9bc190 commit a6e9098
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
9 changes: 6 additions & 3 deletions src/coreclr/src/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,12 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr,
src->gtType = genActualType(returnType);
call->gtType = src->gtType;

// !!! The destination could be on stack. !!!
// This flag will let us choose the correct write barrier.
destFlags = GTF_IND_TGTANYWHERE;
if ((destAddr->gtOper != GT_ADDR) || (destAddr->AsOp()->gtOp1->gtOper != GT_LCL_VAR))
{
// !!! The destination could be on stack. !!!
// This flag will let us choose the correct write barrier.
destFlags = GTF_IND_TGTANYWHERE;
}
}
}
else if (src->OperIsBlk())
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/src/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3794,7 +3794,8 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt,
allowStructs || genActualType(varDsc->TypeGet()) == genActualType(tree->gtType) ||
(tree->gtType == TYP_BYREF && varDsc->TypeGet() == TYP_I_IMPL) ||
(tree->gtType == TYP_I_IMPL && varDsc->TypeGet() == TYP_BYREF) || (tree->gtFlags & GTF_VAR_CAST) ||
varTypeIsFloating(varDsc->TypeGet()) && varTypeIsFloating(tree->gtType));
(varTypeIsFloating(varDsc) && varTypeIsFloating(tree)) ||
(varTypeIsStruct(varDsc) == varTypeIsStruct(tree)));

/* Remember the type of the reference */

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9443,7 +9443,7 @@ void LinearScan::lsraGetOperandString(GenTree* tree,
unsigned operandStringLength)
{
const char* lastUseChar = "";
if ((tree->gtFlags & GTF_VAR_DEATH) != 0)
if (tree->OperIsScalarLocal() && ((tree->gtFlags & GTF_VAR_DEATH) != 0))
{
lastUseChar = "*";
}
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/src/jit/treelifeupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ void TreeLifeUpdater<ForCodeGen>::UpdateLifeVar(GenTree* tree)
}

// if it's a partial definition then variable "x" must have had a previous, original, site to be born.
bool isBorn = ((tree->gtFlags & GTF_VAR_DEF) != 0 && (tree->gtFlags & GTF_VAR_USEASG) == 0);
bool isDying = ((tree->gtFlags & GTF_VAR_DEATH) != 0);
bool spill = ((tree->gtFlags & GTF_SPILL) != 0);
bool isBorn = ((lclVarTree->gtFlags & GTF_VAR_DEF) != 0 && (lclVarTree->gtFlags & GTF_VAR_USEASG) == 0);
bool isDying = ((lclVarTree->gtFlags & GTF_VAR_DEATH) != 0);
bool spill = ((lclVarTree->gtFlags & GTF_SPILL) != 0);

// Since all tracked vars are register candidates, but not all are in registers at all times,
// we maintain two separate sets of variables - the total set of variables that are either
Expand Down

0 comments on commit a6e9098

Please sign in to comment.