[flang-commits] [flang] [flang] Decouple HLFIR array expansion from optimization level (PR #233478)

via flang-commits flang-commits at lists.llvm.org
Mon Oct 19 13:47:54 PDT 2026


================
@@ -114,11 +114,13 @@ class FlangEPCallBacks {
 struct MLIRToLLVMPassPipelineConfig : public FlangEPCallBacks {
   explicit MLIRToLLVMPassPipelineConfig(llvm::OptimizationLevel level) {
     OptLevel = level;
+    useArrayRuntime = level == llvm::OptimizationLevel::O0;
   }
   explicit MLIRToLLVMPassPipelineConfig(llvm::OptimizationLevel level,
       const Fortran::frontend::CodeGenOptions &opts,
       const Fortran::common::MathOptionsBase &mathOpts) {
     OptLevel = level;
+    useArrayRuntime = level == llvm::OptimizationLevel::O0;
----------------
jeanPerier wrote:

The old device checks only applied at O0; higher levels already enabled the
HLFIR optimizations. That remains unchanged. Scalar broadcasts are now attempted
at every level on both host and device.

https://github.com/llvm/llvm-project/pull/233478


More information about the flang-commits mailing list