Skip to content

[AsmPrinter] Simplify $local after D131429. NFC #128138

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

Conversation

MaskRay
Copy link
Member

@MaskRay MaskRay commented Feb 21, 2025

setType is unneeded (and AsmPrinter tries not to modify symbols).
AsmPrinter. MCSA_ELF_TypeFunction is available on all
targets using getSymbolPreferLocal.

Created using spr 1.3.5-bogner
@MaskRay MaskRay requested a review from arichardson February 21, 2025 06:06
Copy link
Member

@arichardson arichardson left a comment

Choose a reason for hiding this comment

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

Ah nice was not aware that this was allowed without checking (I believe there was/is another place I copied this from).

LGTM. And if this wasn't NFC it would have noticed by the tests.

I can see a few other placs that check for MAI->hasDotTypeDotSizeDirective() before calling emitSymbolAttribute(). Should those be simplified as well as part of this PR or as a separate one?

@arichardson
Copy link
Member

Similarly, I wonder if we could change all the guarded OutStreamer->emitELFSize to just OutStreamer->emitSymbolSize() and make that a non-op on unsupported platforms. The emitELFSize() appears to be misnamed since e.g. WASM also sets the size.

@MaskRay
Copy link
Member Author

MaskRay commented Feb 23, 2025

Similarly, I wonder if we could change all the guarded OutStreamer->emitELFSize to just OutStreamer->emitSymbolSize() and make that a non-op on unsupported platforms. The emitELFSize() appears to be misnamed since e.g. WASM also sets the size.

Thanks for the suggestion. Let me explore this as a potential simplification...

edit: I think we still need MAI->hasDotTypeDotSizeDirective(). Some call sites create non-trivial MCExpr or call emitLabel, which should not run for other targets.

@MaskRay MaskRay merged commit 34387fc into main Feb 23, 2025
12 checks passed
@MaskRay MaskRay deleted the users/MaskRay/spr/asmprinter-simplify-local-after-d131429-nfc branch February 23, 2025 18:19
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Feb 23, 2025
setType is unneeded (and AsmPrinter tries not to modify symbols).
AsmPrinter. MCSA_ELF_TypeFunction is available on all
targets using getSymbolPreferLocal.

Pull Request: llvm/llvm-project#128138
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