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

Global (intra-procedural) removal of redundant calls to setVisibility. #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ArunChauhan
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Jun 10, 2016

Current coverage is 70.11%

Merging #99 into master will not change coverage

@@             master        #99   diff @@
==========================================
  Files           491        491          
  Lines         95771      95771          
  Methods        5854       5854          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          67151      67151          
  Misses        28620      28620          
  Partials          0          0          

Powered by Codecov. Last updated by 63e10cb...0d7890f

bool RemoveRedundantCallsToSetVisibility::runOnBasicBlock(
llvm::BasicBlock& block) {
int RemoveRedundantCallsToSetVisibility::RemoveRedundantCalls(
llvm::BasicBlock& block, bool leave_one) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the (probably) common case where leave_one is false, this could be:

'''
for (llvm::Instruction& instr : block) {
if (isCallToSetVisility(instr)) {
instr.eraseFromParent();
}
}'''

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, eraseFromParent() doesn't seem to work with reverse iterators. But, it might work with forward iterators. Let me see if I can simplify the code using that.

@ArunChauhan
Copy link
Contributor Author

The unit tests for the JIT will take a bit longer, because I will need probably need to get some code to get hold of the IR. All the existing unit tests pass. I also want to get rid of all the duplicate error blocks that are currently getting generated.

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

Successfully merging this pull request may close these issues.

3 participants