Skip to content

[CodeGen][GC] Remove GCInfoPrinter #75033

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

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

paperchalice
Copy link
Contributor

@paperchalice paperchalice commented Dec 11, 2023

This pass is broken and looks like no one uses it.

bool Printer::runOnFunction(Function &F) {
  if (F.hasGC())
    return false;

  GCFunctionInfo *FD = &getAnalysis<GCModuleInfo>().getFunctionInfo(F);
GCFunctionInfo &GCModuleInfo::getFunctionInfo(const Function &F) {
  assert(!F.isDeclaration() && "Can only get GCFunctionInfo for a definition!");
  assert(F.hasGC()); // Equivalent to `assert(false);` when called by `Printer::runOnFunction`

See also #74972.

This pass is broken and looks like no one uses this pass.
@MaskRay
Copy link
Member

MaskRay commented Dec 12, 2023

Can you expand the statement "This pass is broken and looks like no one uses it." ? I suspect that it is broken due to the following inverted condition

bool Printer::runOnFunction(Function &F) {
  if (F.hasGC()) ///////
    return false;

@paperchalice
Copy link
Contributor Author

Can you expand the statement "This pass is broken and looks like no one uses it." ? I suspect that it is broken due to the following inverted condition

bool Printer::runOnFunction(Function &F) {
  if (F.hasGC()) ///////
    return false;

This code triggers the assertion:

GCFunctionInfo &GCModuleInfo::getFunctionInfo(const Function &F) {
assert(!F.isDeclaration() && "Can only get GCFunctionInfo for a definition!");
assert(F.hasGC());

No one has noticed it for the last 15 years.

@MaskRay
Copy link
Member

MaskRay commented Dec 12, 2023

This pass is broken and looks like no one uses it.

Thanks. Consider making the commit message/first comment more information how the pass is broken.

@paperchalice paperchalice merged commit 4d8bf6e into llvm:main Dec 12, 2023
@paperchalice paperchalice deleted the remove-gc-info-printer branch January 20, 2024 10:50
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.

2 participants