mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
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
This commit is contained in:
parent
526a14a344
commit
74b5b195fd
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user