Skip to content
Merged
Show file tree
Hide file tree
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
115 changes: 0 additions & 115 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1724,18 +1724,6 @@ CORINFO_CONST_LOOKUP Compiler::compGetHelperFtn(CorInfoHelpFunc ftnNum)
return lookup;
}

unsigned Compiler::compGetTypeSize(CorInfoType cit, CORINFO_CLASS_HANDLE clsHnd)
{
var_types sigType = genActualType(JITtype2varType(cit));
unsigned sigSize;
sigSize = genTypeSize(sigType);
if (cit == CORINFO_TYPE_VALUECLASS)
{
sigSize = info.compCompHnd->getClassSize(clsHnd);
}
return sigSize;
}

#ifdef DEBUG
static bool DidComponentUnitTests = false;

Expand Down Expand Up @@ -1875,46 +1863,6 @@ const char* Compiler::compRegVarName(regNumber reg, bool displayVar, bool isFloa
return getRegName(reg);
}

const char* Compiler::compRegNameForSize(regNumber reg, size_t size)
{
#if CPU_HAS_BYTE_REGS
if (size == 1 || size == 2)
{
// clang-format off
static const char* sizeNames[][2] =
{
{ "al", "ax" },
{ "cl", "cx" },
{ "dl", "dx" },
{ "bl", "bx" },
#ifdef TARGET_AMD64
{ "spl", "sp" }, // ESP
{ "bpl", "bp" }, // EBP
{ "sil", "si" }, // ESI
{ "dil", "di" }, // EDI
{ "r8b", "r8w" },
{ "r9b", "r9w" },
{ "r10b", "r10w" },
{ "r11b", "r11w" },
{ "r12b", "r12w" },
{ "r13b", "r13w" },
{ "r14b", "r14w" },
{ "r15b", "r15w" },
#endif // TARGET_AMD64
};
// clang-format on

assert(isByteReg(reg));
assert(genRegMask(reg) & RBM_BYTE_REGS);
assert(size == 1 || size == 2);

return sizeNames[reg][size - 1];
}
#endif // CPU_HAS_BYTE_REGS

return compRegVarName(reg, true);
}

#ifdef DEBUG
const char* Compiler::compLocalVarName(unsigned varNum, unsigned offs)
{
Expand Down Expand Up @@ -8113,54 +8061,8 @@ Compiler::NodeToIntMap* Compiler::FindReachableNodesInNodeTestData()
return reachable;
}

void Compiler::TransferTestDataToNode(GenTree* from, GenTree* to)
{
TestLabelAndNum tlAndN;
// We can't currently associate multiple annotations with a single node.
// If we need to, we can fix this...

// If the table is null, don't create it just to do the lookup, which would fail...
if (m_nodeTestData != nullptr && GetNodeTestData()->Lookup(from, &tlAndN))
{
assert(!GetNodeTestData()->Lookup(to, &tlAndN));
// We can't currently associate multiple annotations with a single node.
// If we need to, we can fix this...
TestLabelAndNum tlAndNTo;
assert(!GetNodeTestData()->Lookup(to, &tlAndNTo));

GetNodeTestData()->Remove(from);
GetNodeTestData()->Set(to, tlAndN);
}
}

#endif // DEBUG

/*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX XX
XX jvc XX
XX XX
XX Functions for the stand-alone version of the JIT . XX
XX XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/

/*****************************************************************************/
void codeGeneratorCodeSizeBeg()
{
}

/*****************************************************************************
*
* Used for counting pointer assignments.
*/

