[llvm] [TailDuplicator] Only duplicate the blocks containing computed gotos (PR #114990)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 17:25:23 PST 2024


DianQK wrote:

> > I think the current IR is already as you want: https://llvm.godbolt.org/z/o5YT191P9.
> > There’s only a single merged indirectbr here.
> 
> Currently, taildup means we end up with O(N^2) edges, even in the indirectbr case. This patch is just deciding that we're willing to pay that cost in the indirectbr case, because it's a strong hint that that the code is important for performance. The question is, can we rework the backend representation to allow taildup without the explosion in the number of edges?

Sound makes sense to me. I can try to address it, although the process can be slow.

https://www.ajla-lang.cz/tutorial.html pointed out several issues:

> It is recommended to use gcc &mdash the compilation will take several minutes and it will consume about 4GB memory when compiling the files ipret.c and ipretc.c. Compilation with clang works, but it is very slow, it may take an hour or more to compile the files ipret.c and ipretc.c.

https://github.com/llvm/llvm-project/pull/114990


More information about the llvm-commits mailing list