forked from OSchip/llvm-project
Simplify the implementation of getUnderlyingObjectsForInstr, without intending to change the semantics at all.
llvm-svn: 201754
This commit is contained in:
parent
3d9e38273b
commit
b9e44d6bcf
|
@ -148,31 +148,30 @@ static void getUnderlyingObjectsForInstr(const MachineInstr *MI,
|
|||
if (!V)
|
||||
return;
|
||||
|
||||
if (const PseudoSourceValue *PSV = dyn_cast<PseudoSourceValue>(V)) {
|
||||
// For now, ignore PseudoSourceValues which may alias LLVM IR values
|
||||
// because the code that uses this function has no way to cope with
|
||||
// such aliases.
|
||||
if (!PSV->isAliased(MFI))
|
||||
Objects.push_back(UnderlyingObjectsVector::value_type(V, false));
|
||||
return;
|
||||
}
|
||||
|
||||
SmallVector<Value *, 4> Objs;
|
||||
getUnderlyingObjects(V, Objs);
|
||||
|
||||
for (SmallVectorImpl<Value *>::iterator I = Objs.begin(), IE = Objs.end();
|
||||
I != IE; ++I) {
|
||||
bool MayAlias = true;
|
||||
V = *I;
|
||||
|
||||
if (const PseudoSourceValue *PSV = dyn_cast<PseudoSourceValue>(V)) {
|
||||
// For now, ignore PseudoSourceValues which may alias LLVM IR values
|
||||
// because the code that uses this function has no way to cope with
|
||||
// such aliases.
|
||||
assert(!isa<PseudoSourceValue>(V) && "Underlying value is a stack slot!");
|
||||
|
||||
if (PSV->isAliased(MFI)) {
|
||||
Objects.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
MayAlias = PSV->mayAlias(MFI);
|
||||
} else if (!isIdentifiedObject(V)) {
|
||||
if (!isIdentifiedObject(V)) {
|
||||
Objects.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
Objects.push_back(UnderlyingObjectsVector::value_type(V, MayAlias));
|
||||
Objects.push_back(UnderlyingObjectsVector::value_type(V, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue