mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 05:31:51 +00:00
Trim includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136218 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0da49df0b1
commit
a09d514b29
@ -21,11 +21,10 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/InstrTypes.h"
|
||||||
#include "llvm/Support/ConstantRange.h"
|
#include "llvm/Support/ConstantRange.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/Instructions.h"
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
/// Initialize a full (the default) or empty set for the specified type.
|
/// Initialize a full (the default) or empty set for the specified type.
|
||||||
@ -57,55 +56,55 @@ ConstantRange ConstantRange::makeICmpRegion(unsigned Pred,
|
|||||||
uint32_t W = CR.getBitWidth();
|
uint32_t W = CR.getBitWidth();
|
||||||
switch (Pred) {
|
switch (Pred) {
|
||||||
default: assert(!"Invalid ICmp predicate to makeICmpRegion()");
|
default: assert(!"Invalid ICmp predicate to makeICmpRegion()");
|
||||||
case ICmpInst::ICMP_EQ:
|
case CmpInst::ICMP_EQ:
|
||||||
return CR;
|
return CR;
|
||||||
case ICmpInst::ICMP_NE:
|
case CmpInst::ICMP_NE:
|
||||||
if (CR.isSingleElement())
|
if (CR.isSingleElement())
|
||||||
return ConstantRange(CR.getUpper(), CR.getLower());
|
return ConstantRange(CR.getUpper(), CR.getLower());
|
||||||
return ConstantRange(W);
|
return ConstantRange(W);
|
||||||
case ICmpInst::ICMP_ULT: {
|
case CmpInst::ICMP_ULT: {
|
||||||
APInt UMax(CR.getUnsignedMax());
|
APInt UMax(CR.getUnsignedMax());
|
||||||
if (UMax.isMinValue())
|
if (UMax.isMinValue())
|
||||||
return ConstantRange(W, /* empty */ false);
|
return ConstantRange(W, /* empty */ false);
|
||||||
return ConstantRange(APInt::getMinValue(W), UMax);
|
return ConstantRange(APInt::getMinValue(W), UMax);
|
||||||
}
|
}
|
||||||
case ICmpInst::ICMP_SLT: {
|
case CmpInst::ICMP_SLT: {
|
||||||
APInt SMax(CR.getSignedMax());
|
APInt SMax(CR.getSignedMax());
|
||||||
if (SMax.isMinSignedValue())
|
if (SMax.isMinSignedValue())
|
||||||
return ConstantRange(W, /* empty */ false);
|
return ConstantRange(W, /* empty */ false);
|
||||||
return ConstantRange(APInt::getSignedMinValue(W), SMax);
|
return ConstantRange(APInt::getSignedMinValue(W), SMax);
|
||||||
}
|
}
|
||||||
case ICmpInst::ICMP_ULE: {
|
case CmpInst::ICMP_ULE: {
|
||||||
APInt UMax(CR.getUnsignedMax());
|
APInt UMax(CR.getUnsignedMax());
|
||||||
if (UMax.isMaxValue())
|
if (UMax.isMaxValue())
|
||||||
return ConstantRange(W);
|
return ConstantRange(W);
|
||||||
return ConstantRange(APInt::getMinValue(W), UMax + 1);
|
return ConstantRange(APInt::getMinValue(W), UMax + 1);
|
||||||
}
|
}
|
||||||
case ICmpInst::ICMP_SLE: {
|
case CmpInst::ICMP_SLE: {
|
||||||
APInt SMax(CR.getSignedMax());
|
APInt SMax(CR.getSignedMax());
|
||||||
if (SMax.isMaxSignedValue())
|
if (SMax.isMaxSignedValue())
|
||||||
return ConstantRange(W);
|
return ConstantRange(W);
|
||||||
return ConstantRange(APInt::getSignedMinValue(W), SMax + 1);
|
return ConstantRange(APInt::getSignedMinValue(W), SMax + 1);
|
||||||
}
|
}
|
||||||
case ICmpInst::ICMP_UGT: {
|
case CmpInst::ICMP_UGT: {
|
||||||
APInt UMin(CR.getUnsignedMin());
|
APInt UMin(CR.getUnsignedMin());
|
||||||
if (UMin.isMaxValue())
|
if (UMin.isMaxValue())
|
||||||
return ConstantRange(W, /* empty */ false);
|
return ConstantRange(W, /* empty */ false);
|
||||||
return ConstantRange(UMin + 1, APInt::getNullValue(W));
|
return ConstantRange(UMin + 1, APInt::getNullValue(W));
|
||||||
}
|
}
|
||||||
case ICmpInst::ICMP_SGT: {
|
case CmpInst::ICMP_SGT: {
|
||||||
APInt SMin(CR.getSignedMin());
|
APInt SMin(CR.getSignedMin());
|
||||||
if (SMin.isMaxSignedValue())
|
if (SMin.isMaxSignedValue())
|
||||||
return ConstantRange(W, /* empty */ false);
|
return ConstantRange(W, /* empty */ false);
|
||||||
return ConstantRange(SMin + 1, APInt::getSignedMinValue(W));
|
return ConstantRange(SMin + 1, APInt::getSignedMinValue(W));
|
||||||
}
|
}
|
||||||
case ICmpInst::ICMP_UGE: {
|
case CmpInst::ICMP_UGE: {
|
||||||
APInt UMin(CR.getUnsignedMin());
|
APInt UMin(CR.getUnsignedMin());
|
||||||
if (UMin.isMinValue())
|
if (UMin.isMinValue())
|
||||||
return ConstantRange(W);
|
return ConstantRange(W);
|
||||||
return ConstantRange(UMin, APInt::getNullValue(W));
|
return ConstantRange(UMin, APInt::getNullValue(W));
|
||||||
}
|
}
|
||||||
case ICmpInst::ICMP_SGE: {
|
case CmpInst::ICMP_SGE: {
|
||||||
APInt SMin(CR.getSignedMin());
|
APInt SMin(CR.getSignedMin());
|
||||||
if (SMin.isMinSignedValue())
|
if (SMin.isMinSignedValue())
|
||||||
return ConstantRange(W);
|
return ConstantRange(W);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user