From f7b0041fb5605828bede461cc58a1b17a356676d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 27 Feb 2004 06:27:07 +0000 Subject: [PATCH] The instcombiner should canonicalize comparisons. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11899 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../InstCombine/canonicalize_branch.ll | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/Transforms/InstCombine/canonicalize_branch.ll diff --git a/test/Transforms/InstCombine/canonicalize_branch.ll b/test/Transforms/InstCombine/canonicalize_branch.ll new file mode 100644 index 00000000000..dbf3ab2058a --- /dev/null +++ b/test/Transforms/InstCombine/canonicalize_branch.ll @@ -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 +}