mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
Make AAMDNodes ctor and operator bool (!!!) explicit, mop up bugs and weirdness exposed by it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219068 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a5fda70c13
commit
814a2ffc7c
@ -568,14 +568,12 @@ public:
|
||||
template<>
|
||||
struct DenseMapInfo<AliasAnalysis::Location> {
|
||||
static inline AliasAnalysis::Location getEmptyKey() {
|
||||
return
|
||||
AliasAnalysis::Location(DenseMapInfo<const Value *>::getEmptyKey(),
|
||||
0, nullptr);
|
||||
return AliasAnalysis::Location(DenseMapInfo<const Value *>::getEmptyKey(),
|
||||
0);
|
||||
}
|
||||
static inline AliasAnalysis::Location getTombstoneKey() {
|
||||
return
|
||||
AliasAnalysis::Location(DenseMapInfo<const Value *>::getTombstoneKey(),
|
||||
0, nullptr);
|
||||
return AliasAnalysis::Location(
|
||||
DenseMapInfo<const Value *>::getTombstoneKey(), 0);
|
||||
}
|
||||
static unsigned getHashValue(const AliasAnalysis::Location &Val) {
|
||||
return DenseMapInfo<const Value *>::getHashValue(Val.Ptr) ^
|
||||
|
@ -70,20 +70,17 @@ public:
|
||||
/// AAMDNodes - A collection of metadata nodes that might be associated with a
|
||||
/// memory access used by the alias-analysis infrastructure.
|
||||
struct AAMDNodes {
|
||||
AAMDNodes(MDNode *T = nullptr, MDNode *S = nullptr, MDNode *N = nullptr)
|
||||
: TBAA(T), Scope(S), NoAlias(N) {}
|
||||
explicit AAMDNodes(MDNode *T = nullptr, MDNode *S = nullptr,
|
||||
MDNode *N = nullptr)
|
||||
: TBAA(T), Scope(S), NoAlias(N) {}
|
||||
|
||||
bool operator == (const AAMDNodes &A) const {
|
||||
return equals(A);
|
||||
bool operator==(const AAMDNodes &A) const {
|
||||
return TBAA == A.TBAA && Scope == A.Scope && NoAlias == A.NoAlias;
|
||||
}
|
||||
|
||||
bool operator != (const AAMDNodes &A) const {
|
||||
return !equals(A);
|
||||
}
|
||||
bool operator!=(const AAMDNodes &A) const { return !(*this == A); }
|
||||
|
||||
operator bool() const {
|
||||
return TBAA || Scope || NoAlias;
|
||||
}
|
||||
LLVM_EXPLICIT operator bool() const { return TBAA || Scope || NoAlias; }
|
||||
|
||||
/// TBAA - The tag for type-based alias analysis.
|
||||
MDNode *TBAA;
|
||||
@ -93,11 +90,6 @@ struct AAMDNodes {
|
||||
|
||||
/// NoAlias - The tag specifying the noalias scope.
|
||||
MDNode *NoAlias;
|
||||
|
||||
protected:
|
||||
bool equals(const AAMDNodes &A) const {
|
||||
return TBAA == A.TBAA && Scope == A.Scope && NoAlias == A.NoAlias;
|
||||
}
|
||||
};
|
||||
|
||||
// Specialize DenseMapInfo for AAMDNodes.
|
||||
|
@ -171,7 +171,7 @@ namespace {
|
||||
llvm::RGPassManager RGM;
|
||||
((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);
|
||||
llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)nullptr);
|
||||
X.add((llvm::Value*)nullptr, 0, nullptr); // for -print-alias-sets
|
||||
X.add(nullptr, 0, llvm::AAMDNodes()); // for -print-alias-sets
|
||||
}
|
||||
} ForcePassLinking; // Force link by creating a global definition.
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ AliasAnalysis::getLocationForDest(const MemIntrinsic *MTI) {
|
||||
// memcpy/memmove can have AA tags. For memcpy, they apply
|
||||
// to both the source and the destination.
|
||||
AAMDNodes AATags;
|
||||
MTI->getMetadata(AATags);
|
||||
MTI->getAAMetadata(AATags);
|
||||
|
||||
return Location(MTI->getRawDest(), Size, AATags);
|
||||
}
|
||||
|
@ -904,8 +904,8 @@ BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
|
||||
// derived pointer.
|
||||
if (const GEPOperator *GEP2 = dyn_cast<GEPOperator>(V2)) {
|
||||
// Do the base pointers alias?
|
||||
AliasResult BaseAlias = aliasCheck(UnderlyingV1, UnknownSize, nullptr,
|
||||
UnderlyingV2, UnknownSize, nullptr);
|
||||
AliasResult BaseAlias = aliasCheck(UnderlyingV1, UnknownSize, AAMDNodes(),
|
||||
UnderlyingV2, UnknownSize, AAMDNodes());
|
||||
|
||||
// Check for geps of non-aliasing underlying pointers where the offsets are
|
||||
// identical.
|
||||
@ -988,7 +988,7 @@ BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
|
||||
if (V1Size == UnknownSize && V2Size == UnknownSize)
|
||||
return MayAlias;
|
||||
|
||||
AliasResult R = aliasCheck(UnderlyingV1, UnknownSize, nullptr,
|
||||
AliasResult R = aliasCheck(UnderlyingV1, UnknownSize, AAMDNodes(),
|
||||
V2, V2Size, V2AAInfo);
|
||||
if (R != MustAlias)
|
||||
// If V2 may alias GEP base pointer, conservatively returns MayAlias.
|
||||
|
@ -57,8 +57,11 @@ namespace {
|
||||
Location getArgLocation(ImmutableCallSite CS, unsigned ArgIdx,
|
||||
ModRefResult &Mask) override {
|
||||
Mask = ModRef;
|
||||
return Location(CS.getArgument(ArgIdx), UnknownSize,
|
||||
CS.getInstruction()->getMetadata(LLVMContext::MD_tbaa));
|
||||
AAMDNodes AATags(
|
||||
CS.getInstruction()->getMetadata(LLVMContext::MD_tbaa),
|
||||
CS.getInstruction()->getMetadata(LLVMContext::MD_alias_scope),
|
||||
CS.getInstruction()->getMetadata(LLVMContext::MD_noalias));
|
||||
return Location(CS.getArgument(ArgIdx), UnknownSize, AATags);
|
||||
}
|
||||
|
||||
ModRefResult getModRefInfo(ImmutableCallSite CS,
|
||||
|
@ -247,12 +247,12 @@ MachineFunction::getMachineMemOperand(const MachineMemOperand *MMO,
|
||||
MachineMemOperand(MachinePointerInfo(MMO->getValue(),
|
||||
MMO->getOffset()+Offset),
|
||||
MMO->getFlags(), Size,
|
||||
MMO->getBaseAlignment(), nullptr);
|
||||
MMO->getBaseAlignment());
|
||||
return new (Allocator)
|
||||
MachineMemOperand(MachinePointerInfo(MMO->getPseudoValue(),
|
||||
MMO->getOffset()+Offset),
|
||||
MMO->getFlags(), Size,
|
||||
MMO->getBaseAlignment(), nullptr);
|
||||
MMO->getBaseAlignment());
|
||||
}
|
||||
|
||||
MachineInstr::mmo_iterator
|
||||
|
@ -1947,7 +1947,7 @@ SDValue AArch64TargetLowering::LowerFormalArguments(
|
||||
|
||||
ArgValue = DAG.getExtLoad(ExtType, DL, VA.getLocVT(), Chain, FIN,
|
||||
MachinePointerInfo::getFixedStack(FI),
|
||||
MemVT, false, false, false, 0, nullptr);
|
||||
MemVT, false, false, false, 0);
|
||||
|
||||
InVals.push_back(ArgValue);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user