/*****************************************************************************/
void codeGeneratorCodeSizeEnd()
{
}
/*****************************************************************************
*
* Gather statistics - mainly used for the standalone
Expand Down Expand Up @@ -9146,23 +9048,6 @@ void Compiler::AddLoopHoistStats()
s_totalHoistedExpressions += m_totalHoistedExpressions;
}

void Compiler::PrintPerMethodLoopHoistStats()
{
double pctWithHoisted = 0.0;
if (m_loopsConsidered > 0)
{
pctWithHoisted = 100.0 * (double(m_loopsWithHoistedExpressions) / double(m_loopsConsidered));
}
double exprsPerLoopWithExpr = 0.0;
if (m_loopsWithHoistedExpressions > 0)
{
exprsPerLoopWithExpr = double(m_totalHoistedExpressions) / double(m_loopsWithHoistedExpressions);
}
printf("Considered %d loops. Of these, we hoisted expressions out of %d (%5.2f%%).\n", m_loopsConsidered,
m_loopsWithHoistedExpressions, pctWithHoisted);
printf(" A total of %d expressions were hoisted, an average of %5.2f per loop-with-hoisted-expr.\n",
m_totalHoistedExpressions, exprsPerLoopWithExpr);
}
#endif // LOOP_HOIST_STATS

//------------------------------------------------------------------------
Expand Down
34 changes: 0 additions & 34 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -4142,7 +4142,6 @@ class Compiler
void gtDispLclVarStructType(unsigned lclNum);
void gtDispSsaName(unsigned lclNum, unsigned ssaNum, bool isDef);
void gtDispClassLayout(ClassLayout* layout, var_types type);
void gtDispILLocation(const ILLocation& loc);
void gtDispStmt(Statement* stmt, const char* msg = nullptr);
void gtDispBlockStmts(BasicBlock* block);
void gtPrintArgPrefix(GenTreeCall* call, CallArg* arg, char** bufp, unsigned* bufLength);
Expand Down Expand Up @@ -6645,9 +6644,6 @@ class Compiler
GCPOLL_INLINE
};

// Initialize the per-block variable sets (used for liveness analysis).
void fgInitBlockVarSets();

PhaseStatus StressSplitTree();
void SplitTreesRandomly();
void SplitTreesRemoveCommas();
Expand Down Expand Up @@ -6862,7 +6858,6 @@ class Compiler
PhaseStatus fgFindOperOrder();

#ifdef TARGET_WASM
FlowGraphDfsTree* fgWasmDfs();
PhaseStatus fgWasmEhFlow();
void fgWasmEhTransformTry(ArrayStack<BasicBlock*>* catchRetBlocks, unsigned regionIndex, unsigned catchRetIndexLocalNum);
PhaseStatus fgWasmControlFlow();
Expand Down Expand Up @@ -6901,9 +6896,6 @@ class Compiler
bool fgCastNeeded(GenTree* tree, var_types toType);
bool fgCastRequiresHelper(var_types fromType, var_types toType, bool overflow = false);

void fgLoopCallTest(BasicBlock* srcBB, BasicBlock* dstBB);
void fgLoopCallMark();

unsigned fgGetCodeEstimate(BasicBlock* block);

#if DUMP_FLOWGRAPHS
Expand Down Expand Up @@ -7186,10 +7178,6 @@ class Compiler
hashBv* fgAvailableOutgoingArgTemps;
ArrayStack<unsigned>* fgUsedSharedTemps = nullptr;

void fgSetRngChkTarget(GenTree* tree, bool delay = true);

BasicBlock* fgSetRngChkTargetInner(SpecialCodeKind kind, bool delay);

#if REARRANGE_ADDS
void fgMoveOpsLeft(GenTree* tree);
#endif
Expand Down Expand Up @@ -7498,10 +7486,6 @@ class Compiler
#endif

PhaseStatus fgPromoteStructs();
void fgMorphLocalField(GenTree* tree, GenTree* parent);

// Reset the refCount for implicit byrefs.
void fgResetImplicitByRefRefCount();

// Identify all candidates for last-use copy omission.
PhaseStatus fgMarkImplicitByRefCopyOmissionCandidates();
Expand Down Expand Up @@ -8264,7 +8248,6 @@ class Compiler
GenTree* optPropGetValueRec(unsigned lclNum, unsigned ssaNum, optPropKind valueKind, int walkDepth);
GenTree* optPropGetValue(unsigned lclNum, unsigned ssaNum, optPropKind valueKind);
GenTree* optEarlyPropRewriteTree(GenTree* tree, LocalNumberToNullCheckTreeMap* nullCheckMap);
bool optDoEarlyPropForBlock(BasicBlock* block);
bool optDoEarlyPropForFunc();
PhaseStatus optEarlyProp();
bool optFoldNullCheck(GenTree* tree, LocalNumberToNullCheckTreeMap* nullCheckMap);
Expand Down Expand Up @@ -9220,7 +9203,6 @@ class Compiler

// Assertion Gen functions.
void optAssertionGen(GenTree* tree);
AssertionIndex optAssertionGenCast(GenTreeCast* cast);
AssertionInfo optCreateJTrueBoundsAssertion(GenTree* tree);
AssertionInfo optAssertionGenJtrue(GenTree* tree);
AssertionIndex optCreateJtrueAssertions(GenTree* op1, GenTree* op2, bool equals);
Expand All @@ -9234,8 +9216,6 @@ class Compiler
// Assertion creation functions.
AssertionIndex optCreateAssertion(GenTree* op1, GenTree* op2, bool equals);

bool optTryExtractSubrangeAssertion(GenTree* source, IntegralRange* pRange);

void optCreateComplementaryAssertion(AssertionIndex assertionIndex);

AssertionIndex optAddAssertion(const AssertionDsc& assertion);
Expand Down Expand Up @@ -12084,11 +12064,6 @@ class Compiler

CORINFO_CONST_LOOKUP compGetHelperFtn(CorInfoHelpFunc ftnNum);

// Several JIT/EE interface functions return a CorInfoType, and also return a
// class handle as an out parameter if the type is a value class. Returns the
// size of the type these describe.
unsigned compGetTypeSize(CorInfoType cit, CORINFO_CLASS_HANDLE clsHnd);

#ifdef DEBUG
// Components used by the compiler may write unit test suites, and
// have them run within this method. They will be run only once per process, and only
Expand Down Expand Up @@ -12124,7 +12099,6 @@ class Compiler
unsigned m_totalHoistedExpressions = 0;

void AddLoopHoistStats();
void PrintPerMethodLoopHoistStats();

static CritSecObject s_loopHoistStatsLock; // This lock protects the data structures below.
static unsigned s_loopsConsidered;
Expand Down Expand Up @@ -12197,11 +12171,7 @@ class Compiler

const char* compLocalVarName(unsigned varNum, unsigned offs);
VarName compVarName(regNumber reg, bool isFloatReg = false);
const char* compFPregVarName(unsigned fpReg, bool displayVar = false);
void compDspSrcLinesByNativeIP(UNATIVE_OFFSET curIP);
void compDspSrcLinesByLineNum(unsigned line, bool seek = false);
#endif // DEBUG
const char* compRegNameForSize(regNumber reg, size_t size);
const char* compRegVarName(regNumber reg, bool displayVar = false, bool isFloatReg = false);

//-------------------------------------------------------------------------
Expand Down Expand Up @@ -12550,10 +12520,6 @@ class Compiler
// currently occur in the AST graph.
NodeToIntMap* FindReachableNodesInNodeTestData();

// Node "from" is being eliminated, and being replaced by node "to". If "from" had any associated
// test data, associate that data with "to".
void TransferTestDataToNode(GenTree* from, GenTree* to);

// These are the methods that test that the various conditions implied by the
// test attributes are satisfied.
void JitTestCheckSSA(); // SSA builder tests.
Expand Down
9 changes: 0 additions & 9 deletions src/coreclr/jit/emitriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2879,15 +2879,6 @@ static unsigned UpperNBitsOfWordSignExtend(ssize_t word)
return UpperNBitsOfWord<MaskSize>(word + kSignExtend);
}

template <uint8_t UpperMaskSize, uint8_t LowerMaskSize>
static ssize_t DoubleWordSignExtend(ssize_t doubleWord)
{
static constexpr size_t kLowerSignExtend = static_cast<size_t>(1) << (63 - LowerMaskSize);
static constexpr size_t kUpperSignExtend = static_cast<size_t>(1) << (63 - UpperMaskSize);

return doubleWord + (kLowerSignExtend | kUpperSignExtend);
}

/*static*/ unsigned emitter::TrimSignedToImm12(ssize_t imm12)
{
assert(isValidSimm12(imm12));
Expand Down
11 changes: 0 additions & 11 deletions src/coreclr/jit/lower.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,23 +252,12 @@ class Lowering final : public Phase
return m_compiler->gtNewPhysRegNode(reg, type);
}

