aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-10-08 00:12:24 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-10-08 00:12:24 +0000
commit4306963170dfc17d580421220674aa3c030f525a (patch)
treeda6a3d74d62f7b8cce8b205f9f0b389cc5b06bb1
parent0ea38bb93955a64477a66f9adca7eadab6635050 (diff)
In instcombine's debug output, avoid printing ADD for instructions that are
already on the worklist, and print Visited when an instruction is about to be visited. Net, on one input, this reduced the output size by at least 9x. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83510 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 66776dde4c..bb0e0996bf 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -90,9 +90,10 @@ namespace {
/// Add - Add the specified instruction to the worklist if it isn't already
/// in it.
void Add(Instruction *I) {
- DEBUG(errs() << "IC: ADD: " << *I << '\n');
- if (WorklistMap.insert(std::make_pair(I, Worklist.size())).second)
+ if (WorklistMap.insert(std::make_pair(I, Worklist.size())).second) {
+ DEBUG(errs() << "IC: ADD: " << *I << '\n');
Worklist.push_back(I);
+ }
}
void AddValue(Value *V) {
@@ -12853,7 +12854,8 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
std::string OrigI;
#endif
DEBUG(raw_string_ostream SS(OrigI); I->print(SS); OrigI = SS.str(););
-
+ DEBUG(errs() << "IC: Visiting: " << OrigI << '\n');
+
if (Instruction *Result = visit(*I)) {
++NumCombined;
// Should we replace the old instruction with a new one?