mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
[PM/AA] Hoist the SCEV-AA interface to its own header and pull the
creation function into that header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,47 +19,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/Analysis/Passes.h"
|
||||
#include "llvm/Analysis/AliasAnalysis.h"
|
||||
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
/// ScalarEvolutionAliasAnalysis - This is a simple alias analysis
|
||||
/// implementation that uses ScalarEvolution to answer queries.
|
||||
class ScalarEvolutionAliasAnalysis : public FunctionPass,
|
||||
public AliasAnalysis {
|
||||
ScalarEvolution *SE;
|
||||
|
||||
public:
|
||||
static char ID; // Class identification, replacement for typeinfo
|
||||
ScalarEvolutionAliasAnalysis() : FunctionPass(ID), SE(nullptr) {
|
||||
initializeScalarEvolutionAliasAnalysisPass(
|
||||
*PassRegistry::getPassRegistry());
|
||||
}
|
||||
|
||||
/// getAdjustedAnalysisPointer - This method is used when a pass implements
|
||||
/// an analysis interface through multiple inheritance. If needed, it
|
||||
/// should override this to adjust the this pointer as needed for the
|
||||
/// specified pass info.
|
||||
void *getAdjustedAnalysisPointer(AnalysisID PI) override {
|
||||
if (PI == &AliasAnalysis::ID)
|
||||
return (AliasAnalysis*)this;
|
||||
return this;
|
||||
}
|
||||
|
||||
private:
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const override;
|
||||
bool runOnFunction(Function &F) override;
|
||||
AliasResult alias(const MemoryLocation &LocA,
|
||||
const MemoryLocation &LocB) override;
|
||||
|
||||
Value *GetBaseValue(const SCEV *S);
|
||||
};
|
||||
} // End of anonymous namespace
|
||||
|
||||
// Register this pass...
|
||||
char ScalarEvolutionAliasAnalysis::ID = 0;
|
||||
INITIALIZE_AG_PASS_BEGIN(ScalarEvolutionAliasAnalysis, AliasAnalysis, "scev-aa",
|
||||
|
||||
Reference in New Issue
Block a user