OSDN Git Service

[LV] Use Demanded Bits and ValueTracking for reduction type-shrinking
authorChad Rosier <mcrosier@codeaurora.org>
Sun, 4 Feb 2018 15:42:24 +0000 (15:42 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Sun, 4 Feb 2018 15:42:24 +0000 (15:42 +0000)
commit451a188a25a1d723233bfaf51a6262944438be5f
tree2e62ded58be4d40559bbcfcba3c88fc77062d628
parent5a24493720154c8145652dd8d2dcee565bd50b99
[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/trunk@324195 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