@@ -457,7 +457,7 @@ unsigned MachineFunction::addLiveIn(unsigned PReg,
457457// / getJTISymbol - Return the MCSymbol for the specified non-empty jump table.
458458// / If isLinkerPrivate is specified, an 'l' label is returned, otherwise a
459459// / normal 'L' label is returned.
460- MCSymbol *MachineFunction::getJTISymbol (unsigned JTI, MCContext &Ctx,
460+ MCSymbol *MachineFunction::getJTISymbol (unsigned JTI, MCContext &Ctx,
461461 bool isLinkerPrivate) const {
462462 const DataLayout *DL = getTarget ().getDataLayout ();
463463 assert (JumpTableInfo && " No jump tables" );
@@ -530,10 +530,9 @@ int MachineFrameInfo::CreateStackObject(uint64_t Size, unsigned Alignment,
530530// /
531531int MachineFrameInfo::CreateSpillStackObject (uint64_t Size,
532532 unsigned Alignment) {
533- Alignment =
534- clampStackAlignment (!getFrameLowering ()->isStackRealignable () ||
535- !RealignOption,
536- Alignment, getFrameLowering ()->getStackAlignment ());
533+ Alignment = clampStackAlignment (
534+ !getFrameLowering ()->isStackRealignable () || !RealignOption, Alignment,
535+ getFrameLowering ()->getStackAlignment ());
537536 CreateStackObject (Size, Alignment, true );
538537 int Index = (int )Objects.size () - NumFixedObjects - 1 ;
539538 ensureMaxAlignment (Alignment);
@@ -548,10 +547,9 @@ int MachineFrameInfo::CreateSpillStackObject(uint64_t Size,
548547int MachineFrameInfo::CreateVariableSizedObject (unsigned Alignment,
549548 const AllocaInst *Alloca) {
550549 HasVarSizedObjects = true ;
551- Alignment =
552- clampStackAlignment (!getFrameLowering ()->isStackRealignable () ||
553- !RealignOption,
554- Alignment, getFrameLowering ()->getStackAlignment ());
550+ Alignment = clampStackAlignment (
551+ !getFrameLowering ()->isStackRealignable () || !RealignOption, Alignment,
552+ getFrameLowering ()->getStackAlignment ());
555553 Objects.push_back (StackObject (0 , Alignment, 0 , false , false , Alloca));
556554 ensureMaxAlignment (Alignment);
557555 return (int )Objects.size ()-NumFixedObjects-1 ;
@@ -571,16 +569,30 @@ int MachineFrameInfo::CreateFixedObject(uint64_t Size, int64_t SPOffset,
571569 // object is 16-byte aligned.
572570 unsigned StackAlign = getFrameLowering ()->getStackAlignment ();
573571 unsigned Align = MinAlign (SPOffset, StackAlign);
574- Align =
575- clampStackAlignment (!getFrameLowering ()->isStackRealignable () ||
576- !RealignOption,
577- Align, getFrameLowering ()->getStackAlignment ());
572+ Align = clampStackAlignment (!getFrameLowering ()->isStackRealignable () ||
573+ !RealignOption,
574+ Align, getFrameLowering ()->getStackAlignment ());
578575 Objects.insert (Objects.begin (), StackObject (Size, Align, SPOffset, Immutable,
579576 /* isSS*/ false ,
580577 /* Alloca*/ nullptr ));
581578 return -++NumFixedObjects;
582579}
583580
581+ // / CreateFixedSpillStackObject - Create a spill slot at a fixed location
582+ // / on the stack. Returns an index with a negative value.
583+ int MachineFrameInfo::CreateFixedSpillStackObject (uint64_t Size,
584+ int64_t SPOffset) {
585+ unsigned StackAlign = getFrameLowering ()->getStackAlignment ();
586+ unsigned Align = MinAlign (SPOffset, StackAlign);
587+ Align = clampStackAlignment (!getFrameLowering ()->isStackRealignable () ||
588+ !RealignOption,
589+ Align, getFrameLowering ()->getStackAlignment ());
590+ Objects.insert (Objects.begin (), StackObject (Size, Align, SPOffset,
591+ /* Immutable*/ true ,
592+ /* isSS*/ true ,
593+ /* Alloca*/ nullptr ));
594+ return -++NumFixedObjects;
595+ }
584596
585597BitVector
586598MachineFrameInfo::getPristineRegs (const MachineBasicBlock *MBB) const {
@@ -849,11 +861,10 @@ static bool CanShareConstantPoolEntry(const Constant *A, const Constant *B,
849861 if (isa<StructType>(A->getType ()) || isa<ArrayType>(A->getType ()) ||
850862 isa<StructType>(B->getType ()) || isa<ArrayType>(B->getType ()))
851863 return false ;
852-
864+
853865 // For now, only support constants with the same size.
854866 uint64_t StoreSize = TD->getTypeStoreSize (A->getType ());
855- if (StoreSize != TD->getTypeStoreSize (B->getType ()) ||
856- StoreSize > 128 )
867+ if (StoreSize != TD->getTypeStoreSize (B->getType ()) || StoreSize > 128 )
857868 return false ;
858869
859870 Type *IntTy = IntegerType::get (A->getContext (), StoreSize*8 );
@@ -882,7 +893,7 @@ static bool CanShareConstantPoolEntry(const Constant *A, const Constant *B,
882893// / an existing one. User must specify the log2 of the minimum required
883894// / alignment for the object.
884895// /
885- unsigned MachineConstantPool::getConstantPoolIndex (const Constant *C,
896+ unsigned MachineConstantPool::getConstantPoolIndex (const Constant *C,
886897 unsigned Alignment) {
887898 assert (Alignment && " Alignment must be specified!" );
888899 if (Alignment > PoolAlignment) PoolAlignment = Alignment;
0 commit comments