[llvm-commits] [llvm] r72565 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Torok Edwin
edwintorok at gmail.com
Fri May 29 02:46:28 PDT 2009
Author: edwin
Date: Fri May 29 04:46:03 2009
New Revision: 72565
URL: http://llvm.org/viewvc/llvm-project?rev=72565&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=72565&r1=72564&r2=72565&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri May 29 04:46:03 2009
@@ -1158,8 +1158,18 @@
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())
More information about the llvm-commits
mailing list