]> granicus.if.org Git - llvm/commitdiff
X86CallFrameOptimization: make adjustCallSequence's return type void
authorHans Wennborg <hans@hanshq.net>
Thu, 5 May 2016 16:39:31 +0000 (16:39 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 5 May 2016 16:39:31 +0000 (16:39 +0000)
It always returned the same value (true). No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268645 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86CallFrameOptimization.cpp

index ac71fc2e5bd4e4e5bfe201cc279749cfbfcf9657..367ae4f4b5af9130d78affec59d42a70ea57dbc8 100644 (file)
@@ -88,7 +88,7 @@ private:
   void collectCallInfo(MachineFunction &MF, MachineBasicBlock &MBB,
                        MachineBasicBlock::iterator I, CallContext &Context);
 
-  bool adjustCallSequence(MachineFunction &MF, const CallContext &Context);
+  void adjustCallSequence(MachineFunction &MF, const CallContext &Context);
 
   MachineInstr *canFoldIntoRegPush(MachineBasicBlock::iterator FrameSetup,
                                    unsigned Reg);
@@ -245,9 +245,12 @@ bool X86CallFrameOptimization::runOnMachineFunction(MachineFunction &MF) {
   if (!isProfitable(MF, CallSeqVector))
     return false;
 
-  for (auto CC : CallSeqVector)
-    if (CC.UsePush)
-      Changed |= adjustCallSequence(MF, CC);
+  for (auto CC : CallSeqVector) {
+    if (CC.UsePush) {
+      adjustCallSequence(MF, CC);
+      Changed = true;
+    }
+  }
 
   return Changed;
 }
@@ -445,7 +448,7 @@ void X86CallFrameOptimization::collectCallInfo(MachineFunction &MF,
   Context.UsePush = true;
 }
 
-bool X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF,
+void X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF,
                                                   const CallContext &Context) {
   // Ok, we can in fact do the transformation for this call.
   // Do not remove the FrameSetup instruction, but adjust the parameters.
@@ -543,8 +546,6 @@ bool X86CallFrameOptimization::adjustCallSequence(MachineFunction &MF,
   // frame.
   X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
   FuncInfo->setHasPushSequences(true);
-
-  return true;
 }
 
 MachineInstr *X86CallFrameOptimization::canFoldIntoRegPush(