forked from OSchip/llvm-project
Add debug prints for when optimizeLoadInstr folds a load.
llvm-svn: 170298
This commit is contained in:
parent
555d1aa3a4
commit
588ceec0f7
|
@ -66,6 +66,7 @@
|
||||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||||
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Target/TargetInstrInfo.h"
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
#include "llvm/Target/TargetRegisterInfo.h"
|
#include "llvm/Target/TargetRegisterInfo.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
@ -478,6 +479,9 @@ bool PeepholeOptimizer::foldImmediate(MachineInstr *MI, MachineBasicBlock *MBB,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
|
bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
|
||||||
|
DEBUG(dbgs() << "********** PEEPHOLE OPTIMIZER **********\n");
|
||||||
|
DEBUG(dbgs() << "********** Function: " << MF.getName() << '\n');
|
||||||
|
|
||||||
if (DisablePeephole)
|
if (DisablePeephole)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -552,6 +556,8 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
|
||||||
FoldAsLoadDefReg, DefMI);
|
FoldAsLoadDefReg, DefMI);
|
||||||
if (FoldMI) {
|
if (FoldMI) {
|
||||||
// Update LocalMIs since we replaced MI with FoldMI and deleted DefMI.
|
// Update LocalMIs since we replaced MI with FoldMI and deleted DefMI.
|
||||||
|
DEBUG(dbgs() << "Replacing: " << *MI);
|
||||||
|
DEBUG(dbgs() << " With: " << *FoldMI);
|
||||||
LocalMIs.erase(MI);
|
LocalMIs.erase(MI);
|
||||||
LocalMIs.erase(DefMI);
|
LocalMIs.erase(DefMI);
|
||||||
LocalMIs.insert(FoldMI);
|
LocalMIs.insert(FoldMI);
|
||||||
|
|
Loading…
Reference in New Issue