summaryrefslogtreecommitdiff
path: root/lib/Target/XCore/XCoreInstrInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-07 17:38:06 +0000
committerDan Gohman <gohman@apple.com>2009-10-07 17:38:06 +0000
commite33f44cfc547359bc28526e4c5e1852b600b4448 (patch)
treed809153a8332a1292de9f01eb8cf5cfbead8297e /lib/Target/XCore/XCoreInstrInfo.cpp
parent2dbc4c84f6de55deeea6631201c5df943d5327c0 (diff)
downloadllvm-e33f44cfc547359bc28526e4c5e1852b600b4448.tar.gz
llvm-e33f44cfc547359bc28526e4c5e1852b600b4448.tar.bz2
llvm-e33f44cfc547359bc28526e4c5e1852b600b4448.tar.xz
Replace TargetInstrInfo::isInvariantLoad and its target-specific
implementations with a new MachineInstr::isInvariantLoad, which uses MachineMemOperands and is target-independent. This brings MachineLICM and other functionality to targets which previously lacked an isInvariantLoad implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore/XCoreInstrInfo.cpp')
-rw-r--r--lib/Target/XCore/XCoreInstrInfo.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/Target/XCore/XCoreInstrInfo.cpp b/lib/Target/XCore/XCoreInstrInfo.cpp
index 9461e20b3a..e616fe68e2 100644
--- a/lib/Target/XCore/XCoreInstrInfo.cpp
+++ b/lib/Target/XCore/XCoreInstrInfo.cpp
@@ -116,30 +116,6 @@ XCoreInstrInfo::isStoreToStackSlot(const MachineInstr *MI,
return 0;
}
-/// isInvariantLoad - Return true if the specified instruction (which is marked
-/// mayLoad) is loading from a location whose value is invariant across the
-/// function. For example, loading a value from the constant pool or from
-/// from the argument area of a function if it does not change. This should
-/// only return true of *all* loads the instruction does are invariant (if it
-/// does multiple loads).
-bool
-XCoreInstrInfo::isInvariantLoad(const MachineInstr *MI) const {
- // Loads from constants pools and loads from invariant argument slots are
- // invariant
- int Opcode = MI->getOpcode();
- if (Opcode == XCore::LDWCP_ru6 || Opcode == XCore::LDWCP_lru6) {
- return MI->getOperand(1).isCPI();
- }
- int FrameIndex;
- if (isLoadFromStackSlot(MI, FrameIndex)) {
- const MachineFrameInfo &MFI =
- *MI->getParent()->getParent()->getFrameInfo();
- return MFI.isFixedObjectIndex(FrameIndex) &&
- MFI.isImmutableObjectIndex(FrameIndex);
- }
- return false;
-}
-
//===----------------------------------------------------------------------===//
// Branch Analysis
//===----------------------------------------------------------------------===//