Use instruction itinerary to determine what instructions are 'cheap'.
[oota-llvm.git] / include / llvm / CodeGen / FunctionLoweringInfo.h
index 011d42617d634563a1d90ea83153ed3a3e52a879..f17fe5a146fcccd1b365fe297bf3d8ccc87ceca0 100644 (file)
@@ -25,6 +25,7 @@
 #endif
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/CodeGen/ISDOpcodes.h"
+#include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/Support/CallSite.h"
 #include <vector>
 
@@ -76,10 +77,22 @@ public:
   /// anywhere in the function.
   DenseMap<const AllocaInst*, int> StaticAllocaMap;
 
+  /// ByValArgFrameIndexMap - Keep track of frame indices for byval arguments.
+  DenseMap<const Argument*, int> ByValArgFrameIndexMap;
+
   /// ArgDbgValues - A list of DBG_VALUE instructions created during isel for
   /// function arguments that are inserted after scheduling is completed.
   SmallVector<MachineInstr*, 8> ArgDbgValues;
 
+  /// RegFixups - Registers which need to be replaced after isel is done.
+  DenseMap<unsigned, unsigned> RegFixups;
+
+  /// MBB - The current block.
+  MachineBasicBlock *MBB;
+
+  /// MBB - The current insert position inside the current block.
+  MachineBasicBlock::iterator InsertPt;
+
 #ifndef NDEBUG
   SmallSet<const Instruction *, 8> CatchInfoLost;
   SmallSet<const Instruction *, 8> CatchInfoFound;
@@ -128,6 +141,13 @@ public:
     assert(R == 0 && "Already initialized this value register!");
     return R = CreateRegs(V->getType());
   }
+
+  /// setByValArgumentFrameIndex - Record frame index for the byval
+  /// argument.
+  void setByValArgumentFrameIndex(const Argument *A, int FI);
+  
+  /// getByValArgumentFrameIndex - Get frame index for the byval argument.
+  int getByValArgumentFrameIndex(const Argument *A);
 };
 
 /// AddCatchInfo - Extract the personality and type infos from an eh.selector