Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0d462da

Browse files
authored
Merge pull request #5813 from mikedn/no-setflags
Remove useless gtSetFlags calls
2 parents 51f010f + 845d348 commit 0d462da

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/jit/codegenxarch.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7459,20 +7459,12 @@ void CodeGen::genIntToIntCast(GenTreePtr treeNode)
74597459
inst_RV_RV(INS_mov, targetReg, sourceReg, srcType);
74607460
}
74617461
}
7462-
else if (treeNode->gtSetFlags() && isUnsignedDst && castOp->InReg() && (targetReg == sourceReg))
7463-
{
7464-
// if we (might) need to set the flags and the value is in the same register
7465-
// and we have an unsigned value then use AND instead of MOVZX
7466-
noway_assert(ins == INS_movzx || ins == INS_mov);
7467-
ins = INS_AND;
7468-
}
74697462

74707463
if (ins == INS_AND)
74717464
{
74727465
noway_assert((needAndAfter == false) && isUnsignedDst);
74737466

74747467
/* Generate "and reg, MASK */
7475-
insFlags flags = treeNode->gtSetFlags() ? INS_FLAGS_SET : INS_FLAGS_DONT_CARE;
74767468
unsigned fillPattern;
74777469
if (size == EA_1BYTE)
74787470
fillPattern = 0xff;
@@ -7481,7 +7473,7 @@ void CodeGen::genIntToIntCast(GenTreePtr treeNode)
74817473
else
74827474
fillPattern = 0xffffffff;
74837475

7484-
inst_RV_IV(INS_AND, targetReg, fillPattern, EA_4BYTE, flags);
7476+
inst_RV_IV(INS_AND, targetReg, fillPattern, EA_4BYTE);
74857477
}
74867478
#ifdef _TARGET_AMD64_
74877479
else if (ins == INS_movsxd)
@@ -7516,8 +7508,7 @@ void CodeGen::genIntToIntCast(GenTreePtr treeNode)
75167508
if (needAndAfter)
75177509
{
75187510
noway_assert(genTypeSize(dstType) == 2 && ins == INS_movsx);
7519-
insFlags flags = treeNode->gtSetFlags() ? INS_FLAGS_SET : INS_FLAGS_DONT_CARE;
7520-
inst_RV_IV(INS_AND, targetReg, 0xFFFF, EA_4BYTE, flags);
7511+
inst_RV_IV(INS_AND, targetReg, 0xFFFF, EA_4BYTE);
75217512
}
75227513
}
75237514
}

0 commit comments

Comments
 (0)