GenTree* ThisReg(GenTreeCall* call)
{
return PhysReg(m_compiler->codeGen->genGetThisArgReg(call), TYP_REF);
}

GenTree* Offset(GenTree* base, unsigned offset)
{
var_types resultType = base->TypeIs(TYP_REF) ? TYP_BYREF : base->TypeGet();
return new (m_compiler, GT_LEA) GenTreeAddrMode(resultType, base, nullptr, 0, offset);
}

GenTree* OffsetByIndex(GenTree* base, GenTree* index)
{
var_types resultType = base->TypeIs(TYP_REF) ? TYP_BYREF : base->TypeGet();
return new (m_compiler, GT_LEA) GenTreeAddrMode(resultType, base, index, 0, 0);
}

GenTree* OffsetByIndexWithScale(GenTree* base, GenTree* index, unsigned scale)
{
var_types resultType = base->TypeIs(TYP_REF) ? TYP_BYREF : base->TypeGet();
Expand Down
31 changes: 0 additions & 31 deletions src/coreclr/jit/lsra.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,15 +587,6 @@ inline bool leafInRange(GenTree* leaf, int lower, int upper, int multiple)
return true;
}

inline bool leafAddInRange(GenTree* leaf, int lower, int upper, int multiple = 1)
{
if (!leaf->OperIs(GT_ADD))
{
return false;
}
return leafInRange(leaf->gtGetOp2(), lower, upper, multiple);
}

