[llvm] [hexagon] Add hexagon_hvx function attribute. (PR #223771)
Weiwei C via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 17 13:06:08 PDT 2026
================
@@ -457,19 +457,14 @@ bool HexagonTTIImpl::shouldBuildLookupTables() const {
bool HexagonTTIImpl::areInlineCompatible(const Function *Caller,
const Function *Callee) const {
- // The hardware provides a fixed number of HVX contexts. Software that mixes
- // the two engines dedicates some threads to HVX, and those threads hold the
- // contexts for as long as they run. A thread dedicated to HMX needs no
- // context at all, until HVX code reaches it. Then it has to wait for one
- // that the HVX threads are still holding, and if the two groups later meet
- // at a barrier, neither side can make progress.
- //
- // Inlining is one way HVX code reaches a thread that was never meant to run
- // it, in either direction: an HVX body merged into an HMX function, or an
- // HMX body merged into a function whose other callers are HVX threads. So
- // the attribute has to match on both sides.
+ // HVX contexts are a fixed hardware resource, held by threads dedicated to
+ // HVX. HVX reaching a thread without one stalls, and deadlocks if the two
+ // then meet at a barrier.
if (Caller->hasFnAttribute("hexagon_hmx") !=
Callee->hasFnAttribute("hexagon_hmx"))
return false;
+ if (Callee->hasFnAttribute("hexagon_hvx") &&
----------------
weiweichen wrote:
@npmiller, is this what you'd like for the hvx function inlining direction you'd like to move forward?
https://github.com/llvm/llvm-project/pull/223771
More information about the llvm-commits
mailing list