]> granicus.if.org Git - llvm/commitdiff
fix formatting, add TODO; NFC
authorSanjay Patel <spatel@rotateright.com>
Thu, 30 Jun 2016 15:32:45 +0000 (15:32 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 30 Jun 2016 15:32:45 +0000 (15:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274238 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstructionCombining.cpp

index c0fb365cb88ec3104f8b370eaba51d7b23df9646..f48b1be5168b23b833d43df321337117e27f978a 100644 (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);