Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
0b650c38
Commit
0b650c38
authored
Feb 17, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #305 from undingen/dup_guards
Don't emit duplicate attr guards
parents
a3a12bb6
6509deb8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
src/asm_writing/rewriter.cpp
src/asm_writing/rewriter.cpp
+2
-0
src/asm_writing/rewriter.h
src/asm_writing/rewriter.h
+5
-0
No files found.
src/asm_writing/rewriter.cpp
View file @
0b650c38
...
@@ -174,6 +174,8 @@ void Rewriter::_addGuardNotEq(RewriterVar* var, uint64_t val) {
...
@@ -174,6 +174,8 @@ void Rewriter::_addGuardNotEq(RewriterVar* var, uint64_t val) {
}
}
void
RewriterVar
::
addAttrGuard
(
int
offset
,
uint64_t
val
,
bool
negate
)
{
void
RewriterVar
::
addAttrGuard
(
int
offset
,
uint64_t
val
,
bool
negate
)
{
if
(
!
attr_guards
.
insert
(
std
::
make_tuple
(
offset
,
val
,
negate
)).
second
)
return
;
// duplicate guard detected
rewriter
->
addAction
([
=
]()
{
rewriter
->
_addAttrGuard
(
this
,
offset
,
val
,
negate
);
},
{
this
},
ActionType
::
GUARD
);
rewriter
->
addAction
([
=
]()
{
rewriter
->
_addAttrGuard
(
this
,
offset
,
val
,
negate
);
},
{
this
},
ActionType
::
GUARD
);
}
}
...
...
src/asm_writing/rewriter.h
View file @
0b650c38
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
#include <map>
#include <map>
#include <memory>
#include <memory>
#include <tuple>
#include "llvm/ADT/SmallSet.h"
#include "asm_writing/assembler.h"
#include "asm_writing/assembler.h"
#include "asm_writing/icinfo.h"
#include "asm_writing/icinfo.h"
...
@@ -248,6 +251,8 @@ private:
...
@@ -248,6 +251,8 @@ private:
bool
is_arg
;
bool
is_arg
;
Location
arg_loc
;
Location
arg_loc
;
llvm
::
SmallSet
<
std
::
tuple
<
int
,
uint64_t
,
bool
>
,
4
>
attr_guards
;
// used to detect duplicate guards
// Gets a copy of this variable in a register, spilling/reloading if necessary.
// Gets a copy of this variable in a register, spilling/reloading if necessary.
// TODO have to be careful with the result since the interface doesn't guarantee
// TODO have to be careful with the result since the interface doesn't guarantee
// that the register will still contain your value when you go to use it
// that the register will still contain your value when you go to use it
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment