diff options
author | Sander de Smalen <sander.desmalen@arm.com> | 2018-09-05 08:59:50 +0000 |
---|---|---|
committer | Sander de Smalen <sander.desmalen@arm.com> | 2018-09-05 08:59:50 +0000 |
commit | c91b27d9ee6e3bc49525532680dd636f1d5a1eed (patch) | |
tree | 0e4b8c03217e0279369c309f26d80cd468b82c17 /llvm/lib/CodeGen/TargetInstrInfo.cpp | |
parent | 445bdd171ff4268157256923a1f143ec959d9366 (diff) | |
download | bcm5719-llvm-c91b27d9ee6e3bc49525532680dd636f1d5a1eed.tar.gz bcm5719-llvm-c91b27d9ee6e3bc49525532680dd636f1d5a1eed.zip |
Remove FrameAccess struct from hasLoadFromStackSlot
This removes the FrameAccess struct that was added to the interface
in D51537, since the PseudoValue from the MachineMemoryOperand
can be safely casted to a FixedStackPseudoSourceValue.
Reviewers: MatzeB, thegameg, javed.absar
Reviewed By: thegameg
Differential Revision: https://reviews.llvm.org/D51617
llvm-svn: 341454
Diffstat (limited to 'llvm/lib/CodeGen/TargetInstrInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetInstrInfo.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp index 4d9aa830414..2a17af39110 100644 --- a/llvm/lib/CodeGen/TargetInstrInfo.cpp +++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp @@ -340,34 +340,29 @@ bool TargetInstrInfo::PredicateInstruction( } bool TargetInstrInfo::hasLoadFromStackSlot( - const MachineInstr &MI, SmallVectorImpl<FrameAccess> &Accesses) const { - + const MachineInstr &MI, + SmallVectorImpl<const MachineMemOperand *> &Accesses) const { size_t StartSize = Accesses.size(); for (MachineInstr::mmo_iterator o = MI.memoperands_begin(), oe = MI.memoperands_end(); o != oe; ++o) { - if ((*o)->isLoad()) { - if (const FixedStackPseudoSourceValue *Value = - dyn_cast_or_null<FixedStackPseudoSourceValue>( - (*o)->getPseudoValue())) - Accesses.emplace_back(*o, Value->getFrameIndex()); - } + if ((*o)->isLoad() && + dyn_cast_or_null<FixedStackPseudoSourceValue>((*o)->getPseudoValue())) + Accesses.push_back(*o); } return Accesses.size() != StartSize; } bool TargetInstrInfo::hasStoreToStackSlot( - const MachineInstr &MI, SmallVectorImpl<FrameAccess> &Accesses) const { + const MachineInstr &MI, + SmallVectorImpl<const MachineMemOperand *> &Accesses) const { size_t StartSize = Accesses.size(); for (MachineInstr::mmo_iterator o = MI.memoperands_begin(), oe = MI.memoperands_end(); o != oe; ++o) { - if ((*o)->isStore()) { - if (const FixedStackPseudoSourceValue *Value = - dyn_cast_or_null<FixedStackPseudoSourceValue>( - (*o)->getPseudoValue())) - Accesses.emplace_back(*o, Value->getFrameIndex()); - } + if ((*o)->isStore() && + dyn_cast_or_null<FixedStackPseudoSourceValue>((*o)->getPseudoValue())) + Accesses.push_back(*o); } return Accesses.size() != StartSize; } |