summaryrefslogtreecommitdiff
path: root/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h')
-rw-r--r--llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h b/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
index d1e7acc877bf..c6c3450f7760 100644
--- a/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
+++ b/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
@@ -198,7 +198,7 @@ class LoopVectorizationLegality {
public:
LoopVectorizationLegality(
Loop *L, PredicatedScalarEvolution &PSE, DominatorTree *DT,
- TargetTransformInfo *TTI, TargetLibraryInfo *TLI, AliasAnalysis *AA,
+ TargetTransformInfo *TTI, TargetLibraryInfo *TLI, AAResults *AA,
Function *F, std::function<const LoopAccessInfo &(Loop &)> *GetLAA,
LoopInfo *LI, OptimizationRemarkEmitter *ORE,
LoopVectorizationRequirements *R, LoopVectorizeHints *H, DemandedBits *DB,
@@ -208,7 +208,7 @@ public:
/// ReductionList contains the reduction descriptors for all
/// of the reductions that were found in the loop.
- using ReductionList = DenseMap<PHINode *, RecurrenceDescriptor>;
+ using ReductionList = MapVector<PHINode *, RecurrenceDescriptor>;
/// InductionList saves induction variables and maps them to the
/// induction descriptor.
@@ -235,13 +235,13 @@ public:
PHINode *getPrimaryInduction() { return PrimaryInduction; }
/// Returns the reduction variables found in the loop.
- ReductionList *getReductionVars() { return &Reductions; }
+ ReductionList &getReductionVars() { return Reductions; }
/// Returns the induction variables found in the loop.
- InductionList *getInductionVars() { return &Inductions; }
+ InductionList &getInductionVars() { return Inductions; }
/// Return the first-order recurrences found in the loop.
- RecurrenceSet *getFirstOrderRecurrences() { return &FirstOrderRecurrences; }
+ RecurrenceSet &getFirstOrderRecurrences() { return FirstOrderRecurrences; }
/// Return the set of instructions to sink to handle first-order recurrences.
DenseMap<Instruction *, Instruction *> &getSinkAfter() { return SinkAfter; }
@@ -312,6 +312,12 @@ public:
// Returns true if the NoNaN attribute is set on the function.
bool hasFunNoNaNAttr() const { return HasFunNoNaNAttr; }
+ /// Returns all assume calls in predicated blocks. They need to be dropped
+ /// when flattening the CFG.
+ const SmallPtrSetImpl<Instruction *> &getConditionalAssumes() const {
+ return ConditionalAssumes;
+ }
+
private:
/// Return true if the pre-header, exiting and latch blocks of \p Lp and all
/// its nested loops are considered legal for vectorization. These legal
@@ -468,6 +474,10 @@ private:
/// While vectorizing these instructions we have to generate a
/// call to the appropriate masked intrinsic
SmallPtrSet<const Instruction *, 8> MaskedOp;
+
+ /// Assume instructions in predicated blocks must be dropped if the CFG gets
+ /// flattened.
+ SmallPtrSet<Instruction *, 8> ConditionalAssumes;
};
} // namespace llvm