mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-28 07:17:32 +00:00
enable iv-users simplification by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89713 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -24,7 +24,6 @@
|
|||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@@ -32,10 +31,6 @@ char IVUsers::ID = 0;
|
|||||||
static RegisterPass<IVUsers>
|
static RegisterPass<IVUsers>
|
||||||
X("iv-users", "Induction Variable Users", false, true);
|
X("iv-users", "Induction Variable Users", false, true);
|
||||||
|
|
||||||
static cl::opt<bool>
|
|
||||||
SimplifyIVUsers("simplify-iv-users", cl::Hidden, cl::init(false),
|
|
||||||
cl::desc("Restrict IV Users to loop-invariant strides"));
|
|
||||||
|
|
||||||
Pass *llvm::createIVUsersPass() {
|
Pass *llvm::createIVUsersPass() {
|
||||||
return new IVUsers();
|
return new IVUsers();
|
||||||
}
|
}
|
||||||
@@ -214,8 +209,7 @@ bool IVUsers::AddUsersIfInteresting(Instruction *I) {
|
|||||||
return false; // Non-reducible symbolic expression, bail out.
|
return false; // Non-reducible symbolic expression, bail out.
|
||||||
|
|
||||||
// Keep things simple. Don't touch loop-variant strides.
|
// Keep things simple. Don't touch loop-variant strides.
|
||||||
if (SimplifyIVUsers && !Stride->isLoopInvariant(L)
|
if (!Stride->isLoopInvariant(L) && L->contains(I->getParent()))
|
||||||
&& L->contains(I->getParent()))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SmallPtrSet<Instruction *, 4> UniqueUsers;
|
SmallPtrSet<Instruction *, 4> UniqueUsers;
|
||||||
|
Reference in New Issue
Block a user