On Tue, May 13, 2025 at 12:51 PM Andrew Stubbs <a...@baylibre.com> wrote: > > On 12/05/2025 15:27, Nikhil Patil via Gcc wrote: > > Hi Richard, > > > > Thank you so much for the reply! > > > > You're absolutely right about using CPU threads. I’m just really curious > > about whether GPU acceleration could somehow be explored for compilation, > > even if it’s not traditionally well-suited. I know it might not be > > practical, but I wanted to understand *why* it’s considered inefficient and > > learn through experimentation. > > To run fast on a GPU it's not enough to be able to parallelize the code, > you need to *vectorize* it. Not much of a compiler vectorizes well.
data-flow analysis would be one theoretical target, but data structures involved are currently not at all GPU friendly and I fear there's much divergence in control flow for effective GPU parallelization even for those theoretically "parallelizable" algorithms. And there's of course the setup/tear-down cost, which for common workload sizes would be prohibitive. Richard. > Andrew > >