mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-26 09:18:56 +00:00
Expose isNonConstantNegative to users of ScalarEvolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147700 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -284,6 +284,20 @@ bool SCEV::isAllOnesValue() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// isNonConstantNegative - Return true if the specified scev is negated, but
|
||||
/// not a constant.
|
||||
bool SCEV::isNonConstantNegative() const {
|
||||
const SCEVMulExpr *Mul = dyn_cast<SCEVMulExpr>(this);
|
||||
if (!Mul) return false;
|
||||
|
||||
// If there is a constant factor, it will be first.
|
||||
const SCEVConstant *SC = dyn_cast<SCEVConstant>(Mul->getOperand(0));
|
||||
if (!SC) return false;
|
||||
|
||||
// Return true if the value is negative, this matches things like (-42 * V).
|
||||
return SC->getValue()->getValue().isNegative();
|
||||
}
|
||||
|
||||
SCEVCouldNotCompute::SCEVCouldNotCompute() :
|
||||
SCEV(FoldingSetNodeIDRef(), scCouldNotCompute) {}
|
||||
|
||||
|
Reference in New Issue
Block a user