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

enhance bugpoint to reduce global initializers #1332

Closed
lattner opened this issue Oct 21, 2006 · 8 comments
Closed

enhance bugpoint to reduce global initializers #1332

lattner opened this issue Oct 21, 2006 · 8 comments
Labels
bugzilla Issues migrated from bugzilla enhancement Improving things as opposed to bug fixing, e.g. new or missing feature tools:bugpoint

Comments

@lattner
Copy link
Collaborator

lattner commented Oct 21, 2006

Bugzilla Link 960
Resolution FIXED
Resolved on Feb 22, 2010 12:43
Version trunk
OS All
CC @isanbard

Extended Description

It would be wonderful if someone would enhance bugpoint to prune down the list of global var initializers
when some are required to provoke a compiler crash. Domagoj Babic produced a patch that does exactly
this:
http://lists.cs.uiuc.edu/pipermail/llvmbugs/2006-October/002004.html

... but his patch does not use the list reducer. It would be great if someone could pick this up and finish
it.

-Chris

@isanbard
Copy link
Contributor

I have a potential patch for this (it compiles! Ship it!). Is there a test case that I can use to verify this
against Domagoj's patch?

-bw

@lattner
Copy link
Collaborator Author

lattner commented Oct 22, 2006

I'd suggest going into lib/CodeGen/AsmPrinter.cpp. In the
AsmPrinter::EmitGlobalConstant method, add:

assert(CV->isNullValue());

you just inserted a 'bug'. Recompile llc, then use:

bugpoint -run-llc myprogram.bc

Which should reduce it down to just one global that has a non-zero initializer.

-Chris

@isanbard
Copy link
Contributor

Putting that line in didn't work. Bugpoint didn't even execute that method. :-(

-bw

@lattner
Copy link
Collaborator Author

lattner commented Oct 23, 2006

Right, bugpoint doesn't run the code generator.  however, it should fork off llc, which should.

Make sure you have a complex-enough .bc file, and use bugpoint -run-llc.

@isanbard
Copy link
Contributor

I did run it with -run-llc, but nothing. I thought that the file was complex enough. Anyway, Domagoj
checked and it did produce the same result as his patch. I submitted the patch. It can stand some
improvement (like not cloning the Module each time).

-bw

@isanbard
Copy link
Contributor

@lattner
Copy link
Collaborator Author

lattner commented Oct 31, 2006

Isn't this done, if so, shouldn't it be closed?

-Chris

@isanbard
Copy link
Contributor

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Endilll Endilll added enhancement Improving things as opposed to bug fixing, e.g. new or missing feature and removed new-feature labels Aug 15, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla enhancement Improving things as opposed to bug fixing, e.g. new or missing feature tools:bugpoint
Projects
None yet
Development

No branches or pull requests

3 participants