enable Anton's shift/and switch lowering stuff! It now passes ppc bootstrap
[oota-llvm.git] / lib / CodeGen / PrologEpilogInserter.cpp
index b6e909507a4d522036cf62250bb267d839ec3ca7..478f3d3a5f2b6f578f419ad5a3e5f77e9671851d 100644 (file)
@@ -156,19 +156,18 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
   // Now figure out which *callee saved* registers are modified by the current
   // function, thus needing to be saved and restored in the prolog/epilog.
   //
-  const bool *PhysRegsUsed = Fn.getUsedPhysregs();
   const TargetRegisterClass* const *CSRegClasses =
     RegInfo->getCalleeSavedRegClasses();
   std::vector<CalleeSavedInfo> CSI;
   for (unsigned i = 0; CSRegs[i]; ++i) {
     unsigned Reg = CSRegs[i];
-    if (PhysRegsUsed[Reg]) {
+    if (Fn.isPhysRegUsed(Reg)) {
         // If the reg is modified, save it!
       CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i]));
     } else {
       for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
            *AliasSet; ++AliasSet) {  // Check alias registers too.
-        if (PhysRegsUsed[*AliasSet]) {
+        if (Fn.isPhysRegUsed(*AliasSet)) {
           CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i]));
           break;
         }
@@ -305,7 +304,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
   // Start at the beginning of the local area.
   // The Offset is the distance from the stack top in the direction
   // of stack growth -- so it's always positive.
-  int Offset = TFI.getOffsetOfLocalArea();
+  int64_t Offset = TFI.getOffsetOfLocalArea();
   if (StackGrowsDown)
     Offset = -Offset;
   assert(Offset >= 0
@@ -317,7 +316,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
   // so we adjust 'Offset' to point to the end of last fixed sized
   // preallocated object.
   for (int i = FFI->getObjectIndexBegin(); i != 0; ++i) {
-    int FixedOff;
+    int64_t FixedOff;
     if (StackGrowsDown) {
       // The maximum distance from the stack pointer is at lower address of
       // the object -- which is given by offset. For down growing stack
@@ -455,7 +454,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
       Offset += FFI->getMaxCallFrameSize();
 
     unsigned AlignMask = TFI.getStackAlignment() - 1;
-    Offset = (Offset + AlignMask) & ~AlignMask;
+    Offset = (Offset + AlignMask) & ~uint64_t(AlignMask);
   }
 
   // Update frame info to pretend that this is part of the stack...