diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/PseudoSourceValue.cpp | 19 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 14 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 10 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/StackSlotColoring.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/TargetInstrInfoImpl.cpp | 2 |
8 files changed, 29 insertions, 26 deletions
diff --git a/lib/CodeGen/PseudoSourceValue.cpp b/lib/CodeGen/PseudoSourceValue.cpp index 00c5d46..e74479e 100644 --- a/lib/CodeGen/PseudoSourceValue.cpp +++ b/lib/CodeGen/PseudoSourceValue.cpp @@ -52,29 +52,31 @@ void PseudoSourceValue::printCustom(raw_ostream &O) const { } namespace { - /// FixedStackPseudoSourceValue - A specialized PseudoSourceValue - /// for holding FixedStack values, which must include a frame + /// StackObjectPseudoSourceValue - A specialized PseudoSourceValue + /// for holding StackObject values, which must include a frame /// index. - class VISIBILITY_HIDDEN FixedStackPseudoSourceValue + class VISIBILITY_HIDDEN StackObjectPseudoSourceValue : public PseudoSourceValue { const int FI; public: - explicit FixedStackPseudoSourceValue(int fi) : FI(fi) {} + explicit StackObjectPseudoSourceValue(int fi) : FI(fi) {} virtual bool isConstant(const MachineFrameInfo *MFI) const; virtual void printCustom(raw_ostream &OS) const { - OS << "FixedStack" << FI; + if (FI < 0) + OS << "Fixed"; + OS << "StackObject" << FI; } }; } static ManagedStatic<std::map<int, const PseudoSourceValue *> > FSValues; -const PseudoSourceValue *PseudoSourceValue::getFixedStack(int FI) { +const PseudoSourceValue *PseudoSourceValue::getStackObject(int FI) { const PseudoSourceValue *&V = (*FSValues)[FI]; if (!V) - V = new FixedStackPseudoSourceValue(FI); + V = new StackObjectPseudoSourceValue(FI); return V; } @@ -89,6 +91,7 @@ bool PseudoSourceValue::isConstant(const MachineFrameInfo *) const { return false; } -bool FixedStackPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const{ +bool +StackObjectPseudoSourceValue::isConstant(const MachineFrameInfo *MFI) const { return MFI && MFI->isImmutableObjectIndex(FI); } diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 7138dd2..9b9e310 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -643,7 +643,7 @@ PerformInsertVectorEltInMemory(SDValue Vec, SDValue Val, SDValue Idx, // Store the vector. SDValue Ch = DAG.getStore(DAG.getEntryNode(), dl, Tmp1, StackPtr, - PseudoSourceValue::getFixedStack(SPFI), 0); + PseudoSourceValue::getStackObject(SPFI), 0); // Truncate or zero extend offset to target pointer type. unsigned CastOpc = IdxVT.bitsGT(PtrVT) ? ISD::TRUNCATE : ISD::ZERO_EXTEND; @@ -654,10 +654,10 @@ PerformInsertVectorEltInMemory(SDValue Vec, SDValue Val, SDValue Idx, SDValue StackPtr2 = DAG.getNode(ISD::ADD, dl, IdxVT, Tmp3, StackPtr); // Store the scalar value. Ch = DAG.getTruncStore(Ch, dl, Tmp2, StackPtr2, - PseudoSourceValue::getFixedStack(SPFI), 0, EltVT); + PseudoSourceValue::getStackObject(SPFI), 0, EltVT); // Load the updated vector. return DAG.getLoad(VT, dl, Ch, StackPtr, - PseudoSourceValue::getFixedStack(SPFI), 0); + PseudoSourceValue::getStackObject(SPFI), 0); } @@ -1518,7 +1518,7 @@ SDValue SelectionDAGLegalize::ExpandVectorBuildThroughStack(SDNode* Node) { DebugLoc dl = Node->getDebugLoc(); SDValue FIPtr = DAG.CreateStackTemporary(VT); int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex(); - const Value *SV = PseudoSourceValue::getFixedStack(FI); + const Value *SV = PseudoSourceValue::getStackObject(FI); // Emit a store of each element to the stack slot. SmallVector<SDValue, 8> Stores; @@ -1714,7 +1714,7 @@ SDValue SelectionDAGLegalize::EmitStackConvert(SDValue SrcOp, FrameIndexSDNode *StackPtrFI = cast<FrameIndexSDNode>(FIPtr); int SPFI = StackPtrFI->getIndex(); - const Value *SV = PseudoSourceValue::getFixedStack(SPFI); + const Value *SV = PseudoSourceValue::getStackObject(SPFI); unsigned SrcSize = SrcOp.getValueType().getSizeInBits(); unsigned SlotSize = SlotVT.getSizeInBits(); @@ -1755,10 +1755,10 @@ SDValue SelectionDAGLegalize::ExpandSCALAR_TO_VECTOR(SDNode *Node) { SDValue Ch = DAG.getTruncStore(DAG.getEntryNode(), dl, Node->getOperand(0), StackPtr, - PseudoSourceValue::getFixedStack(SPFI), 0, + PseudoSourceValue::getStackObject(SPFI), 0, Node->getValueType(0).getVectorElementType()); return DAG.getLoad(Node->getValueType(0), dl, Ch, StackPtr, - PseudoSourceValue::getFixedStack(SPFI), 0); + PseudoSourceValue::getStackObject(SPFI), 0); } diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp index dbd3e39..90451db 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp @@ -119,7 +119,7 @@ void DAGTypeLegalizer::ExpandRes_BIT_CONVERT(SDNode *N, SDValue &Lo, getTypeForEVT(*DAG.getContext())); SDValue StackPtr = DAG.CreateStackTemporary(InVT, Alignment); int SPFI = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex(); - const Value *SV = PseudoSourceValue::getFixedStack(SPFI); + const Value *SV = PseudoSourceValue::getStackObject(SPFI); // Emit a store to the stack slot. SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, InOp, StackPtr, SV, 0); diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 75e1239..bf394a8 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -1058,7 +1058,7 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT(SDNode *N) { DebugLoc dl = N->getDebugLoc(); SDValue StackPtr = DAG.CreateStackTemporary(VecVT); int SPFI = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex(); - const Value *SV = PseudoSourceValue::getFixedStack(SPFI); + const Value *SV = PseudoSourceValue::getStackObject(SPFI); SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr, SV, 0); // Load back the required element. diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 8bd0370..32517ab 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3514,7 +3514,7 @@ SDValue SelectionDAG::getAtomic(unsigned Opcode, DebugLoc dl, EVT MemVT, if (!PtrVal) if (const FrameIndexSDNode *FI = dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - PtrVal = PseudoSourceValue::getFixedStack(FI->getIndex()); + PtrVal = PseudoSourceValue::getStackObject(FI->getIndex()); MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore; @@ -3567,7 +3567,7 @@ SDValue SelectionDAG::getAtomic(unsigned Opcode, DebugLoc dl, EVT MemVT, if (!PtrVal) if (const FrameIndexSDNode *FI = dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - PtrVal = PseudoSourceValue::getFixedStack(FI->getIndex()); + PtrVal = PseudoSourceValue::getStackObject(FI->getIndex()); MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore; @@ -3714,7 +3714,7 @@ SelectionDAG::getLoad(ISD::MemIndexedMode AM, DebugLoc dl, if (!SV) if (const FrameIndexSDNode *FI = dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - SV = PseudoSourceValue::getFixedStack(FI->getIndex()); + SV = PseudoSourceValue::getStackObject(FI->getIndex()); MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOLoad; @@ -3813,7 +3813,7 @@ SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val, if (!SV) if (const FrameIndexSDNode *FI = dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - SV = PseudoSourceValue::getFixedStack(FI->getIndex()); + SV = PseudoSourceValue::getStackObject(FI->getIndex()); MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOStore; @@ -3859,7 +3859,7 @@ SDValue SelectionDAG::getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val, if (!SV) if (const FrameIndexSDNode *FI = dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - SV = PseudoSourceValue::getFixedStack(FI->getIndex()); + SV = PseudoSourceValue::getStackObject(FI->getIndex()); MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOStore; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index adcc532..f1bf737 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -4197,7 +4197,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { // Store the stack protector onto the stack. SDValue Result = DAG.getStore(getRoot(), getCurDebugLoc(), Src, FIN, - PseudoSourceValue::getFixedStack(FI), + PseudoSourceValue::getStackObject(FI), 0, true); setValue(&I, Result); DAG.setRoot(Result); diff --git a/lib/CodeGen/StackSlotColoring.cpp b/lib/CodeGen/StackSlotColoring.cpp index fad0808..242ff65 100644 --- a/lib/CodeGen/StackSlotColoring.cpp +++ b/lib/CodeGen/StackSlotColoring.cpp @@ -466,8 +466,8 @@ void StackSlotColoring::RewriteInstruction(MachineInstr *MI, int OldFI, // Update the memory references. This changes the MachineMemOperands // directly. They may be in use by multiple instructions, however all // instructions using OldFI are being rewritten to use NewFI. - const Value *OldSV = PseudoSourceValue::getFixedStack(OldFI); - const Value *NewSV = PseudoSourceValue::getFixedStack(NewFI); + const Value *OldSV = PseudoSourceValue::getStackObject(OldFI); + const Value *NewSV = PseudoSourceValue::getStackObject(NewFI); for (MachineInstr::mmo_iterator I = MI->memoperands_begin(), E = MI->memoperands_end(); I != E; ++I) if ((*I)->getValue() == OldSV) diff --git a/lib/CodeGen/TargetInstrInfoImpl.cpp b/lib/CodeGen/TargetInstrInfoImpl.cpp index c646869..b610777 100644 --- a/lib/CodeGen/TargetInstrInfoImpl.cpp +++ b/lib/CodeGen/TargetInstrInfoImpl.cpp @@ -187,7 +187,7 @@ TargetInstrInfo::foldMemoryOperand(MachineFunction &MF, const MachineFrameInfo &MFI = *MF.getFrameInfo(); assert(MFI.getObjectOffset(FrameIndex) != -1); MachineMemOperand *MMO = - MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FrameIndex), + MF.getMachineMemOperand(PseudoSourceValue::getStackObject(FrameIndex), Flags, /*Offset=*/0, MFI.getObjectSize(FrameIndex), MFI.getObjectAlignment(FrameIndex)); |