From 4bdf4735903e6158f966ff36aa0dba1166ebff83 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Tue, 23 Aug 2016 21:11:36 +0000 Subject: [PATCH] GlobalISel: add forgotten test-case for G_ICMP llvm-svn: 279569 --- .../CodeGen/AArch64/GlobalISel/legalize-cmp.mir | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 llvm/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir new file mode 100644 index 0000000..eb07415 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir @@ -0,0 +1,45 @@ +# RUN: llc -O0 -run-pass=legalize-mir -global-isel %s -o - 2>&1 | FileCheck %s + +--- | + target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" + target triple = "aarch64-apple-ios" + define void @test_icmp() { + entry: + ret void + } +... + +--- +name: test_icmp +isSSA: true +registers: + - { id: 0, class: _ } + - { id: 1, class: _ } + - { id: 2, class: _ } + - { id: 3, class: _ } +body: | + bb.0.entry: + liveins: %x0, %x1, %x2, %x3 + %0(64) = COPY %x0 + %1(64) = COPY %x1 + + ; 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: %3(32) = G_ICMP { s32, s32 } intpred(ne), [[LHS32]], [[RHS32]] + %3(32) = G_ICMP { s32, s8 } intpred(ne), %0, %1 + + ; CHECK: [[LHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %0 + ; CHECK: [[RHS32:%[0-9]+]](32) = G_ZEXT { s32, s8 } %1 + ; CHECK: %3(32) = G_ICMP { s32, s32 } intpred(ugt), [[LHS32]], [[RHS32]] + %3(32) = G_ICMP { s32, s8 } intpred(ugt), %0, %1 + + ; 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 + +... -- 2.7.4