[llvm-commits] [llvm] r170298 - /llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
Craig Topper
craig.topper at gmail.com
Sun Dec 16 19:56:00 PST 2012
Author: ctopper
Date: Sun Dec 16 21:56:00 2012
New Revision: 170298
URL: http://llvm.org/viewvc/llvm-project?rev=170298&view=rev
Log:
Add debug prints for when optimizeLoadInstr folds a load.
Modified:
llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
Modified: llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp?rev=170298&r1=170297&r2=170298&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/PeepholeOptimizer.cpp Sun Dec 16 21:56:00 2012
@@ -66,6 +66,7 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm;
@@ -478,6 +479,9 @@
}
bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
+ DEBUG(dbgs() << "********** PEEPHOLE OPTIMIZER **********\n");
+ DEBUG(dbgs() << "********** Function: " << MF.getName() << '\n');
+
if (DisablePeephole)
return false;
@@ -552,6 +556,8 @@
FoldAsLoadDefReg, DefMI);
if (FoldMI) {
// Update LocalMIs since we replaced MI with FoldMI and deleted DefMI.
+ DEBUG(dbgs() << "Replacing: " << *MI);
+ DEBUG(dbgs() << " With: " << *FoldMI);
LocalMIs.erase(MI);
LocalMIs.erase(DefMI);
LocalMIs.insert(FoldMI);
More information about the llvm-commits
mailing list