[all-commits] [llvm/llvm-project] 834b8b: [acc] Add acc.specialized_routine attribute (#170766)

Razvan Lupusoru via All-commits all-commits at lists.llvm.org
Thu Dec 4 15:47:26 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 834b8b7221b3be7d057a0dd1413158948bba41cc
      https://github.com/llvm/llvm-project/commit/834b8b7221b3be7d057a0dd1413158948bba41cc
  Author: Razvan Lupusoru <razvan.lupusoru at gmail.com>
  Date:   2025-12-04 (Thu, 04 Dec 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/OpenACC/OpenACC.h
    M mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
    M mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp
    M mlir/test/Dialect/OpenACC/ops.mlir

  Log Message:
  -----------
  [acc] Add acc.specialized_routine attribute (#170766)

Introduce a new attribute `acc.specialized_routine` to mark functions
that have been specialized from a host function marked with
`acc.routine_info`.

The new attribute captures:
- A SymbolRefAttr referencing the original `acc.routine` operation
- The parallelism level via the new `ParLevel` enum
- The original function name (since specialized functions may be
renamed)

Example - before specialization:
```
acc.routine @routine_gang func(@foo) gang
acc.routine @routine_vector func(@foo) vector

func.func @foo() attributes {
  acc.routine_info = #acc.routine_info<[@routine_gang, @routine_vector]>
} { ... }
```

After specialization, there are three functions:
the original function and two specialized versions (one per parallelism
level):
```
acc.routine @routine_gang func(@foo) gang
acc.routine @routine_vector func(@foo) vector

// Original function (unchanged)
func.func @foo() attributes {
  acc.routine_info = #acc.routine_info<[@routine_gang, @routine_vector]>
} { ... }

// Specialized for gang parallelism
func.func @foo_gang() attributes {
  acc.specialized_routine = #acc.specialized_routine<@routine_gang,
<gang_dim1>, "foo">
} { ... }

// Specialized for vector parallelism
func.func @foo_vector() attributes {
  acc.specialized_routine = #acc.specialized_routine<@routine_vector,
<vector>, "foo">
} { ... }
```



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