From c67bdc288aac130d88630f7fa95ceca6bcf95077 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 21 Apr 2007 18:36:27 +0000 Subject: [PATCH] Revert Christopher Lamb's load/store alignment changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36309 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/SelectionDAG.h | 11 +- include/llvm/CodeGen/SelectionDAGNodes.h | 4 +- include/llvm/Instructions.h | 40 +- lib/AsmParser/llvmAsmParser.cpp.cvs | 7094 +++++++++-------- lib/AsmParser/llvmAsmParser.h.cvs | 448 +- lib/AsmParser/llvmAsmParser.y | 8 +- lib/AsmParser/llvmAsmParser.y.cvs | 8 +- lib/Bytecode/Reader/Reader.cpp | 24 +- lib/Bytecode/Writer/Writer.cpp | 32 +- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 70 +- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 33 +- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 12 +- lib/VMCore/AsmWriter.cpp | 7 - lib/VMCore/Instructions.cpp | 42 - 14 files changed, 4366 insertions(+), 3467 deletions(-) diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 9d8024b86d4..0f17e6993ad 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -311,12 +311,10 @@ public: /// 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 @@ public: /// 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); diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index f617800d038..77d607a2cb6 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1448,7 +1448,7 @@ protected: 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 @@ protected: 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 @@ protected: 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"); diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 40e31745ee5..2387739720c 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -211,11 +211,9 @@ public: /// SubclassData field in Value to store whether or not the load is volatile. /// class LoadInst : public UnaryInstruction { - LoadInst(const LoadInst &LI) : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) { setVolatile(LI.isVolatile()); - setAlignment(LI.getAlignment()); #ifndef NDEBUG AssertOK(); @@ -225,16 +223,14 @@ class LoadInst : public UnaryInstruction { public: LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd); - LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, - Instruction *InsertBefore = 0); - LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned Align, + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, BasicBlock *InsertAtEnd); LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd); - explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, + explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const char *Name, bool isVolatile, BasicBlock *InsertAtEnd); @@ -242,23 +238,14 @@ public: /// isVolatile - Return true if this is a load from a volatile memory /// location. /// - bool isVolatile() const { return SubclassData & 1; } + bool isVolatile() const { return SubclassData; } /// setVolatile - Specify whether this is a volatile load or not. /// - void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); } + void setVolatile(bool V) { SubclassData = V; } virtual LoadInst *clone() const; - /// getAlignment - Return the alignment of the access that is being performed - /// - unsigned getAlignment() const { - signed Log2AlignVal = ((SubclassData>>1)-1); - return ((Log2AlignVal < 0) ? 0 : 1<>1)-1); - return ((Log2AlignVal < 0) ? 0 : 1<