1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[MemorySSA] Make a return type reflect reality. NFC.

llvm-svn: 263286
This commit is contained in:
George Burgess IV 2016-03-11 19:34:03 +00:00
parent 3b791814db
commit e00d07860b
2 changed files with 13 additions and 12 deletions

View File

@ -553,7 +553,7 @@ private:
void computeDomLevels(DenseMap<DomTreeNode *, unsigned> &DomLevels);
void markUnreachableAsLiveOnEntry(BasicBlock *BB);
bool dominatesUse(const MemoryAccess *, const MemoryAccess *) const;
MemoryAccess *createNewAccess(Instruction *, bool ignoreNonMemory = false);
MemoryUseOrDef *createNewAccess(Instruction *, bool ignoreNonMemory = false);
MemoryAccess *findDominatingDef(BasicBlock *, enum InsertionPlace);
void removeFromLookups(MemoryAccess *);

View File

@ -257,17 +257,17 @@ MemorySSAWalker *MemorySSA::buildMemorySSA(AliasAnalysis *AA,
bool InsertIntoDef = false;
AccessListType *Accesses = nullptr;
for (Instruction &I : B) {
MemoryAccess *MA = createNewAccess(&I, true);
if (!MA)
MemoryUseOrDef *MUD = createNewAccess(&I, true);
if (!MUD)
continue;
if (isa<MemoryDef>(MA))
if (isa<MemoryDef>(MUD))
InsertIntoDef = true;
else if (isa<MemoryUse>(MA))
else
InsertIntoDefUse = true;
if (!Accesses)
Accesses = getOrCreateAccessList(&B);
Accesses->push_back(MA);
Accesses->push_back(MUD);
}
if (InsertIntoDef)
DefiningBlocks.insert(&B);
@ -358,7 +358,8 @@ MemorySSAWalker *MemorySSA::buildMemorySSA(AliasAnalysis *AA,
}
/// \brief Helper function to create new memory accesses
MemoryAccess *MemorySSA::createNewAccess(Instruction *I, bool IgnoreNonMemory) {
MemoryUseOrDef *MemorySSA::createNewAccess(Instruction *I,
bool IgnoreNonMemory) {
// Find out what affect this instruction has on memory.
ModRefInfo ModRef = AA->getModRefInfo(I);
bool Def = bool(ModRef & MRI_Mod);
@ -372,13 +373,13 @@ MemoryAccess *MemorySSA::createNewAccess(Instruction *I, bool IgnoreNonMemory) {
assert((Def || Use) &&
"Trying to create a memory access with a non-memory instruction");
MemoryUseOrDef *MA;
MemoryUseOrDef *MUD;
if (Def)
MA = new MemoryDef(I->getContext(), nullptr, I, I->getParent(), NextID++);
MUD = new MemoryDef(I->getContext(), nullptr, I, I->getParent(), NextID++);
else
MA = new MemoryUse(I->getContext(), nullptr, I, I->getParent());
ValueToMemoryAccess.insert(std::make_pair(I, MA));
return MA;
MUD = new MemoryUse(I->getContext(), nullptr, I, I->getParent());
ValueToMemoryAccess.insert(std::make_pair(I, MUD));
return MUD;
}
MemoryAccess *MemorySSA::findDominatingDef(BasicBlock *UseBlock,