[RFC] Enabling the HLFIR lowering by default

Thank you very much @szakharin, @kiranchandramohan, @tblah and all the others who contributed to making flang ready for the switch!

Since all tasks in Issues · llvm/llvm-project · GitHub are closed it’s time to do it.

Here is the transition plan I propose:

Step 1: The Switch (now)

  • Patch 1: add a hidden -flang-deprecated-no-hlfir option to flang-new so that external users can revert to the current lowering if they face issues until any potential HLFIR regression is fixed. It will also be handy to transition remaining FIR tests that do not test HLFIR outputs.
  • Patch 2: update all these lowering tests to use bbc -hlfir=false and flang-deprecated-no-hlfir.
  • Patch 3: THE SWITCH. Set HLFIR lowering to be default in flang-new and bbc.

Step 2: The Wait and Clean (aiming for a duration of one LLVM release cycle).

  • Remove the -flang-experimental-hlfir (now redundant).
  • Have at least one LLVM release where HLFIR is enabled by default and -flang-deprecated-no-hlfir is accessible and in the meantime, remove all the no-hlfir version LIT tests that have already ported to HLFIR and transition the remaining no-hlfir LIT tests.
  • Debug any HLFIR regression reported by users

Step 3: The Removal (when step 2 is over)

  • Remove the -flang-deprecated-no-hlfir option in flang-new and -hlfir option in bbc.
  • Remove all usages of ConvertExpr.h interface inside Bridge.cpp and the rest of lowering.
  • Remove ConvertExpr.h/ ConvertExpr.cpp files and any helpers specific to it.
5 Likes