fix warning

DependenceAnalysis.cpp:1164:32: warning: implicit truncation from 'int' to bitfield changes value from -5 to 3
      [-Wconstant-conversion]
    Result.DV[Level].Direction &= ~Dependence::DVEntry::GT;
                               ^  ~~~~~~~~~~~~~~~~~~~~~~~~

Patch from Preston Briggs <preston.briggs@gmail.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165784 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sebastian Pop 2012-10-12 02:04:32 +00:00
parent 7d90d4d709
commit b4164284b5

View File

@ -1160,8 +1160,8 @@ bool DependenceAnalysis::weakCrossingSIVtest(const SCEV *Coeff,
DEBUG(dbgs() << "\t Delta = " << *Delta << "\n"); DEBUG(dbgs() << "\t Delta = " << *Delta << "\n");
NewConstraint.setLine(Coeff, Coeff, Delta, CurLoop); NewConstraint.setLine(Coeff, Coeff, Delta, CurLoop);
if (Delta->isZero()) { if (Delta->isZero()) {
Result.DV[Level].Direction &= ~Dependence::DVEntry::LT; Result.DV[Level].Direction &= unsigned(~Dependence::DVEntry::LT);
Result.DV[Level].Direction &= ~Dependence::DVEntry::GT; Result.DV[Level].Direction &= unsigned(~Dependence::DVEntry::GT);
++WeakCrossingSIVsuccesses; ++WeakCrossingSIVsuccesses;
if (!Result.DV[Level].Direction) { if (!Result.DV[Level].Direction) {
++WeakCrossingSIVindependence; ++WeakCrossingSIVindependence;
@ -1222,8 +1222,8 @@ bool DependenceAnalysis::weakCrossingSIVtest(const SCEV *Coeff,
} }
if (isKnownPredicate(CmpInst::ICMP_EQ, Delta, ML)) { if (isKnownPredicate(CmpInst::ICMP_EQ, Delta, ML)) {
// i = i' = UB // i = i' = UB
Result.DV[Level].Direction &= ~Dependence::DVEntry::LT; Result.DV[Level].Direction &= unsigned(~Dependence::DVEntry::LT);
Result.DV[Level].Direction &= ~Dependence::DVEntry::GT; Result.DV[Level].Direction &= unsigned(~Dependence::DVEntry::GT);
++WeakCrossingSIVsuccesses; ++WeakCrossingSIVsuccesses;
if (!Result.DV[Level].Direction) { if (!Result.DV[Level].Direction) {
++WeakCrossingSIVindependence; ++WeakCrossingSIVindependence;
@ -1256,7 +1256,7 @@ bool DependenceAnalysis::weakCrossingSIVtest(const SCEV *Coeff,
DEBUG(dbgs() << "\t Remainder = " << Remainder << "\n"); DEBUG(dbgs() << "\t Remainder = " << Remainder << "\n");
if (Remainder != 0) { if (Remainder != 0) {
// Equal direction isn't possible // Equal direction isn't possible
Result.DV[Level].Direction &= ~Dependence::DVEntry::EQ; Result.DV[Level].Direction &= unsigned(~Dependence::DVEntry::EQ);
++WeakCrossingSIVsuccesses; ++WeakCrossingSIVsuccesses;
} }
return false; return false;
@ -2380,7 +2380,7 @@ bool DependenceAnalysis::gcdMIVtest(const SCEV *Src,
DEBUG(dbgs() << "\tRemainder = " << Remainder << "\n"); DEBUG(dbgs() << "\tRemainder = " << Remainder << "\n");
if (Remainder != 0) { if (Remainder != 0) {
unsigned Level = mapSrcLoop(CurLoop); unsigned Level = mapSrcLoop(CurLoop);
Result.DV[Level - 1].Direction &= ~Dependence::DVEntry::EQ; Result.DV[Level - 1].Direction &= unsigned(~Dependence::DVEntry::EQ);
Improved = true; Improved = true;
} }
} }