Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Adding codegen code owners as reviewers just so they're aware (I think you're fine to land these changes if you don't hear back in the next day or two).
clang/lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
1102 | I wouldn't return here, doesn't seem right that we'll skip running the opt pipeline but continue with compilation. we should either bail out entirely of producing any output files (which would probably require code changes elsewhere), or run everything as normal, not do something weird where we don't run the optimization pipeline but still output files | |
clang/test/CodeGen/print-pipeline-passes.c | ||
9 | I wouldn't test BitcodeWriterPass, we may have a proper textual name for it at some point |
clang/lib/CodeGen/BackendUtil.cpp | ||
---|---|---|
1102 | This is basically doing the same thing that opt -print-pipeline-passes is doing: https://github.com/llvm/llvm-project/blob/d1b418f55263ec48d14f220ad020d55f126cfcab/llvm/tools/opt/NewPMDriver.cpp#L500-L524. In the case of emitting LLVM IR or bitcode, this logic is sufficient to not emit any output. In the case of .s or .o files, it looks like I have to also bail out of running RunCodegenPipeline |
I don't really like extern cl::opt<bool> PrintPipelinePasses; (as opposed to implementing a proper driver option that calls a proper API); secret handshakes like this make it harder for people to write non-clang frontends. But I won't block the patch just for that, I guess.
clang/test/CodeGen/print-pipeline-passes.c | ||
---|---|---|
9 | Apparently verify is added by clang unless -disable-llvm-verifier is present on the command line, but I've switched it to annotation-remarks nevertheless. |
clang/test/CodeGen/print-pipeline-passes.c | ||
---|---|---|
9 | -disable-llvm-verifier is added by clang in non-assert builds |
I wouldn't return here, doesn't seem right that we'll skip running the opt pipeline but continue with compilation. we should either bail out entirely of producing any output files (which would probably require code changes elsewhere), or run everything as normal, not do something weird where we don't run the optimization pipeline but still output files