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 | 3f3c6d4e5be4b916ed9d30ba85a428e01a65d8c5 (patch) | |
tree | 906c0fbe03659bf1f13b64f87e834fff00ac67f9 | |
parent | 246ddf55d12c3347a5a4e5d1cc04e6a31974f0c8 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72565 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 222320f525..946c33eea4 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/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()) |