[llvm-commits] CVS: llvm/lib/Target/SparcV9/DecomposeMultiDimRefs.cpp SparcV9Internals.h

Chris Lattner lattner at cs.uiuc.edu
Sat Nov 6 16:43:37 PST 2004



Changes in directory llvm/lib/Target/SparcV9:

DecomposeMultiDimRefs.cpp updated: 1.1 -> 1.2
SparcV9Internals.h updated: 1.117 -> 1.118
---
Log message:

Decompose* is V9 specific, make it internal


---
Diffs of the changes:  (+15 -1)

Index: llvm/lib/Target/SparcV9/DecomposeMultiDimRefs.cpp
diff -u llvm/lib/Target/SparcV9/DecomposeMultiDimRefs.cpp:1.1 llvm/lib/Target/SparcV9/DecomposeMultiDimRefs.cpp:1.2
--- llvm/lib/Target/SparcV9/DecomposeMultiDimRefs.cpp:1.1	Sat Nov  6 18:39:09 2004
+++ llvm/lib/Target/SparcV9/DecomposeMultiDimRefs.cpp	Sat Nov  6 18:43:24 2004
@@ -15,7 +15,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Transforms/Scalar.h"
+#include "SparcV9Internals.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Constants.h"
 #include "llvm/Constant.h"


Index: llvm/lib/Target/SparcV9/SparcV9Internals.h
diff -u llvm/lib/Target/SparcV9/SparcV9Internals.h:1.117 llvm/lib/Target/SparcV9/SparcV9Internals.h:1.118
--- llvm/lib/Target/SparcV9/SparcV9Internals.h:1.117	Sun Sep 19 23:46:39 2004
+++ llvm/lib/Target/SparcV9/SparcV9Internals.h	Sat Nov  6 18:43:24 2004
@@ -29,6 +29,7 @@
 class LiveRange;
 class SparcV9TargetMachine;
 class ModulePass;
+class GetElementPtrInst;
 
 enum SparcV9InstrSchedClass {
   SPARC_NONE,		/* Instructions with no scheduling restrictions */
@@ -97,6 +98,19 @@
 ///
 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);






More information about the llvm-commits mailing list