From 9fc2f3ceff85e151af587bb24a5da54e0ace52d3 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Tue, 23 Aug 2016 22:07:31 +0000 Subject: [PATCH] GlobalISel: add some G_TRUNCs to make icmp test valid MIR. llvm-svn: 279579 --- .../AArch64/GlobalISel/legalize-cmp.mir | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir b/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir index eb07415b62e..4308236a16a 100644 --- a/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir +++ b/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir @@ -17,29 +17,35 @@ registers: - { id: 1, class: _ } - { id: 2, class: _ } - { id: 3, class: _ } + - { id: 4, class: _ } + - { id: 5, class: _ } + - { id: 6, class: _ } body: | bb.0.entry: liveins: %x0, %x1, %x2, %x3 %0(64) = COPY %x0 - %1(64) = COPY %x1 + %1(64) = COPY %x0 + + %4(8) = G_TRUNC { s8, s64 } %0 + %5(8) = G_TRUNC { s8, s64 } %1 ; CHECK: [[TST32:%[0-9]+]](32) = G_ICMP { s32, s64 } intpred(sge), %0, %1 ; CHECK: %2(1) = G_TRUNC { s1, s32 } [[TST32]] %2(1) = G_ICMP { s1, s64 } intpred(sge), %0, %1 - ; CHECK: [[LHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %0 - ; CHECK: [[RHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %1 + ; CHECK: [[LHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %4 + ; CHECK: [[RHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %5 ; CHECK: %3(32) = G_ICMP { s32, s32 } intpred(ne), [[LHS32]], [[RHS32]] - %3(32) = G_ICMP { s32, s8 } intpred(ne), %0, %1 + %3(32) = G_ICMP { s32, s8 } intpred(ne), %4, %5 - ; CHECK: [[LHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %0 - ; CHECK: [[RHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %1 + ; CHECK: [[LHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %4 + ; CHECK: [[RHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %5 ; CHECK: %3(32) = G_ICMP { s32, s32 } intpred(ugt), [[LHS32]], [[RHS32]] - %3(32) = G_ICMP { s32, s8 } intpred(ugt), %0, %1 + %3(32) = G_ICMP { s32, s8 } intpred(ugt), %4, %5 - ; CHECK: [[LHS32:%[0-9]+]](32) = G_SEXT { s32, s8 } %0 - ; CHECK: [[RHS32:%[0-9]+]](32) = G_SEXT { s32, s8 } %1 - ; CHECK: %3(32) = G_ICMP { s32, s32 } intpred(sle), [[LHS32]], [[RHS32]] - %3(32) = G_ICMP { s32, s8 } intpred(sle), %0, %1 + ; CHECK: [[LHS32:%[0-9]+]](32) = G_SEXT { s32, s8 } %4 + ; CHECK: [[RHS32:%[0-9]+]](32) = G_SEXT { s32, s8 } %5 + ; CHECK: %6(32) = G_ICMP { s32, s32 } intpred(sle), [[LHS32]], [[RHS32]] + %6(32) = G_ICMP { s32, s8 } intpred(sle), %4, %5 ...