inline bool isCandidateVar(const LclVarDsc* varDsc)
{
return varDsc->lvLRACandidate;
Expand Down Expand Up @@ -956,15 +947,6 @@ class LinearScan : public RegAllocInterface
{
return false;
}
// In a retail build we support only the default traversal order
bool isTraversalLayoutOrder()
{
return false;
}
bool isTraversalPredFirstOrder()
{
return true;
}
bool getLsraExtendLifeTimes()
{
return false;
Expand Down Expand Up @@ -1896,11 +1878,6 @@ class LinearScan : public RegAllocInterface
{
regsBusyUntilKill.AddRegNum(reg, regType);
}
void clearRegBusyUntilKill(regNumber reg)
{
regsBusyUntilKill.RemoveRegNumFromMask(reg);
}

bool isRegInUse(regNumber reg, var_types regType)
{
return regsInUseThisLocation.IsRegNumPresent(reg, regType);
Expand Down Expand Up @@ -2365,14 +2342,6 @@ class Interval : public Referenceable
return varDsc->lvVarIndex;
}

bool isAssignedTo(regNumber regNum)
{
// This uses regMasks to handle the case where a double actually occupies two registers
// TODO-Throughput: This could/should be done more cheaply.
return (physReg != REG_NA &&
(genSingleTypeRegMask(physReg, registerType) & genSingleTypeRegMask(regNum)) != RBM_NONE);
}

// Assign the related interval.
void assignRelatedInterval(Interval* newRelatedInterval)
{
Expand Down
Loading
Loading