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-17291-1894922
Compiler2023-KleeDontKnow-3046
Commits
68545eb4
Commit
68545eb4
authored
1 year ago
by
可莉不知道呦
Browse files
Options
Download
Patches
Plain Diff
check it?
parent
a90f19c6
main
CFG
CSE
GCM
GVN
GVN1
InliningPass
LoopPass
OffsetInS11
SCCP
StrenReduction
div
float3
loo
loop
memset
mian
peephole
phi-destruct
submit2
submit4
submit5
submit6
submit7
submit8
submit9
test10
test11
test12
test13
test14
test15
test6
test7
test7-1
test8
test9
test_many_params
to_test
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/Utils.h
+1
-1
include/Utils.h
src/BasicBlock.cpp
+9
-9
src/BasicBlock.cpp
with
10 additions
and
10 deletions
+10
-10
include/Utils.h
+
1
−
1
View file @
68545eb4
...
...
@@ -22,7 +22,7 @@ public:
}
static
std
::
string
getNewTamp
(){
return
"%
t_
"
+
std
::
to_string
(
tempCounter
++
);
return
"%"
+
std
::
to_string
(
tempCounter
++
);
}
static
std
::
string
getNewLabel
(
const
std
::
string
&
label
){
...
...
This diff is collapsed.
Click to expand it.
src/BasicBlock.cpp
+
9
−
9
View file @
68545eb4
...
...
@@ -118,7 +118,7 @@ void BasicBlock::codegen(AsmBuilder *builder,
if
(
Type_Enum
(
arguments
[
i
]
->
type
)
==
INT32TYPE
){
auto
addArgument
=
new
BinaryMInstruction
(
cur_block
,
BinaryMInstruction
::
ADDI
,
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)),
//x2(sp)
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)),
//x2(sp)
new
MachineOperand
(
MachineOperand
::
REG
,
IREGISTER
::
A0
+
i
),
//x2(sp)
new
MachineOperand
(
MachineOperand
::
IMM
,
0
));
cur_block
->
insertInst
(
addArgument
);
...
...
@@ -126,7 +126,7 @@ void BasicBlock::codegen(AsmBuilder *builder,
else
if
(
Type_Enum
(
arguments
[
i
]
->
type
)
==
POINTERTYPE
){
auto
addArgument
=
new
BinaryMInstruction
(
cur_block
,
BinaryMInstruction
::
ADDI
,
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
REG
,
IREGISTER
::
A0
+
i
),
new
MachineOperand
(
MachineOperand
::
IMM
,
0
));
cur_block
->
insertInst
(
addArgument
);
...
...
@@ -139,25 +139,25 @@ void BasicBlock::codegen(AsmBuilder *builder,
if
(
offset
<=
2032
&&
false
)
{
auto
lw1
=
new
LoadMInstruction
(
cur_block
,
LoadMInstruction
::
LW
,
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
IMM
,
offset
),
new
MachineOperand
(
MachineOperand
::
REG
,
IREGISTER
::
FP
));
cur_block
->
insertInst
(
lw1
);
}
else
{
auto
li
=
new
LoadImmInstruction
(
cur_block
,
LoadImmInstruction
::
LI
,
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
IMM
,
offset
));
cur_block
->
insertInst
(
li
);
auto
add
=
new
BinaryMInstruction
(
cur_block
,
BinaryMInstruction
::
ADD
,
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
REG
,
IREGISTER
::
FP
));
cur_block
->
insertInst
(
add
);
auto
lw1
=
new
LoadMInstruction
(
cur_block
,
LoadMInstruction
::
LW
,
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
IMM
,
0
),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)));
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)));
cur_block
->
insertInst
(
lw1
);
}
offset
+=
8
;
...
...
@@ -166,7 +166,7 @@ void BasicBlock::codegen(AsmBuilder *builder,
if
(
offset
<=
2032
)
{
auto
ld1
=
new
LoadMInstruction
(
cur_block
,
LoadMInstruction
::
LD
,
new
MachineOperand
(
MachineOperand
::
VREG
,
"%
t_
"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
VREG
,
"%"
+
to_string
(
i
)),
new
MachineOperand
(
MachineOperand
::
IMM
,
offset
),
new
MachineOperand
(
MachineOperand
::
REG
,
IREGISTER
::
FP
));
cur_block
->
insertInst
(
ld1
);
...
...
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