103 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; RUN: llc -mtriple=x86_64-grtev4-linux-gnu < %s | FileCheck %s3 4; Test a bad interaction between register allocation and the register5; coalescer. The coalescer lost the high subregister def when6; SUBREG_TO_REG was used to implement i32->i64 zext. The allocator7; then recognized the undef subregister defing MOV as a copy8; instruction, resulting in the users seeing different undef values.9 10 11%struct.wibble = type { %struct.wombat }12%struct.wombat = type { %struct.ham, [3 x i8] }13%struct.ham = type { %struct.zot }14%struct.zot = type { %struct.blam }15%struct.blam = type { %struct.ham.0 }16%struct.ham.0 = type { %struct.bar }17%struct.bar = type { %struct.bar.1 }18%struct.bar.1 = type { %struct.baz, i8 }19%struct.baz = type { %struct.snork }20%struct.snork = type <{ %struct.spam, i8, [3 x i8] }>21%struct.spam = type { %struct.snork.2, %struct.snork.2 }22%struct.snork.2 = type { i32 }23 24define void @foo(ptr %arg3, i1 %icmp16) #0 {25; CHECK-LABEL: foo:26; CHECK: # %bb.0: # %bb27; CHECK-NEXT: pushq %rbp28; CHECK-NEXT: .cfi_def_cfa_offset 1629; CHECK-NEXT: .cfi_offset %rbp, -1630; CHECK-NEXT: movq %rsp, %rbp31; CHECK-NEXT: .cfi_def_cfa_register %rbp32; CHECK-NEXT: pushq %r1533; CHECK-NEXT: pushq %r1434; CHECK-NEXT: pushq %r1335; CHECK-NEXT: pushq %r1236; CHECK-NEXT: pushq %rbx37; CHECK-NEXT: pushq %rax38; CHECK-NEXT: .cfi_offset %rbx, -5639; CHECK-NEXT: .cfi_offset %r12, -4840; CHECK-NEXT: .cfi_offset %r13, -4041; CHECK-NEXT: .cfi_offset %r14, -3242; CHECK-NEXT: .cfi_offset %r15, -2443; CHECK-NEXT: movl %esi, %ebx44; CHECK-NEXT: movq %rdi, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill45; CHECK-NEXT: xorl %r15d, %r15d46; CHECK-NEXT: xorl %r12d, %r12d47; CHECK-NEXT: # implicit-def: $r1348; CHECK-NEXT: jmp .LBB0_249; CHECK-NEXT: .p2align 450; CHECK-NEXT: .LBB0_1: # %bb551; CHECK-NEXT: # in Loop: Header=BB0_2 Depth=152; CHECK-NEXT: orl $1, %r12d53; CHECK-NEXT: movq %r14, %r1554; CHECK-NEXT: .LBB0_2: # %bb755; CHECK-NEXT: # =>This Inner Loop Header: Depth=156; CHECK-NEXT: xorl %eax, %eax57; CHECK-NEXT: callq *%rax58; CHECK-NEXT: movl %r13d, %r13d59; CHECK-NEXT: testb $1, %bl60; CHECK-NEXT: movl $0, %r14d61; CHECK-NEXT: jne .LBB0_162; CHECK-NEXT: # %bb.3: # %bb1763; CHECK-NEXT: # in Loop: Header=BB0_2 Depth=164; CHECK-NEXT: xorl %r14d, %r14d65; CHECK-NEXT: testq %r15, %r1566; CHECK-NEXT: sete %r14b67; CHECK-NEXT: xorl %edi, %edi68; CHECK-NEXT: xorl %eax, %eax69; CHECK-NEXT: callq *%rax70; CHECK-NEXT: shll $4, %r14d71; CHECK-NEXT: addq {{[-0-9]+}}(%r{{[sb]}}p), %r14 # 8-byte Folded Reload72; CHECK-NEXT: movl %r13d, 073; CHECK-NEXT: movb $0, 474; CHECK-NEXT: jmp .LBB0_175bb:76 br label %bb777 78bb5: ; preds = %bb17, %bb779 %phi6 = phi ptr [ %getelementptr, %bb17 ], [ null, %bb7 ]80 %add = or i32 %phi9, 181 %icmp = icmp eq i32 %phi9, 082 br label %bb783 84bb7: ; preds = %bb5, %bb85 %phi8 = phi ptr [ null, %bb ], [ %phi6, %bb5 ]86 %phi9 = phi i32 [ 0, %bb ], [ %add, %bb5 ]87 %phi10 = phi i40 [ undef, %bb ], [ %and, %bb5 ]88 %call = call ptr null()89 %and = and i40 %phi10, 429496729590 %icmp161 = icmp ugt ptr %phi8, null91 br i1 %icmp16, label %bb5, label %bb1792 93bb17: ; preds = %bb794 %icmp18 = icmp eq ptr %phi8, null95 %zext = zext i1 %icmp18 to i6496 %call19 = call ptr null(i64 0)97 %getelementptr = getelementptr %struct.wibble, ptr %arg3, i64 %zext98 store i40 %and, ptr null, align 499 br label %bb5100}101 102attributes #0 = { "frame-pointer"="all" }103