forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrationalize.h
62 lines (46 loc) · 1.6 KB
/
rationalize.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//===============================================================================
#ifndef JIT_RATIONALIZE_H
#define JIT_RATIONALIZE_H
#include "phase.h"
class Rationalizer final : public Phase
{
private:
BasicBlock* m_block;
Statement* m_statement;
public:
Rationalizer(Compiler* comp);
#ifdef DEBUG
static void ValidateStatement(Statement* stmt, BasicBlock* block);
// general purpose sanity checking of de facto standard GenTree
void SanityCheck();
// sanity checking of rationalized IR
void SanityCheckRational();
#endif // DEBUG
virtual PhaseStatus DoPhase() override;
private:
inline LIR::Range& BlockRange() const
{
return LIR::AsRange(m_block);
}
// Intrinsic related transformations
void RewriteNodeAsCall(GenTree** use,
ArrayStack<GenTree*>& parents,
CORINFO_METHOD_HANDLE callHnd,
#ifdef FEATURE_READYTORUN
CORINFO_CONST_LOOKUP entryPoint,
#endif
GenTree* arg1 = nullptr,
GenTree* arg2 = nullptr);
void RewriteIntrinsicAsUserCall(GenTree** use, Compiler::GenTreeStack& parents);
#ifdef TARGET_ARM64
void RewriteSubLshDiv(GenTree** use);
#endif
// Root visitor
Compiler::fgWalkResult RewriteNode(GenTree** useEdge, Compiler::GenTreeStack& parents);
};
inline Rationalizer::Rationalizer(Compiler* _comp) : Phase(_comp, PHASE_RATIONALIZE)
{
}
#endif