SLPVectorizer: Change the order in which new instructions are added to the function.

We are not working on a DAG and I ran into a number of problems when I enabled the vectorizations of 'diamond-trees' (trees that share leafs).
* Imroved the numbering API.
* Changed the placement of new instructions to the last root.
* Fixed a bug with external tree users with non-zero lane.
* Fixed a bug in the placement of in-tree users.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182508 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem
2013-05-22 19:47:32 +00:00
parent 23d1d5eb56
commit 3f75c6cfb5
7 changed files with 236 additions and 58 deletions

View File

@ -20,6 +20,7 @@
#include "VecUtils.h"
#include "llvm/Transforms/Vectorize.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
@ -47,7 +48,7 @@ namespace {
/// The SLPVectorizer Pass.
struct SLPVectorizer : public FunctionPass {
typedef std::map<Value*, BoUpSLP::StoreList> StoreListMap;
typedef MapVector<Value*, BoUpSLP::StoreList> StoreListMap;
/// Pass identification, replacement for typeid
static char ID;