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

wrangle the llvm bitcode CLI options #19778

Open
andrewrk opened this issue Apr 27, 2024 · 0 comments
Open

wrangle the llvm bitcode CLI options #19778

andrewrk opened this issue Apr 27, 2024 · 0 comments
Labels
backend-llvm The LLVM backend outputs an LLVM IR Module. enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Apr 27, 2024

With #16270 in mind, let's reevaluate the CLI options that relate to LLVM IR modules.

-femit-llvm-bc and -femit-llvm-ir: Currently this is post LLVM optimization. This should continue to be the case, however these options should print an error if you try to use them with a build of zig that does not have LLVM enabled. When #16270 is implemented, these options will disappear entirely. Before that, they should be renamed into -femit-llvm-opt-bc and -femit-llvm-opt-ir.

-ofmt=bc: This option should be introduced, making LLVM IR modules an additional object format that can be selected in a similar fashion to the C backend (-ofmt=c). This is how you specify to emit LLVM bitcode modules with a zig compiler that does not have LLVM enabled. When #16270 is implemented, -fllvm and -fno-llvm disappear entirely but -ofmt=bc remains. When this target is selected, Zig optimization pipeline is run but LLVM's is not.

--verbose-llvm-ir: Should be changed into -femit-llvm-ir for debugging convenience. Corresponding exactly to -ofmt=bc, this emits LLVM IR after Zig optimizations; before LLVM optimizations. After #16270 is implemented, this (changed) option remains because it is useful in combination with -ofmt=bc.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. backend-llvm The LLVM backend outputs an LLVM IR Module. labels Apr 27, 2024
@andrewrk andrewrk added this to the 0.13.0 milestone Apr 27, 2024
@andrewrk andrewrk modified the milestones: 0.14.0, 0.15.0 Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend-llvm The LLVM backend outputs an LLVM IR Module. enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Projects
None yet
Development

No branches or pull requests

1 participant