[llvm-commits] [llvm] r49348 - in /llvm/trunk: include/llvm/CodeGen/MachineInstr.h include/llvm/CodeGen/MachineInstrBuilder.h include/llvm/CodeGen/MachineMemOperand.h include/llvm/CodeGen/MemOperand.h include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/MachineInstr.cpp lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/X86/X86InstrInfo.cpp

Dan Gohman gohman at apple.com
Mon Apr 7 12:35:22 PDT 2008


Author: djg
Date: Mon Apr  7 14:35:22 2008
New Revision: 49348

URL: http://llvm.org/viewvc/llvm-project?rev=49348&view=rev
Log:
Rename MemOperand to MachineMemOperand. This was suggested by
review feedback from Chris quite a while ago. No functionality
change.

Added:
    llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h
      - copied, changed from r49345, llvm/trunk/include/llvm/CodeGen/MemOperand.h
Removed:
    llvm/trunk/include/llvm/CodeGen/MemOperand.h
Modified:
    llvm/trunk/include/llvm/CodeGen/MachineInstr.h
    llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
    llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
    llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
    llvm/trunk/lib/CodeGen/MachineInstr.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
    llvm/trunk/lib/Target/X86/X86InstrInfo.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Mon Apr  7 14:35:22 2008
@@ -17,7 +17,7 @@
 #define LLVM_CODEGEN_MACHINEINSTR_H
 
 #include "llvm/CodeGen/MachineOperand.h"
