[PATCH] D99967: [Flang] Changes to mangling code
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 14 01:12:48 PDT 2021
dblaikie added a comment.
In D99967#2688105 <https://reviews.llvm.org/D99967#2688105>, @kiranchandramohan wrote:
>>>> Though the description mentions that the functions are all tested - yet it looks like this patch adds a new function/overload without any callers, so how is it tested?
>>>
>>> Apologies for the misunderstanding here. What i meant is that the function that is ultimately called (fir::NameUniquer::doType) is already tested and this is a wrapper around that function. I will check today if I can add a unit
>>> test for this function (assuming that is the recommendation here).
>>
>> Hmm - well, then there's the question of: What's the purpose of the new function? We don't usually add new code without usage (& then test the new code via that usage). But there are some times when it's suitable to implement new code with nothing but a unit test for coverage - usually only if that code is intended for API usage by clients outside the LLVM project.
>>
>> What's the purpose/intended usage of this new code?
>
> Names have to be unique at the FIR (MLIR IR for Flang) layer. So the usage of name mangling is when we lower from the parse-tree of Flang to FIR. The bridge code which does this lowering has not yet landed in llvm-project/flang. The approach for upstreaming this portion is to bring in all the support functions and classes and then introduce the bridge code and show the lowering and testing for each Fortran construct.
That presents a challenge for testing - usually we'd implement partial support for a feature more end-to-end (ie: make it "work" but without all the functionality) then as functionality is added incrementally, so is corresponding testing.
But adding lots of implementation code that's basically "dead" until the final patches wire it up makes it hard to tell which parts are tested - it'll need to be significantly unit tested & be a bit out of sync with the way the rest of LLVM is authored and tested.
> (Note that at the FIR layer and lowering to LLVM IR the agreed approach is to upstream pass by pass).
I'm not especially familiar with MLIR or Flang to properly parse this statement - could you rephrase/add more detail?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99967/new/
https://reviews.llvm.org/D99967
More information about the llvm-commits
mailing list