[all-commits] [llvm/llvm-project] 3113e3: [flang] Fold fir.if with a constant condition (#22...

Delaram Talaashrafi via All-commits all-commits at lists.llvm.org
Wed Sep 23 18:25:14 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3113e3b63d7e4f480dc30e6438f49a10faa020b0
      https://github.com/llvm/llvm-project/commit/3113e3b63d7e4f480dc30e6438f49a10faa020b0
  Author: Delaram Talaashrafi <dtalaashrafi at nvidia.com>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/test/Fir/CUDA/predefined-variables.mlir
    A flang/test/Fir/if-constant-condition-fold.fir
    M flang/test/Lower/Intrinsics/ieee_flag.f90
    M flang/test/Lower/Intrinsics/ieee_logb.f90
    M flang/test/Lower/Intrinsics/ieee_max_min.f90
    A flang/test/Lower/if-constant-condition.f90

  Log Message:
  -----------
  [flang] Fold fir.if with a constant condition (#225542)

Use `populateRegionBranchOpInterfaceInliningPattern` to fold `fir.if`
when the condition is a constant. It inlines the region the condition
selects, replacing uses of the `fir.if` results with the operands of
that region's `fir.result`, and erases the `fir.result`. A false
condition with no else region leaves nothing behind.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list