mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
[LoopAccesses] Make VectorizerParams global + fix for cyclic dep
As LAA is becoming a pass, we can no longer pass the params to its constructor. This changes the command line flags to have external storage. These can now be accessed both from LV and LAA. VectorizerParams is moved out of LoopAccessInfo in order to shorten the code to access it. This commits also has the fix (D7731) to the break dependence cycle between the analysis and vector libraries. This is part of the patchset that converts LoopAccessAnalysis into an actual analysis pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229890 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -60,6 +60,24 @@ public:
|
||||
const Loop *TheLoop);
|
||||
};
|
||||
|
||||
/// \brief Collection of parameters shared beetween the Loop Vectorizer and the
|
||||
/// Loop Access Analysis.
|
||||
struct VectorizerParams {
|
||||
/// \brief Maximum SIMD width.
|
||||
static const unsigned MaxVectorWidth;
|
||||
|
||||
/// \brief VF as overridden by the user.
|
||||
static unsigned VectorizationFactor;
|
||||
/// \brief Interleave factor as overridden by the user.
|
||||
static unsigned VectorizationInterleave;
|
||||
/// \brief True if force-vector-interleave was specified by the user.
|
||||
static bool isInterleaveForced();
|
||||
|
||||
/// \\brief When performing memory disambiguation checks at runtime do not
|
||||
/// make more than this number of comparisons.
|
||||
static const unsigned RuntimeMemoryCheckThreshold;
|
||||
};
|
||||
|
||||
/// \brief Drive the analysis of memory accesses in the loop
|
||||
///
|
||||
/// This class is responsible for analyzing the memory accesses of a loop. It
|
||||
@@ -76,30 +94,6 @@ public:
|
||||
/// RuntimePointerCheck class.
|
||||
class LoopAccessInfo {
|
||||
public:
|
||||
/// \brief Collection of parameters used from the vectorizer.
|
||||
struct VectorizerParams {
|
||||
/// \brief Maximum simd width.
|
||||
unsigned MaxVectorWidth;
|
||||
|
||||
/// \brief VF as overridden by the user.
|
||||
unsigned VectorizationFactor;
|
||||
/// \brief Interleave factor as overridden by the user.
|
||||
unsigned VectorizationInterleave;
|
||||
|
||||
/// \\brief When performing memory disambiguation checks at runtime do not
|
||||
/// make more than this number of comparisons.
|
||||
unsigned RuntimeMemoryCheckThreshold;
|
||||
|
||||
VectorizerParams(unsigned MaxVectorWidth,
|
||||
unsigned VectorizationFactor,
|
||||
unsigned VectorizationInterleave,
|
||||
unsigned RuntimeMemoryCheckThreshold) :
|
||||
MaxVectorWidth(MaxVectorWidth),
|
||||
VectorizationFactor(VectorizationFactor),
|
||||
VectorizationInterleave(VectorizationInterleave),
|
||||
RuntimeMemoryCheckThreshold(RuntimeMemoryCheckThreshold) {}
|
||||
};
|
||||
|
||||
/// This struct holds information about the memory runtime legality check that
|
||||
/// a group of pointers do not overlap.
|
||||
struct RuntimePointerCheck {
|
||||
@@ -143,11 +137,9 @@ public:
|
||||
|
||||
LoopAccessInfo(Function *F, Loop *L, ScalarEvolution *SE,
|
||||
const DataLayout *DL, const TargetLibraryInfo *TLI,
|
||||
AliasAnalysis *AA, DominatorTree *DT,
|
||||
const VectorizerParams &VectParams) :
|
||||
AliasAnalysis *AA, DominatorTree *DT) :
|
||||
TheFunction(F), TheLoop(L), SE(SE), DL(DL), TLI(TLI), AA(AA), DT(DT),
|
||||
NumLoads(0), NumStores(0), MaxSafeDepDistBytes(-1U),
|
||||
VectParams(VectParams) {}
|
||||
NumLoads(0), NumStores(0), MaxSafeDepDistBytes(-1U) {}
|
||||
|
||||
/// Return true we can analyze the memory accesses in the loop and there are
|
||||
/// no memory dependence cycles. Replaces symbolic strides using Strides.
|
||||
@@ -192,9 +184,6 @@ private:
|
||||
unsigned NumStores;
|
||||
|
||||
unsigned MaxSafeDepDistBytes;
|
||||
|
||||
/// \brief Vectorizer parameters used by the analysis.
|
||||
VectorizerParams VectParams;
|
||||
};
|
||||
|
||||
Value *stripIntegerCast(Value *V);
|
||||
|
||||
Reference in New Issue
Block a user