<div dir="ltr"><div dir="ltr">This commit causes an assertion failure when compiling LLVM sources. A small repro:<div><div>$ cat repro.cpp </div><div>class QQQ { </div><div>public: </div><div> bool x() const; </div><div> bool y() const;</div><div> unsigned getSizeInBits() const { </div><div> if (y() || x()) </div><div> return getScalarSizeInBits(); </div><div> return getScalarSizeInBits() * 2; </div><div> } </div><div> unsigned getScalarSizeInBits() const;</div><div>};</div><div>int f(const QQQ &Ty) {</div><div> switch (Ty.getSizeInBits()) {</div><div> case 1:</div><div> case 8:</div><div> return 0;</div><div> case 16:</div><div> return 1;</div><div> case 32:</div><div> return 2;</div><div> case 64:</div><div> return 3;</div><div> default:</div><div> __builtin_unreachable();</div><div> }</div><div>}</div><div>$ clang -O2 -o repro.o repro.cpp</div><div>assert.h assertion failed at llvm/include/llvm/ADT/ilist_iterator.h:139 in llvm::ilist_iterator::reference llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, true, false>::operator*() const [OptionsT = llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, IsReverse = true, IsConst = false]: !NodePtr->i<br></div><div>sKnownSentinel()</div><div>*** Check failure stack trace: ***</div><div> @ 0x558aab4afc10 __assert_fail<br></div><div> @ 0x558aa885479b llvm::ilist_iterator<>::operator*()</div><div> @ 0x558aa8854715 llvm::MachineInstrBundleIterator<>::operator*()</div><div> @ 0x558aa92c33c3 llvm::X86InstrInfo::optimizeCompareInstr()</div><div> @ 0x558aa9a9c251 (anonymous namespace)::PeepholeOptimizer::optimizeCmpInstr()</div><div> @ 0x558aa9a9b371 (anonymous namespace)::PeepholeOptimizer::runOnMachineFunction()</div><div> @ 0x558aa99a4fc8 llvm::MachineFunctionPass::runOnFunction()</div><div> @ 0x558aab019fc4 llvm::FPPassManager::runOnFunction()</div><div> @ 0x558aab01a3a5 llvm::FPPassManager::runOnModule()</div><div> @ 0x558aab01aa9b (anonymous namespace)::MPPassManager::runOnModule()</div><div> @ 0x558aab01a635 llvm::legacy::PassManagerImpl::run()</div><div> @ 0x558aab01afe1 llvm::legacy::PassManager::run()</div><div> @ 0x558aa5914769 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly()</div><div> @ 0x558aa5910f44 clang::EmitBackendOutput()</div><div> @ 0x558aa5906135 clang::BackendConsumer::HandleTranslationUnit()</div><div> @ 0x558aa6d165ad clang::ParseAST()</div><div> @ 0x558aa6a94e22 clang::ASTFrontendAction::ExecuteAction()</div><div> @ 0x558aa590255d clang::CodeGenAction::ExecuteAction()</div><div> @ 0x558aa6a94840 clang::FrontendAction::Execute()</div><div> @ 0x558aa6a38cca clang::CompilerInstance::ExecuteAction()</div><div> @ 0x558aa4e2294b clang::ExecuteCompilerInvocation()</div><div> @ 0x558aa4df6200 cc1_main()</div><div> @ 0x558aa4e1b37f ExecuteCC1Tool()</div><div> @ 0x558aa4e1a725 main</div><div> @ 0x7ff20d56abbd __libc_start_main</div><div> @ 0x558aa4df51c9 _start</div></div><div><br></div><div>Please revert or fix.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 6, 2019 at 8:26 AM Ayonam Ray via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: ayonam<br>
Date: Tue Mar 5 23:27:45 2019<br>
New Revision: 355483<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=355483&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=355483&view=rev</a><br>
Log:<br>
[CodeGen] Omit range checks from jump tables when lowering switches with unreachable default<br>
<br>
During the lowering of a switch that would result in the generation of a<br>
jump table, a range check is performed before indexing into the jump<br>
table, for the switch value being outside the jump table range and a<br>
conditional branch is inserted to jump to the default block. In case the<br>
default block is unreachable, this conditional jump can be omitted. This<br>
patch implements omitting this conditional branch for unreachable<br>
defaults.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D52002" rel="noreferrer" target="_blank">https://reviews.llvm.org/D52002</a><br>
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev<br>
<br>
Added:<br>
llvm/trunk/test/CodeGen/AArch64/switch-unreachable-default.ll<br>
Modified:<br>
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp<br>
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h<br>
llvm/trunk/test/CodeGen/X86/pr38743.ll<br>
llvm/trunk/test/CodeGen/X86/switch-jump-table.ll<br>
<br>
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=355483&r1=355482&r2=355483&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=355483&r1=355482&r2=355483&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Mar 5 23:27:45 2019<br>
@@ -2388,24 +2388,31 @@ void SelectionDAGBuilder::visitJumpTable<br>
JumpTableReg, SwitchOp);<br>
JT.Reg = JumpTableReg;<br>
<br>
- // Emit the range check for the jump table, and branch to the default block<br>
- // for the switch statement if the value being switched on exceeds the largest<br>
- // case in the switch.<br>
- SDValue CMP = DAG.getSetCC(<br>
- dl, TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(),<br>
- Sub.getValueType()),<br>
- Sub, DAG.getConstant(JTH.Last - JTH.First, dl, VT), ISD::SETUGT);<br>
-<br>
- SDValue BrCond = DAG.getNode(ISD::BRCOND, dl,<br>
- MVT::Other, CopyTo, CMP,<br>
- DAG.getBasicBlock(JT.Default));<br>
-<br>
- // Avoid emitting unnecessary branches to the next block.<br>
- if (JT.MBB != NextBlock(SwitchBB))<br>
- BrCond = DAG.getNode(ISD::BR, dl, MVT::Other, BrCond,<br>
- DAG.getBasicBlock(JT.MBB));<br>
-<br>
- DAG.setRoot(BrCond);<br>
+ if (!JTH.OmitRangeCheck) {<br>
+ // Emit the range check for the jump table, and branch to the default block<br>
+ // for the switch statement if the value being switched on exceeds the<br>
+ // largest case in the switch.<br>
+ SDValue CMP = DAG.getSetCC(<br>
+ dl, TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(),<br>
+ Sub.getValueType()),<br>
+ Sub, DAG.getConstant(JTH.Last - JTH.First, dl, VT), ISD::SETUGT);<br>
+<br>
+ SDValue BrCond = DAG.getNode(ISD::BRCOND, dl,<br>
+ MVT::Other, CopyTo, CMP,<br>
+ DAG.getBasicBlock(JT.Default));<br>
+<br>
+ // Avoid emitting unnecessary branches to the next block.<br>
+ if (JT.MBB != NextBlock(SwitchBB))<br>
+ BrCond = DAG.getNode(ISD::BR, dl, MVT::Other, BrCond,<br>
+ DAG.getBasicBlock(JT.MBB));<br>
+ <br>
+ DAG.setRoot(BrCond);<br>
+ } else {<br>
+ SDValue BrCond = DAG.getNode(ISD::BR, dl, MVT::Other, CopyTo,<br>
+ DAG.getBasicBlock(JT.MBB));<br>
+ DAG.setRoot(BrCond);<br>
+ SwitchBB->removeSuccessor(JT.Default, true);<br>
+ }<br>
}<br>
<br>
/// Create a LOAD_STACK_GUARD node, and let it carry the target specific global<br>
@@ -9790,10 +9797,13 @@ bool SelectionDAGBuilder::buildJumpTable<br>
->createJumpTableIndex(Table);<br>
<br>
// Set up the jump table info.<br>
+ bool UnreachableDefault =<br>
+ isa<UnreachableInst>(SI->getDefaultDest()->getFirstNonPHIOrDbg());<br>
+ bool OmitRangeCheck = UnreachableDefault;<br>
JumpTable JT(-1U, JTI, JumpTableMBB, nullptr);<br>
JumpTableHeader JTH(Clusters[First].Low->getValue(),<br>
Clusters[Last].High->getValue(), SI->getCondition(),<br>
- nullptr, false);<br>
+ nullptr, false, OmitRangeCheck);<br>
JTCases.emplace_back(std::move(JTH), std::move(JT));<br>
<br>
JTCluster = CaseCluster::jumpTable(Clusters[First].Low, Clusters[Last].High,<br>
@@ -10599,38 +10609,6 @@ void SelectionDAGBuilder::visitSwitch(co<br>
// if there are many clusters.<br>
sortAndRangeify(Clusters);<br>
<br>
- if (TM.getOptLevel() != CodeGenOpt::None) {<br>
- // Replace an unreachable default with the most popular destination.<br>
- // FIXME: Exploit unreachable default more aggressively.<br>
- bool UnreachableDefault =<br>
- isa<UnreachableInst>(SI.getDefaultDest()->getFirstNonPHIOrDbg());<br>
- if (UnreachableDefault && !Clusters.empty()) {<br>
- DenseMap<const BasicBlock *, unsigned> Popularity;<br>
- unsigned MaxPop = 0;<br>
- const BasicBlock *MaxBB = nullptr;<br>
- for (auto I : SI.cases()) {<br>
- const BasicBlock *BB = I.getCaseSuccessor();<br>
- if (++Popularity[BB] > MaxPop) {<br>
- MaxPop = Popularity[BB];<br>
- MaxBB = BB;<br>
- }<br>
- }<br>
- // Set new default.<br>
- assert(MaxPop > 0 && MaxBB);<br>
- DefaultMBB = FuncInfo.MBBMap[MaxBB];<br>
-<br>
- // Remove cases that were pointing to the destination that is now the<br>
- // default.<br>
- CaseClusterVector New;<br>
- New.reserve(Clusters.size());<br>
- for (CaseCluster &CC : Clusters) {<br>
- if (CC.MBB != DefaultMBB)<br>
- New.push_back(CC);<br>
- }<br>
- Clusters = std::move(New);<br>
- }<br>
- }<br>
-<br>
// The branch probablity of the peeled case.<br>
BranchProbability PeeledCaseProb = BranchProbability::getZero();<br>
MachineBasicBlock *PeeledSwitchMBB =<br>
<br>
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h?rev=355483&r1=355482&r2=355483&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h?rev=355483&r1=355482&r2=355483&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h (original)<br>
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h Tue Mar 5 23:27:45 2019<br>
@@ -277,11 +277,12 @@ private:<br>
const Value *SValue;<br>
MachineBasicBlock *HeaderBB;<br>
bool Emitted;<br>
+ bool OmitRangeCheck;<br>
<br>
JumpTableHeader(APInt F, APInt L, const Value *SV, MachineBasicBlock *H,<br>
- bool E = false)<br>
+ bool E = false, bool ORC = false)<br>
: First(std::move(F)), Last(std::move(L)), SValue(SV), HeaderBB(H),<br>
- Emitted(E) {}<br>
+ Emitted(E), OmitRangeCheck(ORC) {}<br>
};<br>
using JumpTableBlock = std::pair<JumpTableHeader, JumpTable>;<br>
<br>
<br>
Added: llvm/trunk/test/CodeGen/AArch64/switch-unreachable-default.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/switch-unreachable-default.ll?rev=355483&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/switch-unreachable-default.ll?rev=355483&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/CodeGen/AArch64/switch-unreachable-default.ll (added)<br>
+++ llvm/trunk/test/CodeGen/AArch64/switch-unreachable-default.ll Tue Mar 5 23:27:45 2019<br>
@@ -0,0 +1,62 @@<br>
+; RUN: llc -O3 -o - %s | FileCheck %s<br>
+<br>
+; Test that the output in the presence of an unreachable default does not have<br>
+; a compare and branch at the top of the switch to handle the default case.<br>
+<br>
+target triple = "aarch64-unknown-linux-gnu"<br>
+<br>
+; Function Attrs: nounwind<br>
+define void @fn(i4) {<br>
+ switch i4 %0, label %default [<br>
+ i4 0, label %case_0<br>
+ i4 1, label %case_1<br>
+ i4 2, label %case_2<br>
+ i4 3, label %case_3<br>
+ i4 4, label %case_4<br>
+ i4 5, label %case_5<br>
+ ]<br>
+<br>
+; CHECK-LABEL: fn:<br>
+; CHECK-NOT: sub<br>
+; CHECK-NOT: cmp<br>
+; CHECK-NOT: b.hi<br>
+; CHECK: ldr {{x[0-9]+}}, [{{x[0-9]+}}, {{x[0-9]+}}, lsl #3]<br>
+; CHECK: br {{x[0-9]+}}<br>
+<br>
+default:<br>
+ unreachable<br>
+<br>
+case_0:<br>
+ tail call void @handle_case_00(i4 %0) #2<br>
+ br label %return_label<br>
+<br>
+case_1:<br>
+ tail call void @handle_case_01(i4 %0) #2<br>
+ br label %return_label<br>
+<br>
+case_2:<br>
+ tail call void @handle_case_02(i4 %0) #2<br>
+ br label %return_label<br>
+<br>
+case_3:<br>
+ tail call void @handle_case_03(i4 %0) #2<br>
+ br label %return_label<br>
+<br>
+case_4:<br>
+ tail call void @handle_case_04(i4 %0) #2<br>
+ br label %return_label<br>
+<br>
+case_5:<br>
+ tail call void @handle_case_05(i4 %0) #2<br>
+ br label %return_label<br>
+<br>
+return_label:<br>
+ ret void<br>
+}<br>
+<br>
+declare void @handle_case_00(i4)<br>
+declare void @handle_case_01(i4)<br>
+declare void @handle_case_02(i4)<br>
+declare void @handle_case_03(i4)<br>
+declare void @handle_case_04(i4)<br>
+declare void @handle_case_05(i4)<br>
<br>
Modified: llvm/trunk/test/CodeGen/X86/pr38743.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr38743.ll?rev=355483&r1=355482&r2=355483&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr38743.ll?rev=355483&r1=355482&r2=355483&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/CodeGen/X86/pr38743.ll (original)<br>
+++ llvm/trunk/test/CodeGen/X86/pr38743.ll Tue Mar 5 23:27:45 2019<br>
@@ -18,41 +18,43 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(<br>
<br>
define void @pr38743() #1 align 2 {<br>
; CHECK-LABEL: pr38743:<br>
-; CHECK: # %bb.0: # %bb<br>
-; CHECK-NEXT: cmpl $3, %eax<br>
-; CHECK-NEXT: je .LBB0_4<br>
-; CHECK-NEXT: # %bb.1: # %bb<br>
-; CHECK-NEXT: cmpl $1, %eax<br>
-; CHECK-NEXT: je .LBB0_2<br>
-; CHECK-NEXT: # %bb.3: # %bb5<br>
-; CHECK-NEXT: movzwl .str.17+{{.*}}(%rip), %eax<br>
-; CHECK-NEXT: movw %ax, -{{[0-9]+}}(%rsp)<br>
-; CHECK-NEXT: movq {{.*}}(%rip), %rax<br>
-; CHECK-NEXT: jmp .LBB0_5<br>
-; CHECK-NEXT: .LBB0_4: # %bb8<br>
-; CHECK-NEXT: movq .str.18+{{.*}}(%rip), %rax<br>
-; CHECK-NEXT: movq %rax, -{{[0-9]+}}(%rsp)<br>
-; CHECK-NEXT: movq {{.*}}(%rip), %rax<br>
-; CHECK-NEXT: jmp .LBB0_5<br>
-; CHECK-NEXT: .LBB0_2: # %bb2<br>
-; CHECK-NEXT: movq .str.16+{{.*}}(%rip), %rax<br>
-; CHECK-NEXT: movq %rax, -{{[0-9]+}}(%rsp)<br>
-; CHECK-NEXT: movq {{.*}}(%rip), %rax<br>
-; CHECK-NEXT: .LBB0_5: # %bb12<br>
-; CHECK-NEXT: movq %rax, -{{[0-9]+}}(%rsp)<br>
-; CHECK-NEXT: movq -{{[0-9]+}}(%rsp), %rax<br>
-; CHECK-NEXT: movq %rax, (%rax)<br>
-; CHECK-NEXT: movb -{{[0-9]+}}(%rsp), %al<br>
-; CHECK-NEXT: movq -{{[0-9]+}}(%rsp), %rcx<br>
-; CHECK-NEXT: movzwl -{{[0-9]+}}(%rsp), %edx<br>
-; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %esi<br>
-; CHECK-NEXT: movb -{{[0-9]+}}(%rsp), %dil<br>
-; CHECK-NEXT: movb %al, (%rax)<br>
-; CHECK-NEXT: movq %rcx, 1(%rax)<br>
-; CHECK-NEXT: movw %dx, 9(%rax)<br>
-; CHECK-NEXT: movl %esi, 11(%rax)<br>
-; CHECK-NEXT: movb %dil, 15(%rax)<br>
-; CHECK-NEXT: retq<br>
+; CHECK: # %bb.0: # %bb<br>
+; CHECK-NEXT: xorl %eax, %eax<br>
+; CHECK-NEXT: jmpq *.LJTI0_0(,%rax,8)<br>
+; CHECK-NEXT: .[[LABEL1:[A-Z_0-9]+]]: # %bb5<br>
+; CHECK-NEXT: movzwl .str.17+{{.*}}(%rip), %eax<br>
+; CHECK-NEXT: movw %ax, -{{[0-9]+}}(%rsp)<br>
+; CHECK-NEXT: movq .str.17(%rip), %rax<br>
+; CHECK-NEXT: jmp .[[LABEL4:[A-Z_0-9]+]]<br>
+; CHECK-NEXT: .[[LABEL2:[A-Z_0-9]+]]: # %bb2<br>
+; CHECK-NEXT: movq .str.16+{{.*}}(%rip), %rax<br>
+; CHECK-NEXT: movq %rax, -{{[0-9]+}}(%rsp)<br>
+; CHECK-NEXT: movq .str.16(%rip), %rax<br>
+; CHECK-NEXT: jmp .[[LABEL4]]<br>
+; CHECK-NEXT: .[[LABEL3:[A-Z_0-9]+]]: # %bb8<br>
+; CHECK-NEXT: movq .str.18+{{.*}}(%rip), %rax<br>
+; CHECK-NEXT: movq %rax, -{{[0-9]+}}(%rsp)<br>
+; CHECK-NEXT: movq .str.18(%rip), %rax<br>
+; CHECK-NEXT: .[[LABEL4]]: # %bb12<br>
+; CHECK-NEXT: movq %rax, -{{[0-9]+}}(%rsp)<br>
+; CHECK-NEXT: movq -{{[0-9]+}}(%rsp), %rax<br>
+; CHECK-NEXT: movq %rax, (%rax)<br>
+; CHECK-NEXT: movb -{{[0-9]+}}(%rsp), %al<br>
+; CHECK-NEXT: movq -{{[0-9]+}}(%rsp), %rcx<br>
+; CHECK-NEXT: movzwl -{{[0-9]+}}(%rsp), %edx<br>
+; CHECK-NEXT: movl -{{[0-9]+}}(%rsp), %esi<br>
+; CHECK-NEXT: movb -{{[0-9]+}}(%rsp), %dil<br>
+; CHECK-NEXT: movb %al, (%rax)<br>
+; CHECK-NEXT: movq %rcx, {{[0-9]+}}(%rax)<br>
+; CHECK-NEXT: movw %dx, {{[0-9]+}}(%rax)<br>
+; CHECK-NEXT: movl %esi, {{[0-9]+}}(%rax)<br>
+; CHECK-NEXT: movb %dil, {{[0-9]+}}(%rax)<br>
+; CHECK-NEXT: retq<br>
+; CHECK-LABEL: .LJTI0_0:<br>
+; CHECK: .quad .[[LABEL2]]<br>
+; CHECK-NEXT: .quad .[[LABEL1]]<br>
+; CHECK-NEXT: .quad .[[LABEL3]]<br>
+; CHECK-NEXT: .quad .[[LABEL1]]<br>
bb:<br>
%tmp = alloca %0, align 16<br>
%tmp1 = bitcast %0* %tmp to i8*<br>
<br>
Modified: llvm/trunk/test/CodeGen/X86/switch-jump-table.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/switch-jump-table.ll?rev=355483&r1=355482&r2=355483&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/switch-jump-table.ll?rev=355483&r1=355482&r2=355483&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/CodeGen/X86/switch-jump-table.ll (original)<br>
+++ llvm/trunk/test/CodeGen/X86/switch-jump-table.ll Tue Mar 5 23:27:45 2019<br>
@@ -2,14 +2,12 @@<br>
; RUN: llc -mtriple=i686-pc-gnu-linux -print-machineinstrs=expand-isel-pseudos %s -o /dev/null 2>&1 | FileCheck %s -check-prefix=CHECK-JT-PROB<br>
<br>
<br>
-; An unreachable default destination is replaced with the most popular case label.<br>
+; An unreachable default destination is ignored and no compare and branch<br>
+; is generated for the default values.<br>
<br>
define void @foo(i32 %x, i32* %to) {<br>
; CHECK-LABEL: foo:<br>
; CHECK: movl 4(%esp), [[REG:%e[a-z]{2}]]<br>
-; CHECK: cmpl $3, [[REG]]<br>
-; CHECK: ja .LBB0_6<br>
-; CHECK-NEXT: # %bb.1:<br>
; CHECK-NEXT: jmpl *.LJTI0_0(,[[REG]],4)<br>
; CHECK: movl $4<br>
; CHECK: retl<br>
@@ -45,10 +43,12 @@ default:<br>
<br>
; The jump table has four entries.<br>
; CHECK-LABEL: .LJTI0_0:<br>
+; CHECK-NEXT: .long .LBB0_1<br>
; CHECK-NEXT: .long .LBB0_2<br>
; CHECK-NEXT: .long .LBB0_3<br>
; CHECK-NEXT: .long .LBB0_4<br>
; CHECK-NEXT: .long .LBB0_5<br>
+; CHECK-NEXT: .long .LBB0_5<br>
}<br>
<br>
; Check if branch probabilities are correctly assigned to the jump table.<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>