The instcombiner should canonicalize comparisons.
authorChris Lattner <sabre@nondot.org>
Fri, 27 Feb 2004 06:27:07 +0000 (06:27 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 27 Feb 2004 06:27:07 +0000 (06:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11899 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/canonicalize_branch.ll [new file with mode: 0644]

diff --git a/test/Transforms/InstCombine/canonicalize_branch.ll b/test/Transforms/InstCombine/canonicalize_branch.ll
new file mode 100644 (file)
index 0000000..dbf3ab2
--- /dev/null
@@ -0,0 +1,27 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'setne\|setle\|setge'
+
+int %test1(uint %X, uint %Y) {
+       %C = setne uint %X, %Y
+       br bool %C, label %T, label %F
+T:
+       ret int 12
+F:
+       ret int 123
+}
+
+int %test2(uint %X, uint %Y) {
+       %C = setle uint %X, %Y
+       br bool %C, label %T, label %F
+T:
+       ret int 12
+F:
+       ret int 123
+}
+int %test3(uint %X, uint %Y) {
+       %C = setge uint %X, %Y
+       br bool %C, label %T, label %F
+T:
+       ret int 12
+F:
+       ret int 123
+}