diff options
| author | Torok Edwin <edwintorok@gmail.com> | 2009-05-29 09:46:03 +0000 | 
|---|---|---|
| committer | Torok Edwin <edwintorok@gmail.com> | 2009-05-29 09:46:03 +0000 | 
| commit | 72070282eb258a3addf64daa2358e4ba12871d3e (patch) | |
| tree | f761e229d313df84df75dcb52fe36dfd6def53e8 /llvm/lib | |
| parent | 04cfdd38a26620e509bd852afd993b3dd458dc33 (diff) | |
| download | bcm5719-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')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 12 | 
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()) | 

