Skip to content

Commit

Permalink
Remove some dead assignements found by scan-build
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204013 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Arnaud-de-Grandmaison committed Mar 15, 2014
1 parent 571832b commit 3c143dd
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
7 changes: 1 addition & 6 deletions lib/Analysis/ScalarEvolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6155,7 +6155,6 @@ ScalarEvolution::isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
default:
llvm_unreachable("Unexpected ICmpInst::Predicate value!");
case ICmpInst::ICMP_SGT:
Pred = ICmpInst::ICMP_SLT;
std::swap(LHS, RHS);
case ICmpInst::ICMP_SLT: {
ConstantRange LHSRange = getSignedRange(LHS);
Expand All @@ -6167,7 +6166,6 @@ ScalarEvolution::isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
break;
}
case ICmpInst::ICMP_SGE:
Pred = ICmpInst::ICMP_SLE;
std::swap(LHS, RHS);
case ICmpInst::ICMP_SLE: {
ConstantRange LHSRange = getSignedRange(LHS);
Expand All @@ -6179,7 +6177,6 @@ ScalarEvolution::isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
break;
}
case ICmpInst::ICMP_UGT:
Pred = ICmpInst::ICMP_ULT;
std::swap(LHS, RHS);
case ICmpInst::ICMP_ULT: {
ConstantRange LHSRange = getUnsignedRange(LHS);
Expand All @@ -6191,7 +6188,6 @@ ScalarEvolution::isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
break;
}
case ICmpInst::ICMP_UGE:
Pred = ICmpInst::ICMP_ULE;
std::swap(LHS, RHS);
case ICmpInst::ICMP_ULE: {
ConstantRange LHSRange = getUnsignedRange(LHS);
Expand Down Expand Up @@ -6597,7 +6593,7 @@ ScalarEvolution::HowManyLessThans(const SCEV *LHS, const SCEV *RHS,
IsSigned ? APIntOps::smin(getSignedRange(RHS).getSignedMax(), Limit)
: APIntOps::umin(getUnsignedRange(RHS).getUnsignedMax(), Limit);

const SCEV *MaxBECount = getCouldNotCompute();
const SCEV *MaxBECount;
if (isa<SCEVConstant>(BECount))
MaxBECount = BECount;
else
Expand Down Expand Up @@ -7114,7 +7110,6 @@ struct SCEVDivision : public SCEVVisitor<SCEVDivision, const SCEV *> {
Operands.push_back(Expr->getOperand(i));
}
} else {
FoundGCDTerm = false;
const SCEV *PartialGCD = One;
for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
if (PartialGCD == GCD) {
Expand Down
3 changes: 1 addition & 2 deletions lib/CodeGen/MachineInstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const {
OS << "tied";
if (TiedTo != 15)
OS << unsigned(TiedTo - 1);
NeedComma = true;
}
OS << '>';
}
Expand Down Expand Up @@ -1687,7 +1686,7 @@ void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM,
}
}
} else if (!debugLoc.isUnknown() && MF) {
if (!HaveSemi) OS << ";"; HaveSemi = true;
if (!HaveSemi) OS << ";";
OS << " dbg:";
printDebugLoc(debugLoc, MF, OS);
}
Expand Down
1 change: 0 additions & 1 deletion lib/CodeGen/RegisterCoalescer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ bool CoalescerPair::setRegisters(const MachineInstr *MI) {
if (SrcSub) {
Dst = TRI.getMatchingSuperReg(Dst, SrcSub, MRI.getRegClass(Src));
if (!Dst) return false;
SrcSub = 0;
} else if (!MRI.getRegClass(Src)->contains(Dst)) {
return false;
}
Expand Down
1 change: 0 additions & 1 deletion lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7506,7 +7506,6 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const {
CommuteVectorShuffleMask(M, NumElems);
std::swap(V1, V2);
std::swap(V1IsSplat, V2IsSplat);
Commuted = false;

if (isUNPCKLMask(M, VT, HasInt256))
return getTargetShuffleNode(X86ISD::UNPCKL, dl, VT, V1, V2, DAG);
Expand Down
2 changes: 1 addition & 1 deletion lib/Transforms/Scalar/LoopStrengthReduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void Formula::print(raw_ostream &OS) const {
OS << ')';
}
if (UnfoldedOffset != 0) {
if (!First) OS << " + "; else First = false;
if (!First) OS << " + ";
OS << "imm(" << UnfoldedOffset << ')';
}
}
Expand Down

0 comments on commit 3c143dd

Please sign in to comment.