Add special check to avoid isLoop call. Simple, but doesn't seem to speed
up lcssa much in practice.
llvm-svn: 29465
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp
index 43c9678..21f9352 100644
--- a/llvm/lib/Transforms/Utils/LCSSA.cpp
+++ b/llvm/lib/Transforms/Utils/LCSSA.cpp
@@ -177,7 +177,7 @@
}
// If the user is in the loop, don't rewrite it!
- if (inLoop(UserBB)) {
+ if (UserBB == Instr->getParent() || inLoop(UserBB)) {
++UI;
continue;
}
@@ -215,7 +215,7 @@
UserBB = p->getIncomingBlock(OperandNo/2);
}
- if (!inLoop(UserBB)) {
+ if (*BB != UserBB && !inLoop(UserBB)) {
AffectedValues.insert(I);
break;
}