mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Minimal LDA interface, maximally conservative tester.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "llvm/Analysis/LoopDependenceAnalysis.h"
|
||||
#include "llvm/Analysis/LoopPass.h"
|
||||
#include "llvm/Analysis/ScalarEvolution.h"
|
||||
#include "llvm/Instructions.h"
|
||||
using namespace llvm;
|
||||
|
||||
LoopPass *llvm::createLoopDependenceAnalysisPass() {
|
||||
@@ -31,6 +32,29 @@ static RegisterPass<LoopDependenceAnalysis>
|
||||
R("lda", "Loop Dependence Analysis", false, true);
|
||||
char LoopDependenceAnalysis::ID = 0;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Utility Functions
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static inline bool isMemRefInstr(const Value *I) {
|
||||
return isa<LoadInst>(I) || isa<StoreInst>(I);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Dependence Testing
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
bool LoopDependenceAnalysis::isDependencePair(const Value *x,
|
||||
const Value *y) const {
|
||||
return isMemRefInstr(x) && isMemRefInstr(y)
|
||||
&& (isa<StoreInst>(x) || isa<StoreInst>(y));
|
||||
}
|
||||
|
||||
bool LoopDependenceAnalysis::depends(Value *src, Value *dst) {
|
||||
assert(isDependencePair(src, dst) && "Values form no dependence pair!");
|
||||
return true;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// LoopDependenceAnalysis Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user