[llvm-commits] [llvm] r97054 - in /llvm/trunk/lib/Target/MBlaze: MBlazeISelLowering.cpp MBlazeIntrinsicInfo.cpp MBlazeIntrinsicInfo.h MBlazeMachineFunction.h MBlazeRegisterInfo.cpp

Wesley Peck peckw at wesleypeck.com
Wed Feb 24 12:16:27 PST 2010


Author: peckw
Date: Wed Feb 24 14:16:27 2010
New Revision: 97054

URL: http://llvm.org/viewvc/llvm-project?rev=97054&view=rev
Log:
Adding function "lookupGCCName" to MBlazeIntrinsicInfo

Adding the function "lookupGCCName" to the MBlazeIntrinsicInfo
class to support the Clang MicroBlaze target.

Additionally, minor fixes which remove some unused PIC code 
(PIC is not supported yet in the MicroBlaze backend) and
removed some unused variables.


Modified:
    llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp
    llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
    llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.h
    llvm/trunk/lib/Target/MBlaze/MBlazeMachineFunction.h
    llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.cpp

Modified: llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp?rev=97054&r1=97053&r2=97054&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/MBlaze/MBlazeISelLowering.cpp Wed Feb 24 14:16:27 2010
@@ -470,7 +470,6 @@
           SmallVectorImpl<SDValue> &InVals) {
   MachineFunction &MF = DAG.getMachineFunction();
   MachineFrameInfo *MFI = MF.getFrameInfo();
-  bool IsPIC = getTargetMachine().getRelocationModel() == Reloc::PIC_;
 
   // Analyze operands of the call, assigning locations to each operand.
   SmallVector<CCValAssign, 16> ArgLocs;
@@ -556,7 +555,7 @@
   // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
   // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
   // node so that legalize doesn't hack it.
-  unsigned char OpFlag = IsPIC ? MBlazeII::MO_GOT_CALL : MBlazeII::MO_NO_FLAG;
+  unsigned char OpFlag = MBlazeII::MO_NO_FLAG;
   if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
     Callee = DAG.getTargetGlobalAddress(G->getGlobal(),
                                 getPointerTy(), 0, OpFlag);

Modified: llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp?rev=97054&r1=97053&r2=97054&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp (original)
+++ llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp Wed Feb 24 14:16:27 2010
@@ -32,6 +32,9 @@
     , num_mblaze_intrinsics
   };
 
+#define GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
+#include "MBlazeGenIntrinsics.inc"
+#undef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
 }
 
 std::string MBlazeIntrinsicInfo::getName(unsigned IntrID, const Type **Tys,
@@ -60,6 +63,11 @@
   return 0;
 }
 
+unsigned MBlazeIntrinsicInfo::
+lookupGCCName(const char *Name) const {
+    return mblazeIntrinsic::getIntrinsicForGCCBuiltin("mblaze",Name);
+}
+
 bool MBlazeIntrinsicInfo::isOverloaded(unsigned IntrID) const {
   // Overload Table
   const bool OTable[] = {

Modified: llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.h?rev=97054&r1=97053&r2=97054&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.h (original)
+++ llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsicInfo.h Wed Feb 24 14:16:27 2010
@@ -22,6 +22,7 @@
     std::string getName(unsigned IntrID, const Type **Tys = 0,
                         unsigned numTys = 0) const;
     unsigned lookupName(const char *Name, unsigned Len) const;
+    unsigned lookupGCCName(const char *Name) const;
     bool isOverloaded(unsigned IID) const;
     Function *getDeclaration(Module *M, unsigned ID, const Type **Tys = 0,
                              unsigned numTys = 0) const;

Modified: llvm/trunk/lib/Target/MBlaze/MBlazeMachineFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeMachineFunction.h?rev=97054&r1=97053&r2=97054&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/MBlazeMachineFunction.h (original)
+++ llvm/trunk/lib/Target/MBlaze/MBlazeMachineFunction.h Wed Feb 24 14:16:27 2010
@@ -34,12 +34,11 @@
   /// saved. This is used on Prologue and Epilogue to emit RA save/restore
   int RAStackOffset;
 
-  /// At each function entry, two special bitmask directives must be emitted
-  /// to help debugging, for CPU and FPU callee saved registers. Both need
-  /// the negative offset from the final stack size and its higher registers
-  /// location on the stack.
+  /// At each function entry a special bitmask directive must be emitted
+  /// to help in debugging CPU callee saved registers. It needs a negative
+  /// offset from the final stack size and its higher register location on
+  /// the stack.
   int CPUTopSavedRegOff;
-  int FPUTopSavedRegOff;
 
   /// MBlazeFIHolder - Holds a FrameIndex and it's Stack Pointer Offset
   struct MBlazeFIHolder {
@@ -83,8 +82,8 @@
 public:
   MBlazeFunctionInfo(MachineFunction& MF) 
   : FPStackOffset(0), RAStackOffset(0), CPUTopSavedRegOff(0), 
-    FPUTopSavedRegOff(0), GPHolder(-1,-1), HasLoadArgs(false), 
-    HasStoreVarArgs(false), SRetReturnReg(0), GlobalBaseReg(0)
+    GPHolder(-1,-1), HasLoadArgs(false), HasStoreVarArgs(false),
+    SRetReturnReg(0), GlobalBaseReg(0)
   {}
 
   int getFPStackOffset() const { return FPStackOffset; }
@@ -96,9 +95,6 @@
   int getCPUTopSavedRegOff() const { return CPUTopSavedRegOff; }
   void setCPUTopSavedRegOff(int Off) { CPUTopSavedRegOff = Off; }
 
-  int getFPUTopSavedRegOff() const { return FPUTopSavedRegOff; }
-  void setFPUTopSavedRegOff(int Off) { FPUTopSavedRegOff = Off; }
-
   int getGPStackOffset() const { return GPHolder.SPOffset; }
   int getGPFI() const { return GPHolder.FI; }
   void setGPStackOffset(int Off) { GPHolder.SPOffset = Off; }

Modified: llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.cpp?rev=97054&r1=97053&r2=97054&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/MBlaze/MBlazeRegisterInfo.cpp Wed Feb 24 14:16:27 2010
@@ -96,7 +96,7 @@
 /// MBlaze Callee Saved Registers
 const unsigned* MBlazeRegisterInfo::
 getCalleeSavedRegs(const MachineFunction *MF) const {
-  // MBlaze callee-save register range is R19 - R31
+  // MBlaze callee-save register range is R20 - R31
   static const unsigned CalleeSavedRegs[] = {
     MBlaze::R20, MBlaze::R21, MBlaze::R22, MBlaze::R23,
     MBlaze::R24, MBlaze::R25, MBlaze::R26, MBlaze::R27,





More information about the llvm-commits mailing list