[PATCH] D95832: [SampleFDO][NFC] Refacrot SampleProfileLoad to reuse the code in MachineIR

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 6 14:23:55 PST 2021


I think what Rong means is that
1) moving code to a header is for code sharing between IR and codeGenPass
2) Wei's idea of avoiding the header move can lead to circular dependencies.

In other words, doing 1) is not to achieve circular dependency avoidance,
but just using 2) as an alternative way is not working.

On Sat, Feb 6, 2021 at 2:13 PM David Blaikie via Phabricator <
reviews at reviews.llvm.org> wrote:

> dblaikie added a comment.
>
> (sorry if this comment is off-base, I haven't quite understood/followed
> the reviews, but some of the discussion here seems potentially problematic,
> so I'll say this... )
>
> If code is being moved into a header to avoid layering/circular dependency
> violations, that's not OK. Since the layering violation would still exist
> (from a software design perspective, though not one a linker would
> diagnose/trip over). Google's build system, for instance, does enforce
> header layering & we use/support that to avoid creating header-only
> dependencies.
>
> Another way of thinking about it: We shouldn't create a situation where
> it's non-trivial to move code between headers and implementation files.
> That should always be simple/trivial to do.
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D95832/new/
>
> https://reviews.llvm.org/D95832
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210206/afe23fb0/attachment.html>


More information about the llvm-commits mailing list