[PATCH] D81905: Enhance Itanium demangler interface.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 16:20:14 PDT 2020


hfinkel added a comment.

In D81905#2112803 <https://reviews.llvm.org/D81905#2112803>, @dexonsmith wrote:

> In D81905#2105843 <https://reviews.llvm.org/D81905#2105843>, @kbobrovs wrote:
>
> > Yes, I infer semantics properties. I use demangler to implement lowering of "C++ intrinsics" - Itanium-mangled C++ name (e.g. templated function instantiation) - for my SPIRV-based target. Lowering depends on the name, template parameter values and argument types (if overloaded). https://github.com/intel/llvm/pull/1881
> >
> > > If its to infer some semantic property of the symbol then there probably are better ways of expressing that, like getting the frontend to add metadata or a function attribute or something.
> >
> > It is not obvious to me that metadata + attributes is better than demangling (as long as it implemented correctly) - with demangling implementation is more self-encapsulated and simpler. But that's pretty much orthogonal to this code change.
>
>
> Hmm, I would tend to agree with Erik here, that directly declaring the semantics via an attribute (or metadata) is better than encoding it in the name. I think it will be easier to reason about if you declare the semantics in the IR.
>
> @hfinkel do you have thoughts?


I agree. We want to encode semantics using the facilities that are intended to convey semantics (e.g., attributes). I don't think that we want to go down the road of imbuing the function name itself with IR-level semantics. That would mean that passes that change function names (outliners, specializers, etc.) need to be aware of special rules not to disturb those encoded semantics. I realize that, in some sense, this may be a theoretical concern (because these semantics are likely encoded in the middle of the string or at the beginning, and the names are normally changed by appending to the end of the string). Regardless, I'd prefer we leave the names free of special meaning in the IR.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81905/new/

https://reviews.llvm.org/D81905





More information about the llvm-commits mailing list