forked from OSchip/llvm-project
[LVI] Hide a confusing internal interface
llvm-svn: 288764
This commit is contained in:
parent
9a561aa34c
commit
b29496246f
|
@ -148,6 +148,7 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
/// Return true if this is a change in status.
|
/// Return true if this is a change in status.
|
||||||
bool markConstant(Constant *V) {
|
bool markConstant(Constant *V) {
|
||||||
assert(V && "Marking constant with NULL");
|
assert(V && "Marking constant with NULL");
|
||||||
|
@ -202,6 +203,8 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
/// Merge the specified lattice value into this one, updating this
|
/// Merge the specified lattice value into this one, updating this
|
||||||
/// one and returning true if anything changed.
|
/// one and returning true if anything changed.
|
||||||
bool mergeIn(const LVILatticeVal &RHS, const DataLayout &DL) {
|
bool mergeIn(const LVILatticeVal &RHS, const DataLayout &DL) {
|
||||||
|
@ -1028,22 +1031,22 @@ bool LazyValueInfoImpl::solveBlockValueSelect(LVILatticeVal &BBLV,
|
||||||
// ValueTracking getting smarter looking back past our immediate inputs.)
|
// ValueTracking getting smarter looking back past our immediate inputs.)
|
||||||
if (SelectPatternResult::isMinOrMax(SPR.Flavor) &&
|
if (SelectPatternResult::isMinOrMax(SPR.Flavor) &&
|
||||||
LHS == SI->getTrueValue() && RHS == SI->getFalseValue()) {
|
LHS == SI->getTrueValue() && RHS == SI->getFalseValue()) {
|
||||||
|
ConstantRange ResultCR = [&]() {
|
||||||
switch (SPR.Flavor) {
|
switch (SPR.Flavor) {
|
||||||
default:
|
default:
|
||||||
llvm_unreachable("unexpected minmax type!");
|
llvm_unreachable("unexpected minmax type!");
|
||||||
case SPF_SMIN: /// Signed minimum
|
case SPF_SMIN: /// Signed minimum
|
||||||
BBLV.markConstantRange(TrueCR.smin(FalseCR));
|
return TrueCR.smin(FalseCR);
|
||||||
return true;
|
|
||||||
case SPF_UMIN: /// Unsigned minimum
|
case SPF_UMIN: /// Unsigned minimum
|
||||||
BBLV.markConstantRange(TrueCR.umin(FalseCR));
|
return TrueCR.umin(FalseCR);
|
||||||
return true;
|
|
||||||
case SPF_SMAX: /// Signed maximum
|
case SPF_SMAX: /// Signed maximum
|
||||||
BBLV.markConstantRange(TrueCR.smax(FalseCR));
|
return TrueCR.smax(FalseCR);
|
||||||
return true;
|
|
||||||
case SPF_UMAX: /// Unsigned maximum
|
case SPF_UMAX: /// Unsigned maximum
|
||||||
BBLV.markConstantRange(TrueCR.umax(FalseCR));
|
return TrueCR.umax(FalseCR);
|
||||||
return true;
|
|
||||||
};
|
};
|
||||||
|
}();
|
||||||
|
BBLV = LVILatticeVal::getRange(ResultCR);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: ABS, NABS from the SelectPatternResult
|
// TODO: ABS, NABS from the SelectPatternResult
|
||||||
|
|
Loading…
Reference in New Issue