SHUFP* are two address code.
[oota-llvm.git] / lib / Target / SparcV9 / SparcV9Internals.h
index 1f6599892c0558d75740a025896489a82ddf3afd..b770f0bbc4ffbe4c6bc5a1ebd6b6513a54ab3f34 100644 (file)
@@ -1,12 +1,12 @@
 //===-- SparcV9Internals.h --------------------------------------*- C++ -*-===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
-// 
+//
 // This file defines stuff that is to be private to the SparcV9 backend, but is
 // shared among different portions of the backend.
 //
 #include "SparcV9RegInfo.h"
 #include "llvm/Type.h"
 #include "SparcV9RegClassInfo.h"
-#include "llvm/Config/sys/types.h"
 
 namespace llvm {
 
-class LiveRange;
+class V9LiveRange;
 class SparcV9TargetMachine;
 class ModulePass;
+class GetElementPtrInst;
 
 enum SparcV9InstrSchedClass {
-  SPARC_NONE,          /* Instructions with no scheduling restrictions */
-  SPARC_IEUN,          /* Integer class that can use IEU0 or IEU1 */
-  SPARC_IEU0,          /* Integer class IEU0 */
-  SPARC_IEU1,          /* Integer class IEU1 */
-  SPARC_FPM,           /* FP Multiply or Divide instructions */
-  SPARC_FPA,           /* All other FP instructions */ 
-  SPARC_CTI,           /* Control-transfer instructions */
-  SPARC_LD,            /* Load instructions */
-  SPARC_ST,            /* Store instructions */
-  SPARC_SINGLE,                /* Instructions that must issue by themselves */
-  
-  SPARC_INV,           /* This should stay at the end for the next value */
+  SPARC_NONE,           /* Instructions with no scheduling restrictions */
+  SPARC_IEUN,           /* Integer class that can use IEU0 or IEU1 */
+  SPARC_IEU0,           /* Integer class IEU0 */
+  SPARC_IEU1,           /* Integer class IEU1 */
+  SPARC_FPM,            /* FP Multiply or Divide instructions */
+  SPARC_FPA,            /* All other FP instructions */
+  SPARC_CTI,            /* Control-transfer instructions */
+  SPARC_LD,             /* Load instructions */
+  SPARC_ST,             /* Store instructions */
+  SPARC_SINGLE,         /* Instructions that must issue by themselves */
+
+  SPARC_INV,            /* This should stay at the end for the next value */
   SPARC_NUM_SCHED_CLASSES = SPARC_INV
 };
 
 
 //---------------------------------------------------------------------------
-// enum SparcV9MachineOpCode. 
+// enum SparcV9MachineOpCode.
 // const TargetInstrDescriptor SparcV9MachineInstrDesc[]
-// 
+//
 // Purpose:
 //   Description of UltraSparcV9 machine instructions.
-// 
+//
 //---------------------------------------------------------------------------
 
 namespace V9 {
@@ -65,7 +65,7 @@ namespace V9 {
 
     // End-of-array marker
     INVALID_OPCODE,
-    NUM_REAL_OPCODES = PHI,            // number of valid opcodes
+    NUM_REAL_OPCODES = PHI,             // number of valid opcodes
     NUM_TOTAL_OPCODES = INVALID_OPCODE
   };
 }
@@ -75,7 +75,7 @@ extern const TargetInstrDescriptor SparcV9MachineInstrDesc[];
 
 //---------------------------------------------------------------------------
 // class SparcV9SchedInfo
-// 
+//
 // Purpose:
 //   Interface to instruction scheduling information for UltraSPARC.
 //   The parameter values above are based on UltraSPARC IIi.
@@ -97,6 +97,19 @@ FunctionPass *createStackSlotsPass(const TargetMachine &TM);
 ///
 FunctionPass *createPreSelectionPass(const TargetMachine &TM);
 
+// DecomposeMultiDimRefs - Convert multi-dimensional references consisting of
+// any combination of 2 or more array and structure indices into a sequence of
+// instructions (using getelementpr and cast) so that each instruction has at
+// most one index (except structure references, which need an extra leading
+// index of [0]).
+// This pass decomposes all multi-dimensional references in a function.
+FunctionPass *createDecomposeMultiDimRefsPass();
+
+// This function decomposes a single instance of such a reference.
+// Return value: true if the instruction was replaced; false otherwise.
+//
+bool DecomposeArrayRef(GetElementPtrInst* GEP);
+
 /// Peephole optimization pass operating on machine code
 ///
 FunctionPass *createPeepholeOptsPass(const TargetMachine &TM);