From 74b5b195fdc9a9eba82e2813b1586f491a534c1e Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 16 Dec 2014 23:41:59 +0000 Subject: [PATCH] SelectionDAG switch lowering: use 'unsigned' to count destination popularity SwitchInst::getNumCases() returns unsinged, so using uint64_t to count cases seems unnecessary. Also fix a missing CHECK in the test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224393 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 4 ++-- test/CodeGen/X86/switch-jump-table.ll | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 3c0229f2bf3..81b824f305e 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -2712,8 +2712,8 @@ void SelectionDAGBuilder::visitSwitch(const SwitchInst &SI) { !Cases.empty()) { // Replace an unreachable default destination with the most popular case // destination. - DenseMap Popularity; - uint64_t MaxPop = 0; + DenseMap Popularity; + unsigned MaxPop = 0; const BasicBlock *MaxBB = nullptr; for (auto I : SI.cases()) { const BasicBlock *BB = I.getCaseSuccessor(); diff --git a/test/CodeGen/X86/switch-jump-table.ll b/test/CodeGen/X86/switch-jump-table.ll index d1bd4bccbe0..a84fb4aafd1 100644 --- a/test/CodeGen/X86/switch-jump-table.ll +++ b/test/CodeGen/X86/switch-jump-table.ll @@ -6,7 +6,7 @@ define void @sum2(i32 %x, i32* %to) { ; CHECK-LABEL: sum2: ; CHECK: movl 4(%esp), [[REG:%e[a-z]{2}]] -; cmpl $3, [[REG]] +; CHECK: cmpl $3, [[REG]] ; CHECK: jbe .LBB0_1 ; CHECK: movl $4 ; CHECK: retl -- 2.34.1