indvars --disable-iv-rewrite: sever ties with IVUsers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133988 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick
2011-06-28 03:01:46 +00:00
parent 15832f6177
commit 56caa09808
2 changed files with 6 additions and 21 deletions

View File

@ -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_DEPENDENCY(ScalarEvolution)
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 @@ bool IVUsers::AddUsersIfInteresting(Instruction *I) {
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.