[LoopVectorize] Ignore @llvm.assume for cost estimates and legality
authorHal Finkel <hfinkel@anl.gov>
Tue, 14 Oct 2014 22:59:49 +0000 (22:59 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 14 Oct 2014 22:59:49 +0000 (22:59 +0000)
commit75277b9f70a086b0dcdf5c71cdca6d58e9d29941
tree82412c14c5497514c682ee2d1e845951cf02d0e6
parent3a1045d8dbf6a6911161a18a9578f3159afa62ce
[LoopVectorize] Ignore @llvm.assume for cost estimates and legality

A few minor changes to prevent @llvm.assume from interfering with loop
vectorization. First, treat @llvm.assume like the lifetime intrinsics, which
are scalarized (but don't otherwise interfere with the legality checking).
Second, ignore the cost of ephemeral instructions in the loop (these will go
away anyway during CodeGen).

Alignment assumptions and other uses of @llvm.assume can often end up inside of
loops that should be vectorized (this is not uncommon for assumptions generated
by __attribute__((align_value(n))), for example).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219741 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/VectorUtils.h
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/X86/assume.ll [new file with mode: 0644]