From c91b27d9ee6e3bc49525532680dd636f1d5a1eed Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Wed, 5 Sep 2018 08:59:50 +0000 Subject: 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 --- llvm/lib/CodeGen/TargetInstrInfo.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'llvm/lib/CodeGen/TargetInstrInfo.cpp') 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 &Accesses) const { - + const MachineInstr &MI, + SmallVectorImpl &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( - (*o)->getPseudoValue())) - Accesses.emplace_back(*o, Value->getFrameIndex()); - } + if ((*o)->isLoad() && + dyn_cast_or_null((*o)->getPseudoValue())) + Accesses.push_back(*o); } return Accesses.size() != StartSize; } bool TargetInstrInfo::hasStoreToStackSlot( - const MachineInstr &MI, SmallVectorImpl &Accesses) const { + const MachineInstr &MI, + SmallVectorImpl &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( - (*o)->getPseudoValue())) - Accesses.emplace_back(*o, Value->getFrameIndex()); - } + if ((*o)->isStore() && + dyn_cast_or_null((*o)->getPseudoValue())) + Accesses.push_back(*o); } return Accesses.size() != StartSize; } -- cgit v1.2.3