From c458e6512dac143150483ae67da8a034902e2cbf Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Sun, 27 Mar 2011 23:32:31 +0000 Subject: [PATCH] Add some debug output when -instcombine uses RAUW. This can make debug output for those cases much clearer since without this it only showed that the original instruction was removed, not what it was replaced with. llvm-svn: 128399 --- lib/Transforms/InstCombine/InstCombine.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/InstCombine/InstCombine.h b/lib/Transforms/InstCombine/InstCombine.h index 0da962a5f40..d5de53aa926 100644 --- a/lib/Transforms/InstCombine/InstCombine.h +++ b/lib/Transforms/InstCombine/InstCombine.h @@ -246,7 +246,10 @@ public: // segment of unreachable code, so just clobber the instruction. if (&I == V) V = UndefValue::get(I.getType()); - + + DEBUG(errs() << "IC: Replacing " << I << "\n" + " with " << *V << '\n'); + I.replaceAllUsesWith(V); return &I; }