Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
educg-net-12619-928705
carolcc-2071
Commits
ec1b0d97
Commit
ec1b0d97
authored
2 years ago
by
yonchicy
Browse files
Options
Download
Patches
Plain Diff
准备添加global_value_number
parent
68eda048
master
dev
function_inline
linearScanRegAlloc
rm_phi
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/passes/global_value_numbering.cpp
+1
-0
src/passes/global_value_numbering.cpp
src/passes/global_value_numbering.h
+25
-0
src/passes/global_value_numbering.h
with
26 additions
and
0 deletions
+26
-0
src/passes/global_value_numbering.cpp
0 → 100644
+
1
−
0
View file @
ec1b0d97
#include
"global_value_numbering.h"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/passes/global_value_numbering.h
0 → 100644
+
25
−
0
View file @
ec1b0d97
#ifndef COMPILER_GLOBAL_VALUE_NUMBERING_H
#define COMPILER_GLOBAL_VALUE_NUMBERING_H
#include
"ir/constant.h"
#include
"ir/instruction.h"
#include
"pass.h"
class
Function
;
class
BinaryInst
;
class
ConstantFold
:
public
Transform
{
public:
ConstantFold
(
Module
*
m
,
const
std
::
string
&
name
)
:
Transform
(
m
,
name
){}
void
run
()
override
;
void
constantFold
(
Function
*
f
);
Constant
*
calConstantIntBinary
(
Instruction
*
pInstruction
);
Constant
*
calConstantFloatBinary
(
Instruction
*
instr
);
private
:
// Function* _cur_fun;
bool
detectBinaryConstantFold
(
BinaryInst
*
inst
);
bool
detectCastConstantFold
(
UnaryInst
*
pInst
);
bool
detectCmpConstantFold
(
CmpInst
*
pInst
);
};
#endif //COMPILER_GLOBAL_VALUE_NUMBERING_H
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets