[SLP] Simplify extendSchedulingRegion
authorPhilip Reames <listmail@philipreames.com>
Wed, 23 Feb 2022 16:51:33 +0000 (08:51 -0800)
committerPhilip Reames <listmail@philipreames.com>
Wed, 23 Feb 2022 19:23:38 +0000 (11:23 -0800)
commit8c85f3a0523070ef656e30e368df0a679c1400cd
tree886f56fba3468867fbfdc3cc37a0904beb56906c
parent9bd9cbfa2f7b60ddb95cb321eaf2a4804aeef611
[SLP] Simplify extendSchedulingRegion

This change uses instruction's comesBefore method to simplify the code significantly. There's little compile time concern here because getSpillCost already calls comesBefore on every basic block which contains a vectorization candidate. The only additional times we'll build basic block ordering is when we can't schedule a vector candidate anywhere in the containing block.

Differential Revision: https://reviews.llvm.org/D120364
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp