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
4b5c6964
Commit
4b5c6964
authored
Oct 29, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #184 from undingen/simplify_ir
Some small changes to simplify the generated IR.
parents
4492dc98
30c691d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
22 deletions
+21
-22
src/codegen/opt/dead_allocs.cpp
src/codegen/opt/dead_allocs.cpp
+5
-3
src/core/types.h
src/core/types.h
+13
-1
src/gc/heap.h
src/gc/heap.h
+3
-3
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+0
-15
No files found.
src/codegen/opt/dead_allocs.cpp
View file @
4b5c6964
...
...
@@ -18,6 +18,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/PostDominators.h"
...
...
@@ -402,11 +403,12 @@ private:
std
::
unordered_map
<
BasicBlock
*
,
Value
*>
seen
;
Value
*
new_v
=
getLoadValFromPrevious
(
li
->
getPointerOperand
(),
li
->
getParent
(),
seen
,
chain
);
assert
(
new_v
);
if
(
!
new_v
)
{
new_v
=
llvm
::
UndefValue
::
get
(
li
->
getType
());
}
if
(
VERBOSITY
(
"opt"
)
>=
1
)
errs
()
<<
"Remapped to: "
<<
*
new_v
<<
'\n'
;
li
->
replaceAllUsesWith
(
new_v
);
li
->
eraseFromParent
();
llvm
::
replaceAndRecursivelySimplify
(
li
,
new_v
);
}
public:
...
...
src/core/types.h
View file @
4b5c6964
...
...
@@ -398,7 +398,19 @@ public:
llvm
::
iterator_range
<
BoxIterator
>
pyElements
();
Box
(
BoxedClass
*
cls
);
Box
(
BoxedClass
*
cls
)
:
cls
(
cls
)
{
// if (TRACK_ALLOCATIONS) {
// int id = Stats::getStatId("allocated_" + *getNameOfClass(c));
// Stats::log(id);
//}
// the only way cls should be NULL is if we're creating the type_cls
// object itself:
if
(
cls
==
NULL
)
{
ASSERT
(
type_cls
==
NULL
,
"should pass a non-null cls here"
);
}
else
{
}
}
HCAttrs
*
getAttrsPtr
();
...
...
src/gc/heap.h
View file @
4b5c6964
...
...
@@ -108,8 +108,8 @@ private:
Block
*
full_heads
[
NUM_BUCKETS
];
LargeObj
*
large_head
=
NULL
;
GCAllocation
*
allocSmall
(
size_t
rounded_size
,
int
bucket_idx
);
GCAllocation
*
allocLarge
(
size_t
bytes
);
GCAllocation
*
__attribute__
((
__malloc__
))
allocSmall
(
size_t
rounded_size
,
int
bucket_idx
);
GCAllocation
*
__attribute__
((
__malloc__
))
allocLarge
(
size_t
bytes
);
// DS_DEFINE_MUTEX(lock);
DS_DEFINE_SPINLOCK
(
lock
);
...
...
@@ -134,7 +134,7 @@ public:
GCAllocation
*
realloc
(
GCAllocation
*
alloc
,
size_t
bytes
);
GCAllocation
*
alloc
(
size_t
bytes
)
{
GCAllocation
*
__attribute__
((
__malloc__
))
alloc
(
size_t
bytes
)
{
GCAllocation
*
rtn
;
// assert(bytes >= 16);
if
(
bytes
<=
16
)
...
...
src/runtime/objmodel.cpp
View file @
4b5c6964
...
...
@@ -494,21 +494,6 @@ HiddenClass* HiddenClass::delAttrToMakeHC(const std::string& attr) {
return
cur
;
}
Box
::
Box
(
BoxedClass
*
cls
)
:
cls
(
cls
)
{
// if (TRACK_ALLOCATIONS) {
// int id = Stats::getStatId("allocated_" + *getNameOfClass(c));
// Stats::log(id);
//}
// the only way cls should be NULL is if we're creating the type_cls
// object itself:
if
(
cls
==
NULL
)
{
ASSERT
(
type_cls
==
NULL
,
"should pass a non-null cls here"
);
}
else
{
}
}
HCAttrs
*
Box
::
getAttrsPtr
()
{
assert
(
cls
->
instancesHaveAttrs
());
...
...
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