mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Remove the MarkModRef pass (use AddReadAttrs instead).
Unfortunately this means removing one regression test of GlobalsModRef because I couldn't work out how to perform it without MarkModRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56342 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -86,7 +86,6 @@ namespace {
|
|||||||
(void) llvm::createLowerInvokePass();
|
(void) llvm::createLowerInvokePass();
|
||||||
(void) llvm::createLowerSetJmpPass();
|
(void) llvm::createLowerSetJmpPass();
|
||||||
(void) llvm::createLowerSwitchPass();
|
(void) llvm::createLowerSwitchPass();
|
||||||
(void) llvm::createMarkModRefPass();
|
|
||||||
(void) llvm::createNoAAPass();
|
(void) llvm::createNoAAPass();
|
||||||
(void) llvm::createNoProfileInfoPass();
|
(void) llvm::createNoProfileInfoPass();
|
||||||
(void) llvm::createProfileLoaderPass();
|
(void) llvm::createProfileLoaderPass();
|
||||||
|
@@ -137,12 +137,6 @@ LoopPass *createLoopRotatePass();
|
|||||||
//
|
//
|
||||||
LoopPass *createLoopIndexSplitPass();
|
LoopPass *createLoopIndexSplitPass();
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
//
|
|
||||||
// MarkModRef - This pass marks functions readnone/readonly.
|
|
||||||
//
|
|
||||||
FunctionPass *createMarkModRefPass();
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// PromoteMemoryToRegister - This pass is used to promote memory references to
|
// PromoteMemoryToRegister - This pass is used to promote memory references to
|
||||||
|
@@ -1,69 +0,0 @@
|
|||||||
//===--------- MarkModRef.cpp - Mark functions readnone/readonly ----------===//
|
|
||||||
//
|
|
||||||
// The LLVM Compiler Infrastructure
|
|
||||||
//
|
|
||||||
// This file is distributed under the University of Illinois Open Source
|
|
||||||
// License. See LICENSE.TXT for details.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
//
|
|
||||||
// This pass marks functions readnone/readonly based on the results of alias
|
|
||||||
// analysis. This requires a sufficiently powerful alias analysis, such as
|
|
||||||
// GlobalsModRef (invoke as "opt ... -globalsmodref-aa -markmodref ...").
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
#define DEBUG_TYPE "markmodref"
|
|
||||||
#include "llvm/ADT/Statistic.h"
|
|
||||||
#include "llvm/Analysis/AliasAnalysis.h"
|
|
||||||
#include "llvm/Support/Compiler.h"
|
|
||||||
#include "llvm/Transforms/Scalar.h"
|
|
||||||
#include "llvm/Function.h"
|
|
||||||
#include "llvm/Pass.h"
|
|
||||||
using namespace llvm;
|
|
||||||
|
|
||||||
STATISTIC(NumReadNone, "Number of functions marked readnone");
|
|
||||||
STATISTIC(NumReadOnly, "Number of functions marked readonly");
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
struct VISIBILITY_HIDDEN MarkModRef : public FunctionPass {
|
|
||||||
static char ID; // Pass identification, replacement for typeid
|
|
||||||
MarkModRef() : FunctionPass(&ID) {}
|
|
||||||
|
|
||||||
bool runOnFunction(Function &F);
|
|
||||||
|
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
|
||||||
AU.setPreservesCFG();
|
|
||||||
AU.addRequired<AliasAnalysis>();
|
|
||||||
AU.addPreserved<AliasAnalysis>();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
char MarkModRef::ID = 0;
|
|
||||||
static RegisterPass<MarkModRef>
|
|
||||||
X("markmodref", "Mark functions readnone/readonly");
|
|
||||||
|
|
||||||
bool MarkModRef::runOnFunction(Function &F) {
|
|
||||||
// FIXME: Wrong for functions with weak linkage.
|
|
||||||
if (F.doesNotAccessMemory())
|
|
||||||
// Cannot do better.
|
|
||||||
return false;
|
|
||||||
|
|
||||||
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
|
|
||||||
AliasAnalysis::ModRefBehavior ModRef = AA.getModRefBehavior(&F);
|
|
||||||
if (ModRef == AliasAnalysis::DoesNotAccessMemory) {
|
|
||||||
F.setDoesNotAccessMemory();
|
|
||||||
NumReadNone++;
|
|
||||||
return true;
|
|
||||||
} else if (ModRef == AliasAnalysis::OnlyReadsMemory && !F.onlyReadsMemory()) {
|
|
||||||
F.setOnlyReadsMemory();
|
|
||||||
NumReadOnly++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
FunctionPass *llvm::createMarkModRefPass() {
|
|
||||||
return new MarkModRef();
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@@ -499,10 +499,6 @@
|
|||||||
RelativePath="..\..\lib\Transforms\Scalar\LoopUnswitch.cpp"
|
RelativePath="..\..\lib\Transforms\Scalar\LoopUnswitch.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\lib\Transforms\Scalar\MarkModRef.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\lib\Transforms\Scalar\MemCpyOptimizer.cpp"
|
RelativePath="..\..\lib\Transforms\Scalar\MemCpyOptimizer.cpp"
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user