[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.147 - 1.148 SelectionDAGNodes.h updated: 1.185 - 1.186 --- Log message: add support for alignment attributes on load/store instructions --- Diffs of the changes: (+10 -5) SelectionDAG.h | 11 +++ SelectionDAGNodes.h |4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.147 llvm/include/llvm/CodeGen/SelectionDAG.h:1.148 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.147 Fri Apr 20 16:38:10 2007 +++ llvm/include/llvm/CodeGen/SelectionDAG.hSat Apr 21 03:16:25 2007 @@ -311,10 +311,12 @@ /// determined by their operands, and they produce a value AND a token chain. /// SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, -const Value *SV, int SVOffset, bool isVolatile=false); +const Value *SV, int SVOffset, bool isVolatile=false, +unsigned Alignment=0); SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, - int SVOffset, MVT::ValueType EVT, bool isVolatile=false); + int SVOffset, MVT::ValueType EVT, bool isVolatile=false, + unsigned Alignment=0); SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, @@ -323,10 +325,11 @@ /// getStore - Helper function to build ISD::STORE nodes. /// SDOperand getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, - const Value *SV, int SVOffset, bool isVolatile=false); + const Value *SV, int SVOffset, bool isVolatile=false, + unsigned Alignment=0); SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType TVT, - bool isVolatile=false); + bool isVolatile=false, unsigned Alignment=0); SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.185 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.186 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.185 Fri Apr 20 16:38:10 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sat Apr 21 03:16:25 2007 @@ -1448,7 +1448,7 @@ friend class SelectionDAG; LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, - const Value *SV, int O=0, unsigned Align=1, bool Vol=false) + const Value *SV, int O=0, unsigned Align=0, bool Vol=false) : SDNode(ISD::LOAD, VTs), AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { @@ -1456,6 +1456,7 @@ Ops[1] = ChainPtrOff[1]; // Ptr Ops[2] = ChainPtrOff[2]; // Off InitOperands(Ops, 3); +assert(Align != 0 Loads should have non-zero aligment); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) Only indexed load has a non-undef offset operand); @@ -1518,6 +1519,7 @@ Ops[2] = ChainValuePtrOff[2]; // Ptr Ops[3] = ChainValuePtrOff[3]; // Off InitOperands(Ops, 4); +assert(Align != 0 Stores should have non-zero aligment); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) Only indexed store has a non-undef offset operand); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.148 - 1.149 SelectionDAGNodes.h updated: 1.186 - 1.187 --- Log message: Revert Christopher Lamb's load/store alignment changes. --- Diffs of the changes: (+5 -10) SelectionDAG.h | 11 --- SelectionDAGNodes.h |4 +--- 2 files changed, 5 insertions(+), 10 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.148 llvm/include/llvm/CodeGen/SelectionDAG.h:1.149 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.148 Sat Apr 21 03:16:25 2007 +++ llvm/include/llvm/CodeGen/SelectionDAG.hSat Apr 21 13:36:27 2007 @@ -311,12 +311,10 @@ /// determined by their operands, and they produce a value AND a token chain. /// SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, -const Value *SV, int SVOffset, bool isVolatile=false, -unsigned Alignment=0); +const Value *SV, int SVOffset, bool isVolatile=false); SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, - int SVOffset, MVT::ValueType EVT, bool isVolatile=false, - unsigned Alignment=0); + int SVOffset, MVT::ValueType EVT, bool isVolatile=false); SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, @@ -325,11 +323,10 @@ /// getStore - Helper function to build ISD::STORE nodes. /// SDOperand getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, - const Value *SV, int SVOffset, bool isVolatile=false, - unsigned Alignment=0); + const Value *SV, int SVOffset, bool isVolatile=false); SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType TVT, - bool isVolatile=false, unsigned Alignment=0); + bool isVolatile=false); SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.186 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.187 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.186 Sat Apr 21 03:16:25 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sat Apr 21 13:36:27 2007 @@ -1448,7 +1448,7 @@ friend class SelectionDAG; LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, - const Value *SV, int O=0, unsigned Align=0, bool Vol=false) + const Value *SV, int O=0, unsigned Align=1, bool Vol=false) : SDNode(ISD::LOAD, VTs), AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { @@ -1456,7 +1456,6 @@ Ops[1] = ChainPtrOff[1]; // Ptr Ops[2] = ChainPtrOff[2]; // Off InitOperands(Ops, 3); -assert(Align != 0 Loads should have non-zero aligment); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) Only indexed load has a non-undef offset operand); @@ -1519,7 +1518,6 @@ Ops[2] = ChainValuePtrOff[2]; // Ptr Ops[3] = ChainValuePtrOff[3]; // Off InitOperands(Ops, 4); -assert(Align != 0 Stores should have non-zero aligment); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) Only indexed store has a non-undef offset operand); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.146 - 1.147 SelectionDAGNodes.h updated: 1.184 - 1.185 --- Log message: Implement general dynamic, initial exec and local exec TLS models for X86 32 bits. --- Diffs of the changes: (+16 -4) SelectionDAG.h |3 +++ SelectionDAGNodes.h | 17 + 2 files changed, 16 insertions(+), 4 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.146 llvm/include/llvm/CodeGen/SelectionDAG.h:1.147 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.146 Fri Jan 26 15:22:28 2007 +++ llvm/include/llvm/CodeGen/SelectionDAG.hFri Apr 20 16:38:10 2007 @@ -398,6 +398,9 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2); + SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, +MVT::ValueType VT2, MVT::ValueType VT3, +SDOperand Op1, SDOperand Op2, SDOperand Op3); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, const SDOperand *Ops, unsigned NumOps); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.184 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.185 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.184 Tue Apr 17 04:20:00 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Fri Apr 20 16:38:10 2007 @@ -19,6 +19,7 @@ #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H #define LLVM_CODEGEN_SELECTIONDAGNODES_H +#include llvm/GlobalVariable.h #include llvm/Value.h #include llvm/ADT/FoldingSet.h #include llvm/ADT/GraphTraits.h @@ -95,7 +96,8 @@ // Various leaf nodes. STRING, BasicBlock, VALUETYPE, CONDCODE, Register, Constant, ConstantFP, -GlobalAddress, FrameIndex, JumpTable, ConstantPool, ExternalSymbol, +GlobalAddress, GlobalTLSAddress, FrameIndex, +JumpTable, ConstantPool, ExternalSymbol, // The address of the GOT GLOBAL_OFFSET_TABLE, @@ -124,6 +126,7 @@ // anything else with this node, and this is valid in the target-specific // dag, turning into a GlobalAddress operand. TargetGlobalAddress, +TargetGlobalTLSAddress, TargetFrameIndex, TargetJumpTable, TargetConstantPool, @@ -1164,7 +1167,12 @@ friend class SelectionDAG; GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT, int o = 0) -: SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress, +: SDNode(dyn_castGlobalVariable(GA) + dyn_castGlobalVariable(GA)-isThreadLocal() ? + // Thread Local + (isTarget ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress) : + // Non Thread Local + (isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress), getSDVTList(VT)), Offset(o) { TheGlobal = const_castGlobalValue*(GA); } @@ -1176,11 +1184,12 @@ static bool classof(const GlobalAddressSDNode *) { return true; } static bool classof(const SDNode *N) { return N-getOpcode() == ISD::GlobalAddress || - N-getOpcode() == ISD::TargetGlobalAddress; + N-getOpcode() == ISD::TargetGlobalAddress || + N-getOpcode() == ISD::GlobalTLSAddress || + N-getOpcode() == ISD::TargetGlobalTLSAddress; } }; - class FrameIndexSDNode : public SDNode { int FI; virtual void ANCHOR(); // Out-of-line virtual method to give class a home. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Fri Apr 20 16:38:10 2007 @@ -19,6 +19,7 @@ #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H #define LLVM_CODEGEN_SELECTIONDAGNODES_H +#include llvm/GlobalVariable.h Please don't add this #include, just define the GlobalAddressSDNode ctor method out-of-line as needed. @@ -1164,7 +1167,12 @@ friend class SelectionDAG; GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT, int o = 0) -: SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress, +: SDNode(dyn_castGlobalVariable(GA) Please use isaGlobalVariable(GA) instead of dyncast because this is a predicate. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.144 - 1.145 SelectionDAGNodes.h updated: 1.161 - 1.162 --- Log message: Rename ISD::MemOpAddrMode to ISD::MemIndexedMode --- Diffs of the changes: (+14 -13) SelectionDAG.h |4 ++-- SelectionDAGNodes.h | 23 --- 2 files changed, 14 insertions(+), 13 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.144 llvm/include/llvm/CodeGen/SelectionDAG.h:1.145 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.144 Sun Nov 5 13:31:28 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hThu Nov 9 11:53:01 2006 @@ -316,7 +316,7 @@ SDOperand Chain, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType EVT, bool isVolatile=false); SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base, - SDOperand Offset, ISD::MemOpAddrMode AM); + SDOperand Offset, ISD::MemIndexedMode AM); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV); @@ -328,7 +328,7 @@ const Value *SV, int SVOffset, MVT::ValueType TVT, bool isVolatile=false); SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base, - SDOperand Offset, ISD::MemOpAddrMode AM); + SDOperand Offset, ISD::MemIndexedMode AM); // getSrcValue - construct a node to track a Value* through the backend SDOperand getSrcValue(const Value* I, int offset = 0); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.161 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.162 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.161 Fri Nov 3 01:29:55 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Thu Nov 9 11:53:01 2006 @@ -524,8 +524,8 @@ bool isBuildVectorAllZeros(const SDNode *N); //======// - /// MemOpAddrMode enum - This enum defines the three load / store addressing - /// modes. + /// MemIndexedMode enum - This enum defines the load / store indexed + /// addressing modes. /// /// UNINDEXEDNormal load / store. The effective address is already /// computed and is available in the base pointer. The offset @@ -552,12 +552,13 @@ /// computation); a post-indexed store produces one value (the /// the result of the base +/- offset computation). /// - enum MemOpAddrMode { + enum MemIndexedMode { UNINDEXED = 0, PRE_INC, PRE_DEC, POST_INC, -POST_DEC +POST_DEC, +LAST_INDEXED_MODE }; //======// @@ -865,7 +866,7 @@ /// getOperationName - Return the opcode of this operation for printing. /// const char* getOperationName(const SelectionDAG *G = 0) const; - static const char* getAddressingModeName(ISD::MemOpAddrMode AM); + static const char* getIndexedModeName(ISD::MemIndexedMode AM); void dump() const; void dump(const SelectionDAG *G) const; @@ -1383,7 +1384,7 @@ /// class LoadSDNode : public SDNode { // AddrMode - unindexed, pre-indexed, post-indexed. - ISD::MemOpAddrMode AddrMode; + ISD::MemIndexedMode AddrMode; // ExtType - non-ext, anyext, sext, zext. ISD::LoadExtType ExtType; @@ -1405,7 +1406,7 @@ protected: friend class SelectionDAG; LoadSDNode(SDOperand Chain, SDOperand Ptr, SDOperand Off, - ISD::MemOpAddrMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, + ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, const Value *SV, int O=0, unsigned Align=1, bool Vol=false) : SDNode(ISD::LOAD, Chain, Ptr, Off), AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O), @@ -1418,7 +1419,7 @@ const SDOperand getChain() const { return getOperand(0); } const SDOperand getBasePtr() const { return getOperand(1); } const SDOperand getOffset() const { return getOperand(2); } - ISD::MemOpAddrMode getAddressingMode() const { return AddrMode; } + ISD::MemIndexedMode getAddressingMode() const { return AddrMode; } ISD::LoadExtType getExtensionType() const { return ExtType; } MVT::ValueType getLoadedVT() const { return LoadedVT; } const Value *getSrcValue() const { return SrcValue; } @@ -1436,7 +1437,7 @@ /// class StoreSDNode : public SDNode { // AddrMode - unindexed, pre-indexed, post-indexed. - ISD::MemOpAddrMode AddrMode; + ISD::MemIndexedMode AddrMode; // IsTruncStore - True is the op does a truncation before store. bool IsTruncStore; @@ -1458,7 +1459,7 @@ protected: friend class SelectionDAG; StoreSDNode(SDOperand Chain, SDOperand Value, SDOperand Ptr,
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.141 - 1.142 SelectionDAGNodes.h updated: 1.157 - 1.158 --- Log message: Editorial clean up. --- Diffs of the changes: (+0 -2) SelectionDAG.h |1 - SelectionDAGNodes.h |1 - 2 files changed, 2 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.141 llvm/include/llvm/CodeGen/SelectionDAG.h:1.142 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.141 Fri Oct 27 18:46:08 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hFri Oct 27 20:34:21 2006 @@ -32,7 +32,6 @@ class MachineDebugInfo; class MachineFunction; class MachineConstantPoolValue; - class SDOperand; /// SelectionDAG class - This is used to represent a portion of an LLVM function /// in a low-level Data Dependence DAG representation suitable for instruction Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.157 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.158 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.157 Fri Oct 27 18:46:08 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Fri Oct 27 20:34:21 2006 @@ -23,7 +23,6 @@ #include llvm/ADT/FoldingSet.h #include llvm/ADT/GraphTraits.h #include llvm/ADT/iterator -#include llvm/ADT/SmallVector.h #include llvm/CodeGen/ValueTypes.h #include llvm/Support/DataTypes.h #include cassert ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.139 - 1.140 SelectionDAGNodes.h updated: 1.155 - 1.156 --- Log message: Indexed load / store changes. --- Diffs of the changes: (+18 -18) SelectionDAG.h |3 ++- SelectionDAGNodes.h | 33 - 2 files changed, 18 insertions(+), 18 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.139 llvm/include/llvm/CodeGen/SelectionDAG.h:1.140 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.139 Tue Oct 17 16:12:56 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hThu Oct 26 16:52:23 2006 @@ -314,7 +314,8 @@ SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType EVT, bool isVolatile=false); - SDOperand getPreIndexedLoad(SDOperand OrigLoad, SDOperand Base); + SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base, + SDOperand Offset, ISD::MemOpAddrMode AM); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.155 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.156 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.155 Tue Oct 17 16:12:56 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Thu Oct 26 16:52:24 2006 @@ -370,9 +370,10 @@ // operations. FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, -// Other operators. LOAD and STORE have token chains as their first -// operand, then the same operands as an LLVM load/store instruction, then a -// SRCVALUE node that provides alias analysis information. +// LOAD and STORE have token chains as their first operand, then the same +// operands as an LLVM load/store instruction, then an offset node that +// is added / subtracted from the base pointer to form the address (for +// indexed memory ops). LOAD, STORE, // Abstract vector version of LOAD. VLOAD has a constant element count as @@ -529,8 +530,8 @@ /// load); an unindexed store does not produces a value. /// /// PRE_INC Similar to the unindexed mode where the effective address is - /// PRE_DEC the result of computation of the base pointer. However, it - /// considers the computation as being folded into the load / + /// PRE_DEC the value of the base pointer add / subtract the offset. + /// It considers the computation as being folded into the load / /// store operation (i.e. the load / store does the address /// computation as well as performing the memory transaction). /// The base operand is always undefined. In addition to @@ -540,12 +541,12 @@ /// of the address computation). /// /// POST_INC The effective address is the value of the base pointer. The - /// POST_DEC value of the offset operand is then added to the base after - /// memory transaction. In addition to producing a chain, - /// post-indexed load produces two values (the result of the load - /// and the result of the base + offset computation); a - /// post-indexed store produces one value (the the result of the - /// base + offset computation). + /// POST_DEC value of the offset operand is then added to / subtracted + /// from the base after memory transaction. In addition to + /// producing a chain, post-indexed load produces two values + /// (the result of the load and the result of the base +/- offset + /// computation); a post-indexed store produces one value (the + /// the result of the base +/- offset computation). /// enum MemOpAddrMode { UNINDEXED = 0, @@ -1408,9 +1409,8 @@ : SDNode(ISD::LOAD, Chain, Ptr, Off), AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { -assert((Off.getOpcode() == ISD::UNDEF || -AddrMode == ISD::POST_INC || AddrMode == ISD::POST_DEC) - Only post-indexed load has a non-undef offset operand); +assert((Off.getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) + Only indexed load has a non-undef offset operand); } public: @@ -1462,9 +1462,8 @@ : SDNode(ISD::STORE, Chain, Value, Ptr, Off), AddrMode(AM), IsTruncStore(isTrunc), StoredVT(SVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { -assert((Off.getOpcode() == ISD::UNDEF || -AddrMode == ISD::POST_INC || AddrMode == ISD::POST_DEC) - Only post-indexed store has a non-undef offset
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.138 - 1.139 SelectionDAGNodes.h updated: 1.154 - 1.155 --- Log message: Split PRE_INDEXED to PRE_INC / PRE_DEC and similarly for POST_INDEXED. --- Diffs of the changes: (+14 -8) SelectionDAG.h |1 + SelectionDAGNodes.h | 21 + 2 files changed, 14 insertions(+), 8 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.138 llvm/include/llvm/CodeGen/SelectionDAG.h:1.139 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.138 Mon Oct 16 15:52:31 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hTue Oct 17 16:12:56 2006 @@ -314,6 +314,7 @@ SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType EVT, bool isVolatile=false); + SDOperand getPreIndexedLoad(SDOperand OrigLoad, SDOperand Base); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.154 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.155 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.154 Fri Oct 13 16:08:54 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Oct 17 16:12:56 2006 @@ -528,8 +528,8 @@ /// chain, an unindexed load produces one value (result of the /// load); an unindexed store does not produces a value. /// - /// PRE_INDEXED Similar to the unindexed mode where the effective address is - /// the result of computation of the base pointer. However, it + /// PRE_INC Similar to the unindexed mode where the effective address is + /// PRE_DEC the result of computation of the base pointer. However, it /// considers the computation as being folded into the load / /// store operation (i.e. the load / store does the address /// computation as well as performing the memory transaction). @@ -539,8 +539,8 @@ /// computation); a pre-indexed store produces one value (result /// of the address computation). /// - /// POST_INDEXED The effective address is the value of the base pointer. The - /// value of the offset operand is then added to the base after + /// POST_INC The effective address is the value of the base pointer. The + /// POST_DEC value of the offset operand is then added to the base after /// memory transaction. In addition to producing a chain, /// post-indexed load produces two values (the result of the load /// and the result of the base + offset computation); a @@ -549,8 +549,10 @@ /// enum MemOpAddrMode { UNINDEXED = 0, -PRE_INDEXED, -POST_INDEXED +PRE_INC, +PRE_DEC, +POST_INC, +POST_DEC }; //======// @@ -854,6 +856,7 @@ /// getOperationName - Return the opcode of this operation for printing. /// const char* getOperationName(const SelectionDAG *G = 0) const; + static const char* getAddressingModeName(ISD::MemOpAddrMode AM); void dump() const; void dump(const SelectionDAG *G) const; @@ -1405,7 +1408,8 @@ : SDNode(ISD::LOAD, Chain, Ptr, Off), AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { -assert((Off.getOpcode() == ISD::UNDEF || AddrMode == ISD::POST_INDEXED) +assert((Off.getOpcode() == ISD::UNDEF || +AddrMode == ISD::POST_INC || AddrMode == ISD::POST_DEC) Only post-indexed load has a non-undef offset operand); } public: @@ -1458,7 +1462,8 @@ : SDNode(ISD::STORE, Chain, Value, Ptr, Off), AddrMode(AM), IsTruncStore(isTrunc), StoredVT(SVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { -assert((Off.getOpcode() == ISD::UNDEF || AddrMode == ISD::POST_INDEXED) +assert((Off.getOpcode() == ISD::UNDEF || +AddrMode == ISD::POST_INC || AddrMode == ISD::POST_DEC) Only post-indexed store has a non-undef offset operand); } public: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.135 - 1.136 SelectionDAGNodes.h updated: 1.153 - 1.154 --- Log message: Merge ISD::TRUNCSTORE to ISD::STORE. Switch to using StoreSDNode. --- Diffs of the changes: (+23 -14) SelectionDAG.h |5 - SelectionDAGNodes.h | 32 +++- 2 files changed, 23 insertions(+), 14 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.135 llvm/include/llvm/CodeGen/SelectionDAG.h:1.136 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.135 Thu Oct 12 15:33:14 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hFri Oct 13 16:08:54 2006 @@ -319,7 +319,10 @@ /// getStore - Helper function to build ISD::STORE nodes. /// SDOperand getStore(SDOperand Chain, SDOperand Value, SDOperand Ptr, - SDOperand SV); + const Value *SV, int SVOffset, bool isVolatile=false); + SDOperand getTruncStore(SDOperand Chain, SDOperand Value, SDOperand Ptr, + const Value *SV, int SVOffset, MVT::ValueType TVT, + bool isVolatile=false); // getSrcValue - construct a node to track a Value* through the backend SDOperand getSrcValue(const Value* I, int offset = 0); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.153 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.154 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.153 Wed Oct 11 02:08:53 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Fri Oct 13 16:08:54 2006 @@ -1408,15 +1408,6 @@ assert((Off.getOpcode() == ISD::UNDEF || AddrMode == ISD::POST_INDEXED) Only post-indexed load has a non-undef offset operand); } - LoadSDNode(SDOperand Chain, SDOperand Ptr, SDOperand Off, - ISD::LoadExtType ETy, MVT::ValueType LVT, - const Value *SV, int O=0, unsigned Align=1, bool Vol=false) -: SDNode(ISD::LOAD, Chain, Ptr, Off), - AddrMode(ISD::UNINDEXED), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), - SVOffset(O), Alignment(Align), IsVolatile(Vol) { -assert((Off.getOpcode() == ISD::UNDEF || AddrMode == ISD::POST_INDEXED) - Only post-indexed load has a non-undef offset operand); - } public: const SDOperand getChain() const { return getOperand(0); } @@ -1461,10 +1452,10 @@ bool IsVolatile; protected: friend class SelectionDAG; - StoreSDNode(SDOperand Chain, SDOperand Ptr, SDOperand Off, + StoreSDNode(SDOperand Chain, SDOperand Value, SDOperand Ptr, SDOperand Off, ISD::MemOpAddrMode AM, bool isTrunc, MVT::ValueType SVT, const Value *SV, int O=0, unsigned Align=0, bool Vol=false) -: SDNode(ISD::STORE, Chain, Ptr, Off), +: SDNode(ISD::STORE, Chain, Value, Ptr, Off), AddrMode(AM), IsTruncStore(isTrunc), StoredVT(SVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { assert((Off.getOpcode() == ISD::UNDEF || AddrMode == ISD::POST_INDEXED) @@ -1473,8 +1464,9 @@ public: const SDOperand getChain() const { return getOperand(0); } - const SDOperand getBasePtr() const { return getOperand(1); } - const SDOperand getOffset() const { return getOperand(2); } + const SDOperand getValue() const { return getOperand(1); } + const SDOperand getBasePtr() const { return getOperand(2); } + const SDOperand getOffset() const { return getOperand(3); } ISD::MemOpAddrMode getAddressingMode() const { return AddrMode; } bool isTruncatingStore() const { return IsTruncStore; } MVT::ValueType getStoredVT() const { return StoredVT; } @@ -1591,6 +1583,20 @@ return N-getOpcode() == ISD::LOAD castLoadSDNode(N)-getExtensionType() == ISD::ZEXTLOAD; } + + /// isNON_TRUNCStore - Returns true if the specified node is a non-truncating + /// store. + inline bool isNON_TRUNCStore(const SDNode *N) { +return N-getOpcode() == ISD::STORE + !castStoreSDNode(N)-isTruncatingStore(); + } + + /// isTRUNCStore - Returns true if the specified node is a truncating + /// store. + inline bool isTRUNCStore(const SDNode *N) { +return N-getOpcode() == ISD::STORE + castStoreSDNode(N)-isTruncatingStore(); + } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.133 - 1.134 SelectionDAGNodes.h updated: 1.149 - 1.150 --- Log message: Merging ISD::LOAD and ISD::LOADX. Added LoadSDNode to represent load nodes. Chain and address ptr remains as operands. SrcValue, extending mode, extending VT (or rather loaded VT before extension) are now instance variables of LoadSDNode. Introduce load / store addressing modes to represent pre- and post-indexed load and store. Also added an additional operand offset that is only used in post-indexed mode (i.e. base ptr += offset after load/store). Added alignment info (not yet used) and isVolatile fields. --- Diffs of the changes: (+148 -25) SelectionDAG.h |8 +- SelectionDAGNodes.h | 165 +--- 2 files changed, 148 insertions(+), 25 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.133 llvm/include/llvm/CodeGen/SelectionDAG.h:1.134 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.133 Thu Oct 5 17:54:31 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Oct 9 15:55:20 2006 @@ -300,12 +300,12 @@ /// determined by their operands, and they produce a value AND a token chain. /// SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, -SDOperand SV); +const Value *SV, int SVOffset, bool isVolatile=false); + SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, + SDOperand Chain, SDOperand Ptr, const Value *SV, + int SVOffset, MVT::ValueType EVT, bool isVolatile=false); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV); - SDOperand getExtLoad(ISD::LoadExtType LType, MVT::ValueType VT, - SDOperand Chain, SDOperand Ptr, SDOperand SV, - MVT::ValueType EVT); /// getStore - Helper function to build ISD::STORE nodes. /// Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.149 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.150 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.149 Tue Oct 3 19:50:21 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Oct 9 15:55:20 2006 @@ -380,21 +380,6 @@ // the elements, a token chain, a pointer operand, and a SRCVALUE node. VLOAD, -// Load a value from memory and extend them to a larger value (e.g. load a -// byte into a word register). All three of these have four operands, a -// token chain, a pointer to load from, a SRCVALUE for alias analysis, a -// VALUETYPE node indicating the type to load, and an enum indicating what -// sub-type of LOADX it is: -// -// SEXTLOAD loads the integer operand and sign extends it to a larger -// integer result type. -// ZEXTLOAD loads the integer operand and zero extends it to a larger -// integer result type. -// EXTLOAD is used for three things: floating point extending loads, -// integer extending loads [the top bits are undefined], and vector -// extending loads [load into low elt]. -LOADX, - // TRUNCSTORE - This operators truncates (for integer) or rounds (for FP) a // value and stores it to memory in one operation. This can be used for // either integer or floating point operands. The first four operands of @@ -534,10 +519,52 @@ bool isBuildVectorAllZeros(const SDNode *N); //======// + /// MemOpAddrMode enum - This enum defines the three load / store addressing + /// modes. + /// + /// UNINDEXEDNormal load / store. The effective address is already + /// computed and is available in the base pointer. The offset + /// operand is always undefined. An unindexed load produces one + /// value (result of the load); an unindexed store does not + /// produces a value. + /// + /// PRE_INDEXED Similar to the unindexed mode where the effective address is + /// the result of computation of the base pointer. However, it + /// considers the computation as being folded into the load / + /// store operation (i.e. the load / store does the address + /// computation as well as performing the memory transaction). + /// The base operand is always undefined. A pre-indexed load + /// produces two values (result of the load and the result of + /// the address computation); a pre-indexed store produces one + /// value (result of the address computation). + /// + /// POST_INDEXED The effective address is the value of the base pointer. The + /// value of the offset
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.131 - 1.132 SelectionDAGNodes.h updated: 1.148 - 1.149 --- Log message: Combine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add an extra operand to LOADX to specify the exact value extension type. --- Diffs of the changes: (+53 -8) SelectionDAG.h |5 ++-- SelectionDAGNodes.h | 56 ++-- 2 files changed, 53 insertions(+), 8 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.131 llvm/include/llvm/CodeGen/SelectionDAG.h:1.132 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.131 Mon Oct 2 07:26:53 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hTue Oct 3 19:50:21 2006 @@ -303,8 +303,9 @@ SDOperand SV); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV); - SDOperand getExtLoad(unsigned Opcode, MVT::ValueType VT, SDOperand Chain, - SDOperand Ptr, SDOperand SV, MVT::ValueType EVT); + SDOperand getExtLoad(ISD::LoadExtType LType, MVT::ValueType VT, + SDOperand Chain, SDOperand Ptr, SDOperand SV, + MVT::ValueType EVT); // getSrcValue - construct a node to track a Value* through the backend SDOperand getSrcValue(const Value* I, int offset = 0); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.148 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.149 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.148 Sun Sep 24 14:43:29 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Oct 3 19:50:21 2006 @@ -380,11 +380,11 @@ // the elements, a token chain, a pointer operand, and a SRCVALUE node. VLOAD, -// EXTLOAD, SEXTLOAD, ZEXTLOAD - These three operators all load a value from -// memory and extend them to a larger value (e.g. load a byte into a word -// register). All three of these have four operands, a token chain, a -// pointer to load from, a SRCVALUE for alias analysis, and a VALUETYPE node -// indicating the type to load. +// Load a value from memory and extend them to a larger value (e.g. load a +// byte into a word register). All three of these have four operands, a +// token chain, a pointer to load from, a SRCVALUE for alias analysis, a +// VALUETYPE node indicating the type to load, and an enum indicating what +// sub-type of LOADX it is: // // SEXTLOAD loads the integer operand and sign extends it to a larger // integer result type. @@ -393,7 +393,7 @@ // EXTLOAD is used for three things: floating point extending loads, // integer extending loads [the top bits are undefined], and vector // extending loads [load into low elt]. -EXTLOAD, SEXTLOAD, ZEXTLOAD, +LOADX, // TRUNCSTORE - This operators truncates (for integer) or rounds (for FP) a // value and stores it to memory in one operation. This can be used for @@ -534,6 +534,17 @@ bool isBuildVectorAllZeros(const SDNode *N); //======// + /// LoadExtType enum - This enum defines the three variants of LOADEXT + /// (load with extension). + /// + enum LoadExtType { +EXTLOAD, +SEXTLOAD, +ZEXTLOAD, +LAST_LOADX_TYPE + }; + + //======// /// ISD::CondCode enum - These are ordered carefully to make the bitfields /// below work out, when considering SETFALSE (something that never exists /// dynamically) as 0. U - Unsigned (for integer operands) or Unordered @@ -671,6 +682,7 @@ inline unsigned getOpcode() const; inline unsigned getNumOperands() const; inline const SDOperand getOperand(unsigned i) const; + inline uint64_t getConstantOperandVal(unsigned i) const; inline bool isTargetOpcode() const; inline unsigned getTargetOpcode() const; @@ -775,10 +787,15 @@ /// unsigned getNumOperands() const { return NumOperands; } + /// getConstantOperandVal - Helper method returns the integer value of a + /// ConstantSDNode operand. + uint64_t getConstantOperandVal(unsigned Num) const; + const SDOperand getOperand(unsigned Num) const { assert(Num NumOperands Invalid child # of SDNode!); return OperandList[Num]; } + typedef const SDOperand* op_iterator; op_iterator op_begin() const { return OperandList; } op_iterator op_end() const { return OperandList+NumOperands; } @@ -997,6 +1014,9 @@ inline const SDOperand SDOperand::getOperand(unsigned i) const { return Val-getOperand(i); } +inline uint64_t SDOperand::getConstantOperandVal(unsigned i) const { + return Val-getConstantOperandVal(i); +} inline bool SDOperand::isTargetOpcode() const {
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.126 - 1.127 SelectionDAGNodes.h updated: 1.143 - 1.144 --- Log message: Eliminate SelectNodeTo() and getTargetNode() variants which take more than 3 SDOperand operands. They are replaced by versions which take an array of SDOperand and the number of operands. --- Diffs of the changes: (+16 -142) SelectionDAG.h | 76 SelectionDAGNodes.h | 82 +--- 2 files changed, 16 insertions(+), 142 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.126 llvm/include/llvm/CodeGen/SelectionDAG.h:1.127 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.126 Sat Aug 26 02:55:35 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hSun Aug 27 03:07:55 2006 @@ -311,34 +311,14 @@ SDOperand Op1, SDOperand Op2); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, +const SDOperand *Ops, unsigned NumOps); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5); + /// getTargetNode - These are used for target selectors to create a new node /// with specified return type(s), target opcode, and operands. @@ -354,23 +334,6 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, -SDOperand Op1, SDOperand Op2, SDOperand Op3, -SDOperand Op4); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, -SDOperand Op1, SDOperand Op2, SDOperand Op3, -SDOperand Op4, SDOperand Op5); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, -SDOperand Op1, SDOperand Op2, SDOperand Op3, -SDOperand Op4, SDOperand Op5, SDOperand Op6); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, -SDOperand Op1, SDOperand Op2, SDOperand Op3, -SDOperand Op4, SDOperand Op5, SDOperand Op6, -SDOperand Op7); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, -SDOperand Op1, SDOperand Op2, SDOperand Op3, -SDOperand Op4, SDOperand Op5, SDOperand Op6, -SDOperand Op7, SDOperand Op8); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, const SDOperand *Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1); @@ -379,39 +342,14 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *getTargetNode(unsigned Opcode,
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.123 - 1.124 SelectionDAGNodes.h updated: 1.142 - 1.143 --- Log message: Change the use_list to be a smallvector instead of a vector. This reduces isel time from 6.79s to 5.53s (22%) on kc++ with a release build on ppc. Go smallvector! :) --- Diffs of the changes: (+4 -3) SelectionDAG.h |1 + SelectionDAGNodes.h |6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.123 llvm/include/llvm/CodeGen/SelectionDAG.h:1.124 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.123 Tue Aug 15 14:11:05 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hWed Aug 16 16:01:10 2006 @@ -20,6 +20,7 @@ #include llvm/ADT/ilist #include list +#include vector #include map #include set #include string Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.142 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.143 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.142 Tue Aug 15 14:11:05 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Wed Aug 16 16:01:10 2006 @@ -23,9 +23,9 @@ #include llvm/Value.h #include llvm/ADT/GraphTraits.h #include llvm/ADT/iterator +#include llvm/ADT/SmallVector.h #include llvm/Support/DataTypes.h #include cassert -#include vector namespace llvm { @@ -722,7 +722,7 @@ /// Uses - These are all of the SDNode's that use a value produced by this /// node. - std::vectorSDNode* Uses; + SmallVectorSDNode*,3 Uses; // Out-of-line virtual method to give class a home. virtual void ANCHOR(); @@ -751,7 +751,7 @@ /// int getNodeId() const { return NodeId; } - typedef std::vectorSDNode*::const_iterator use_iterator; + typedef SmallVectorSDNode*,3::const_iterator use_iterator; use_iterator use_begin() const { return Uses.begin(); } use_iterator use_end() const { return Uses.end(); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.119 - 1.120 SelectionDAGNodes.h updated: 1.140 - 1.141 --- Log message: Add a new getNode() method that takes a pointer to an already-intern'd list of value-type nodes. This avoids having to do mallocs for std::vectors of valuetypes when a node returns more than one type. --- Diffs of the changes: (+18 -25) SelectionDAG.h | 39 --- SelectionDAGNodes.h |4 ++-- 2 files changed, 18 insertions(+), 25 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.119 llvm/include/llvm/CodeGen/SelectionDAG.h:1.120 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.119 Mon Aug 14 17:24:39 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Aug 14 18:31:51 2006 @@ -155,29 +155,23 @@ // null) and that there should be a flag result. SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N, SDOperand Flag) { -std::vectorMVT::ValueType VTs; -VTs.push_back(MVT::Other); -VTs.push_back(MVT::Flag); +const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag); SDOperand Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag }; -return getNode(ISD::CopyToReg, VTs, Ops, Flag.Val ? 4 : 3); +return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3); } // Similar to last getCopyToReg() except parameter Reg is a SDOperand SDOperand getCopyToReg(SDOperand Chain, SDOperand Reg, SDOperand N, SDOperand Flag) { -std::vectorMVT::ValueType VTs; -VTs.push_back(MVT::Other); -VTs.push_back(MVT::Flag); +const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag); SDOperand Ops[] = { Chain, Reg, N, Flag }; -return getNode(ISD::CopyToReg, VTs, Ops, Flag.Val ? 4 : 3); +return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3); } SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) { -std::vectorMVT::ValueType ResultTys; -ResultTys.push_back(VT); -ResultTys.push_back(MVT::Other); +const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); SDOperand Ops[] = { Chain, getRegister(Reg, VT) }; -return getNode(ISD::CopyFromReg, ResultTys, Ops, 2); +return getNode(ISD::CopyFromReg, VTs, 2, Ops, 2); } // This version of the getCopyFromReg method takes an extra operand, which @@ -185,12 +179,9 @@ // null) and that there should be a flag result. SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT, SDOperand Flag) { -std::vectorMVT::ValueType ResultTys; -ResultTys.push_back(VT); -ResultTys.push_back(MVT::Other); -ResultTys.push_back(MVT::Flag); +const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag); SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag }; -return getNode(ISD::CopyFromReg, ResultTys, Ops, Flag.Val ? 3 : 2); +return getNode(ISD::CopyFromReg, VTs, 3, Ops, Flag.Val ? 3 : 2); } SDOperand getCondCode(ISD::CondCode Cond); @@ -202,11 +193,9 @@ /// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must have /// a flag result (to ensure it's not CSE'd). SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) { -std::vectorMVT::ValueType ResultTys; -ResultTys.push_back(MVT::Other); -ResultTys.push_back(MVT::Flag); +const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag); SDOperand Ops[] = { Chain, Op }; -return getNode(ISD::CALLSEQ_START, ResultTys, Ops, 2); +return getNode(ISD::CALLSEQ_START, VTs, 2, Ops, 2); } /// getNode - Gets or creates the specified node. @@ -226,6 +215,8 @@ const SDOperand *Ops, unsigned NumOps); SDOperand getNode(unsigned Opcode, std::vectorMVT::ValueType ResultTys, const SDOperand *Ops, unsigned NumOps); + SDOperand getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs, +const SDOperand *Ops, unsigned NumOps); /// getSetCC - Helper function to make it easier to build SetCC's if you just /// have an ISD::CondCode instead of an SDOperand. @@ -240,8 +231,8 @@ /// SDOperand getSelectCC(SDOperand LHS, SDOperand RHS, SDOperand True, SDOperand False, ISD::CondCode Cond) { -MVT::ValueType VT = True.getValueType(); -return getNode(ISD::SELECT_CC, VT, LHS, RHS, True, False,getCondCode(Cond)); +return getNode(ISD::SELECT_CC, True.getValueType(), LHS, RHS, True, False, + getCondCode(Cond)); } /// getVAArg - VAArg produces a result and token chain, and takes a pointer @@ -443,6 +434,8 @@ void DeleteNodeNotInCSEMaps(SDNode *N); MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1); MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.108 - 1.109 SelectionDAGNodes.h updated: 1.137 - 1.138 --- Log message: Revamp the CSEMap datastructure used in the SelectionDAG class. This eliminates a bunch of std::map's in the SelectionDAG, replacing them with a home-grown hashtable. This is still a work in progress: not all the maps have been moved over and the hashtable never resizes. That said, this still speeds up llc 20% on kimwitu++ with -fast -regalloc=local using a release build. --- Diffs of the changes: (+24 -24) SelectionDAG.h | 29 ++--- SelectionDAGNodes.h | 19 ++- 2 files changed, 24 insertions(+), 24 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.108 llvm/include/llvm/CodeGen/SelectionDAG.h:1.109 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.108 Fri Aug 4 12:45:20 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Aug 7 18:03:03 2006 @@ -16,6 +16,7 @@ #define LLVM_CODEGEN_SELECTIONDAG_H #include llvm/CodeGen/SelectionDAGNodes.h +#include llvm/CodeGen/SelectionDAGCSEMap.h #include llvm/ADT/ilist #include list @@ -441,13 +442,16 @@ private: void RemoveNodeFromCSEMaps(SDNode *N); SDNode *AddNonLeafNodeToCSEMaps(SDNode *N); - SDNode **FindModifiedNodeSlot(SDNode *N, SDOperand Op); - SDNode **FindModifiedNodeSlot(SDNode *N, SDOperand Op1, SDOperand Op2); - SDNode **FindModifiedNodeSlot(SDNode *N, const std::vectorSDOperand Ops); + SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op, void *InsertPos); + SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op1, SDOperand Op2, + void *InsertPos); + SDNode *FindModifiedNodeSlot(SDNode *N, const std::vectorSDOperand Ops, + void *InsertPos); void DeleteNodeNotInCSEMaps(SDNode *N); - void setNodeValueTypes(SDNode *N, std::vectorMVT::ValueType RetVals); - void setNodeValueTypes(SDNode *N, MVT::ValueType VT1, MVT::ValueType VT2); + MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1); + MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2); + MVT::ValueType *getNodeValueTypes(std::vectorMVT::ValueType RetVals); /// SimplifySetCC - Try to simplify a setcc built with the specified operands @@ -460,17 +464,10 @@ // Maps to auto-CSE operations. std::mapstd::pairunsigned, MVT::ValueType, SDNode * NullaryOps; - std::mapstd::pairunsigned, std::pairSDOperand, MVT::ValueType , - SDNode * UnaryOps; - std::mapstd::pairunsigned, std::pairSDOperand, SDOperand , - SDNode * BinaryOps; std::mapstd::pairunsigned, MVT::ValueType, RegisterSDNode* RegNodes; std::vectorCondCodeSDNode* CondCodeNodes; - std::mapstd::pairSDOperand, std::pairSDOperand, MVT::ValueType , - SDNode * Loads; - std::mapstd::pairconst GlobalValue*, int, SDNode* GlobalValues; std::mapstd::pairconst GlobalValue*, int, SDNode* TargetGlobalValues; std::mapstd::pairuint64_t, MVT::ValueType, SDNode* Constants; @@ -488,13 +485,7 @@ std::mapstd::string, SDNode* ExternalSymbols; std::mapstd::string, SDNode* TargetExternalSymbols; std::mapstd::string, StringSDNode* StringNodes; - std::mapstd::pairunsigned, - std::pairMVT::ValueType, std::vectorSDOperand , - SDNode* OneResultNodes; - std::mapstd::pairunsigned, - std::pairstd::vectorMVT::ValueType, - std::vectorSDOperand , - SDNode* ArbitraryNodes; + SelectionDAGCSEMap CSEMap; }; template struct GraphTraitsSelectionDAG* : public GraphTraitsSDNode* { Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.137 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.138 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.137 Thu Jul 27 01:38:21 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Aug 7 18:03:03 2006 @@ -707,6 +707,9 @@ SDNode *Prev, *Next; friend struct ilist_traitsSDNode; + /// NextInBucket - This is used by the SelectionDAGCSEMap. + void *NextInBucket; + /// Uses - These are all of the SDNode's that use a value produced by this /// node. std::vectorSDNode* Uses; @@ -789,6 +792,11 @@ static bool classof(const SDNode *) { return true; } + + /// NextInBucket accessors, these are private to SelectionDAGCSEMap. + void *getNextInBucket() const { return NextInBucket; } + void SetNextInBucket(void *N) { NextInBucket = N; } + protected: friend class SelectionDAG; @@ -801,6 +809,7 @@ ValueList = getValueTypeList(VT); NumValues = 1; Prev = 0; Next = 0; +NextInBucket = 0; } SDNode(unsigned NT, SDOperand Op) : NodeType(NT), NodeId(-1) { @@ -811,6 +820,7 @@ ValueList = 0; NumValues = 0; Prev = 0; Next = 0; +NextInBucket = 0; } SDNode(unsigned NT,
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.109 - 1.110 SelectionDAGNodes.h updated: 1.138 - 1.139 --- Log message: Eliminate some malloc traffic by allocating vectors on the stack. Change some method that took std::vectorSDOperand to take a pointer to a first operand and #operands. This speeds up isel on kc++ by about 3%. --- Diffs of the changes: (+18 -19) SelectionDAG.h | 29 ++--- SelectionDAGNodes.h |8 2 files changed, 18 insertions(+), 19 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.109 llvm/include/llvm/CodeGen/SelectionDAG.h:1.110 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.109 Mon Aug 7 18:03:03 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Aug 7 20:09:31 2006 @@ -171,10 +171,8 @@ std::vectorMVT::ValueType ResultTys; ResultTys.push_back(VT); ResultTys.push_back(MVT::Other); -std::vectorSDOperand Ops; -Ops.push_back(Chain); -Ops.push_back(getRegister(Reg, VT)); -return getNode(ISD::CopyFromReg, ResultTys, Ops); +SDOperand Ops[] = { Chain, getRegister(Reg, VT) }; +return getNode(ISD::CopyFromReg, ResultTys, Ops, 2); } // This version of the getCopyFromReg method takes an extra operand, which @@ -186,11 +184,8 @@ ResultTys.push_back(VT); ResultTys.push_back(MVT::Other); ResultTys.push_back(MVT::Flag); -std::vectorSDOperand Ops; -Ops.push_back(Chain); -Ops.push_back(getRegister(Reg, VT)); -if (Flag.Val) Ops.push_back(Flag); -return getNode(ISD::CopyFromReg, ResultTys, Ops); +SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag }; +return getNode(ISD::CopyFromReg, ResultTys, Ops, Flag.Val ? 3 : 2); } SDOperand getCondCode(ISD::CondCode Cond); @@ -205,10 +200,8 @@ std::vectorMVT::ValueType ResultTys; ResultTys.push_back(MVT::Other); ResultTys.push_back(MVT::Flag); -std::vectorSDOperand Ops; -Ops.push_back(Chain); -Ops.push_back(Op); -return getNode(ISD::CALLSEQ_START, ResultTys, Ops); +SDOperand Ops[] = { Chain, Op }; +return getNode(ISD::CALLSEQ_START, ResultTys, Ops, 2); } /// getNode - Gets or creates the specified node. @@ -229,6 +222,12 @@ SDOperand getNode(unsigned Opcode, std::vectorMVT::ValueType ResultTys, std::vectorSDOperand Ops); + SDOperand getNode(unsigned Opcode, MVT::ValueType VT, +const SDOperand *Ops, unsigned NumOps); + SDOperand getNode(unsigned Opcode, std::vectorMVT::ValueType ResultTys, +const SDOperand *Ops, unsigned NumOps); + + /// getSetCC - Helper function to make it easier to build SetCC's if you just /// have an ISD::CondCode instead of an SDOperand. /// @@ -278,7 +277,7 @@ SDOperand Op3, SDOperand Op4); SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5); - SDOperand UpdateNodeOperands(SDOperand N, const std::vectorSDOperand Op); + SDOperand UpdateNodeOperands(SDOperand N, SDOperand *Ops, unsigned NumOps); /// SelectNodeTo - These are used for target selectors to *mutate* the /// specified node to have the specified return type, Target opcode, and @@ -445,7 +444,7 @@ SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op, void *InsertPos); SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op1, SDOperand Op2, void *InsertPos); - SDNode *FindModifiedNodeSlot(SDNode *N, const std::vectorSDOperand Ops, + SDNode *FindModifiedNodeSlot(SDNode *N, const SDOperand *Ops, unsigned NumOps, void *InsertPos); void DeleteNodeNotInCSEMaps(SDNode *N); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.138 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.139 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.138 Mon Aug 7 18:03:03 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Aug 7 20:09:31 2006 @@ -865,13 +865,13 @@ Prev = 0; Next = 0; NextInBucket = 0; } - SDNode(unsigned Opc, const std::vectorSDOperand Nodes) + SDNode(unsigned Opc, const SDOperand *Ops, unsigned NumOps) : NodeType(Opc), NodeId(-1) { -NumOperands = Nodes.size(); +NumOperands = NumOps; OperandList = new SDOperand[NumOperands]; -for (unsigned i = 0, e = Nodes.size(); i != e; ++i) { - OperandList[i] = Nodes[i]; +for (unsigned i = 0, e = NumOps; i != e; ++i) { + OperandList[i] = Ops[i]; SDNode *N = OperandList[i].Val; N-Uses.push_back(this); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.102 - 1.103 SelectionDAGNodes.h updated: 1.136 - 1.137 --- Log message: Remove NodeDepth; Add NodeId which is a unique id per node per DAG. It can only be set by SelectionDAG. --- Diffs of the changes: (+21 -41) SelectionDAG.h |6 - SelectionDAGNodes.h | 56 ++-- 2 files changed, 21 insertions(+), 41 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.102 llvm/include/llvm/CodeGen/SelectionDAG.h:1.103 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.102 Thu Jun 29 18:57:05 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hThu Jul 27 01:38:21 2006 @@ -421,7 +421,11 @@ /// DeleteNode - Remove the specified node from the system. This node must /// have no referrers. void DeleteNode(SDNode *N); - + + /// AssignNodeIds - Assign a unique node id for each node in the DAG. It + /// returns the maximum id. + int AssignNodeIds(); + void dump() const; /// InsertISelMapEntry - A helper function to insert a key / element pair Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.136 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.137 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.136 Tue Jul 18 19:00:37 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Thu Jul 27 01:38:21 2006 @@ -654,7 +654,6 @@ // Forwarding methods - These forward to the corresponding methods in SDNode. inline unsigned getOpcode() const; - inline unsigned getNodeDepth() const; inline unsigned getNumOperands() const; inline const SDOperand getOperand(unsigned i) const; inline bool isTargetOpcode() const; @@ -689,10 +688,8 @@ /// unsigned short NodeType; - /// NodeDepth - Node depth is defined as MAX(Node depth of children)+1. This - /// means that leaves have a depth of 1, things that use only leaves have a - /// depth of 2, etc. - unsigned short NodeDepth; + /// NodeId - Unique id per SDNode in the DAG. + int NodeId; /// OperandList - The values that are used by this operation. /// @@ -736,9 +733,9 @@ bool use_empty() const { return Uses.empty(); } bool hasOneUse() const { return Uses.size() == 1; } - /// getNodeDepth - Return the distance from this node to the leaves in the - /// graph. The leaves have a depth of 1. - unsigned getNodeDepth() const { return NodeDepth; } + /// getNodeId - Return the unique node id. + /// + int getNodeId() const { return NodeId; } typedef std::vectorSDNode*::const_iterator use_iterator; use_iterator use_begin() const { return Uses.begin(); } @@ -799,14 +796,14 @@ /// static MVT::ValueType *getValueTypeList(MVT::ValueType VT); - SDNode(unsigned NT, MVT::ValueType VT) : NodeType(NT), NodeDepth(1) { + SDNode(unsigned NT, MVT::ValueType VT) : NodeType(NT), NodeId(-1) { OperandList = 0; NumOperands = 0; ValueList = getValueTypeList(VT); NumValues = 1; Prev = 0; Next = 0; } SDNode(unsigned NT, SDOperand Op) -: NodeType(NT), NodeDepth(Op.Val-getNodeDepth()+1) { +: NodeType(NT), NodeId(-1) { OperandList = new SDOperand[1]; OperandList[0] = Op; NumOperands = 1; @@ -816,11 +813,7 @@ Prev = 0; Next = 0; } SDNode(unsigned NT, SDOperand N1, SDOperand N2) -: NodeType(NT) { -if (N1.Val-getNodeDepth() N2.Val-getNodeDepth()) - NodeDepth = N1.Val-getNodeDepth()+1; -else - NodeDepth = N2.Val-getNodeDepth()+1; +: NodeType(NT), NodeId(-1) { OperandList = new SDOperand[2]; OperandList[0] = N1; OperandList[1] = N2; @@ -831,14 +824,7 @@ Prev = 0; Next = 0; } SDNode(unsigned NT, SDOperand N1, SDOperand N2, SDOperand N3) -: NodeType(NT) { -unsigned ND = N1.Val-getNodeDepth(); -if (ND N2.Val-getNodeDepth()) - ND = N2.Val-getNodeDepth(); -if (ND N3.Val-getNodeDepth()) - ND = N3.Val-getNodeDepth(); -NodeDepth = ND+1; - +: NodeType(NT), NodeId(-1) { OperandList = new SDOperand[3]; OperandList[0] = N1; OperandList[1] = N2; @@ -852,16 +838,7 @@ Prev = 0; Next = 0; } SDNode(unsigned NT, SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4) -: NodeType(NT) { -unsigned ND = N1.Val-getNodeDepth(); -if (ND N2.Val-getNodeDepth()) - ND = N2.Val-getNodeDepth(); -if (ND N3.Val-getNodeDepth()) - ND = N3.Val-getNodeDepth(); -if (ND N4.Val-getNodeDepth()) - ND = N4.Val-getNodeDepth(); -NodeDepth = ND+1; - +: NodeType(NT), NodeId(-1) { OperandList = new SDOperand[4]; OperandList[0] = N1; OperandList[1] = N2; @@ -875,18 +852,16 @@ NumValues = 0; Prev = 0; Next = 0; } - SDNode(unsigned Opc, const std::vectorSDOperand Nodes) : NodeType(Opc) { + SDNode(unsigned Opc, const std::vectorSDOperand Nodes) +: NodeType(Opc), NodeId(-1) {
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.85 - 1.86 SelectionDAGNodes.h updated: 1.90 - 1.91 --- Log message: another selectto --- Diffs of the changes: (+22 -0) SelectionDAG.h |4 SelectionDAGNodes.h | 18 ++ 2 files changed, 22 insertions(+) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.85 llvm/include/llvm/CodeGen/SelectionDAG.h:1.86 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.85 Mon Jan 16 18:32:38 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Jan 23 14:58:48 2006 @@ -314,6 +314,10 @@ SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6); + SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, +SDOperand Op7); SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.90 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.91 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.90 Thu Jan 12 20:39:03 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jan 23 14:58:48 2006 @@ -839,6 +839,24 @@ Op2.Val-Uses.push_back(this); Op3.Val-Uses.push_back(this); Op4.Val-Uses.push_back(this); Op5.Val-Uses.push_back(this); } + void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6) { +assert(NumOperands == 0 Should not have operands yet!); +OperandList = new SDOperand[7]; +OperandList[0] = Op0; +OperandList[1] = Op1; +OperandList[2] = Op2; +OperandList[3] = Op3; +OperandList[4] = Op4; +OperandList[5] = Op5; +OperandList[6] = Op6; +NumOperands = 7; +Op0.Val-Uses.push_back(this); Op1.Val-Uses.push_back(this); +Op2.Val-Uses.push_back(this); Op3.Val-Uses.push_back(this); +Op4.Val-Uses.push_back(this); Op5.Val-Uses.push_back(this); +Op6.Val-Uses.push_back(this); + } + void addUser(SDNode *User) { Uses.push_back(User); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.86 - 1.87 SelectionDAGNodes.h updated: 1.91 - 1.92 --- Log message: another couple selects --- Diffs of the changes: (+38 -0) SelectionDAG.h | 20 SelectionDAGNodes.h | 18 ++ 2 files changed, 38 insertions(+) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.86 llvm/include/llvm/CodeGen/SelectionDAG.h:1.87 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.86 Mon Jan 23 14:58:48 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Jan 23 15:51:14 2006 @@ -318,6 +318,10 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7); + SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, +SDOperand Op7, SDOperand Op8); SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, @@ -384,6 +388,22 @@ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops); } SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, + SDOperand Op7, SDOperand Op8) { +std::vectorSDOperand Ops; +Ops.reserve(8); +Ops.push_back(Op1); +Ops.push_back(Op2); +Ops.push_back(Op3); +Ops.push_back(Op4); +Ops.push_back(Op5); +Ops.push_back(Op6); +Ops.push_back(Op7); +Ops.push_back(Op8); +return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops); + } + SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT, std::vectorSDOperand Ops) { return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops); } Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.91 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.92 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.91 Mon Jan 23 14:58:48 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jan 23 15:51:14 2006 @@ -856,6 +856,24 @@ Op4.Val-Uses.push_back(this); Op5.Val-Uses.push_back(this); Op6.Val-Uses.push_back(this); } + void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { +assert(NumOperands == 0 Should not have operands yet!); +OperandList = new SDOperand[8]; +OperandList[0] = Op0; +OperandList[1] = Op1; +OperandList[2] = Op2; +OperandList[3] = Op3; +OperandList[4] = Op4; +OperandList[5] = Op5; +OperandList[6] = Op6; +OperandList[7] = Op7; +NumOperands = 8; +Op0.Val-Uses.push_back(this); Op1.Val-Uses.push_back(this); +Op2.Val-Uses.push_back(this); Op3.Val-Uses.push_back(this); +Op4.Val-Uses.push_back(this); Op5.Val-Uses.push_back(this); +Op6.Val-Uses.push_back(this); Op7.Val-Uses.push_back(this); + } void addUser(SDNode *User) { Uses.push_back(User); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.81 - 1.82 SelectionDAGNodes.h updated: 1.82 - 1.83 --- Log message: remove a dead node --- Diffs of the changes: (+0 -10) SelectionDAG.h |4 SelectionDAGNodes.h |6 -- 2 files changed, 10 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.81 llvm/include/llvm/CodeGen/SelectionDAG.h:1.82 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.81 Thu Dec 22 01:02:51 2005 +++ llvm/include/llvm/CodeGen/SelectionDAG.hThu Dec 22 15:16:35 2005 @@ -184,10 +184,6 @@ return getNode(ISD::CopyFromReg, ResultTys, Ops); } - SDOperand getImplicitDef(SDOperand Chain, unsigned Reg, MVT::ValueType VT) { -return getNode(ISD::ImplicitDef, MVT::Other, Chain, getRegister(Reg, VT)); - } - /// getCall - Note that this destroys the vector of RetVals passed in. /// SDNode *getCall(std::vectorMVT::ValueType RetVals, SDOperand Chain, Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.82 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.83 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.82 Fri Dec 16 16:45:28 2005 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Thu Dec 22 15:16:35 2005 @@ -92,12 +92,6 @@ // SelectionDAG. The register is available from the RegSDNode object. CopyFromReg, -// ImplicitDef - This node indicates that the specified register is -// implicitly defined by some operation (e.g. its a live-in argument). The -// two operands to this are the token chain coming in and the register. -// The only result is the token chain going out. -ImplicitDef, - // UNDEF - An undefined node UNDEF, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.70 - 1.71 SelectionDAGNodes.h updated: 1.78 - 1.79 --- Log message: Add support for a new STRING and LOCATION node for line number support, patch contributed by Daniel Berlin, with a few cleanups here and there by me. --- Diffs of the changes: (+24 -1) SelectionDAG.h |2 ++ SelectionDAGNodes.h | 23 ++- 2 files changed, 24 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.70 llvm/include/llvm/CodeGen/SelectionDAG.h:1.71 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.70 Fri Nov 18 19:42:10 2005 +++ llvm/include/llvm/CodeGen/SelectionDAG.hTue Nov 29 00:15:39 2005 @@ -105,6 +105,7 @@ /// argument, it is used as the seed for node deletion. void RemoveDeadNodes(SDNode *N = 0); + SDOperand getString(const std::string Val); SDOperand getConstant(uint64_t Val, MVT::ValueType VT); SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT); SDOperand getConstantFP(double Val, MVT::ValueType VT); @@ -406,6 +407,7 @@ std::vectorSDNode* ValueTypeNodes; std::mapstd::string, SDNode* ExternalSymbols; std::mapstd::string, SDNode* TargetExternalSymbols; + std::mapstd::string, StringSDNode* StringNodes; std::mapstd::pairunsigned, std::pairMVT::ValueType, std::vectorSDOperand , SDNode* OneResultNodes; Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.78 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.79 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.78 Tue Nov 22 12:15:59 2005 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Nov 29 00:15:39 2005 @@ -63,7 +63,8 @@ AssertSext, AssertZext, // Various leaf nodes. -Constant, ConstantFP, GlobalAddress, FrameIndex, ConstantPool, +Constant, ConstantFP, STRING, +GlobalAddress, FrameIndex, ConstantPool, BasicBlock, ExternalSymbol, VALUETYPE, CONDCODE, Register, // TargetConstant - Like Constant, but the DAG does not do any folding or @@ -341,6 +342,12 @@ // HANDLENODE node - Used as a handle for various purposes. HANDLENODE, +// LOCATION - This node is used to represent a source location for debug +// info. It takes token chain as input, then a line number, then a column +// number, then a filename, then a working dir. It produces a token chain +// as output. +LOCATION, + // BUILTIN_OP_END - This must be the last enum value in this list. BUILTIN_OP_END, }; @@ -846,6 +853,20 @@ SDOperand getValue() const { return getOperand(0); } }; +class StringSDNode : public SDNode { + std::string Value; +protected: + friend class SelectionDAG; + StringSDNode(const std::string val) +: SDNode(ISD::STRING, MVT::Other), Value(val) { + } +public: + const std::string getValue() const { return Value; } + static bool classof(const StringSDNode *) { return true; } + static bool classof(const SDNode *N) { +return N-getOpcode() == ISD::STRING; + } +}; class ConstantSDNode : public SDNode { uint64_t Value; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits