Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unneeded GC Roots (fixed #20981) #21158

Closed
wants to merge 2 commits into from
Closed

Delete unneeded GC Roots (fixed #20981) #21158

wants to merge 2 commits into from

Conversation

Keno
Copy link
Member

@Keno Keno commented Mar 24, 2017

See lengthy comment in llvm-gcroot.cpp for a description of the algorithm.

See lengthy comment in llvm-gcroot.cpp for a description of the algorithm.
@StefanKarpinski
Copy link
Sponsor Member

Cool :)

@Keno
Copy link
Member Author

Keno commented Mar 24, 2017

I just realized this has a bug for certain loop patterns. Will fix later.

@ararslan ararslan added the GC Garbage collector label Mar 24, 2017
@@ -7339,6 +7344,15 @@ extern "C" void jl_dump_llvm_value(void *v)
((Value*)v)->dump();
#endif
}

extern "C" void jl_dump_llvm_to_file(char *fname, llvm::Function *F) {
auto M = CloneModule(F->getParent());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 4 space indents

@Keno
Copy link
Member Author

Keno commented Mar 25, 2017

Fixed the loop case.

@vchuravy
Copy link
Member

Trailing whitespace in:

make check-whitespace
src/llvm-gcroot.cpp:182:    
src/llvm-gcroot.cpp:185:      
src/llvm-gcroot.cpp:188:     
src/llvm-gcroot.cpp:191:     
src/llvm-gcroot.cpp:194:     
src/llvm-gcroot.cpp:197:      
src/llvm-gcroot.cpp:200:      
src/llvm-gcroot.cpp:693:  
Error: trailing whitespace found in source file(s)

@@ -124,7 +104,7 @@ ifeq ($(USE_LLVM_SHLIB),1)
# NOTE: we could also --disable-static here (on the condition we link tools
# against libLLVM) but there doesn't seem to be a CMake counterpart option
LLVM_FLAGS += --enable-shared
LLVM_CMAKE += -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON
LLVM_CMAKE += -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON -DLLVM_LINK_LLVM_DYLIB:BOOL=ON
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what version of llvm first had this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely certain but it's no earlier than 3.7.0.

* - "hard kill": We can prove a GC root will no longer be used
* - "soft kill": An opaque safe point was encountered, we don't know
* anything,
* about whether this root is needed anymore.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd line splitting / wrapping / indentation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comma also not needed after "anything"

config.test_source_root = os.path.dirname(__file__)
config.test_format = lit.formats.ShTest(False)

path = os.path.pathsep.join((os.path.join(os.path.dirname(__file__),"../../usr/tools"), config.environment['PATH']))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should separate out the string into arguments to os.path.join

@ViralBShah
Copy link
Member

Perhaps it would be good to have some of this discussion in the dev docs.

@Keno
Copy link
Member Author

Keno commented Apr 22, 2017

This works basically fine, but I think a better solution would be a proper iterative data flow approach to so both optimizations and placement in one go. I'll split some of the LLVM test infrastructure I wrote here into a separate PR and then put up a new PR for a better algorithm.

@Keno Keno closed this Apr 22, 2017
@ararslan ararslan deleted the kf/gcrootdeleter branch April 22, 2017 19:22
@Keno Keno restored the kf/gcrootdeleter branch April 22, 2017 19:27
@Keno
Copy link
Member Author

Keno commented Apr 22, 2017

Leave the branch until the replacement is done ;)

@ararslan
Copy link
Member

Right, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants