mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 20:26:07 +00:00
Finegrainify namespacification
Add capability to represent volatile AliasSet's Propagate this information from loads&stores into the aliassets git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10457 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -20,8 +20,7 @@
|
|||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/Support/InstIterator.h"
|
#include "llvm/Support/InstIterator.h"
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
/// mergeSetIn - Merge the specified alias set into this alias set...
|
/// mergeSetIn - Merge the specified alias set into this alias set...
|
||||||
///
|
///
|
||||||
@@ -190,16 +189,21 @@ AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, unsigned Size){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AliasSetTracker::add(LoadInst *LI) {
|
void AliasSetTracker::add(LoadInst *LI) {
|
||||||
|
AliasSet &AS =
|
||||||
addPointer(LI->getOperand(0),
|
addPointer(LI->getOperand(0),
|
||||||
AA.getTargetData().getTypeSize(LI->getType()), AliasSet::Refs);
|
AA.getTargetData().getTypeSize(LI->getType()), AliasSet::Refs);
|
||||||
|
if (LI->isVolatile()) AS.setVolatile();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AliasSetTracker::add(StoreInst *SI) {
|
void AliasSetTracker::add(StoreInst *SI) {
|
||||||
|
AliasSet &AS =
|
||||||
addPointer(SI->getOperand(1),
|
addPointer(SI->getOperand(1),
|
||||||
AA.getTargetData().getTypeSize(SI->getOperand(0)->getType()),
|
AA.getTargetData().getTypeSize(SI->getOperand(0)->getType()),
|
||||||
AliasSet::Mods);
|
AliasSet::Mods);
|
||||||
|
if (SI->isVolatile()) AS.setVolatile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AliasSetTracker::add(CallSite CS) {
|
void AliasSetTracker::add(CallSite CS) {
|
||||||
AliasSet *AS = findAliasSetForCallSite(CS);
|
AliasSet *AS = findAliasSetForCallSite(CS);
|
||||||
if (!AS) {
|
if (!AS) {
|
||||||
@@ -263,6 +267,7 @@ void AliasSet::print(std::ostream &OS) const {
|
|||||||
case ModRef : OS << "Mod/Ref "; break;
|
case ModRef : OS << "Mod/Ref "; break;
|
||||||
default: assert(0 && "Bad value for AccessTy!");
|
default: assert(0 && "Bad value for AccessTy!");
|
||||||
}
|
}
|
||||||
|
if (isVolatile()) OS << "[volatile] ";
|
||||||
if (Forward)
|
if (Forward)
|
||||||
OS << " forwarding to " << (void*)Forward;
|
OS << " forwarding to " << (void*)Forward;
|
||||||
|
|
||||||
@@ -329,5 +334,3 @@ namespace {
|
|||||||
RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer",
|
RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer",
|
||||||
PassInfo::Analysis | PassInfo::Optimization);
|
PassInfo::Analysis | PassInfo::Optimization);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
Reference in New Issue
Block a user