mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
LazyValueInfo: fix some typos and indentation, etc. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222554 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
//===- LazyValueInfo.cpp - Value constraint analysis ----------------------===//
|
//===- LazyValueInfo.cpp - Value constraint analysis ------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@@ -520,15 +520,15 @@ bool LazyValueInfoCache::solveBlockValue(Value *Val, BasicBlock *BB) {
|
|||||||
|
|
||||||
// OverDefinedCacheUpdater is a helper object that will update
|
// OverDefinedCacheUpdater is a helper object that will update
|
||||||
// the OverDefinedCache for us when this method exits. Make sure to
|
// the OverDefinedCache for us when this method exits. Make sure to
|
||||||
// call markResult on it as we exist, passing a bool to indicate if the
|
// call markResult on it as we exit, passing a bool to indicate if the
|
||||||
// cache needs updating, i.e. if we have solve a new value or not.
|
// cache needs updating, i.e. if we have solved a new value or not.
|
||||||
OverDefinedCacheUpdater ODCacheUpdater(Val, BB, BBLV, this);
|
OverDefinedCacheUpdater ODCacheUpdater(Val, BB, BBLV, this);
|
||||||
|
|
||||||
if (!BBLV.isUndefined()) {
|
if (!BBLV.isUndefined()) {
|
||||||
DEBUG(dbgs() << " reuse BB '" << BB->getName() << "' val=" << BBLV <<'\n');
|
DEBUG(dbgs() << " reuse BB '" << BB->getName() << "' val=" << BBLV <<'\n');
|
||||||
|
|
||||||
// Since we're reusing a cached value here, we don't need to update the
|
// Since we're reusing a cached value here, we don't need to update the
|
||||||
// OverDefinedCahce. The cache will have been properly updated
|
// OverDefinedCache. The cache will have been properly updated
|
||||||
// whenever the cached value was inserted.
|
// whenever the cached value was inserted.
|
||||||
ODCacheUpdater.markResult(false);
|
ODCacheUpdater.markResult(false);
|
||||||
return true;
|
return true;
|
||||||
@@ -724,11 +724,12 @@ static bool getValueFromFromCondition(Value *Val, ICmpInst *ICI,
|
|||||||
LVILatticeVal &Result,
|
LVILatticeVal &Result,
|
||||||
bool isTrueDest = true);
|
bool isTrueDest = true);
|
||||||
|
|
||||||
// If we can determine a constant range for the value Val at the context
|
// If we can determine a constant range for the value Val in the context
|
||||||
// provided by the instruction BBI, then merge it into BBLV. If we did find a
|
// provided by the instruction BBI, then merge it into BBLV. If we did find a
|
||||||
// constant range, return true.
|
// constant range, return true.
|
||||||
void LazyValueInfoCache::mergeAssumeBlockValueConstantRange(
|
void LazyValueInfoCache::mergeAssumeBlockValueConstantRange(Value *Val,
|
||||||
Value *Val, LVILatticeVal &BBLV, Instruction *BBI) {
|
LVILatticeVal &BBLV,
|
||||||
|
Instruction *BBI) {
|
||||||
BBI = BBI ? BBI : dyn_cast<Instruction>(Val);
|
BBI = BBI ? BBI : dyn_cast<Instruction>(Val);
|
||||||
if (!BBI)
|
if (!BBI)
|
||||||
return;
|
return;
|
||||||
@@ -944,7 +945,7 @@ bool LazyValueInfoCache::getEdgeValue(Value *Val, BasicBlock *BBFrom,
|
|||||||
|
|
||||||
if (getEdgeValueLocal(Val, BBFrom, BBTo, Result)) {
|
if (getEdgeValueLocal(Val, BBFrom, BBTo, Result)) {
|
||||||
if (!Result.isConstantRange() ||
|
if (!Result.isConstantRange() ||
|
||||||
Result.getConstantRange().getSingleElement())
|
Result.getConstantRange().getSingleElement())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// FIXME: this check should be moved to the beginning of the function when
|
// FIXME: this check should be moved to the beginning of the function when
|
||||||
@@ -975,7 +976,7 @@ bool LazyValueInfoCache::getEdgeValue(Value *Val, BasicBlock *BBFrom,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we couldn't compute the value on the edge, use the value from the BB
|
// If we couldn't compute the value on the edge, use the value from the BB.
|
||||||
Result = getBlockValue(Val, BBFrom);
|
Result = getBlockValue(Val, BBFrom);
|
||||||
mergeAssumeBlockValueConstantRange(Val, Result, BBFrom->getTerminator());
|
mergeAssumeBlockValueConstantRange(Val, Result, BBFrom->getTerminator());
|
||||||
// We can use the context instruction (generically the ultimate instruction
|
// We can use the context instruction (generically the ultimate instruction
|
||||||
@@ -1041,7 +1042,7 @@ void LazyValueInfoCache::threadEdge(BasicBlock *PredBB, BasicBlock *OldSucc,
|
|||||||
// we clear their entries from the cache, and allow lazy updating to recompute
|
// we clear their entries from the cache, and allow lazy updating to recompute
|
||||||
// them when needed.
|
// them when needed.
|
||||||
|
|
||||||
// The updating process is fairly simple: we need to dropped cached info
|
// The updating process is fairly simple: we need to drop cached info
|
||||||
// for all values that were marked overdefined in OldSucc, and for those same
|
// for all values that were marked overdefined in OldSucc, and for those same
|
||||||
// values in any successor of OldSucc (except NewSucc) in which they were
|
// values in any successor of OldSucc (except NewSucc) in which they were
|
||||||
// also marked overdefined.
|
// also marked overdefined.
|
||||||
@@ -1116,6 +1117,7 @@ bool LazyValueInfo::runOnFunction(Function &F) {
|
|||||||
|
|
||||||
DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
|
DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
|
||||||
DL = DLP ? &DLP->getDataLayout() : nullptr;
|
DL = DLP ? &DLP->getDataLayout() : nullptr;
|
||||||
|
|
||||||
TLI = &getAnalysis<TargetLibraryInfo>();
|
TLI = &getAnalysis<TargetLibraryInfo>();
|
||||||
|
|
||||||
if (PImpl)
|
if (PImpl)
|
||||||
|
Reference in New Issue
Block a user