aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/Hexagon/cmp_pred.ll115
-rw-r--r--test/CodeGen/Hexagon/cmp_pred_reg.ll115
-rw-r--r--test/CodeGen/Hexagon/cmpb_pred.ll92
3 files changed, 322 insertions, 0 deletions
diff --git a/test/CodeGen/Hexagon/cmp_pred.ll b/test/CodeGen/Hexagon/cmp_pred.ll
new file mode 100644
index 0000000..37db3b4
--- /dev/null
+++ b/test/CodeGen/Hexagon/cmp_pred.ll
@@ -0,0 +1,115 @@
+; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s
+; Generate various cmpb instruction followed by if (p0) .. if (!p0)...
+target triple = "hexagon"
+
+define i32 @Func_3Ugt(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ugt i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Uge(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp uge i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Ult(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ult i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Ule(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ule i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Ueq(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp eq i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Une(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ne i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3UneC(i32 %Enum_Par_Val) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ne i32 %Enum_Par_Val, 122
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3gt(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK: mux
+ %cmp = icmp sgt i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3ge(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp sge i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3lt(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp slt i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3le(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp sle i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3eq(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp eq i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3ne(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ne i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3neC(i32 %Enum_Par_Val) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ne i32 %Enum_Par_Val, 122
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
diff --git a/test/CodeGen/Hexagon/cmp_pred_reg.ll b/test/CodeGen/Hexagon/cmp_pred_reg.ll
new file mode 100644
index 0000000..37db3b4
--- /dev/null
+++ b/test/CodeGen/Hexagon/cmp_pred_reg.ll
@@ -0,0 +1,115 @@
+; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s
+; Generate various cmpb instruction followed by if (p0) .. if (!p0)...
+target triple = "hexagon"
+
+define i32 @Func_3Ugt(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ugt i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Uge(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp uge i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Ult(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ult i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Ule(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ule i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Ueq(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp eq i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3Une(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ne i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3UneC(i32 %Enum_Par_Val) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ne i32 %Enum_Par_Val, 122
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3gt(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK: mux
+ %cmp = icmp sgt i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3ge(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp sge i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3lt(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp slt i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3le(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp sle i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3eq(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp eq i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3ne(i32 %Enum_Par_Val, i32 %pv2) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ne i32 %Enum_Par_Val, %pv2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3neC(i32 %Enum_Par_Val) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %cmp = icmp ne i32 %Enum_Par_Val, 122
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
diff --git a/test/CodeGen/Hexagon/cmpb_pred.ll b/test/CodeGen/Hexagon/cmpb_pred.ll
new file mode 100644
index 0000000..1e61447
--- /dev/null
+++ b/test/CodeGen/Hexagon/cmpb_pred.ll
@@ -0,0 +1,92 @@
+; RUN: llc -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s
+; Generate various cmpb instruction followed by if (p0) .. if (!p0)...
+target triple = "hexagon"
+
+@Enum_global = external global i8
+
+define i32 @Func_3(i32) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %conv = and i32 %0, 255
+ %cmp = icmp eq i32 %conv, 2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3b(i32) nounwind readonly {
+entry:
+; CHECK-NOT: mux
+ %1 = load i8* @Enum_global, align 1, !tbaa !0
+ %2 = trunc i32 %0 to i8
+ %cmp = icmp ne i8 %1, %2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3c(i32) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %conv = and i32 %0, 255
+ %cmp = icmp eq i32 %conv, 2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3d(i32) nounwind readonly {
+entry:
+; CHECK-NOT: mux
+ %1 = load i8* @Enum_global, align 1, !tbaa !0
+ %2 = trunc i32 %0 to i8
+ %cmp = icmp eq i8 %1, %2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3e(i32) nounwind readonly {
+entry:
+; CHECK-NOT: mux
+ %1 = load i8* @Enum_global, align 1, !tbaa !0
+ %2 = trunc i32 %0 to i8
+ %cmp = icmp eq i8 %1, %2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3f(i32) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %conv = and i32 %0, 255
+ %cmp = icmp ugt i32 %conv, 2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3g(i32) nounwind readnone {
+entry:
+; CHECK: mux
+ %conv = and i32 %0, 255
+ %cmp = icmp ult i32 %conv, 3
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3h(i32) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %conv = and i32 %0, 254
+ %cmp = icmp ult i32 %conv, 2
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+define i32 @Func_3i(i32) nounwind readnone {
+entry:
+; CHECK-NOT: mux
+ %conv = and i32 %0, 254
+ %cmp = icmp ugt i32 %conv, 1
+ %selv = zext i1 %cmp to i32
+ ret i32 %selv
+}
+
+!0 = metadata !{metadata !"omnipotent char", metadata !1}
+!1 = metadata !{metadata !"Simple C/C++ TBAA"}