#include "llvm/Analysis/AssumeBundleQueries.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/DebugCounter.h"
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacellvm::PatternMatch;
STATISTIC(NumAssumeQueries, "Number of Queries into an assume assume bundles");
STATISTIC(
NumUsefullAssumeQueries,
"Number of Queries into an assume assume bundles that were satisfied");
DEBUG_COUNTER(AssumeQueryCounter, "assume-queries-counter",
"Controls which assumes gets created");
static bool bundleHasArgument(const CallBase::BundleOpInfo &BOI, unsigned Idx) { … }
static Value *getValueFromBundleOpInfo(AssumeInst &Assume,
const CallBase::BundleOpInfo &BOI,
unsigned Idx) { … }
bool llvm::hasAttributeInAssume(AssumeInst &Assume, Value *IsOn,
StringRef AttrName, uint64_t *ArgVal) { … }
void llvm::fillMapFromAssume(AssumeInst &Assume, RetainedKnowledgeMap &Result) { … }
RetainedKnowledge
llvm::getKnowledgeFromBundle(AssumeInst &Assume,
const CallBase::BundleOpInfo &BOI) { … }
RetainedKnowledge llvm::getKnowledgeFromOperandInAssume(AssumeInst &Assume,
unsigned Idx) { … }
bool llvm::isAssumeWithEmptyBundle(const AssumeInst &Assume) { … }
static CallInst::BundleOpInfo *getBundleFromUse(const Use *U) { … }
RetainedKnowledge
llvm::getKnowledgeFromUse(const Use *U,
ArrayRef<Attribute::AttrKind> AttrKinds) { … }
RetainedKnowledge
llvm::getKnowledgeForValue(const Value *V,
ArrayRef<Attribute::AttrKind> AttrKinds,
AssumptionCache *AC,
function_ref<bool(RetainedKnowledge, Instruction *,
const CallBase::BundleOpInfo *)>
Filter) { … }
RetainedKnowledge llvm::getKnowledgeValidInContext(
const Value *V, ArrayRef<Attribute::AttrKind> AttrKinds,
const Instruction *CtxI, const DominatorTree *DT, AssumptionCache *AC) { … }