[all-commits] [llvm/llvm-project] 70343c: [mlir][flang] Added Weighted[Region]BranchOpInterf...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Tue Jun 17 16:14:34 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 70343c8d44273c187e3f7fa5e2037fbc41307077
      https://github.com/llvm/llvm-project/commit/70343c8d44273c187e3f7fa5e2037fbc41307077
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/lib/Optimizer/Transforms/ControlFlowConverter.cpp
    A flang/test/Fir/cfg-conversion-if.fir
    M flang/test/Fir/fir-ops.fir
    M flang/test/Fir/invalid.fir
    M mlir/include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMInterfaces.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
    M mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
    M mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
    M mlir/lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Interfaces/ControlFlowInterfaces.cpp
    M mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/test/Conversion/ControlFlowToLLVM/branch.mlir
    M mlir/test/Dialect/ControlFlow/invalid.mlir
    M mlir/test/Dialect/ControlFlow/ops.mlir
    M mlir/test/Target/LLVMIR/Import/metadata-profiling.ll
    M mlir/test/Target/LLVMIR/llvmir-invalid.mlir
    M mlir/test/Target/LLVMIR/llvmir.mlir

  Log Message:
  -----------
  [mlir][flang] Added Weighted[Region]BranchOpInterface's. (#142079)

The new interfaces provide getters and setters for the weight
information about the branches of BranchOpInterface and
RegionBranchOpInterface operations.

These interfaces are done the same way as LLVM dialect's
BranchWeightOpInterface.

The plan is to produce this information in Flang, e.g. mark
most probably "cold" code as such and allow LLVM to order
basic blocks accordingly. An example of such a code is
copy loops generated for arrays repacking - we can mark it
as "cold" assuming that the copy will not happen dynamically.
If the copy actually happens the overhead of the copy is probably high
enough so that we may not care about the little overhead
of jumping to the "cold" code and fetching it.



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