summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-12-16 23:41:59 +0000
committerHans Wennborg <hans@hanshq.net>2014-12-16 23:41:59 +0000
commit224cb82a39851c9d9f34c13c469c78e14ca4d8e4 (patch)
treeb17dbeaa0edb70318cf6c6a610df4f931303d7e9
parent5e09c8c32cb61ef3633afa7ecfc9609b5b97c779 (diff)
downloadbcm5719-llvm-224cb82a39851c9d9f34c13c469c78e14ca4d8e4.tar.gz
bcm5719-llvm-224cb82a39851c9d9f34c13c469c78e14ca4d8e4.zip
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. llvm-svn: 224393
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp4
-rw-r--r--llvm/test/CodeGen/X86/switch-jump-table.ll2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 3c0229f2bf3..81b824f305e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/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<const BasicBlock *, uint64_t> Popularity;
- uint64_t MaxPop = 0;
+ DenseMap<const BasicBlock *, unsigned> Popularity;
+ unsigned MaxPop = 0;
const BasicBlock *MaxBB = nullptr;
for (auto I : SI.cases()) {
const BasicBlock *BB = I.getCaseSuccessor();
diff --git a/llvm/test/CodeGen/X86/switch-jump-table.ll b/llvm/test/CodeGen/X86/switch-jump-table.ll
index d1bd4bccbe0..a84fb4aafd1 100644
--- a/llvm/test/CodeGen/X86/switch-jump-table.ll
+++ b/llvm/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
OpenPOWER on IntegriCloud