This patch adds support for the -emit-llvm option in the frontend
driver (i.e. flang-new -fc1). Similarly to Clang, `flang-new -fc1
-emit-llvm file.f` will generate a textual LLVM IR file.
Depends on D118985
Paths
| Differential D119012
[flang][driver] Add support for the `-emit-llvm` option ClosedPublic Authored by awarzynski on Feb 4 2022, 9:25 AM.
Details Summary This patch adds support for the -emit-llvm option in the frontend Depends on D118985
Diff Detail
Event TimelineComment Actions This has been extracted from fir-dev. Original PR: https://github.com/flang-compiler/f18-llvm-project/pull/1113
Comment Actions LGTM, thanks! I just have a minor nit, feel free to ignore it.
This revision is now accepted and ready to land.Feb 8 2022, 12:22 AM Comment Actions The tests added are failing in the windows CI.
Comment Actions I believe that Windows failures are due to the missing support here: https://github.com/llvm/llvm-project/blob/81cde474e2c5a6280cb693b777ddcf473825ae8a/flang/lib/Optimizer/CodeGen/Target.cpp#L290. I can disable the LIT test on Windows, but I'm not sure how to do it for unit tests.
Comment Actions Disable the LIT test on Windows, simplify how output is dumped in EmitLLVMAction::ExecuteAction, remove auto Comment Actions Updated fir::CodeGenSpecifics::get to see whether the unit tests pass on Windows. If they do, I'll create a seperate patch with this change. Comment Actions Remove the change from fir::CodeGenSpecifics::get (this was uploaded as a awarzynski edited parent revisions, added: D119332: [flang] Add Win32 to the list of supported triples; removed: D118985: [flang][driver] Add support for `-emit-mlir`.Feb 9 2022, 6:25 AM Comment Actions A believe that all of Kiran's comments have been addressed and pre-merge CI is also passing now (that was one of the concerns). Kiran has not accepted this yet, but he will be away for a few weeks. I will merge this as is to unblock further work. I more than happy to address any post-commit comments, Kiran! Closed by commit rGe993b20c049d: [flang][driver] Add support for `-emit-llvm` (authored by awarzynski). · Explain WhyFeb 17 2022, 4:13 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 407130 clang/include/clang/Driver/Options.td
flang/include/flang/Frontend/FrontendActions.h
flang/include/flang/Frontend/FrontendOptions.h
flang/lib/Frontend/CompilerInvocation.cpp
flang/lib/Frontend/FrontendActions.cpp
flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
flang/lib/Optimizer/CodeGen/Target.cpp
flang/test/Driver/driver-help.f90
flang/test/Driver/emit-llvm.f90
flang/unittests/Frontend/FrontendActionTest.cpp
|
Shouldn't this be .ll?