[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInternals.h Sparc.cpp
Vikram Adve
vadve at psmith.cs.uiuc.edu
Thu Sep 19 19:53:00 PDT 2002
Changes in directory llvm/lib/Target/Sparc:
SparcInternals.h updated: 1.63 -> 1.64
Sparc.cpp updated: 1.45 -> 1.46
---
Log message:
Added class MachineOptInfo as interface to target-specific
routines supporting machine code optimization.
Also added method MachineInstrInfo::getNOPOpCode().
---
Diffs of the changes:
Index: llvm/lib/Target/Sparc/SparcInternals.h
diff -u llvm/lib/Target/Sparc/SparcInternals.h:1.63 llvm/lib/Target/Sparc/SparcInternals.h:1.64
--- llvm/lib/Target/Sparc/SparcInternals.h:1.63 Mon Sep 16 10:39:26 2002
+++ llvm/lib/Target/Sparc/SparcInternals.h Thu Sep 19 19:52:09 2002
@@ -13,6 +13,7 @@
#include "llvm/Target/MachineFrameInfo.h"
#include "llvm/Target/MachineCacheInfo.h"
#include "llvm/Target/MachineRegInfo.h"
+#include "llvm/Target/MachineOptInfo.h"
#include "llvm/Type.h"
#include <sys/types.h>
@@ -125,7 +126,12 @@
//-------------------------------------------------------------------------
// Code generation support for creating individual machine instructions
//-------------------------------------------------------------------------
-
+
+ // Get certain common op codes for the current target. This and all the
+ // Create* methods below should be moved to a machine code generation class
+ //
+ virtual MachineOpCode getNOPOpCode() const { return NOP; }
+
// Create an instruction sequence to put the constant `val' into
// the virtual register `dest'. `val' may be a Constant or a
// GlobalValue, viz., the constant address of a global variable or function.
@@ -691,6 +697,21 @@
//---------------------------------------------------------------------------
+// class UltraSparcOptInfo
+//
+// Purpose:
+// Interface to machine-level optimization routines for the UltraSPARC.
+//---------------------------------------------------------------------------
+
+class UltraSparcOptInfo: public MachineOptInfo {
+public:
+ UltraSparcOptInfo(const TargetMachine &T) : MachineOptInfo(T) {}
+
+ virtual bool IsUselessCopy (const MachineInstr* MI) const;
+};
+
+
+//---------------------------------------------------------------------------
// class UltraSparcMachine
//
// Purpose:
@@ -707,14 +728,16 @@
UltraSparcRegInfo regInfo;
UltraSparcFrameInfo frameInfo;
UltraSparcCacheInfo cacheInfo;
+ UltraSparcOptInfo optInfo;
public:
UltraSparc();
-
+
virtual const MachineInstrInfo &getInstrInfo() const { return instrInfo; }
virtual const MachineSchedInfo &getSchedInfo() const { return schedInfo; }
virtual const MachineRegInfo &getRegInfo() const { return regInfo; }
virtual const MachineFrameInfo &getFrameInfo() const { return frameInfo; }
virtual const MachineCacheInfo &getCacheInfo() const { return cacheInfo; }
+ virtual const MachineOptInfo &getOptInfo() const { return optInfo; }
// getPrologEpilogCodeInserter - Inserts prolog/epilog code.
virtual Pass* getPrologEpilogInsertionPass();
Index: llvm/lib/Target/Sparc/Sparc.cpp
diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.45 llvm/lib/Target/Sparc/Sparc.cpp:1.46
--- llvm/lib/Target/Sparc/Sparc.cpp:1.45 Mon Sep 16 10:39:26 2002
+++ llvm/lib/Target/Sparc/Sparc.cpp Thu Sep 19 19:52:09 2002
@@ -108,7 +108,8 @@
schedInfo(*this),
regInfo(*this),
frameInfo(*this),
- cacheInfo(*this)
+ cacheInfo(*this),
+ optInfo(*this)
{
optSizeForSubWordData = 4;
minMemOpWordSize = 8;
More information about the llvm-commits
mailing list