#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/ValueHandle.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetLibraryInfo.h"
#define DEBUG_TYPE "lazy-value-info"
-// Experimentally derived threshold for the number of basic blocks lowered for
-// lattice value overdefined.
-static cl::opt<unsigned>
-OverdefinedBBThreshold("lvi-overdefined-BB-threshold",
- cl::init(1500), cl::Hidden,
- cl::desc("Threshold of the number of basic blocks lowered for lattice value"
- "'overdefined'."));
-
-// Experimentally derived threshold for additional lowering lattice values
-// overdefined per block.
-static cl::opt<unsigned>
-OverdefinedThreshold("lvi-overdefined-threshold", cl::init(10), cl::Hidden,
- cl::desc("Threshold of lowering lattice value 'overdefined'."));
-
char LazyValueInfo::ID = 0;
INITIALIZE_PASS_BEGIN(LazyValueInfo, "lazy-value-info",
"Lazy Value Information Analysis", false, true)
const DataLayout *DL;
/// An optional DT pointer.
DominatorTree *DT;
- /// A counter to record how many times Overdefined has been tried to be
- /// lowered.
- DenseMap<BasicBlock *, unsigned> LoweringOverdefinedTimes;
friend struct LVIValueHandle;
}
void LazyValueInfoCache::solve() {
- // Reset the counter of lowering overdefined value.
- LoweringOverdefinedTimes.clear();
-
while (!BlockValueStack.empty()) {
std::pair<BasicBlock*, Value*> &e = BlockValueStack.top();
if (solveBlockValue(e.second, e.first)) {
// lattice value to overdefined, so that cycles will terminate and be
// conservatively correct.
BBLV.markOverdefined();
- ++LoweringOverdefinedTimes[BB];
Instruction *BBI = dyn_cast<Instruction>(Val);
if (!BBI || BBI->getParent() != BB) {