Skip to content

Commit

Permalink
Remove the AssumptionCache
Browse files Browse the repository at this point in the history
After r289755, the AssumptionCache is no longer needed. Variables affected by
assumptions are now found by using the new operand-bundle-based scheme. This
new scheme is more computationally efficient, and also we need much less
code...

llvm-svn: 289756
  • Loading branch information
Hal Finkel committed Dec 15, 2016
1 parent cb9f78e commit 3ca4a6b
Show file tree
Hide file tree
Showing 99 changed files with 572 additions and 1,358 deletions.
168 changes: 0 additions & 168 deletions llvm/include/llvm/Analysis/AssumptionCache.h

This file was deleted.

17 changes: 7 additions & 10 deletions llvm/include/llvm/Analysis/BasicAliasAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
Expand All @@ -27,7 +26,6 @@
#include "llvm/Support/ErrorHandling.h"

namespace llvm {
class AssumptionCache;
class DominatorTree;
class LoopInfo;

Expand All @@ -41,21 +39,20 @@ class BasicAAResult : public AAResultBase<BasicAAResult> {

const DataLayout &DL;
const TargetLibraryInfo &TLI;
AssumptionCache &AC;
DominatorTree *DT;
LoopInfo *LI;

public:
BasicAAResult(const DataLayout &DL, const TargetLibraryInfo &TLI,
AssumptionCache &AC, DominatorTree *DT = nullptr,
DominatorTree *DT = nullptr,
LoopInfo *LI = nullptr)
: AAResultBase(), DL(DL), TLI(TLI), AC(AC), DT(DT), LI(LI) {}
: AAResultBase(), DL(DL), TLI(TLI), DT(DT), LI(LI) {}

BasicAAResult(const BasicAAResult &Arg)
: AAResultBase(Arg), DL(Arg.DL), TLI(Arg.TLI), AC(Arg.AC), DT(Arg.DT),
: AAResultBase(Arg), DL(Arg.DL), TLI(Arg.TLI), DT(Arg.DT),
LI(Arg.LI) {}
BasicAAResult(BasicAAResult &&Arg)
: AAResultBase(std::move(Arg)), DL(Arg.DL), TLI(Arg.TLI), AC(Arg.AC),
: AAResultBase(std::move(Arg)), DL(Arg.DL), TLI(Arg.TLI),
DT(Arg.DT), LI(Arg.LI) {}

AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB);
Expand Down Expand Up @@ -145,11 +142,11 @@ class BasicAAResult : public AAResultBase<BasicAAResult> {
static const Value *
GetLinearExpression(const Value *V, APInt &Scale, APInt &Offset,
unsigned &ZExtBits, unsigned &SExtBits,
const DataLayout &DL, unsigned Depth, AssumptionCache *AC,
const DataLayout &DL, unsigned Depth,
DominatorTree *DT, bool &NSW, bool &NUW);

static bool DecomposeGEPExpression(const Value *V, DecomposedGEP &Decomposed,
const DataLayout &DL, AssumptionCache *AC, DominatorTree *DT);
const DataLayout &DL, DominatorTree *DT);

static bool isGEPBaseAtNegativeOffset(const GEPOperator *GEPOp,
const DecomposedGEP &DecompGEP, const DecomposedGEP &DecompObject,
Expand All @@ -166,7 +163,7 @@ class BasicAAResult : public AAResultBase<BasicAAResult> {
bool
constantOffsetHeuristic(const SmallVectorImpl<VariableGEPIndex> &VarIndices,
uint64_t V1Size, uint64_t V2Size, int64_t BaseOffset,
AssumptionCache *AC, DominatorTree *DT);
DominatorTree *DT);

bool isValueEqualInPotentialCycles(const Value *V1, const Value *V2);

Expand Down
5 changes: 2 additions & 3 deletions llvm/include/llvm/Analysis/CodeMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "llvm/IR/CallSite.h"

namespace llvm {
class AssumptionCache;
class BasicBlock;
class Loop;
class Function;
Expand Down Expand Up @@ -91,12 +90,12 @@ struct CodeMetrics {

/// \brief Collect a loop's ephemeral values (those used only by an assume
/// or similar intrinsics in the loop).
static void collectEphemeralValues(const Loop *L, AssumptionCache *AC,
static void collectEphemeralValues(const Loop *L,
SmallPtrSetImpl<const Value *> &EphValues);

/// \brief Collect a functions's ephemeral values (those used only by an
/// assume or similar intrinsics in the function).
static void collectEphemeralValues(const Function *L, AssumptionCache *AC,
static void collectEphemeralValues(const Function *L,
SmallPtrSetImpl<const Value *> &EphValues);
};

Expand Down
6 changes: 2 additions & 4 deletions llvm/include/llvm/Analysis/DemandedBits.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ class FunctionPass;
class Function;
class Instruction;
class DominatorTree;
class AssumptionCache;

class DemandedBits {
public:
DemandedBits(Function &F, AssumptionCache &AC, DominatorTree &DT) :
F(F), AC(AC), DT(DT), Analyzed(false) {}
DemandedBits(Function &F, DominatorTree &DT) :
F(F), DT(DT), Analyzed(false) {}

/// Return the bits demanded from instruction I.
APInt getDemandedBits(Instruction *I);
Expand All @@ -51,7 +50,6 @@ class DemandedBits {

private:
Function &F;
AssumptionCache &AC;
DominatorTree &DT;

void performAnalysis();
Expand Down
6 changes: 2 additions & 4 deletions llvm/include/llvm/Analysis/IVUsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

namespace llvm {

class AssumptionCache;
class DominatorTree;
class Instruction;
class Value;
Expand Down Expand Up @@ -94,7 +93,6 @@ class IVStrideUse final : public CallbackVH, public ilist_node<IVStrideUse> {
class IVUsers {
friend class IVStrideUse;
Loop *L;
AssumptionCache *AC;
LoopInfo *LI;
DominatorTree *DT;
ScalarEvolution *SE;
Expand All @@ -108,11 +106,11 @@ class IVUsers {
SmallPtrSet<const Value *, 32> EphValues;

public:
IVUsers(Loop *L, AssumptionCache *AC, LoopInfo *LI, DominatorTree *DT,
IVUsers(Loop *L, LoopInfo *LI, DominatorTree *DT,
ScalarEvolution *SE);

IVUsers(IVUsers &&X)
: L(std::move(X.L)), AC(std::move(X.AC)), DT(std::move(X.DT)),
: L(std::move(X.L)), DT(std::move(X.DT)),
SE(std::move(X.SE)), Processed(std::move(X.Processed)),
IVUses(std::move(X.IVUses)), EphValues(std::move(X.EphValues)) {
for (IVStrideUse &U : IVUses)
Expand Down
4 changes: 0 additions & 4 deletions llvm/include/llvm/Analysis/InlineCost.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
#define LLVM_ANALYSIS_INLINECOST_H

#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/Analysis/AssumptionCache.h"
#include <cassert>
#include <climits>

namespace llvm {
class AssumptionCacheTracker;
class CallSite;
class DataLayout;
class Function;
Expand Down Expand Up @@ -170,7 +168,6 @@ InlineParams getInlineParams(unsigned OptLevel, unsigned SizeOptLevel);
InlineCost
getInlineCost(CallSite CS, const InlineParams &Params,
TargetTransformInfo &CalleeTTI,
std::function<AssumptionCache &(Function &)> &GetAssumptionCache,
ProfileSummaryInfo *PSI);

/// \brief Get an InlineCost with the callee explicitly specified.
Expand All @@ -181,7 +178,6 @@ getInlineCost(CallSite CS, const InlineParams &Params,
InlineCost
getInlineCost(CallSite CS, Function *Callee, const InlineParams &Params,
TargetTransformInfo &CalleeTTI,
std::function<AssumptionCache &(Function &)> &GetAssumptionCache,
ProfileSummaryInfo *PSI);

/// \brief Minimal filter to detect invalid constructs for inlining.
Expand Down
Loading

0 comments on commit 3ca4a6b

Please sign in to comment.