Remove an unnecessary if statement and adjust indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34939 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2007-03-05 23:36:13 +00:00
parent 229baffc4e
commit baf1e4b914

View File

@@ -2407,10 +2407,9 @@ Instruction *InstCombiner::visitUDiv(BinaryOperator &I) {
// udiv X, (Select Cond, C1, C2) --> Select Cond, (shr X, C1), (shr X, C2)
// where C1&C2 are powers of two.
if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) {
if (SelectInst *SI = dyn_cast<SelectInst>(Op1))
if (ConstantInt *STO = dyn_cast<ConstantInt>(SI->getOperand(1)))
if (ConstantInt *SFO = dyn_cast<ConstantInt>(SI->getOperand(2)))
if (!STO->isNullValue() && !STO->isNullValue()) {
if (ConstantInt *SFO = dyn_cast<ConstantInt>(SI->getOperand(2))) {
uint64_t TVA = STO->getZExtValue(), FVA = SFO->getZExtValue();
if (isPowerOf2_64(TVA) && isPowerOf2_64(FVA)) {
// Compute the shift amounts
@@ -2431,7 +2430,6 @@ Instruction *InstCombiner::visitUDiv(BinaryOperator &I) {
return new SelectInst(SI->getOperand(0), TSI, FSI, SI->getName());
}
}
}
return 0;
}