diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2014-02-20 05:06:26 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2014-02-20 05:06:26 +0000 |
| commit | b9e44d6bcf31125b638c8b2eb8aa021fb94b6ed7 (patch) | |
| tree | cc02eddb7bf7f092e7f37c28d36e8e3fdcd44b59 /llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | |
| parent | 3d9e38273b9bfaa35d8f55751989db90a149329b (diff) | |
| download | bcm5719-llvm-b9e44d6bcf31125b638c8b2eb8aa021fb94b6ed7.tar.gz bcm5719-llvm-b9e44d6bcf31125b638c8b2eb8aa021fb94b6ed7.zip | |
Simplify the implementation of getUnderlyingObjectsForInstr, without intending to change the semantics at all.
llvm-svn: 201754
Diffstat (limited to 'llvm/lib/CodeGen/ScheduleDAGInstrs.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp index f0de7982b12..376b6f22083 100644 --- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/llvm/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)); } } |

