[clang] [lld] [lld][LTO] Respect `-fno-slp-vectorize` for the LTO pipeline (PR #201585)

Teresa Johnson via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 4 08:29:24 PDT 2026


teresajohnson wrote:

> > I had that thought, but the current control is pretty much this, which means that adding a module flag would require some more invasive changes to how the pass functions because this level of config doesn't touch IR at all. I can try to add a function level attribute or similar for it and make the pass exit early if you think that's cleaner.
> 
> This is a _much_ larger change that should not be done in isolation for this one flag, and would need a fleshed out design and RFC. I do not think pass configuration belongs in the program

Yeah, an attribute is better than a module flag. We have some other examples that have gone this route...can dig them up if requested. The other reason is compatibility with non-LTO builds. I.e. a non-lto build like:

clang++ -c -fno-slp-vectorize *.cc
clang++ *.o

works the same wrt slp vectorization if you add -flto.

I'm not 100% opposed to adding the flag, but it gets messy if we have to add all of them to lld and the lld driver in clang.

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


More information about the cfe-commits mailing list