[SLP] Don't try to vectorize allocas
authorPhilip Reames <listmail@philipreames.com>
Wed, 2 Mar 2022 17:58:26 +0000 (09:58 -0800)
committerPhilip Reames <listmail@philipreames.com>
Wed, 2 Mar 2022 18:08:43 +0000 (10:08 -0800)
commit689babdf687f98b6790c66e628bd057af3bc87d8
tree4f379c79a06e79741f369ce50421f99d215dffeb
parent97e0366d6711babc3121d2a043c08a7a0c258479
[SLP] Don't try to vectorize allocas

While a collection of allocas are technically vectorizeable - by forming a wider alloca - this was not a transform SLP actually knows how to do.  Instead, we were forming a bundle with missing dependencies, and then relying on the scheduling code to preserve program order if multiple instructions were scheduleable at once.  I haven't been able to write a test case, but I'm 99% sure this was wrong in some edge case.

The unknown op case was flowing down the shufflevector path.  This did result in some splat handling being lost with this change, but the same lack of splat handling is visible in a whole bunch of simple examples for the gather path.  I didn't consider this interesting to fix given how narrow the splat of allocas case is.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/store_alloca.ll