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

JIT: run type equality optimizations earlier #14244

Merged
merged 5 commits into from
Oct 3, 2017
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
25 changes: 19 additions & 6 deletions src/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2230,8 +2230,8 @@ class Compiler

//-------------------------------------------------------------------------

GenTreePtr gtFoldExpr(GenTreePtr tree);
GenTreePtr
GenTree* gtFoldExpr(GenTree* tree);
GenTree*
#ifdef __clang__
// TODO-Amd64-Unix: Remove this when the clang optimizer is fixed and/or the method implementation is
// refactored in a simpler code. This is a workaround for a bug in the clang-3.5 optimizer. The issue is that in
Expand All @@ -2242,9 +2242,12 @@ class Compiler
// optimizations for now.
__attribute__((optnone))
#endif // __clang__
gtFoldExprConst(GenTreePtr tree);
GenTreePtr gtFoldExprSpecial(GenTreePtr tree);
GenTreePtr gtFoldExprCompare(GenTreePtr tree);
gtFoldExprConst(GenTree* tree);
GenTree* gtFoldExprSpecial(GenTree* tree);
GenTree* gtFoldExprCompare(GenTree* tree);
GenTree* gtFoldExprCall(GenTreeCall* call);
GenTree* gtFoldTypeCompare(GenTree* tree);
GenTree* gtFoldTypeEqualityCall(CorInfoIntrinsics methodID, GenTree* op1, GenTree* op2);

// Options to control behavior of gtTryRemoveBoxUpstreamEffects
enum BoxRemovalOptions
Expand Down Expand Up @@ -4997,7 +5000,17 @@ class Compiler
void fgLclFldAssign(unsigned lclNum);

static fgWalkPreFn gtHasLocalsWithAddrOpCB;
bool gtCanOptimizeTypeEquality(GenTreePtr tree);

enum TypeProducerKind
{
TPK_Unknown = 0, // May not be a RuntimeType
TPK_Handle = 1, // RuntimeType via handle
TPK_GetType = 2, // RuntimeType via Object.get_Type()
TPK_Null = 3, // Tree value is null
TPK_Other = 4 // RuntimeType via other means
};

TypeProducerKind gtGetTypeProducerKind(GenTree* tree);
bool gtIsTypeHandleToRuntimeTypeHelper(GenTreeCall* call);
bool gtIsActiveCSE_Candidate(GenTreePtr tree);

Expand Down
Loading