[llvm-commits] [llvm] r133988 - in /llvm/trunk/lib: Analysis/IVUsers.cpp Transforms/Scalar/IndVarSimplify.cpp
Andrew Trick
atrick at apple.com
Mon Jun 27 20:01:46 PDT 2011
Author: atrick
Date: Mon Jun 27 22:01:46 2011
New Revision: 133988
URL: http://llvm.org/viewvc/llvm-project?rev=133988&view=rev
Log:
indvars --disable-iv-rewrite: sever ties with IVUsers.
Modified:
llvm/trunk/lib/Analysis/IVUsers.cpp
llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
Modified: llvm/trunk/lib/Analysis/IVUsers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=133988&r1=133987&r2=133988&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IVUsers.cpp (original)
+++ llvm/trunk/lib/Analysis/IVUsers.cpp Mon Jun 27 22:01:46 2011
@@ -21,7 +21,6 @@
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/ADT/STLExtras.h"
@@ -39,15 +38,6 @@
INITIALIZE_PASS_END(IVUsers, "iv-users",
"Induction Variable Users", false, true)
-// IVUsers behavior currently depends on this temporary indvars mode. The
-// option must be defined upstream from its uses.
-namespace llvm {
- bool DisableIVRewrite = false;
-}
-cl::opt<bool, true> DisableIVRewriteOpt(
- "disable-iv-rewrite", cl::Hidden, cl::location(llvm::DisableIVRewrite),
- cl::desc("Disable canonical induction variable rewriting"));
-
Pass *llvm::createIVUsersPass() {
return new IVUsers();
}
@@ -100,11 +90,6 @@
if (Width > 64 || (TD && !TD->isLegalInteger(Width)))
return false;
- // We expect Sign/Zero extension to be eliminated from the IR before analyzing
- // any downstream uses.
- if (DisableIVRewrite && (isa<SExtInst>(I) || isa<ZExtInst>(I)))
- return false;
-
if (!Processed.insert(I))
return true; // Instruction already handled.
Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=133988&r1=133987&r2=133988&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Mon Jun 27 22:01:46 2011
@@ -52,6 +52,7 @@
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/Local.h"
@@ -72,11 +73,9 @@
STATISTIC(NumElimRem , "Number of IV remainder operations eliminated");
STATISTIC(NumElimCmp , "Number of IV comparisons eliminated");
-// DisableIVRewrite mode currently affects IVUsers, so is defined in libAnalysis
-// and referenced here.
-namespace llvm {
- extern bool DisableIVRewrite;
-}
+static cl::opt<bool> DisableIVRewrite(
+ "disable-iv-rewrite", cl::Hidden,
+ cl::desc("Disable canonical induction variable rewriting"));
namespace {
class IndVarSimplify : public LoopPass {
@@ -104,7 +103,8 @@
AU.addRequired<ScalarEvolution>();
AU.addRequiredID(LoopSimplifyID);
AU.addRequiredID(LCSSAID);
- AU.addRequired<IVUsers>();
+ if (!DisableIVRewrite)
+ AU.addRequired<IVUsers>();
AU.addPreserved<ScalarEvolution>();
AU.addPreservedID(LoopSimplifyID);
AU.addPreservedID(LCSSAID);
More information about the llvm-commits
mailing list