fix formatting, add TODO; NFC

llvm-svn: 274238
This commit is contained in:
Sanjay Patel 2016-06-30 15:32:45 +00:00
parent 596a3bd9ec
commit 7521e1b880
1 changed files with 2 additions and 1 deletions

View File

@ -2176,6 +2176,7 @@ Instruction *InstCombiner::visitSwitchInst(SwitchInst &SI) {
unsigned LeadingKnownOnes = KnownOne.countLeadingOnes();
// Compute the number of leading bits we can ignore.
// TODO: A better way to determine this would use ComputeNumSignBits().
for (auto &C : SI.cases()) {
LeadingKnownZeros = std::min(
LeadingKnownZeros, C.getCaseValue()->getValue().countLeadingZeros());
@ -2189,7 +2190,7 @@ Instruction *InstCombiner::visitSwitchInst(SwitchInst &SI) {
// This may produce a non-standard type for the switch, but that's ok because
// the backend should extend back to a legal type for the target.
bool TruncCond = false;
if (NewWidth > 0 && NewWidth < BitWidth) {
if (NewWidth > 0 && NewWidth < BitWidth) {
TruncCond = true;
IntegerType *Ty = IntegerType::get(SI.getContext(), NewWidth);
Builder->SetInsertPoint(&SI);