[all-commits] [llvm/llvm-project] e2d649: [flang][cuda] Defer on_device() folding in host co...

Zhen Wang via All-commits all-commits at lists.llvm.org
Wed Jul 8 09:18:25 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e2d6498e36235ecd9955d8d375a0c1a253c2e11a
      https://github.com/llvm/llvm-project/commit/e2d6498e36235ecd9955d8d375a0c1a253c2e11a
  Author: Zhen Wang <zhenw at nvidia.com>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M flang/include/flang/Optimizer/Transforms/Passes.td
    M flang/lib/Optimizer/Transforms/CUDA/CUFFunctionRewrite.cpp
    M flang/test/Fir/CUDA/cuda-function-rewrite.mlir

  Log Message:
  -----------
  [flang][cuda] Defer on_device() folding in host copies of OpenACC routines (#208125)

Add a `defer-acc-routines` option to `cuf-function-rewrite`. When set,
`on_device()` is not folded in the host copy of an OpenACC routine (has
`acc.routine_info`, not in a `gpu.module`), because that body is later
cloned into the device routine and would otherwise bake in the host
value (`.false.`). A later run folds each copy in its own context. Calls
already in a `gpu.module` are still folded.



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