aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineFunction.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-25 20:36:54 +0000
committerDan Gohman <gohman@apple.com>2009-09-25 20:36:54 +0000
commitc76909abfec876c6b751d693ebd3df07df686aa0 (patch)
treebc66c4b4bc5955aa33a7c6fb19c0163ef070b08a /include/llvm/CodeGen/MachineFunction.h
parent602b0c8c17f458d2c80f2deb3c8e554d516ee316 (diff)
Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions. This eliminates MachineInstr's std::list member and allows the data to be created by isel and live for the remainder of codegen, avoiding a lot of copying and unnecessary translation. This also shrinks MemSDNode. - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated fields for MachineMemOperands. - Change MemSDNode to have a MachineMemOperand member instead of its own fields with the same information. This introduces some redundancy, but it's more consistent with what MachineInstr will eventually want. - Ignore alignment when searching for redundant loads for CSE, but remember the greatest alignment. Target-specific code which previously used MemOperandSDNodes with generic SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range so that the SelectionDAG framework knows that MachineMemOperand information is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineFunction.h')
-rw-r--r--include/llvm/CodeGen/MachineFunction.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h
index 9fe5dfd622..6019ea3c0e 100644
--- a/include/llvm/CodeGen/MachineFunction.h
+++ b/include/llvm/CodeGen/MachineFunction.h
@@ -27,6 +27,7 @@
namespace llvm {
+class Value;
class Function;
class MachineRegisterInfo;
class MachineFrameInfo;
@@ -320,6 +321,24 @@ public:
///
void DeleteMachineBasicBlock(MachineBasicBlock *MBB);
+ /// getMachineMemOperand - Allocate a new MachineMemOperand.
+ /// MachineMemOperands are owned by the MachineFunction and need not be
+ /// explicitly deallocated.
+ MachineMemOperand *getMachineMemOperand(const Value *v, unsigned f,
+ int64_t o, uint64_t s,
+ unsigned base_alignment);
+
+ /// getMachineMemOperand - Allocate a new MachineMemOperand by copying
+ /// an existing one, adjusting by an offset and using the given EVT.
+ /// MachineMemOperands are owned by the MachineFunction and need not be
+ /// explicitly deallocated.
+ MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO,
+ int64_t Offset, uint64_t Size);
+
+ /// allocateMemRefsArray - Allocate an array to hold MachineMemOperand
+ /// pointers. This array is owned by the MachineFunction.
+ MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num);
+
//===--------------------------------------------------------------------===//
// Debug location.
//