[llvm] r311636 - IPRA: Exit early on functions without calls
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 24 00:55:13 PDT 2017
Author: arsenm
Date: Thu Aug 24 00:55:13 2017
New Revision: 311636
URL: http://llvm.org/viewvc/llvm-project?rev=311636&view=rev
Log:
IPRA: Exit early on functions without calls
Modified:
llvm/trunk/lib/CodeGen/RegUsageInfoPropagate.cpp
Modified: llvm/trunk/lib/CodeGen/RegUsageInfoPropagate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegUsageInfoPropagate.cpp?rev=311636&r1=311635&r2=311636&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegUsageInfoPropagate.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegUsageInfoPropagate.cpp Thu Aug 24 00:55:13 2017
@@ -21,6 +21,7 @@
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
@@ -95,6 +96,10 @@ bool RegUsageInfoPropagationPass::runOnM
<< " ++++++++++++++++++++ \n");
DEBUG(dbgs() << "MachineFunction : " << MF.getName() << "\n");
+ const MachineFrameInfo &MFI = MF.getFrameInfo();
+ if (!MFI.hasCalls() && !MFI.hasTailCall())
+ return false;
+
bool Changed = false;
for (MachineBasicBlock &MBB : MF) {
More information about the llvm-commits
mailing list