-#include "llvm/CodeGen/MemOperand.h"
+#include "llvm/CodeGen/MachineMemOperand.h"
 
 namespace llvm {
 
@@ -37,7 +37,7 @@
                                         // are determined at construction time).
 
   std::vector<MachineOperand> Operands; // the operands
-  std::vector<MemOperand> MemOperands;  // information on memory references
+  std::vector<MachineMemOperand> MemOperands;// information on memory references
   MachineInstr *Prev, *Next;            // Links for MBB's intrusive list.
   MachineBasicBlock *Parent;            // Pointer to the owning basic block.
 
@@ -100,11 +100,11 @@
   /// Access to memory operands of the instruction
   unsigned getNumMemOperands() const { return MemOperands.size(); }
 
-  const MemOperand& getMemOperand(unsigned i) const {
+  const MachineMemOperand& getMemOperand(unsigned i) const {
     assert(i < getNumMemOperands() && "getMemOperand() out of range!");
     return MemOperands[i];
   }
-  MemOperand& getMemOperand(unsigned i) {
+  MachineMemOperand& getMemOperand(unsigned i) {
     assert(i < getNumMemOperands() && "getMemOperand() out of range!");
     return MemOperands[i];
   }
@@ -268,9 +268,9 @@
   ///
   void RemoveOperand(unsigned i);
 
-  /// addMemOperand - Add a MemOperand to the machine instruction, referencing
-  /// arbitrary storage.
-  void addMemOperand(const MemOperand &MO) {
+  /// addMemOperand - Add a MachineMemOperand to the machine instruction,
+  /// referencing arbitrary storage.
+  void addMemOperand(const MachineMemOperand &MO) {
     MemOperands.push_back(MO);
   }
 

Modified: llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h Mon Apr  7 14:35:22 2008
@@ -85,7 +85,7 @@
   }
 
   /// addMemOperand - Add a memory operand to the machine instruction.
-  const MachineInstrBuilder &addMemOperand(const MemOperand &MO) const {
+  const MachineInstrBuilder &addMemOperand(const MachineMemOperand &MO) const {
     MI->addMemOperand(MO);
     return *this;
   }

Copied: llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h (from r49345, llvm/trunk/include/llvm/CodeGen/MemOperand.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h?p2=llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h&p1=llvm/trunk/include/llvm/CodeGen/MemOperand.h&r1=49345&r2=49348&rev=49348&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MemOperand.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineMemOperand.h Mon Apr  7 14:35:22 2008
@@ -1,4 +1,4 @@
-//===-- llvm/CodeGen/MemOperand.h - MemOperand class ------------*- C++ -*-===//
+//==- llvm/CodeGen/MachineMemOperand.h - MachineMemOperand class -*- C++ -*-==//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file contains the declaration of the MemOperand class, which is a
+// This file contains the declaration of the MachineMemOperand class, which is a
 // description of a memory reference. It is used to help track dependencies
 // in the backend.
 //
@@ -21,14 +21,14 @@
 class Value;
 
 //===----------------------------------------------------------------------===//
-/// MemOperand - A description of a memory reference used in the backend.
+/// MachineMemOperand - A description of a memory reference used in the backend.
 /// Instead of holding a StoreInst or LoadInst, this class holds the address
 /// Value of the reference along with a byte size and offset. This allows it
 /// to describe lowered loads and stores. Also, the special PseudoSourceValue
 /// objects can be used to represent loads and stores to memory locations
 /// that aren't explicit in the regular LLVM IR.
 ///
-class MemOperand {
+class MachineMemOperand {
   const Value *V;
   unsigned int Flags;
   int64_t Offset;
@@ -46,10 +46,10 @@
     MOVolatile = 4
   };
 
-  /// MemOperand - Construct an MemOperand object with the specified
-  /// address Value, flags, offset, size, and alignment.
-  MemOperand(const Value *v, unsigned int f, int64_t o, uint64_t s,
-             unsigned int a)
+  /// MachineMemOperand - Construct an MachineMemOperand object with the
+  /// specified address Value, flags, offset, size, and alignment.
+  MachineMemOperand(const Value *v, unsigned int f, int64_t o, uint64_t s,
+                    unsigned int a)
     : V(v), Flags(f), Offset(o), Size(s), Alignment(a) {}
 
   /// getValue - Return the base address of the memory access.

Removed: llvm/trunk/include/llvm/CodeGen/MemOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MemOperand.h?rev=49347&view=auto

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MemOperand.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MemOperand.h (removed)
@@ -1,83 +0,0 @@
-//===-- llvm/CodeGen/MemOperand.h - MemOperand class ------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the MemOperand class, which is a
-// description of a memory reference. It is used to help track dependencies
-// in the backend.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MEMOPERAND_H
-#define LLVM_CODEGEN_MEMOPERAND_H
-
-namespace llvm {
-
-class Value;
-
-//===----------------------------------------------------------------------===//
-/// MemOperand - A description of a memory reference used in the backend.
-/// Instead of holding a StoreInst or LoadInst, this class holds the address
-/// Value of the reference along with a byte size and offset. This allows it
-/// to describe lowered loads and stores. Also, the special PseudoSourceValue
-/// objects can be used to represent loads and stores to memory locations
-/// that aren't explicit in the regular LLVM IR.
-///
-class MemOperand {
-  const Value *V;
-  unsigned int Flags;
-  int64_t Offset;
-  uint64_t Size;
-  unsigned int Alignment;
-
-public:
-  /// Flags values. These may be or'd together.
-  enum MemOperandFlags {
-    /// The memory access reads data.
-    MOLoad = 1,
-    /// The memory access writes data.
-    MOStore = 2,
-    /// The memory access is volatile.
-    MOVolatile = 4
-  };
-
-  /// MemOperand - Construct an MemOperand object with the specified
-  /// address Value, flags, offset, size, and alignment.
-  MemOperand(const Value *v, unsigned int f, int64_t o, uint64_t s,
-             unsigned int a)
-    : V(v), Flags(f), Offset(o), Size(s), Alignment(a) {}
-
-  /// getValue - Return the base address of the memory access.
-  /// Special values are PseudoSourceValue::FPRel, PseudoSourceValue::SPRel,
-  /// and the other PseudoSourceValue members which indicate references to
-  /// frame/stack pointer relative references and other special references.
-  const Value *getValue() const { return V; }
-
-  /// getFlags - Return the raw flags of the source value, \see MemOperandFlags.
-  unsigned int getFlags() const { return Flags; }
-
-  /// getOffset - For normal values, this is a byte offset added to the base
-  /// address. For PseudoSourceValue::FPRel values, this is the FrameIndex
-  /// number.
-  int64_t getOffset() const { return Offset; }
-
-  /// getSize - Return the size in bytes of the memory reference.
-  uint64_t getSize() const { return Size; }
-
-  /// getAlignment - Return the minimum known alignment in bytes of the
-  /// memory reference.
-  unsigned int getAlignment() const { return Alignment; }
-
-  bool isLoad() const { return Flags & MOLoad; }
-  bool isStore() const { return Flags & MOStore; }
-  bool isVolatile() const { return Flags & MOVolatile; }
-};
-
-} // End llvm namespace
-
-#endif

Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Mon Apr  7 14:35:22 2008
@@ -365,7 +365,7 @@
                     const TargetInstrDesc *II,
                     DenseMap<SDOperandImpl, unsigned> &VRBaseMap);
 
-    void AddMemOperand(MachineInstr *MI, const MemOperand &MO);
+    void AddMemOperand(MachineInstr *MI, const MachineMemOperand &MO);
 
     void EmitCrossRCCopy(SUnit *SU, DenseMap<SUnit*, unsigned> &VRBaseMap);
 

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Apr  7 14:35:22 2008
@@ -401,7 +401,7 @@
 
   // getMemOperand - Construct a node to track a memory reference
   // through the backend.
-  SDOperand getMemOperand(const MemOperand &MO);
+  SDOperand getMemOperand(const MachineMemOperand &MO);
 
   /// UpdateNodeOperands - *Mutate* the specified node in-place to have the
   /// specified operands.  If the resultant node already exists in the DAG,

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Apr  7 14:35:22 2008
@@ -26,7 +26,7 @@
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/CodeGen/ValueTypes.h"
-#include "llvm/CodeGen/MemOperand.h"
+#include "llvm/CodeGen/MachineMemOperand.h"
 #include "llvm/Support/DataTypes.h"
 #include <cassert>
 
@@ -530,9 +530,9 @@
     // make reference to a value in the LLVM IR.
     SRCVALUE,
 
-    // MEMOPERAND - This is a node that contains a MemOperand which records
-    // information about a memory reference. This is used to make AliasAnalysis
-    // queries from the backend.
+    // MEMOPERAND - This is a node that contains a MachineMemOperand which
+    // records information about a memory reference. This is used to make
+    // AliasAnalysis queries from the backend.
     MEMOPERAND,
 
     // PCMARKER - This corresponds to the pcmarker intrinsic.
@@ -1645,7 +1645,7 @@
 };
 
 
-/// MemOperandSDNode - An SDNode that holds a MemOperand. This is
+/// MemOperandSDNode - An SDNode that holds a MachineMemOperand. This is
 /// used to represent a reference to memory after ISD::LOAD
 /// and ISD::STORE have been lowered.
 ///
@@ -1653,13 +1653,13 @@
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  /// Create a MemOperand node
-  explicit MemOperandSDNode(const MemOperand &mo)
+  /// Create a MachineMemOperand node
+  explicit MemOperandSDNode(const MachineMemOperand &mo)
     : SDNode(ISD::MEMOPERAND, getSDVTList(MVT::Other)), MO(mo) {}
 
 public:
-  /// MO - The contained MemOperand.
-  const MemOperand MO;
+  /// MO - The contained MachineMemOperand.
+  const MachineMemOperand MO;
 
   static bool classof(const MemOperandSDNode *) { return true; }
   static bool classof(const SDNode *N) {
@@ -1906,9 +1906,9 @@
   /// isUnindexed - Return true if this is NOT a pre/post inc/dec load/store.
   bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
 
-  /// getMemOperand - Return a MemOperand object describing the memory
+  /// getMemOperand - Return a MachineMemOperand object describing the memory
   /// reference performed by this load or store.
-  MemOperand getMemOperand() const;
+  MachineMemOperand getMemOperand() const;
 
   static bool classof(const LSBaseSDNode *N) { return true; }
   static bool classof(const SDNode *N) {

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Mon Apr  7 14:35:22 2008
@@ -693,7 +693,7 @@
   if (getNumMemOperands() > 0) {
     OS << ", Mem:";
     for (unsigned i = 0; i < getNumMemOperands(); i++) {
-      const MemOperand &MRO = getMemOperand(i);
+      const MachineMemOperand &MRO = getMemOperand(i);
       const Value *V = MRO.getValue();
 
       assert((MRO.isLoad() || MRO.isStore()) &&

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Mon Apr  7 14:35:22 2008
@@ -369,7 +369,7 @@
 unsigned ScheduleDAG::CountOperands(SDNode *Node) {
   unsigned N = ComputeMemOperandsEnd(Node);
   while (N && isa<MemOperandSDNode>(Node->getOperand(N - 1).Val))
-    --N; // Ignore MemOperand nodes
+    --N; // Ignore MEMOPERAND nodes
   return N;
 }
 
@@ -656,7 +656,7 @@
   
 }
 
-void ScheduleDAG::AddMemOperand(MachineInstr *MI, const MemOperand &MO) {
+void ScheduleDAG::AddMemOperand(MachineInstr *MI, const MachineMemOperand &MO) {
   MI->addMemOperand(MO);
 }
 

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Apr  7 14:35:22 2008
@@ -385,7 +385,7 @@
     ID.AddPointer(cast<SrcValueSDNode>(N)->getValue());
     break;
   case ISD::MEMOPERAND: {
-    const MemOperand &MO = cast<MemOperandSDNode>(N)->MO;
+    const MachineMemOperand &MO = cast<MemOperandSDNode>(N)->MO;
     ID.AddPointer(MO.getValue());
     ID.AddInteger(MO.getFlags());
     ID.AddInteger(MO.getOffset());
@@ -1014,7 +1014,7 @@
   return SDOperand(N, 0);
 }
 
-SDOperand SelectionDAG::getMemOperand(const MemOperand &MO) {
+SDOperand SelectionDAG::getMemOperand(const MachineMemOperand &MO) {
   const Value *v = MO.getValue();
   assert((!v || isa<PointerType>(v->getType())) &&
          "SrcValue is not a pointer?");
@@ -3635,24 +3635,25 @@
   TheGlobal = const_cast<GlobalValue*>(GA);
 }
 
-/// getMemOperand - Return a MemOperand object describing the memory
+/// getMemOperand - Return a MachineMemOperand object describing the memory
 /// reference performed by this load or store.
-MemOperand LSBaseSDNode::getMemOperand() const {
+MachineMemOperand LSBaseSDNode::getMemOperand() const {
   int Size = (MVT::getSizeInBits(getMemoryVT()) + 7) >> 3;
   int Flags =
-    getOpcode() == ISD::LOAD ? MemOperand::MOLoad : MemOperand::MOStore;
-  if (IsVolatile) Flags |= MemOperand::MOVolatile;
+    getOpcode() == ISD::LOAD ? MachineMemOperand::MOLoad :
+                               MachineMemOperand::MOStore;
+  if (IsVolatile) Flags |= MachineMemOperand::MOVolatile;
 
   // Check if the load references a frame index, and does not have
   // an SV attached.
   const FrameIndexSDNode *FI =
     dyn_cast<const FrameIndexSDNode>(getBasePtr().Val);
   if (!getSrcValue() && FI)
-    return MemOperand(PseudoSourceValue::getFixedStack(), Flags,
-                      FI->getIndex(), Size, Alignment);
+    return MachineMemOperand(PseudoSourceValue::getFixedStack(), Flags,
+                             FI->getIndex(), Size, Alignment);
   else
-    return MemOperand(getSrcValue(), Flags,
-                      getSrcValueOffset(), Size, Alignment);
+    return MachineMemOperand(getSrcValue(), Flags,
+                             getSrcValueOffset(), Size, Alignment);
 }
 
 /// Profile - Gather unique data for the node.

Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon Apr  7 14:35:22 2008
@@ -2500,8 +2500,8 @@
                                 Op.getOperand(0));
   
   // STD the extended value into the stack slot.
-  MemOperand MO(PseudoSourceValue::getFixedStack(),
-                MemOperand::MOStore, FrameIdx, 8, 8);
+  MachineMemOperand MO(PseudoSourceValue::getFixedStack(),
+                       MachineMemOperand::MOStore, FrameIdx, 8, 8);
   SDOperand Store = DAG.getNode(PPCISD::STD_32, MVT::Other,
                                 DAG.getEntryNode(), Ext64, FIdx,
                                 DAG.getMemOperand(MO));

Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=49348&r1=49347&r2=49348&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Apr  7 14:35:22 2008
@@ -1930,7 +1930,7 @@
 
   unsigned Alignment = 0;
   for (unsigned i = 0, e = LoadMI->getNumMemOperands(); i != e; ++i) {
-    const MemOperand &MRO = LoadMI->getMemOperand(i);
+    const MachineMemOperand &MRO = LoadMI->getMemOperand(i);
     unsigned Align = MRO.getAlignment();
     if (Align > Alignment)
       Alignment = Align;





More information about the llvm-commits mailing list