1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
4 ; A bug in X86DAGToDAGISel::matchAddressRecursively create a zext SDValue which
5 ; is quickly replaced by other SDValue but already pushed into vector for later
6 ; calling for SelectionDAGISel::Select_INLINEASM getNode builder, see issue
7 ; 82431 for more infomation.
9 define i64 @PR82431_0(i8 %call, ptr %b) {
10 ; CHECK-LABEL: PR82431_0:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: movzbl %dil, %eax
13 ; CHECK-NEXT: movq 8(%rsi,%rax,8), %rax
16 %narrow = add nuw i8 %call, 1
17 %idxprom = zext i8 %narrow to i64
18 %arrayidx = getelementptr [1 x i64], ptr %b, i64 0, i64 %idxprom
19 %ret_val = load i64, ptr %arrayidx
23 define i32 @PR82431_1(i32 %0, ptr %f) {
24 ; CHECK-LABEL: PR82431_1:
25 ; CHECK: # %bb.0: # %entry
26 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
27 ; CHECK-NEXT: addl %edi, %edi
28 ; CHECK-NEXT: andl $8, %edi
29 ; CHECK-NEXT: movl 4(%rsi,%rdi), %eax
33 %and = and i32 %shr, 2
35 %idxprom = zext i32 %add to i64
36 %arrayidx = getelementptr [0 x i32], ptr %f, i64 0, i64 %idxprom
37 %ret_val = load i32, ptr %arrayidx
41 define void @PR82431_2(i8 %call, ptr %b) {
42 ; CHECK-LABEL: PR82431_2:
43 ; CHECK: # %bb.0: # %entry
44 ; CHECK-NEXT: movzbl %dil, %eax
49 %narrow = add nuw i8 %call, 1
50 %idxprom = zext i8 %narrow to i64
51 %arrayidx = getelementptr [1 x i64], ptr %b, i64 0, i64 %idxprom
52 tail call void asm "", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i64) %arrayidx, ptr elementtype(i64) %arrayidx)
56 define void @PR82431_3(i32 %0, ptr %f) {
57 ; CHECK-LABEL: PR82431_3:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
60 ; CHECK-NEXT: addl %edi, %edi
61 ; CHECK-NEXT: andl $8, %edi
67 %and = and i32 %shr, 2
69 %idxprom = zext i32 %add to i64
70 %arrayidx = getelementptr [0 x i32], ptr %f, i64 0, i64 %idxprom
71 tail call void asm "", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i32) %arrayidx, ptr elementtype(i32) %arrayidx)