summaryrefslogtreecommitdiff
path: root/test/CodeGen/Hexagon/cmpb_pred.ll
diff options
context:
space:
mode:
authorJyotsna Verma <jverma@codeaurora.org>2013-02-05 19:20:45 +0000
committerJyotsna Verma <jverma@codeaurora.org>2013-02-05 19:20:45 +0000
commit1d3d2c57f55e04197efe15b293c783fe879c2551 (patch)
tree8d38dc5411bd63c1f74584fb6d065d2e114f7e2f /test/CodeGen/Hexagon/cmpb_pred.ll
parentfaf601ee936a440027447fa11ef400cf53bc1acf (diff)
downloadllvm-1d3d2c57f55e04197efe15b293c783fe879c2551.tar.gz
llvm-1d3d2c57f55e04197efe15b293c783fe879c2551.tar.bz2
llvm-1d3d2c57f55e04197efe15b293c783fe879c2551.tar.xz
Hexagon: Use TFR_cond with cmpb.[eq,gt,gtu] to handle
zext( set[ne,eq,gt,ugt] (...) ) type of dag patterns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Hexagon/cmpb_pred.ll')
-rw-r--r--test/CodeGen/Hexagon/cmpb_pred.ll92
1 files changed, 92 insertions, 0 deletions
diff --git a/test/CodeGen/Hexagon/cmpb_pred.ll b/test/CodeGen/Hexagon/cmpb_pred.ll
new file mode 100644
index 0000000000..1e6144701f
--- /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"}