[LoopRotation] Allow loop header duplication if vectorization is forced.
authorFlorian Hahn <flo@fhahn.com>
Tue, 27 Oct 2020 08:59:18 +0000 (08:59 +0000)
committerFlorian Hahn <flo@fhahn.com>
Tue, 27 Oct 2020 09:28:01 +0000 (09:28 +0000)
commitf067bc3c0ad6b8800f63066d654ad15c3dd33fd1
tree29c88578a17544150194fc53fc4449ded269bfd5
parentad299364a7ee2ab1669dfe10347b0430140ee0ce
[LoopRotation] Allow loop header duplication if vectorization is forced.

-Oz normally does not allow loop header duplication so this loop wouldn't be
vectorized.  However the vectorization pragma should override this and allow
for loop rotation.

rdar://problem/49281061

Original patch by Adam Nemet.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D59832
llvm/lib/Transforms/Scalar/LoopRotation.cpp
llvm/test/Transforms/LoopVectorize/AArch64/Oz-and-forced-vectorize.ll [new file with mode: 0644]