llvm.org GIT mirror llvm / 9a8c625
[Codegen] Merge tail blocks with no successors after block placement Summary: I found the following case having tail blocks with no successors merging opportunities after block placement. Before block placement: bb0: ... bne a0, 0, bb2: bb1: mv a0, 1 ret bb2: ... bb3: mv a0, 1 ret bb4: mv a0, -1 ret The conditional branch bne in bb0 is opposite to beq. After block placement: bb0: ... beq a0, 0, bb1 bb2: ... bb4: mv a0, -1 ret bb1: mv a0, 1 ret bb3: mv a0, 1 ret After block placement, that appears new tail merging opportunity, bb1 and bb3 can be merged as one block. So the conditional constraint for merging tail blocks with no successors should be removed. In my experiment for RISC-V, it decreases code size. Author of original patch: Jim Lin Reviewers: haicheng, aheejin, craig.topper, rnk, RKSimon, Jim, dmgreen Reviewed By: Jim, dmgreen Subscribers: xbolva00, dschuff, javed.absar, sbc100, jgravelle-google, aheejin, kito-cheng, dmgreen, PkmX, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D54411 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363284 91177308-0d34-0410-b5e6-96231b3b80d8 David Bolvansky 4 months ago
11 changed file(s) with 318 addition(s) and 404 deletion(s). Raw diff Collapse all Expand all
10691069
10701070 bool BranchFolder::TailMergeBlocks(MachineFunction &MF) {
10711071 bool MadeChange = false;
1072 if (!EnableTailMerge) return MadeChange;
1072 if (!EnableTailMerge)
1073 return MadeChange;
10731074
10741075 // First find blocks with no successors.
1075 // Block placement does not create new tail merging opportunities for these
1076 // blocks.
1077 if (!AfterBlockPlacement) {
1078 MergePotentials.clear();
1079 for (MachineBasicBlock &MBB : MF) {
1080 if (MergePotentials.size() == TailMergeThreshold)
1081 break;
1082 if (!TriedMerging.count(&MBB) && MBB.succ_empty())
1083 MergePotentials.push_back(MergePotentialsElt(HashEndOfMBB(MBB), &MBB));
1084 }
1085
1086 // If this is a large problem, avoid visiting the same basic blocks
1087 // multiple times.
1076 // Block placement may create new tail merging opportunities for these blocks.
1077 MergePotentials.clear();
1078 for (MachineBasicBlock &MBB : MF) {
10881079 if (MergePotentials.size() == TailMergeThreshold)
1089 for (unsigned i = 0, e = MergePotentials.size(); i != e; ++i)
1090 TriedMerging.insert(MergePotentials[i].getBlock());
1091
1092 // See if we can do any tail merging on those.
1093 if (MergePotentials.size() >= 2)
1094 MadeChange |= TryTailMergeBlocks(nullptr, nullptr, MinCommonTailLength);
1095 }
1080 break;
1081 if (!TriedMerging.count(&MBB) && MBB.succ_empty())
1082 MergePotentials.push_back(MergePotentialsElt(HashEndOfMBB(MBB), &MBB));
1083 }
1084
1085 // If this is a large problem, avoid visiting the same basic blocks
1086 // multiple times.
1087 if (MergePotentials.size() == TailMergeThreshold)
1088 for (unsigned i = 0, e = MergePotentials.size(); i != e; ++i)
1089 TriedMerging.insert(MergePotentials[i].getBlock());
1090
1091 // See if we can do any tail merging on those.
1092 if (MergePotentials.size() >= 2)
1093 MadeChange |= TryTailMergeBlocks(nullptr, nullptr, MinCommonTailLength);
10961094
10971095 // Look at blocks (IBB) with multiple predecessors (PBB).
10981096 // We change each predecessor to a canonical form, by
6060 ; CHECK-PIC-NEXT: cmpeq
6161 ; CHECK-PIC-NEXT: beq
6262 ; CHECK-PIC: %bb6
63 ; CHECK-PIC-NEXT: movs
64 ; CHECK-PIC-NEXT: add
65 ; CHECK-PIC-NEXT: pop
63 ; CHECK-PIC: mov
6664 ret i32 0
6765
6866 bb6:
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: sed -e s/.Cxx:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefix=CXX
12 ; RUN: sed -e s/.Seh:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefix=SEH
23
6768 ; SEH-NEXT: .long .Ltmp0@IMGREL+1
6869 ; SEH-NEXT: .long .Ltmp1@IMGREL+1
6970 ; SEH-NEXT: .long dummy_filter@IMGREL
70 ; SEH-NEXT: .long .LBB0_5@IMGREL
71 ; SEH-NEXT: .long .LBB0_2@IMGREL
7172 ; SEH-NEXT: .long .Ltmp2@IMGREL+1
7273 ; SEH-NEXT: .long .Ltmp3@IMGREL+1
73 ; SEH-NEXT: .long "?dtor$2@?0?test@4HA"@IMGREL
74 ; SEH-NEXT: .long "?dtor$5@?0?test@4HA"@IMGREL
7475 ; SEH-NEXT: .long 0
7576 ; SEH-NEXT: .long .Ltmp2@IMGREL+1
7677 ; SEH-NEXT: .long .Ltmp3@IMGREL+1
7778 ; SEH-NEXT: .long dummy_filter@IMGREL
78 ; SEH-NEXT: .long .LBB0_5@IMGREL
79 ; SEH-NEXT: .long .LBB0_2@IMGREL
7980 ; SEH-NEXT: .Llsda_end0:
148148 ; CHECK32: # %bb.0: # %entry
149149 ; CHECK32-NEXT: movl {{[0-9]+}}(%esp), %edx # encoding: [0x8b,0x54,0x24,0x04]
150150 ; CHECK32-NEXT: testb $42, %dl # encoding: [0xf6,0xc2,0x2a]
151 ; CHECK32-NEXT: je .LBB2_1 # encoding: [0x74,A]
152 ; CHECK32-NEXT: # fixup A - offset: 1, value: .LBB2_1-1, kind: FK_PCRel_1
153 ; CHECK32-NEXT: # %bb.2: # %land.rhs
151 ; CHECK32-NEXT: je .LBB2_3 # encoding: [0x74,A]
152 ; CHECK32-NEXT: # fixup A - offset: 1, value: .LBB2_3-1, kind: FK_PCRel_1
153 ; CHECK32-NEXT: # %bb.1: # %land.rhs
154154 ; CHECK32-NEXT: movb $1, %al # encoding: [0xb0,0x01]
155155 ; CHECK32-NEXT: testb $44, %dl # encoding: [0xf6,0xc2,0x2c]
156156 ; CHECK32-NEXT: je baz # TAILCALL
157157 ; CHECK32-NEXT: # encoding: [0x74,A]
158158 ; CHECK32-NEXT: # fixup A - offset: 1, value: baz-1, kind: FK_PCRel_1
159 ; CHECK32-NEXT: # %bb.3: # %land.end
159 ; CHECK32-NEXT: .LBB2_2: # %land.end
160160 ; CHECK32-NEXT: # kill: def $al killed $al killed $eax
161161 ; CHECK32-NEXT: retl $4 # encoding: [0xc2,0x04,0x00]
162 ; CHECK32-NEXT: .LBB2_1:
162 ; CHECK32-NEXT: .LBB2_3:
163163 ; CHECK32-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
164 ; CHECK32-NEXT: # kill: def $al killed $al killed $eax
165 ; CHECK32-NEXT: retl $4 # encoding: [0xc2,0x04,0x00]
164 ; CHECK32-NEXT: jmp .LBB2_2 # encoding: [0xeb,A]
165 ; CHECK32-NEXT: # fixup A - offset: 1, value: .LBB2_2-1, kind: FK_PCRel_1
166166 ;
167167 ; CHECK64-LABEL: BlockPlacementTest:
168168 ; CHECK64: # %bb.0: # %entry
169169 ; CHECK64-NEXT: testb $42, %sil # encoding: [0x40,0xf6,0xc6,0x2a]
170 ; CHECK64-NEXT: je .LBB2_1 # encoding: [0x74,A]
171 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB2_1-1, kind: FK_PCRel_1
172 ; CHECK64-NEXT: # %bb.2: # %land.rhs
170 ; CHECK64-NEXT: je .LBB2_3 # encoding: [0x74,A]
171 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB2_3-1, kind: FK_PCRel_1
172 ; CHECK64-NEXT: # %bb.1: # %land.rhs
173173 ; CHECK64-NEXT: movb $1, %al # encoding: [0xb0,0x01]
174174 ; CHECK64-NEXT: testb $44, %sil # encoding: [0x40,0xf6,0xc6,0x2c]
175175 ; CHECK64-NEXT: je baz # TAILCALL
176176 ; CHECK64-NEXT: # encoding: [0x74,A]
177177 ; CHECK64-NEXT: # fixup A - offset: 1, value: baz-1, kind: FK_PCRel_1
178 ; CHECK64-NEXT: # %bb.3: # %land.end
178 ; CHECK64-NEXT: .LBB2_2: # %land.end
179179 ; CHECK64-NEXT: # kill: def $al killed $al killed $eax
180180 ; CHECK64-NEXT: retq # encoding: [0xc3]
181 ; CHECK64-NEXT: .LBB2_1:
181 ; CHECK64-NEXT: .LBB2_3:
182182 ; CHECK64-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
183 ; CHECK64-NEXT: # kill: def $al killed $al killed $eax
184 ; CHECK64-NEXT: retq # encoding: [0xc3]
183 ; CHECK64-NEXT: jmp .LBB2_2 # encoding: [0xeb,A]
184 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB2_2-1, kind: FK_PCRel_1
185185 ;
186186 ; WIN64-LABEL: BlockPlacementTest:
187187 ; WIN64: # %bb.0: # %entry
188188 ; WIN64-NEXT: testb $42, %dl # encoding: [0xf6,0xc2,0x2a]
189 ; WIN64-NEXT: je .LBB2_1 # encoding: [0x74,A]
190 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB2_1-1, kind: FK_PCRel_1
191 ; WIN64-NEXT: # %bb.2: # %land.rhs
189 ; WIN64-NEXT: je .LBB2_3 # encoding: [0x74,A]
190 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB2_3-1, kind: FK_PCRel_1
191 ; WIN64-NEXT: # %bb.1: # %land.rhs
192192 ; WIN64-NEXT: movb $1, %al # encoding: [0xb0,0x01]
193193 ; WIN64-NEXT: testb $44, %dl # encoding: [0xf6,0xc2,0x2c]
194194 ; WIN64-NEXT: je baz # TAILCALL
195195 ; WIN64-NEXT: # encoding: [0x74,A]
196196 ; WIN64-NEXT: # fixup A - offset: 1, value: baz-1, kind: FK_PCRel_1
197 ; WIN64-NEXT: # %bb.3: # %land.end
197 ; WIN64-NEXT: .LBB2_2: # %land.end
198198 ; WIN64-NEXT: # kill: def $al killed $al killed $eax
199199 ; WIN64-NEXT: retq # encoding: [0xc3]
200 ; WIN64-NEXT: .LBB2_1:
200 ; WIN64-NEXT: .LBB2_3:
201201 ; WIN64-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
202 ; WIN64-NEXT: # kill: def $al killed $al killed $eax
203 ; WIN64-NEXT: retq # encoding: [0xc3]
202 ; WIN64-NEXT: jmp .LBB2_2 # encoding: [0xeb,A]
203 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB2_2-1, kind: FK_PCRel_1
204204 entry:
205205 %and = and i32 %x, 42
206206 %tobool = icmp eq i32 %and, 0
368368 ; CHECK64-NEXT: .cfi_adjust_cfa_offset 8
369369 ; CHECK64-NEXT: popq %r8 # encoding: [0x41,0x58]
370370 ; CHECK64-NEXT: .cfi_adjust_cfa_offset -8
371 ; CHECK64-NEXT: jmp .LBB3_1 # encoding: [0xeb,A]
372 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_1-1, kind: FK_PCRel_1
373 ; CHECK64-NEXT: .LBB3_2: # %for.body
374 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
371 ; CHECK64-NEXT: jmp .LBB3_11 # encoding: [0xeb,A]
372 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_11-1, kind: FK_PCRel_1
373 ; CHECK64-NEXT: .LBB3_1: # %for.body
374 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
375375 ; CHECK64-NEXT: cmpl $2, %ecx # encoding: [0x83,0xf9,0x02]
376 ; CHECK64-NEXT: je .LBB3_11 # encoding: [0x74,A]
377 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_11-1, kind: FK_PCRel_1
376 ; CHECK64-NEXT: je .LBB3_9 # encoding: [0x74,A]
377 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_9-1, kind: FK_PCRel_1
378 ; CHECK64-NEXT: # %bb.2: # %for.body
379 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
380 ; CHECK64-NEXT: cmpl $1, %ecx # encoding: [0x83,0xf9,0x01]
381 ; CHECK64-NEXT: je .LBB3_7 # encoding: [0x74,A]
382 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_7-1, kind: FK_PCRel_1
378383 ; CHECK64-NEXT: # %bb.3: # %for.body
379 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
380 ; CHECK64-NEXT: cmpl $1, %ecx # encoding: [0x83,0xf9,0x01]
381 ; CHECK64-NEXT: je .LBB3_10 # encoding: [0x74,A]
384 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
385 ; CHECK64-NEXT: testl %ecx, %ecx # encoding: [0x85,0xc9]
386 ; CHECK64-NEXT: jne .LBB3_10 # encoding: [0x75,A]
382387 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_10-1, kind: FK_PCRel_1
383 ; CHECK64-NEXT: # %bb.4: # %for.body
384 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
385 ; CHECK64-NEXT: testl %ecx, %ecx # encoding: [0x85,0xc9]
386 ; CHECK64-NEXT: jne .LBB3_12 # encoding: [0x75,A]
387 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_12-1, kind: FK_PCRel_1
388 ; CHECK64-NEXT: # %bb.5: # %sw.bb
389 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
388 ; CHECK64-NEXT: # %bb.4: # %sw.bb
389 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
390390 ; CHECK64-NEXT: movzbl (%rdi), %edx # encoding: [0x0f,0xb6,0x17]
391391 ; CHECK64-NEXT: cmpl $43, %edx # encoding: [0x83,0xfa,0x2b]
392392 ; CHECK64-NEXT: movl %r8d, %ecx # encoding: [0x44,0x89,0xc1]
393 ; CHECK64-NEXT: je .LBB3_12 # encoding: [0x74,A]
394 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_12-1, kind: FK_PCRel_1
395 ; CHECK64-NEXT: # %bb.6: # %sw.bb
396 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
393 ; CHECK64-NEXT: je .LBB3_10 # encoding: [0x74,A]
394 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_10-1, kind: FK_PCRel_1
395 ; CHECK64-NEXT: # %bb.5: # %sw.bb
396 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
397397 ; CHECK64-NEXT: cmpb $45, %dl # encoding: [0x80,0xfa,0x2d]
398398 ; CHECK64-NEXT: movl %r8d, %ecx # encoding: [0x44,0x89,0xc1]
399 ; CHECK64-NEXT: je .LBB3_12 # encoding: [0x74,A]
400 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_12-1, kind: FK_PCRel_1
401 ; CHECK64-NEXT: # %bb.7: # %if.else
402 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
399 ; CHECK64-NEXT: je .LBB3_10 # encoding: [0x74,A]
400 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_10-1, kind: FK_PCRel_1
401 ; CHECK64-NEXT: # %bb.6: # %if.else
402 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
403403 ; CHECK64-NEXT: addl $-48, %edx # encoding: [0x83,0xc2,0xd0]
404404 ; CHECK64-NEXT: cmpl $10, %edx # encoding: [0x83,0xfa,0x0a]
405405 ; CHECK64-NEXT: jmp .LBB3_8 # encoding: [0xeb,A]
406406 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_8-1, kind: FK_PCRel_1
407 ; CHECK64-NEXT: .LBB3_10: # %sw.bb14
408 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
407 ; CHECK64-NEXT: .LBB3_7: # %sw.bb14
408 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
409409 ; CHECK64-NEXT: movzbl (%rdi), %ecx # encoding: [0x0f,0xb6,0x0f]
410410 ; CHECK64-NEXT: addl $-48, %ecx # encoding: [0x83,0xc1,0xd0]
411411 ; CHECK64-NEXT: cmpl $10, %ecx # encoding: [0x83,0xf9,0x0a]
412412 ; CHECK64-NEXT: .LBB3_8: # %if.else
413 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
413 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
414414 ; CHECK64-NEXT: movl %r9d, %ecx # encoding: [0x44,0x89,0xc9]
415 ; CHECK64-NEXT: jb .LBB3_12 # encoding: [0x72,A]
416 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_12-1, kind: FK_PCRel_1
417 ; CHECK64-NEXT: jmp .LBB3_9 # encoding: [0xeb,A]
418 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_9-1, kind: FK_PCRel_1
419 ; CHECK64-NEXT: .LBB3_11: # %sw.bb22
420 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
415 ; CHECK64-NEXT: jb .LBB3_10 # encoding: [0x72,A]
416 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_10-1, kind: FK_PCRel_1
417 ; CHECK64-NEXT: jmp .LBB3_13 # encoding: [0xeb,A]
418 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_13-1, kind: FK_PCRel_1
419 ; CHECK64-NEXT: .LBB3_9: # %sw.bb22
420 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
421421 ; CHECK64-NEXT: movzbl (%rdi), %ecx # encoding: [0x0f,0xb6,0x0f]
422422 ; CHECK64-NEXT: addl $-48, %ecx # encoding: [0x83,0xc1,0xd0]
423423 ; CHECK64-NEXT: cmpl $10, %ecx # encoding: [0x83,0xf9,0x0a]
425425 ; CHECK64-NEXT: jae _Z20isValidIntegerSuffixN9__gnu_cxx17__normal_iteratorIPKcSsEES3_ # TAILCALL
426426 ; CHECK64-NEXT: # encoding: [0x73,A]
427427 ; CHECK64-NEXT: # fixup A - offset: 1, value: _Z20isValidIntegerSuffixN9__gnu_cxx17__normal_iteratorIPKcSsEES3_-1, kind: FK_PCRel_1
428 ; CHECK64-NEXT: .LBB3_12: # %for.inc
429 ; CHECK64-NEXT: # in Loop: Header=BB3_1 Depth=1
428 ; CHECK64-NEXT: .LBB3_10: # %for.inc
429 ; CHECK64-NEXT: # in Loop: Header=BB3_11 Depth=1
430430 ; CHECK64-NEXT: incq %rdi # encoding: [0x48,0xff,0xc7]
431431 ; CHECK64-NEXT: decq %rax # encoding: [0x48,0xff,0xc8]
432 ; CHECK64-NEXT: .LBB3_1: # %for.cond
432 ; CHECK64-NEXT: .LBB3_11: # %for.cond
433433 ; CHECK64-NEXT: # =>This Inner Loop Header: Depth=1
434434 ; CHECK64-NEXT: testq %rax, %rax # encoding: [0x48,0x85,0xc0]
435 ; CHECK64-NEXT: jne .LBB3_2 # encoding: [0x75,A]
436 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_2-1, kind: FK_PCRel_1
437 ; CHECK64-NEXT: # %bb.13:
435 ; CHECK64-NEXT: jne .LBB3_1 # encoding: [0x75,A]
436 ; CHECK64-NEXT: # fixup A - offset: 1, value: .LBB3_1-1, kind: FK_PCRel_1
437 ; CHECK64-NEXT: # %bb.12:
438438 ; CHECK64-NEXT: cmpl $2, %ecx # encoding: [0x83,0xf9,0x02]
439439 ; CHECK64-NEXT: sete %al # encoding: [0x0f,0x94,0xc0]
440440 ; CHECK64-NEXT: # kill: def $al killed $al killed $eax
441441 ; CHECK64-NEXT: retq # encoding: [0xc3]
442 ; CHECK64-NEXT: .LBB3_9:
442 ; CHECK64-NEXT: .LBB3_13:
443443 ; CHECK64-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
444444 ; CHECK64-NEXT: # kill: def $al killed $al killed $eax
445445 ; CHECK64-NEXT: retq # encoding: [0xc3]
450450 ; WIN64-NEXT: movq -24(%rcx), %r8 # encoding: [0x4c,0x8b,0x41,0xe8]
451451 ; WIN64-NEXT: leaq (%rcx,%r8), %rdx # encoding: [0x4a,0x8d,0x14,0x01]
452452 ; WIN64-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
453 ; WIN64-NEXT: jmp .LBB3_1 # encoding: [0xeb,A]
454 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_1-1, kind: FK_PCRel_1
455 ; WIN64-NEXT: .LBB3_2: # %for.body
456 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
453 ; WIN64-NEXT: jmp .LBB3_10 # encoding: [0xeb,A]
454 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_10-1, kind: FK_PCRel_1
455 ; WIN64-NEXT: .LBB3_1: # %for.body
456 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
457457 ; WIN64-NEXT: cmpl $2, %eax # encoding: [0x83,0xf8,0x02]
458 ; WIN64-NEXT: je .LBB3_10 # encoding: [0x74,A]
459 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_10-1, kind: FK_PCRel_1
458 ; WIN64-NEXT: je .LBB3_8 # encoding: [0x74,A]
459 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_8-1, kind: FK_PCRel_1
460 ; WIN64-NEXT: # %bb.2: # %for.body
461 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
462 ; WIN64-NEXT: cmpl $1, %eax # encoding: [0x83,0xf8,0x01]
463 ; WIN64-NEXT: je .LBB3_6 # encoding: [0x74,A]
464 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_6-1, kind: FK_PCRel_1
460465 ; WIN64-NEXT: # %bb.3: # %for.body
461 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
462 ; WIN64-NEXT: cmpl $1, %eax # encoding: [0x83,0xf8,0x01]
463 ; WIN64-NEXT: je .LBB3_9 # encoding: [0x74,A]
466 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
467 ; WIN64-NEXT: testl %eax, %eax # encoding: [0x85,0xc0]
468 ; WIN64-NEXT: jne .LBB3_9 # encoding: [0x75,A]
464469 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_9-1, kind: FK_PCRel_1
465 ; WIN64-NEXT: # %bb.4: # %for.body
466 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
467 ; WIN64-NEXT: testl %eax, %eax # encoding: [0x85,0xc0]
468 ; WIN64-NEXT: jne .LBB3_11 # encoding: [0x75,A]
469 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_11-1, kind: FK_PCRel_1
470 ; WIN64-NEXT: # %bb.5: # %sw.bb
471 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
470 ; WIN64-NEXT: # %bb.4: # %sw.bb
471 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
472472 ; WIN64-NEXT: movzbl (%rcx), %r9d # encoding: [0x44,0x0f,0xb6,0x09]
473473 ; WIN64-NEXT: cmpl $43, %r9d # encoding: [0x41,0x83,0xf9,0x2b]
474474 ; WIN64-NEXT: movl $1, %eax # encoding: [0xb8,0x01,0x00,0x00,0x00]
475 ; WIN64-NEXT: je .LBB3_11 # encoding: [0x74,A]
476 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_11-1, kind: FK_PCRel_1
477 ; WIN64-NEXT: # %bb.6: # %sw.bb
478 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
475 ; WIN64-NEXT: je .LBB3_9 # encoding: [0x74,A]
476 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_9-1, kind: FK_PCRel_1
477 ; WIN64-NEXT: # %bb.5: # %sw.bb
478 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
479479 ; WIN64-NEXT: cmpb $45, %r9b # encoding: [0x41,0x80,0xf9,0x2d]
480 ; WIN64-NEXT: je .LBB3_11 # encoding: [0x74,A]
481 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_11-1, kind: FK_PCRel_1
480 ; WIN64-NEXT: je .LBB3_9 # encoding: [0x74,A]
481 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_9-1, kind: FK_PCRel_1
482482 ; WIN64-NEXT: jmp .LBB3_7 # encoding: [0xeb,A]
483483 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_7-1, kind: FK_PCRel_1
484 ; WIN64-NEXT: .LBB3_9: # %sw.bb14
485 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
484 ; WIN64-NEXT: .LBB3_6: # %sw.bb14
485 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
486486 ; WIN64-NEXT: movzbl (%rcx), %r9d # encoding: [0x44,0x0f,0xb6,0x09]
487487 ; WIN64-NEXT: .LBB3_7: # %if.else
488 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
488 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
489489 ; WIN64-NEXT: addl $-48, %r9d # encoding: [0x41,0x83,0xc1,0xd0]
490490 ; WIN64-NEXT: movl $2, %eax # encoding: [0xb8,0x02,0x00,0x00,0x00]
491491 ; WIN64-NEXT: cmpl $10, %r9d # encoding: [0x41,0x83,0xf9,0x0a]
492 ; WIN64-NEXT: jb .LBB3_11 # encoding: [0x72,A]
493 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_11-1, kind: FK_PCRel_1
494 ; WIN64-NEXT: jmp .LBB3_8 # encoding: [0xeb,A]
495 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_8-1, kind: FK_PCRel_1
496 ; WIN64-NEXT: .LBB3_10: # %sw.bb22
497 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
492 ; WIN64-NEXT: jb .LBB3_9 # encoding: [0x72,A]
493 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_9-1, kind: FK_PCRel_1
494 ; WIN64-NEXT: jmp .LBB3_12 # encoding: [0xeb,A]
495 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_12-1, kind: FK_PCRel_1
496 ; WIN64-NEXT: .LBB3_8: # %sw.bb22
497 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
498498 ; WIN64-NEXT: movzbl (%rcx), %r9d # encoding: [0x44,0x0f,0xb6,0x09]
499499 ; WIN64-NEXT: addl $-48, %r9d # encoding: [0x41,0x83,0xc1,0xd0]
500500 ; WIN64-NEXT: movl $2, %eax # encoding: [0xb8,0x02,0x00,0x00,0x00]
502502 ; WIN64-NEXT: jae _Z20isValidIntegerSuffixN9__gnu_cxx17__normal_iteratorIPKcSsEES3_ # TAILCALL
503503 ; WIN64-NEXT: # encoding: [0x73,A]
504504 ; WIN64-NEXT: # fixup A - offset: 1, value: _Z20isValidIntegerSuffixN9__gnu_cxx17__normal_iteratorIPKcSsEES3_-1, kind: FK_PCRel_1
505 ; WIN64-NEXT: .LBB3_11: # %for.inc
506 ; WIN64-NEXT: # in Loop: Header=BB3_1 Depth=1
505 ; WIN64-NEXT: .LBB3_9: # %for.inc
506 ; WIN64-NEXT: # in Loop: Header=BB3_10 Depth=1
507507 ; WIN64-NEXT: incq %rcx # encoding: [0x48,0xff,0xc1]
508508 ; WIN64-NEXT: decq %r8 # encoding: [0x49,0xff,0xc8]
509 ; WIN64-NEXT: .LBB3_1: # %for.cond
509 ; WIN64-NEXT: .LBB3_10: # %for.cond
510510 ; WIN64-NEXT: # =>This Inner Loop Header: Depth=1
511511 ; WIN64-NEXT: testq %r8, %r8 # encoding: [0x4d,0x85,0xc0]
512 ; WIN64-NEXT: jne .LBB3_2 # encoding: [0x75,A]
513 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_2-1, kind: FK_PCRel_1
514 ; WIN64-NEXT: # %bb.12:
512 ; WIN64-NEXT: jne .LBB3_1 # encoding: [0x75,A]
513 ; WIN64-NEXT: # fixup A - offset: 1, value: .LBB3_1-1, kind: FK_PCRel_1
514 ; WIN64-NEXT: # %bb.11:
515515 ; WIN64-NEXT: cmpl $2, %eax # encoding: [0x83,0xf8,0x02]
516516 ; WIN64-NEXT: sete %al # encoding: [0x0f,0x94,0xc0]
517517 ; WIN64-NEXT: # kill: def $al killed $al killed $eax
518518 ; WIN64-NEXT: retq # encoding: [0xc3]
519 ; WIN64-NEXT: .LBB3_8:
519 ; WIN64-NEXT: .LBB3_12:
520520 ; WIN64-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
521521 ; WIN64-NEXT: # kill: def $al killed $al killed $eax
522522 ; WIN64-NEXT: retq # encoding: [0xc3]
77 ; CHECK-LABEL: search:
88 ; CHECK: ## %bb.0: ## %entry
99 ; CHECK-NEXT: testl %edx, %edx
10 ; CHECK-NEXT: jle LBB0_1
11 ; CHECK-NEXT: ## %bb.4: ## %for.body.preheader
10 ; CHECK-NEXT: jle LBB0_5
11 ; CHECK-NEXT: ## %bb.1: ## %for.body.preheader
1212 ; CHECK-NEXT: movslq %edx, %rax
1313 ; CHECK-NEXT: xorl %ecx, %ecx
1414 ; CHECK-NEXT: .p2align 4, 0x90
15 ; CHECK-NEXT: LBB0_5: ## %for.body
15 ; CHECK-NEXT: LBB0_2: ## %for.body
1616 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
1717 ; CHECK-NEXT: cmpl %edi, (%rsi,%rcx,4)
1818 ; CHECK-NEXT: je LBB0_6
19 ; CHECK-NEXT: ## %bb.2: ## %for.cond
20 ; CHECK-NEXT: ## in Loop: Header=BB0_5 Depth=1
19 ; CHECK-NEXT: ## %bb.3: ## %for.cond
20 ; CHECK-NEXT: ## in Loop: Header=BB0_2 Depth=1
2121 ; CHECK-NEXT: incq %rcx
2222 ; CHECK-NEXT: cmpq %rax, %rcx
23 ; CHECK-NEXT: jl LBB0_5
24 ; ### FIXME: %bb.3 and LBB0_1 should be merged
25 ; CHECK-NEXT: ## %bb.3:
26 ; CHECK-NEXT: xorl %eax, %eax
27 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
28 ; CHECK-NEXT: retq
29 ; CHECK-NEXT: LBB0_1:
23 ; CHECK-NEXT: jl LBB0_2
24 ; CHECK-NEXT: LBB0_5:
3025 ; CHECK-NEXT: xorl %eax, %eax
3126 ; CHECK-NEXT: ## kill: def $al killed $al killed $eax
3227 ; CHECK-NEXT: retq
77 ; CHECK: ## %bb.0: ## %entry
88 ; CHECK-NEXT: movl %edi, %eax
99 ; CHECK-NEXT: testl %esi, %esi
10 ; CHECK-NEXT: je LBB0_1
11 ; CHECK-NEXT: ## %bb.2: ## %while.body.preheader
10 ; CHECK-NEXT: je LBB0_4
11 ; CHECK-NEXT: ## %bb.1: ## %while.body.preheader
1212 ; CHECK-NEXT: movl %esi, %edx
1313 ; CHECK-NEXT: .p2align 4, 0x90
14 ; CHECK-NEXT: LBB0_3: ## %while.body
14 ; CHECK-NEXT: LBB0_2: ## %while.body
1515 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
1616 ; CHECK-NEXT: movl %edx, %ecx
1717 ; CHECK-NEXT: cltd
1818 ; CHECK-NEXT: idivl %ecx
1919 ; CHECK-NEXT: testl %edx, %edx
2020 ; CHECK-NEXT: movl %ecx, %eax
21 ; CHECK-NEXT: jne LBB0_3
22 ; CHECK-NEXT: ## %bb.4: ## %while.end
21 ; CHECK-NEXT: jne LBB0_2
22 ; CHECK-NEXT: ## %bb.3: ## %while.end
2323 ; CHECK-NEXT: movl %ecx, %eax
24 ; CHECK-NEXT: retq
25 ; CHECK-NEXT: LBB0_1:
24 ; CHECK-NEXT: LBB0_4:
2625 ; CHECK-NEXT: retq
2726 entry:
2827 %cmp1 = icmp eq i32 %b, 0
5958 ; CHECK: ## %bb.0: ## %entry
6059 ; CHECK-NEXT: movq %rdi, %rax
6160 ; CHECK-NEXT: testq %rsi, %rsi
62 ; CHECK-NEXT: je LBB2_1
63 ; CHECK-NEXT: ## %bb.2: ## %while.body.preheader
61 ; CHECK-NEXT: je LBB2_4
62 ; CHECK-NEXT: ## %bb.1: ## %while.body.preheader
6463 ; CHECK-NEXT: movq %rsi, %rdx
6564 ; CHECK-NEXT: .p2align 4, 0x90
66 ; CHECK-NEXT: LBB2_3: ## %while.body
65 ; CHECK-NEXT: LBB2_2: ## %while.body
6766 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
6867 ; CHECK-NEXT: movq %rdx, %rcx
6968 ; CHECK-NEXT: cqto
7069 ; CHECK-NEXT: idivq %rcx
7170 ; CHECK-NEXT: testq %rdx, %rdx
7271 ; CHECK-NEXT: movq %rcx, %rax
73 ; CHECK-NEXT: jne LBB2_3
74 ; CHECK-NEXT: ## %bb.4: ## %while.end
72 ; CHECK-NEXT: jne LBB2_2
73 ; CHECK-NEXT: ## %bb.3: ## %while.end
7574 ; CHECK-NEXT: movl %ecx, %eax
76 ; CHECK-NEXT: retq
77 ; CHECK-NEXT: LBB2_1:
75 ; CHECK-NEXT: LBB2_4:
7876 ; CHECK-NEXT: retq
7977 entry:
8078 %cmp1 = icmp eq i64 %b, 0
2727 ; X86-NEXT: .LBB0_4:
2828 ; X86-NEXT: decl %ecx
2929 ; X86-NEXT: cmpl $31, %ecx
30 ; X86-NEXT: ja .LBB0_39
30 ; X86-NEXT: ja .LBB0_7
3131 ; X86-NEXT: # %bb.5:
3232 ; X86-NEXT: jmpl *.LJTI0_0(,%ecx,4)
3333 ; X86-NEXT: .LBB0_6:
3535 ; X86-NEXT: popl %esi
3636 ; X86-NEXT: .cfi_def_cfa_offset 4
3737 ; X86-NEXT: retl
38 ; X86-NEXT: .LBB0_39:
38 ; X86-NEXT: .LBB0_7:
3939 ; X86-NEXT: .cfi_def_cfa_offset 8
4040 ; X86-NEXT: xorl %eax, %eax
41 ; X86-NEXT: .LBB0_40:
42 ; X86-NEXT: popl %esi
43 ; X86-NEXT: .cfi_def_cfa_offset 4
44 ; X86-NEXT: retl
45 ; X86-NEXT: .LBB0_7:
46 ; X86-NEXT: .cfi_def_cfa_offset 8
47 ; X86-NEXT: leal (%eax,%eax,2), %eax
48 ; X86-NEXT: popl %esi
49 ; X86-NEXT: .cfi_def_cfa_offset 4
50 ; X86-NEXT: retl
5141 ; X86-NEXT: .LBB0_8:
42 ; X86-NEXT: popl %esi
43 ; X86-NEXT: .cfi_def_cfa_offset 4
44 ; X86-NEXT: retl
45 ; X86-NEXT: .LBB0_10:
5246 ; X86-NEXT: .cfi_def_cfa_offset 8
5347 ; X86-NEXT: shll $2, %eax
5448 ; X86-NEXT: popl %esi
5549 ; X86-NEXT: .cfi_def_cfa_offset 4
5650 ; X86-NEXT: retl
57 ; X86-NEXT: .LBB0_9:
58 ; X86-NEXT: .cfi_def_cfa_offset 8
59 ; X86-NEXT: leal (%eax,%eax,4), %eax
60 ; X86-NEXT: popl %esi
61 ; X86-NEXT: .cfi_def_cfa_offset 4
62 ; X86-NEXT: retl
63 ; X86-NEXT: .LBB0_10:
51 ; X86-NEXT: .LBB0_12:
6452 ; X86-NEXT: .cfi_def_cfa_offset 8
6553 ; X86-NEXT: addl %eax, %eax
66 ; X86-NEXT: leal (%eax,%eax,2), %eax
67 ; X86-NEXT: popl %esi
68 ; X86-NEXT: .cfi_def_cfa_offset 4
69 ; X86-NEXT: retl
70 ; X86-NEXT: .LBB0_11:
71 ; X86-NEXT: .cfi_def_cfa_offset 8
54 ; X86-NEXT: jmp .LBB0_9
55 ; X86-NEXT: .LBB0_13:
7256 ; X86-NEXT: leal (,%eax,8), %ecx
73 ; X86-NEXT: jmp .LBB0_12
74 ; X86-NEXT: .LBB0_13:
57 ; X86-NEXT: jmp .LBB0_41
58 ; X86-NEXT: .LBB0_14:
7559 ; X86-NEXT: shll $3, %eax
7660 ; X86-NEXT: popl %esi
7761 ; X86-NEXT: .cfi_def_cfa_offset 4
7862 ; X86-NEXT: retl
79 ; X86-NEXT: .LBB0_14:
80 ; X86-NEXT: .cfi_def_cfa_offset 8
81 ; X86-NEXT: leal (%eax,%eax,8), %eax
82 ; X86-NEXT: popl %esi
83 ; X86-NEXT: .cfi_def_cfa_offset 4
84 ; X86-NEXT: retl
85 ; X86-NEXT: .LBB0_15:
63 ; X86-NEXT: .LBB0_16:
8664 ; X86-NEXT: .cfi_def_cfa_offset 8
8765 ; X86-NEXT: addl %eax, %eax
88 ; X86-NEXT: leal (%eax,%eax,4), %eax
89 ; X86-NEXT: popl %esi
90 ; X86-NEXT: .cfi_def_cfa_offset 4
91 ; X86-NEXT: retl
92 ; X86-NEXT: .LBB0_16:
93 ; X86-NEXT: .cfi_def_cfa_offset 8
66 ; X86-NEXT: jmp .LBB0_11
67 ; X86-NEXT: .LBB0_17:
9468 ; X86-NEXT: leal (%eax,%eax,4), %ecx
95 ; X86-NEXT: leal (%eax,%ecx,2), %eax
96 ; X86-NEXT: popl %esi
97 ; X86-NEXT: .cfi_def_cfa_offset 4
98 ; X86-NEXT: retl
99 ; X86-NEXT: .LBB0_17:
100 ; X86-NEXT: .cfi_def_cfa_offset 8
69 ; X86-NEXT: jmp .LBB0_18
70 ; X86-NEXT: .LBB0_19:
10171 ; X86-NEXT: shll $2, %eax
102 ; X86-NEXT: leal (%eax,%eax,2), %eax
103 ; X86-NEXT: popl %esi
104 ; X86-NEXT: .cfi_def_cfa_offset 4
105 ; X86-NEXT: retl
106 ; X86-NEXT: .LBB0_18:
107 ; X86-NEXT: .cfi_def_cfa_offset 8
72 ; X86-NEXT: jmp .LBB0_9
73 ; X86-NEXT: .LBB0_20:
10874 ; X86-NEXT: leal (%eax,%eax,2), %ecx
109 ; X86-NEXT: leal (%eax,%ecx,4), %eax
110 ; X86-NEXT: popl %esi
111 ; X86-NEXT: .cfi_def_cfa_offset 4
112 ; X86-NEXT: retl
113 ; X86-NEXT: .LBB0_19:
114 ; X86-NEXT: .cfi_def_cfa_offset 8
75 ; X86-NEXT: jmp .LBB0_21
76 ; X86-NEXT: .LBB0_22:
11577 ; X86-NEXT: movl %eax, %ecx
11678 ; X86-NEXT: shll $4, %ecx
11779 ; X86-NEXT: subl %eax, %ecx
118 ; X86-NEXT: jmp .LBB0_12
119 ; X86-NEXT: .LBB0_21:
80 ; X86-NEXT: jmp .LBB0_41
81 ; X86-NEXT: .LBB0_23:
12082 ; X86-NEXT: leal (%eax,%eax,4), %eax
121 ; X86-NEXT: leal (%eax,%eax,2), %eax
122 ; X86-NEXT: popl %esi
123 ; X86-NEXT: .cfi_def_cfa_offset 4
124 ; X86-NEXT: retl
125 ; X86-NEXT: .LBB0_22:
126 ; X86-NEXT: .cfi_def_cfa_offset 8
83 ; X86-NEXT: jmp .LBB0_9
84 ; X86-NEXT: .LBB0_24:
12785 ; X86-NEXT: shll $4, %eax
12886 ; X86-NEXT: popl %esi
12987 ; X86-NEXT: .cfi_def_cfa_offset 4
13088 ; X86-NEXT: retl
131 ; X86-NEXT: .LBB0_23:
89 ; X86-NEXT: .LBB0_25:
13290 ; X86-NEXT: .cfi_def_cfa_offset 8
13391 ; X86-NEXT: movl %eax, %ecx
13492 ; X86-NEXT: shll $4, %ecx
135 ; X86-NEXT: addl %ecx, %eax
136 ; X86-NEXT: popl %esi
137 ; X86-NEXT: .cfi_def_cfa_offset 4
138 ; X86-NEXT: retl
139 ; X86-NEXT: .LBB0_24:
140 ; X86-NEXT: .cfi_def_cfa_offset 8
93 ; X86-NEXT: jmp .LBB0_26
94 ; X86-NEXT: .LBB0_27:
14195 ; X86-NEXT: addl %eax, %eax
96 ; X86-NEXT: .LBB0_15:
14297 ; X86-NEXT: leal (%eax,%eax,8), %eax
14398 ; X86-NEXT: popl %esi
14499 ; X86-NEXT: .cfi_def_cfa_offset 4
145100 ; X86-NEXT: retl
146 ; X86-NEXT: .LBB0_25:
101 ; X86-NEXT: .LBB0_28:
147102 ; X86-NEXT: .cfi_def_cfa_offset 8
148103 ; X86-NEXT: leal (%eax,%eax,8), %ecx
104 ; X86-NEXT: .LBB0_18:
149105 ; X86-NEXT: leal (%eax,%ecx,2), %eax
150106 ; X86-NEXT: popl %esi
151107 ; X86-NEXT: .cfi_def_cfa_offset 4
152108 ; X86-NEXT: retl
153 ; X86-NEXT: .LBB0_26:
109 ; X86-NEXT: .LBB0_29:
154110 ; X86-NEXT: .cfi_def_cfa_offset 8
155111 ; X86-NEXT: shll $2, %eax
156 ; X86-NEXT: leal (%eax,%eax,4), %eax
157 ; X86-NEXT: popl %esi
158 ; X86-NEXT: .cfi_def_cfa_offset 4
159 ; X86-NEXT: retl
160 ; X86-NEXT: .LBB0_27:
161 ; X86-NEXT: .cfi_def_cfa_offset 8
112 ; X86-NEXT: jmp .LBB0_11
113 ; X86-NEXT: .LBB0_30:
162114 ; X86-NEXT: leal (%eax,%eax,4), %ecx
115 ; X86-NEXT: .LBB0_21:
163116 ; X86-NEXT: leal (%eax,%ecx,4), %eax
164117 ; X86-NEXT: popl %esi
165118 ; X86-NEXT: .cfi_def_cfa_offset 4
166119 ; X86-NEXT: retl
167 ; X86-NEXT: .LBB0_28:
120 ; X86-NEXT: .LBB0_31:
168121 ; X86-NEXT: .cfi_def_cfa_offset 8
169122 ; X86-NEXT: leal (%eax,%eax,4), %ecx
170123 ; X86-NEXT: leal (%eax,%ecx,4), %ecx
171 ; X86-NEXT: addl %ecx, %eax
172 ; X86-NEXT: popl %esi
173 ; X86-NEXT: .cfi_def_cfa_offset 4
174 ; X86-NEXT: retl
175 ; X86-NEXT: .LBB0_29:
176 ; X86-NEXT: .cfi_def_cfa_offset 8
124 ; X86-NEXT: jmp .LBB0_26
125 ; X86-NEXT: .LBB0_32:
177126 ; X86-NEXT: leal (%eax,%eax,2), %ecx
178127 ; X86-NEXT: shll $3, %ecx
179 ; X86-NEXT: jmp .LBB0_12
180 ; X86-NEXT: .LBB0_30:
128 ; X86-NEXT: jmp .LBB0_41
129 ; X86-NEXT: .LBB0_33:
181130 ; X86-NEXT: shll $3, %eax
182 ; X86-NEXT: leal (%eax,%eax,2), %eax
183 ; X86-NEXT: popl %esi
184 ; X86-NEXT: .cfi_def_cfa_offset 4
185 ; X86-NEXT: retl
186 ; X86-NEXT: .LBB0_31:
187 ; X86-NEXT: .cfi_def_cfa_offset 8
131 ; X86-NEXT: jmp .LBB0_9
132 ; X86-NEXT: .LBB0_34:
188133 ; X86-NEXT: leal (%eax,%eax,4), %eax
134 ; X86-NEXT: .LBB0_11:
189135 ; X86-NEXT: leal (%eax,%eax,4), %eax
190136 ; X86-NEXT: popl %esi
191137 ; X86-NEXT: .cfi_def_cfa_offset 4
192138 ; X86-NEXT: retl
193 ; X86-NEXT: .LBB0_32:
139 ; X86-NEXT: .LBB0_35:
194140 ; X86-NEXT: .cfi_def_cfa_offset 8
195141 ; X86-NEXT: leal (%eax,%eax,4), %ecx
196142 ; X86-NEXT: leal (%ecx,%ecx,4), %ecx
197 ; X86-NEXT: addl %ecx, %eax
198 ; X86-NEXT: popl %esi
199 ; X86-NEXT: .cfi_def_cfa_offset 4
200 ; X86-NEXT: retl
201 ; X86-NEXT: .LBB0_33:
202 ; X86-NEXT: .cfi_def_cfa_offset 8
143 ; X86-NEXT: jmp .LBB0_26
144 ; X86-NEXT: .LBB0_36:
203145 ; X86-NEXT: leal (%eax,%eax,8), %eax
146 ; X86-NEXT: .LBB0_9:
204147 ; X86-NEXT: leal (%eax,%eax,2), %eax
205148 ; X86-NEXT: popl %esi
206149 ; X86-NEXT: .cfi_def_cfa_offset 4
207150 ; X86-NEXT: retl
208 ; X86-NEXT: .LBB0_34:
151 ; X86-NEXT: .LBB0_37:
209152 ; X86-NEXT: .cfi_def_cfa_offset 8
210153 ; X86-NEXT: leal (%eax,%eax,8), %ecx
211154 ; X86-NEXT: leal (%ecx,%ecx,2), %ecx
212 ; X86-NEXT: addl %ecx, %eax
213 ; X86-NEXT: popl %esi
214 ; X86-NEXT: .cfi_def_cfa_offset 4
215 ; X86-NEXT: retl
216 ; X86-NEXT: .LBB0_35:
217 ; X86-NEXT: .cfi_def_cfa_offset 8
155 ; X86-NEXT: jmp .LBB0_26
156 ; X86-NEXT: .LBB0_38:
218157 ; X86-NEXT: leal (%eax,%eax,8), %ecx
219158 ; X86-NEXT: leal (%ecx,%ecx,2), %ecx
220159 ; X86-NEXT: addl %eax, %ecx
160 ; X86-NEXT: .LBB0_26:
221161 ; X86-NEXT: addl %ecx, %eax
222162 ; X86-NEXT: popl %esi
223163 ; X86-NEXT: .cfi_def_cfa_offset 4
224164 ; X86-NEXT: retl
225 ; X86-NEXT: .LBB0_36:
165 ; X86-NEXT: .LBB0_39:
226166 ; X86-NEXT: .cfi_def_cfa_offset 8
227167 ; X86-NEXT: movl %eax, %ecx
228168 ; X86-NEXT: shll $5, %ecx
229169 ; X86-NEXT: subl %eax, %ecx
230 ; X86-NEXT: jmp .LBB0_12
231 ; X86-NEXT: .LBB0_37:
170 ; X86-NEXT: jmp .LBB0_41
171 ; X86-NEXT: .LBB0_40:
232172 ; X86-NEXT: movl %eax, %ecx
233173 ; X86-NEXT: shll $5, %ecx
234 ; X86-NEXT: .LBB0_12:
174 ; X86-NEXT: .LBB0_41:
235175 ; X86-NEXT: subl %eax, %ecx
236176 ; X86-NEXT: movl %ecx, %eax
237177 ; X86-NEXT: popl %esi
238178 ; X86-NEXT: .cfi_def_cfa_offset 4
239179 ; X86-NEXT: retl
240 ; X86-NEXT: .LBB0_38:
180 ; X86-NEXT: .LBB0_42:
241181 ; X86-NEXT: .cfi_def_cfa_offset 8
242182 ; X86-NEXT: shll $5, %eax
243183 ; X86-NEXT: popl %esi
255195 ; X64-HSW-NEXT: cmovel %ecx, %eax
256196 ; X64-HSW-NEXT: decl %edi
257197 ; X64-HSW-NEXT: cmpl $31, %edi
258 ; X64-HSW-NEXT: ja .LBB0_36
198 ; X64-HSW-NEXT: ja .LBB0_3
259199 ; X64-HSW-NEXT: # %bb.1:
260200 ; X64-HSW-NEXT: jmpq *.LJTI0_0(,%rdi,8)
261201 ; X64-HSW-NEXT: .LBB0_2:
262202 ; X64-HSW-NEXT: addl %eax, %eax
263203 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
264204 ; X64-HSW-NEXT: retq
265 ; X64-HSW-NEXT: .LBB0_36:
205 ; X64-HSW-NEXT: .LBB0_3:
266206 ; X64-HSW-NEXT: xorl %eax, %eax
267 ; X64-HSW-NEXT: .LBB0_37:
268 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
269 ; X64-HSW-NEXT: retq
270 ; X64-HSW-NEXT: .LBB0_3:
207 ; X64-HSW-NEXT: .LBB0_4:
208 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
209 ; X64-HSW-NEXT: retq
210 ; X64-HSW-NEXT: .LBB0_6:
211 ; X64-HSW-NEXT: shll $2, %eax
212 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
213 ; X64-HSW-NEXT: retq
214 ; X64-HSW-NEXT: .LBB0_8:
215 ; X64-HSW-NEXT: addl %eax, %eax
216 ; X64-HSW-NEXT: .LBB0_5:
271217 ; X64-HSW-NEXT: leal (%rax,%rax,2), %eax
272218 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
273219 ; X64-HSW-NEXT: retq
274 ; X64-HSW-NEXT: .LBB0_4:
275 ; X64-HSW-NEXT: shll $2, %eax
276 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
277 ; X64-HSW-NEXT: retq
278 ; X64-HSW-NEXT: .LBB0_5:
220 ; X64-HSW-NEXT: .LBB0_9:
221 ; X64-HSW-NEXT: leal (,%rax,8), %ecx
222 ; X64-HSW-NEXT: jmp .LBB0_37
223 ; X64-HSW-NEXT: .LBB0_10:
224 ; X64-HSW-NEXT: shll $3, %eax
225 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
226 ; X64-HSW-NEXT: retq
227 ; X64-HSW-NEXT: .LBB0_12:
228 ; X64-HSW-NEXT: addl %eax, %eax
229 ; X64-HSW-NEXT: .LBB0_7:
279230 ; X64-HSW-NEXT: leal (%rax,%rax,4), %eax
280231 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
281232 ; X64-HSW-NEXT: retq
282 ; X64-HSW-NEXT: .LBB0_6:
283 ; X64-HSW-NEXT: addl %eax, %eax
284 ; X64-HSW-NEXT: leal (%rax,%rax,2), %eax
285 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
286 ; X64-HSW-NEXT: retq
287 ; X64-HSW-NEXT: .LBB0_7:
288 ; X64-HSW-NEXT: leal (,%rax,8), %ecx
289 ; X64-HSW-NEXT: jmp .LBB0_8
290 ; X64-HSW-NEXT: .LBB0_9:
291 ; X64-HSW-NEXT: shll $3, %eax
292 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
293 ; X64-HSW-NEXT: retq
294 ; X64-HSW-NEXT: .LBB0_10:
295 ; X64-HSW-NEXT: leal (%rax,%rax,8), %eax
296 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
297 ; X64-HSW-NEXT: retq
298 ; X64-HSW-NEXT: .LBB0_11:
299 ; X64-HSW-NEXT: addl %eax, %eax
300 ; X64-HSW-NEXT: leal (%rax,%rax,4), %eax
301 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
302 ; X64-HSW-NEXT: retq
303 ; X64-HSW-NEXT: .LBB0_12:
233 ; X64-HSW-NEXT: .LBB0_13:
304234 ; X64-HSW-NEXT: leal (%rax,%rax,4), %ecx
305235 ; X64-HSW-NEXT: leal (%rax,%rcx,2), %eax
306236 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
307237 ; X64-HSW-NEXT: retq
308 ; X64-HSW-NEXT: .LBB0_13:
238 ; X64-HSW-NEXT: .LBB0_15:
309239 ; X64-HSW-NEXT: shll $2, %eax
310240 ; X64-HSW-NEXT: leal (%rax,%rax,2), %eax
311241 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
312242 ; X64-HSW-NEXT: retq
313 ; X64-HSW-NEXT: .LBB0_14:
243 ; X64-HSW-NEXT: .LBB0_16:
314244 ; X64-HSW-NEXT: leal (%rax,%rax,2), %ecx
315245 ; X64-HSW-NEXT: leal (%rax,%rcx,4), %eax
316246 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
317247 ; X64-HSW-NEXT: retq
318 ; X64-HSW-NEXT: .LBB0_15:
248 ; X64-HSW-NEXT: .LBB0_18:
319249 ; X64-HSW-NEXT: movl %eax, %ecx
320250 ; X64-HSW-NEXT: shll $4, %ecx
321251 ; X64-HSW-NEXT: subl %eax, %ecx
322 ; X64-HSW-NEXT: jmp .LBB0_8
323 ; X64-HSW-NEXT: .LBB0_17:
252 ; X64-HSW-NEXT: jmp .LBB0_37
253 ; X64-HSW-NEXT: .LBB0_19:
324254 ; X64-HSW-NEXT: leal (%rax,%rax,4), %eax
325255 ; X64-HSW-NEXT: leal (%rax,%rax,2), %eax
326256 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
327257 ; X64-HSW-NEXT: retq
328 ; X64-HSW-NEXT: .LBB0_18:
258 ; X64-HSW-NEXT: .LBB0_20:
329259 ; X64-HSW-NEXT: shll $4, %eax
330260 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
331261 ; X64-HSW-NEXT: retq
332 ; X64-HSW-NEXT: .LBB0_19:
262 ; X64-HSW-NEXT: .LBB0_21:
333263 ; X64-HSW-NEXT: movl %eax, %ecx
334264 ; X64-HSW-NEXT: shll $4, %ecx
335 ; X64-HSW-NEXT: jmp .LBB0_20
336 ; X64-HSW-NEXT: .LBB0_21:
265 ; X64-HSW-NEXT: jmp .LBB0_34
266 ; X64-HSW-NEXT: .LBB0_22:
337267 ; X64-HSW-NEXT: addl %eax, %eax
268 ; X64-HSW-NEXT: .LBB0_11:
338269 ; X64-HSW-NEXT: leal (%rax,%rax,8), %eax
339270 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
340271 ; X64-HSW-NEXT: retq
341 ; X64-HSW-NEXT: .LBB0_22:
272 ; X64-HSW-NEXT: .LBB0_23:
342273 ; X64-HSW-NEXT: leal (%rax,%rax,8), %ecx
343274 ; X64-HSW-NEXT: leal (%rax,%rcx,2), %eax
344275 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
345276 ; X64-HSW-NEXT: retq
346 ; X64-HSW-NEXT: .LBB0_23:
277 ; X64-HSW-NEXT: .LBB0_24:
347278 ; X64-HSW-NEXT: shll $2, %eax
348279 ; X64-HSW-NEXT: leal (%rax,%rax,4), %eax
349280 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
350281 ; X64-HSW-NEXT: retq
351 ; X64-HSW-NEXT: .LBB0_24:
282 ; X64-HSW-NEXT: .LBB0_25:
352283 ; X64-HSW-NEXT: leal (%rax,%rax,4), %ecx
353284 ; X64-HSW-NEXT: leal (%rax,%rcx,4), %eax
354285 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
355286 ; X64-HSW-NEXT: retq
356 ; X64-HSW-NEXT: .LBB0_25:
287 ; X64-HSW-NEXT: .LBB0_26:
357288 ; X64-HSW-NEXT: leal (%rax,%rax,4), %ecx
358289 ; X64-HSW-NEXT: leal (%rax,%rcx,4), %ecx
359 ; X64-HSW-NEXT: jmp .LBB0_20
360 ; X64-HSW-NEXT: .LBB0_26:
290 ; X64-HSW-NEXT: jmp .LBB0_34
291 ; X64-HSW-NEXT: .LBB0_27:
361292 ; X64-HSW-NEXT: leal (%rax,%rax,2), %ecx
362293 ; X64-HSW-NEXT: shll $3, %ecx
363 ; X64-HSW-NEXT: jmp .LBB0_8
364 ; X64-HSW-NEXT: .LBB0_27:
294 ; X64-HSW-NEXT: jmp .LBB0_37
295 ; X64-HSW-NEXT: .LBB0_28:
365296 ; X64-HSW-NEXT: shll $3, %eax
366297 ; X64-HSW-NEXT: leal (%rax,%rax,2), %eax
367298 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
368299 ; X64-HSW-NEXT: retq
369 ; X64-HSW-NEXT: .LBB0_28:
300 ; X64-HSW-NEXT: .LBB0_29:
370301 ; X64-HSW-NEXT: leal (%rax,%rax,4), %eax
371302 ; X64-HSW-NEXT: leal (%rax,%rax,4), %eax
372303 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
373304 ; X64-HSW-NEXT: retq
374 ; X64-HSW-NEXT: .LBB0_29:
305 ; X64-HSW-NEXT: .LBB0_30:
375306 ; X64-HSW-NEXT: leal (%rax,%rax,4), %ecx
376307 ; X64-HSW-NEXT: leal (%rcx,%rcx,4), %ecx
377 ; X64-HSW-NEXT: jmp .LBB0_20
378 ; X64-HSW-NEXT: .LBB0_30:
308 ; X64-HSW-NEXT: jmp .LBB0_34
309 ; X64-HSW-NEXT: .LBB0_31:
379310 ; X64-HSW-NEXT: leal (%rax,%rax,8), %eax
380311 ; X64-HSW-NEXT: leal (%rax,%rax,2), %eax
381312 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
382313 ; X64-HSW-NEXT: retq
383 ; X64-HSW-NEXT: .LBB0_31:
384 ; X64-HSW-NEXT: leal (%rax,%rax,8), %ecx
385 ; X64-HSW-NEXT: leal (%rcx,%rcx,2), %ecx
386 ; X64-HSW-NEXT: jmp .LBB0_20
387314 ; X64-HSW-NEXT: .LBB0_32:
388315 ; X64-HSW-NEXT: leal (%rax,%rax,8), %ecx
389316 ; X64-HSW-NEXT: leal (%rcx,%rcx,2), %ecx
317 ; X64-HSW-NEXT: jmp .LBB0_34
318 ; X64-HSW-NEXT: .LBB0_33:
319 ; X64-HSW-NEXT: leal (%rax,%rax,8), %ecx
320 ; X64-HSW-NEXT: leal (%rcx,%rcx,2), %ecx
390321 ; X64-HSW-NEXT: addl %eax, %ecx
391 ; X64-HSW-NEXT: .LBB0_20:
322 ; X64-HSW-NEXT: .LBB0_34:
392323 ; X64-HSW-NEXT: addl %eax, %ecx
393324 ; X64-HSW-NEXT: movl %ecx, %eax
394325 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
395326 ; X64-HSW-NEXT: retq
396 ; X64-HSW-NEXT: .LBB0_33:
327 ; X64-HSW-NEXT: .LBB0_35:
397328 ; X64-HSW-NEXT: movl %eax, %ecx
398329 ; X64-HSW-NEXT: shll $5, %ecx
399330 ; X64-HSW-NEXT: subl %eax, %ecx
400 ; X64-HSW-NEXT: jmp .LBB0_8
401 ; X64-HSW-NEXT: .LBB0_34:
331 ; X64-HSW-NEXT: jmp .LBB0_37
332 ; X64-HSW-NEXT: .LBB0_36:
402333 ; X64-HSW-NEXT: movl %eax, %ecx
403334 ; X64-HSW-NEXT: shll $5, %ecx
404 ; X64-HSW-NEXT: .LBB0_8:
335 ; X64-HSW-NEXT: .LBB0_37:
405336 ; X64-HSW-NEXT: subl %eax, %ecx
406337 ; X64-HSW-NEXT: movl %ecx, %eax
407338 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
408339 ; X64-HSW-NEXT: retq
409 ; X64-HSW-NEXT: .LBB0_35:
340 ; X64-HSW-NEXT: .LBB0_39:
410341 ; X64-HSW-NEXT: shll $5, %eax
411342 ; X64-HSW-NEXT: # kill: def $eax killed $eax killed $rax
412343 ; X64-HSW-NEXT: retq
1010 ; CHECK: bb.0:
1111 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1212 ; CHECK: TEST8ri $dl, 1, implicit-def $eflags, implicit killed $edx
13 ; CHECK: JCC_1 %bb.2, 4, implicit $eflags
13 ; CHECK: JCC_1 %bb.1, 5, implicit $eflags
14 ; CHECK: bb.2:
15 ; CHECK: successors: %bb.1(0x30000000), %bb.3(0x50000000)
16 ; CHECK: $rax = MOV64rm $r14, 1, $noreg, 0, $noreg :: (load 8)
17 ; CHECK: TEST64rr $rax, $rax, implicit-def $eflags
18 ; CHECK: JCC_1 %bb.1, 4, implicit $eflags
19 ; CHECK: bb.3:
20 ; CHECK: successors: %bb.4(0x30000000), %bb.8(0x50000000)
21 ; CHECK: CMP64mi8 killed $rax, 1, $noreg, 8, $noreg, 0, implicit-def $eflags :: (load 8)
22 ; CHECK: JCC_1 %bb.8, 5, implicit $eflags
23 ; CHECK: bb.4:
24 ; CHECK: successors: %bb.1(0x30000000), %bb.5(0x50000000)
25 ; CHECK: $rax = MOV64rm $r14, 1, $noreg, 0, $noreg :: (load 8)
26 ; CHECK: TEST64rr $rax, $rax, implicit-def $eflags
27 ; CHECK: JCC_1 %bb.1, 4, implicit $eflags
28 ; CHECK: bb.5 (align 4):
29 ; CHECK: successors: %bb.6(0x71555555), %bb.8(0x0eaaaaab)
30 ; CHECK: CMP64mi8 killed $rax, 1, $noreg, 8, $noreg, 0, implicit-def $eflags :: (load 8), (load 8)
31 ; CHECK: JCC_1 %bb.8, 5, implicit $eflags
32 ; CHECK: bb.6:
33 ; CHECK: successors: %bb.1(0x04000000), %bb.5(0x7c000000)
34 ; CHECK: $rax = MOV64rm $r14, 1, $noreg, 0, $noreg :: (load 8)
35 ; CHECK: TEST64rr $rax, $rax, implicit-def $eflags
36 ; CHECK: JCC_1 %bb.5, 5, implicit $eflags
1437 ; CHECK: bb.1:
1538 ; CHECK: $ebp = XOR32rr undef $ebp, undef $ebp, implicit-def dead $eflags
1639 ; CHECK: RETQ $eax
17 ; CHECK: bb.2:
18 ; CHECK: successors: %bb.3(0x30000000), %bb.4(0x50000000)
19 ; CHECK: $rax = MOV64rm $r14, 1, $noreg, 0, $noreg :: (load 8)
20 ; CHECK: TEST64rr $rax, $rax, implicit-def $eflags
21 ; CHECK: JCC_1 %bb.3, 4, implicit $eflags
22 ; CHECK: bb.4:
23 ; CHECK: successors: %bb.5(0x30000000), %bb.10(0x50000000)
24 ; CHECK: CMP64mi8 killed $rax, 1, $noreg, 8, $noreg, 0, implicit-def $eflags :: (load 8)
25 ; CHECK: JCC_1 %bb.10, 5, implicit $eflags
26 ; CHECK: bb.5:
27 ; CHECK: successors: %bb.6(0x30000000), %bb.7(0x50000000)
28 ; CHECK: $rax = MOV64rm $r14, 1, $noreg, 0, $noreg :: (load 8)
29 ; CHECK: TEST64rr $rax, $rax, implicit-def $eflags
30 ; CHECK: JCC_1 %bb.6, 4, implicit $eflags
31 ; CHECK: bb.7 (align 4):
32 ; CHECK: successors: %bb.8(0x71555555), %bb.10(0x0eaaaaab)
33 ; CHECK: CMP64mi8 killed $rax, 1, $noreg, 8, $noreg, 0, implicit-def $eflags :: (load 8), (load 8)
34 ; CHECK: JCC_1 %bb.10, 5, implicit $eflags
3540 ; CHECK: bb.8:
36 ; CHECK: successors: %bb.9(0x04000000), %bb.7(0x7c000000)
37 ; CHECK: $rax = MOV64rm $r14, 1, $noreg, 0, $noreg :: (load 8)
38 ; CHECK: TEST64rr $rax, $rax, implicit-def $eflags
39 ; CHECK: JCC_1 %bb.7, 5, implicit $eflags
40 ; CHECK: bb.9:
41 ; CHECK: $ebp = XOR32rr undef $ebp, undef $ebp, implicit-def dead $eflags
42 ; CHECK: RETQ $eax
43 ; CHECK: bb.10:
4441 ; CHECK: $ebp = XOR32rr undef $ebp, undef $ebp, implicit-def dead $eflags
4542 ; CHECK: dead $eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags, implicit-def $al
46 ; CHECK: RETQ $eax
47 ; CHECK: bb.3:
48 ; CHECK: $ebp = XOR32rr undef $ebp, undef $ebp, implicit-def dead $eflags
49 ; CHECK: RETQ $eax
50 ; CHECK: bb.6:
51 ; CHECK: $ebp = XOR32rr undef $ebp, undef $ebp, implicit-def dead $eflags
5243 ; CHECK: RETQ $eax
5344 bb.0:
5445 successors: %bb.1(0x40000000), %bb.7(0x40000000)
570570 ; two_nosize - Same as two, but without the optsize attribute.
571571 ; Now two instructions are enough to be tail-duplicated.
572572
573 define void @two_nosize() nounwind {
573 define void @two_nosize(i32 %x, i32 %y, i32 %z) nounwind {
574574 ; CHECK-LABEL: two_nosize:
575575 ; CHECK: # %bb.0: # %entry
576 ; CHECK-NEXT: xorl %eax, %eax
577 ; CHECK-NEXT: testb %al, %al
578 ; CHECK-NEXT: jne .LBB8_3
576 ; CHECK-NEXT: testl %edi, %edi
577 ; CHECK-NEXT: je .LBB8_3
579578 ; CHECK-NEXT: # %bb.1: # %bby
580 ; CHECK-NEXT: xorl %eax, %eax
581 ; CHECK-NEXT: testb %al, %al
582 ; CHECK-NEXT: jne .LBB8_4
579 ; CHECK-NEXT: testl %esi, %esi
580 ; CHECK-NEXT: je .LBB8_4
583581 ; CHECK-NEXT: # %bb.2: # %bb7
584582 ; CHECK-NEXT: movl $0, {{.*}}(%rip)
585583 ; CHECK-NEXT: jmp tail_call_me # TAILCALL
586584 ; CHECK-NEXT: .LBB8_3: # %bbx
587 ; CHECK-NEXT: xorl %eax, %eax
588 ; CHECK-NEXT: testb %al, %al
589 ; CHECK-NEXT: je .LBB8_5
590 ; CHECK-NEXT: .LBB8_4: # %return
591 ; CHECK-NEXT: retq
592 ; CHECK-NEXT: .LBB8_5: # %bb12
585 ; CHECK-NEXT: cmpl $-1, %edx
586 ; CHECK-NEXT: je .LBB8_4
587 ; CHECK-NEXT: # %bb.5: # %bb12
593588 ; CHECK-NEXT: movl $0, {{.*}}(%rip)
594589 ; CHECK-NEXT: jmp tail_call_me # TAILCALL
595 entry:
596 %0 = icmp eq i32 undef, 0
590 ; CHECK-NEXT: .LBB8_4: # %return
591 ; CHECK-NEXT: retq
592 entry:
593 %0 = icmp eq i32 %x, 0
597594 br i1 %0, label %bbx, label %bby
598595
599596 bby:
600 switch i32 undef, label %bb7 [
601 i32 16, label %return
597 switch i32 %y, label %bb7 [
598 i32 0, label %return
602599 ]
603600
604601 bb7:
607604 ret void
608605
609606 bbx:
610 switch i32 undef, label %bb12 [
611 i32 128, label %return
607 switch i32 %z, label %bb12 [
608 i32 -1, label %return
612609 ]
613610
614611 bb12:
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc -mtriple=x86_64-pc-linux-gnu -tail-merge-threshold 2 < %s | FileCheck %s
12
23 ; Test that we still do some merging if a block has more than
34 ; tail-merge-threshold predecessors.
45
5 ; CHECK: callq bar
6 ; CHECK: callq bar
7 ; CHECK: callq bar
8 ; CHECK-NOT: callq
9
106 declare void @bar()
117
12 define void @foo(i32 %xxx) {
13 entry:
8 define void @foo(i32 %xxx) nounwind {
9 ; CHECK-LABEL: foo:
10 ; CHECK: # %bb.0:
11 ; CHECK-NEXT: pushq %rax
12 ; CHECK-NEXT: cmpl $3, %edi
13 ; CHECK-NEXT: ja .LBB0_4
14 ; CHECK-NEXT: # %bb.1:
15 ; CHECK-NEXT: movl %edi, %eax
16 ; CHECK-NEXT: jmpq *.LJTI0_0(,%rax,8)
17 ; CHECK-NEXT: .LBB0_3: # %bb3
18 ; CHECK-NEXT: callq bar
19 ; CHECK-NEXT: popq %rax
20 ; CHECK-NEXT: retq
21 ; CHECK-NEXT: .LBB0_4: # %bb4
22 ; CHECK-NEXT: callq bar
23 ; CHECK-NEXT: popq %rax
24 ; CHECK-NEXT: retq
1425 switch i32 %xxx, label %bb4 [
1526 i32 0, label %bb0
1627 i32 1, label %bb1
5151 ; CHECK-X86-NEXT: cmpb $123, {{[0-9]+}}(%esp)
5252 ; CHECK-X86-NEXT: sete %al
5353 ; CHECK-X86-NEXT: testl $263, %ecx ## imm = 0x107
54 ; CHECK-X86-NEXT: je LBB1_2
54 ; CHECK-X86-NEXT: je LBB1_3
5555 ; CHECK-X86-NEXT: ## %bb.1:
5656 ; CHECK-X86-NEXT: testb %al, %al
57 ; CHECK-X86-NEXT: jne LBB1_2
58 ; CHECK-X86-NEXT: ## %bb.3: ## %no
57 ; CHECK-X86-NEXT: jne LBB1_3
58 ; CHECK-X86-NEXT: ## %bb.2: ## %no
5959 ; CHECK-X86-NEXT: calll _bar
60 ; CHECK-X86-NEXT: addl $12, %esp
61 ; CHECK-X86-NEXT: retl
62 ; CHECK-X86-NEXT: LBB1_2: ## %yes
60 ; CHECK-X86-NEXT: LBB1_3: ## %yes
6361 ; CHECK-X86-NEXT: addl $12, %esp
6462 ; CHECK-X86-NEXT: retl
6563 ;
6866 ; CHECK-X64-NEXT: pushq %rax
6967 ; CHECK-X64-NEXT: .cfi_def_cfa_offset 16
7068 ; CHECK-X64-NEXT: testl $263, %edi # imm = 0x107
71 ; CHECK-X64-NEXT: je .LBB1_2
69 ; CHECK-X64-NEXT: je .LBB1_3
7270 ; CHECK-X64-NEXT: # %bb.1:
7371 ; CHECK-X64-NEXT: pand {{.*}}(%rip), %xmm0
7472 ; CHECK-X64-NEXT: pcmpeqd {{.*}}(%rip), %xmm0
7674 ; CHECK-X64-NEXT: pand %xmm0, %xmm1
7775 ; CHECK-X64-NEXT: pextrw $4, %xmm1, %eax
7876 ; CHECK-X64-NEXT: testb $1, %al
79 ; CHECK-X64-NEXT: jne .LBB1_2
80 ; CHECK-X64-NEXT: # %bb.3: # %no
77 ; CHECK-X64-NEXT: jne .LBB1_3
78 ; CHECK-X64-NEXT: # %bb.2: # %no
8179 ; CHECK-X64-NEXT: callq bar
82 ; CHECK-X64-NEXT: popq %rax
83 ; CHECK-X64-NEXT: .cfi_def_cfa_offset 8
84 ; CHECK-X64-NEXT: retq
85 ; CHECK-X64-NEXT: .LBB1_2: # %yes
86 ; CHECK-X64-NEXT: .cfi_def_cfa_offset 16
80 ; CHECK-X64-NEXT: .LBB1_3: # %yes
8781 ; CHECK-X64-NEXT: popq %rax
8882 ; CHECK-X64-NEXT: .cfi_def_cfa_offset 8
8983 ; CHECK-X64-NEXT: retq