Add a flag vectorizer-maximize-bandwidth in loop vectorizer to enable using larger...
authorCong Hou <congh@google.com>
Thu, 29 Oct 2015 01:28:44 +0000 (01:28 +0000)
committerCong Hou <congh@google.com>
Thu, 29 Oct 2015 01:28:44 +0000 (01:28 +0000)
commit72daf6257005ae7203dac3898ebf450ea9f41fdb
tree6762f09f1735663dbc4fe74394eda2de7a3b571f
parentb93a3a175715cc408c0567310bde80cbf54bb389
Add a flag vectorizer-maximize-bandwidth in loop vectorizer to enable using larger vectorization factor.

To be able to maximize the bandwidth during vectorization, this patch provides a new flag vectorizer-maximize-bandwidth. When it is turned on, the vectorizer will determine the vectorization factor (VF) using the smallest instead of widest type in the loop. To avoid increasing register pressure too much, estimates of the register usage for different VFs are calculated so that we only choose a VF when its register usage doesn't exceed the number of available registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251592 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/X86/vector_max_bandwidth.ll [new file with mode: 0644]
test/Transforms/LoopVectorize/X86/vector_ptr_load_store.ll