]> granicus.if.org Git - llvm/commit
Merging r324195:
authorHans Wennborg <hans@hanshq.net>
Mon, 19 Feb 2018 15:24:45 +0000 (15:24 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 19 Feb 2018 15:24:45 +0000 (15:24 +0000)
commit71667f50373a9a452c81d6a83204679a8eebbf0c
tree7d02396839563d5cb8dfa80ca568d233f34db4ee
parente0d9119c7a356cc4c7ab17b6a112160902bd3277
Merging r324195:
------------------------------------------------------------------------
r324195 | mcrosier | 2018-02-04 16:42:24 +0100 (Sun, 04 Feb 2018) | 12 lines

[LV] Use Demanded Bits and ValueTracking for reduction type-shrinking

The type-shrinking logic in reduction detection, although narrow in scope, is
also rather ad-hoc, which has led to bugs (e.g., PR35734). This patch modifies
the approach to rely on the demanded bits and value tracking analyses, if
available. We currently perform type-shrinking separately for reductions and
other instructions in the loop. Long-term, we should probably think about
computing minimal bit widths in a more complete way for the loops we want to
vectorize.

PR35734
Differential Revision: https://reviews.llvm.org/D42309
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@325508 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/LoopUtils.h
lib/Transforms/Utils/LoopUtils.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/reduction-small-size.ll