Files
llvm-project/flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
Hocky Yudhiono ed37bdcc3e [mlir][func] Fix crashes in FuncToLLVM discardable attributes propagation logic (#188232)
Refactor how `func.func` discardable attributes are handled in the
Func-to-LLVM conversion. Instead of ad hoc checks for linkage and
readnone followed by a simple filter, the pass now generically processes
inherent attributes from LLVMFuncOp.

Attributes that correspond to inherent `llvm.func` ODS names can be
attached as `llvm.<name>` on `func.func` and are stripped to `<name>`
when building `LLVM::LLVMFuncOp`, so LLVM-specific knobs stay namespaced
on the source op but land on the right inherent slots on `llvm.func`.

Other discardable attributes continue to be propagated as-is.

Fixes #175959
Fixes #181464

Assisted-by: CLion code completion, GPT 5.3-Codex

---------

Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
2026-03-26 11:12:10 +00:00

61 KiB