summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-05-29 09:46:03 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-05-29 09:46:03 +0000
commit72070282eb258a3addf64daa2358e4ba12871d3e (patch)
treef761e229d313df84df75dcb52fe36dfd6def53e8 /llvm/lib/Transforms
parent04cfdd38a26620e509bd852afd993b3dd458dc33 (diff)
downloadbcm5719-llvm-72070282eb258a3addf64daa2358e4ba12871d3e.tar.gz
bcm5719-llvm-72070282eb258a3addf64daa2358e4ba12871d3e.zip
Add a DEBUG() output to GVN that prints the instruction clobbering a load.
This is useful when trying to figure out why GVN didn't eliminate redundant loads. llvm-svn: 72565
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 222320f5257..946c33eea44 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -1158,8 +1158,18 @@ bool GVN::processLoad(LoadInst *L, SmallVectorImpl<Instruction*> &toErase) {
MemDepResult dep = MD->getDependency(L);
// If the value isn't available, don't do anything!
- if (dep.isClobber())
+ if (dep.isClobber()) {
+ DEBUG(
+ // fast print dep, using operator<< on instruction would be too slow
+ DOUT << "GVN: load ";
+ WriteAsOperand(*DOUT.stream(), L);
+ Instruction *I = dep.getInst();
+ DOUT << " is clobbered by " << I->getOpcodeName() << " instruction ";
+ WriteAsOperand(*DOUT.stream(), I, false);
+ DOUT << "\n";
+ );
return false;
+ }
// If it is defined in another block, try harder.
if (dep.isNonLocal())
OpenPOWER on IntegriCloud