81 lines · plain
1; RUN: llc -O0 < %s -verify-machineinstrs2; RUN: llc < %s -verify-machineinstrs3target triple = "x86_64-apple-macosx10.7"4 5; This test case extracts a sub_8bit_hi sub-register:6;7; %r8b = COPY %bh, implicit killed %ebx8; %esi = MOVZX32_NOREXrr8 killed %r8b9;10; The register allocation above is invalid, %bh can only be encoded without an11; REX prefix, so the destination register must be GR8_NOREX. The code above12; triggers an assertion in copyPhysReg.13;14; <rdar://problem/10248099>15 16define void @f() nounwind uwtable ssp {17entry:18 %0 = load i32, ptr undef, align 419 %add = add i32 0, %020 %conv1 = trunc i32 %add to i1621 %bf.value = and i16 %conv1, 25522 %1 = and i16 %bf.value, 25523 %2 = shl i16 %1, 824 %3 = load i16, ptr undef, align 125 %4 = and i16 %3, 25526 %5 = or i16 %4, %227 store i16 %5, ptr undef, align 128 %6 = load i16, ptr undef, align 129 %7 = lshr i16 %6, 830 %bf.clear2 = and i16 %7, 25531 %conv3 = zext i16 %bf.clear2 to i3232 %rem = srem i32 %conv3, 1533 %conv4 = trunc i32 %rem to i1634 %bf.value5 = and i16 %conv4, 25535 %8 = and i16 %bf.value5, 25536 %9 = shl i16 %8, 837 %10 = or i16 undef, %938 store i16 %10, ptr undef, align 139 ret void40}41 42; This test case extracts a sub_8bit_hi sub-register:43;44; %2 = COPY %1:sub_8bit_hi; GR8:%2 GR64_ABCD:%145; TEST8ri %2, 1, implicit-def %eflags; GR8:%246;47; %2 must be constrained to GR8_NOREX, or the COPY could become impossible.48;49; PR1108850 51define fastcc i32 @g(i64 %FB) nounwind uwtable readnone align 2 {52entry:53 %and32 = and i64 %FB, 25654 %cmp33 = icmp eq i64 %and32, 055 %Features.6.or35 = select i1 %cmp33, i32 0, i32 undef56 %cmp38 = icmp eq i64 undef, 057 %or40 = or i32 %Features.6.or35, 458 %Features.8 = select i1 %cmp38, i32 %Features.6.or35, i32 %or4059 %and42 = and i64 %FB, 3260 %or45 = or i32 %Features.8, 261 %cmp43 = icmp eq i64 %and42, 062 %Features.8.or45 = select i1 %cmp43, i32 %Features.8, i32 %or4563 %and47 = and i64 %FB, 819264 %cmp48 = icmp eq i64 %and47, 065 %or50 = or i32 %Features.8.or45, 3266 %Features.10 = select i1 %cmp48, i32 %Features.8.or45, i32 %or5067 %or55 = or i32 %Features.10, 6468 %Features.10.or55 = select i1 undef, i32 %Features.10, i32 %or5569 %and57 = lshr i64 %FB, 270 %and57.tr = trunc i64 %and57 to i3271 %or60 = and i32 %and57.tr, 172 %Features.12 = or i32 %Features.10.or55, %or6073 %and62 = and i64 %FB, 12874 %or65 = or i32 %Features.12, 875 %cmp63 = icmp eq i64 %and62, 076 %Features.12.or65 = select i1 %cmp63, i32 %Features.12, i32 %or6577 %Features.14 = select i1 undef, i32 undef, i32 %Features.12.or6578 %Features.16 = select i1 undef, i32 undef, i32 %Features.1479 ret i32 %Features.1680}81