[llvm] r279569 - GlobalISel: add forgotten test-case for G_ICMP

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 14:11:36 PDT 2016


Author: tnorthover
Date: Tue Aug 23 16:11:36 2016
New Revision: 279569

URL: http://llvm.org/viewvc/llvm-project?rev=279569&view=rev
Log:
GlobalISel: add forgotten test-case for G_ICMP

Added:
    llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir

Added: llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir?rev=279569&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir (added)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir Tue Aug 23 16:11:36 2016
@@ -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
+
+...




More information about the llvm-commits mailing list