[cfe-dev] split hot and cold part of a function into separate function

Reid Kleckner via cfe-dev cfe-dev at lists.llvm.org
Fri May 7 13:08:29 PDT 2021


I believe intra-function hot cold code splitting is in the scope of the
Propeller project, which Sriram Tallam worked on. I'm not sure what the
status of the feature is at this moment.

I believe that the hot cold split pass is an IR pass, which means that it
outlines code at the IR level. This will prevent the register allocator
from working across the boundary between hot and cold code, so I don't
believe it has as much performance potential as splitting the function
during code generation. Looking at the example, I believe GCC is using this
strategy, it is not calling outlined code.

On Thu, May 6, 2021 at 2:17 AM chuanqi.xcq via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi,
>
> IIRC, clang/llvm has HotColdSplit and partial inline passes which has
> similar functionality. However, these two passes are not enabled by default
> for some reasons.
>
> Thanks,
> Chuanqi
>
> ------------------------------------------------------------------
> From:陈云星 via cfe-dev <cfe-dev at lists.llvm.org>
> Send Time:2021年5月6日(星期四) 17:11
> To:cfe-dev <cfe-dev at lists.llvm.org>
> Subject:[cfe-dev] split hot and cold part of a function into separate
> function
>
> currently, gcc support function attribute “cold”, which can hint compiler
> split caller function’s cold into two separate function, one is hot the
> other is cold.
>
> One example is here: https://godbolt.org/z/j7sK4hd48
>
> my question is Clang/llvm has such function/capability ?
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20210507/7a392ada/attachment.html>


More information about the cfe-dev mailing list