summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ScheduleDAGInstrs.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2014-02-20 05:06:26 +0000
committerNick Lewycky <nicholas@mxc.ca>2014-02-20 05:06:26 +0000
commit78554867a279f3d293ce86c18c626d8b16248e34 (patch)
tree9f95a3aad057872e945d584858ee35ef6a947443 /lib/CodeGen/ScheduleDAGInstrs.cpp
parent31dd38ed2f67d5fcab6a7b27c26bd352c6cc93fd (diff)
downloadllvm-78554867a279f3d293ce86c18c626d8b16248e34.tar.gz
llvm-78554867a279f3d293ce86c18c626d8b16248e34.tar.bz2
llvm-78554867a279f3d293ce86c18c626d8b16248e34.tar.xz
Simplify the implementation of getUnderlyingObjectsForInstr, without intending to change the semantics at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAGInstrs.cpp')
-rw-r--r--lib/CodeGen/ScheduleDAGInstrs.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp
index f0de7982b1..376b6f2208 100644
--- a/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -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.
-
- if (PSV->isAliased(MFI)) {
- Objects.clear();
- return;
- }
+ assert(!isa<PseudoSourceValue>(V) && "Underlying value is a stack slot!");
- 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));
}
}