Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a71d7c8

Browse files
committedJul 2, 2024·
Don't lower unnecessarily
1 parent 1d904dc commit a71d7c8

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed
 

‎src/coreclr/jit/lowerarmarch.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -1324,20 +1324,21 @@ GenTree* Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node)
13241324
}
13251325
else
13261326
{
1327-
// We have a non-constant index, so scale it up via mul
1327+
// We have a non-constant index, so scale it up via mul but
1328+
// don't lower the GT_MUL node since the indir will
1329+
// try to create an addressing mode and will do folding itself
13281330

13291331
GenTreeIntConCommon* scale = comp->gtNewIconNode(genTypeSize(simdBaseType));
13301332
BlockRange().InsertBefore(node, scale);
1331-
LowerNode(scale);
13321333

13331334
offset = comp->gtNewOperNode(GT_MUL, op2->TypeGet(), op2, scale);
13341335
BlockRange().InsertBefore(node, offset);
1335-
LowerNode(offset);
13361336
}
13371337

1338+
// Add the offset, don't lower the GT_ADD node since the indir will
1339+
// try to create an addressing mode and will do folding itself
13381340
GenTree* addr = comp->gtNewOperNode(GT_ADD, op1->TypeGet(), op1, offset);
13391341
BlockRange().InsertBefore(node, addr);
1340-
LowerNode(addr);
13411342

13421343
// Finally we can indirect the memory address to get the actual value
13431344
GenTreeIndir* indir = comp->gtNewIndir(simdBaseType, addr);

‎src/coreclr/jit/simd.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,8 @@ unsigned Compiler::getSIMDInitTempVarNum(var_types simdType)
117117
if (lvaSIMDInitTempVarNum == BAD_VAR_NUM)
118118
{
119119
JITDUMP("Allocating SIMDInitTempVar as %s\n", varTypeName(simdType));
120-
121120
lvaSIMDInitTempVarNum = lvaGrabTempWithImplicitUse(false DEBUGARG("SIMDInitTempVar"));
122121
lvaTable[lvaSIMDInitTempVarNum].lvType = simdType;
123-
124-
// Ensure we mark it as do-not-enregister
125-
lvaSetVarDoNotEnregister(lvaSIMDInitTempVarNum DEBUGARG(DoNotEnregisterReason::LclAddrNode));
126122
}
127123
else if (genTypeSize(lvaTable[lvaSIMDInitTempVarNum].lvType) < genTypeSize(simdType))
128124
{

0 commit comments

Comments
 (0)
Please sign in to comment.