diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-24 00:09:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-24 00:09:49 +0000 |
commit | abb992d6a3d2dc05d3f3c62a367ea8977a7dd070 (patch) | |
tree | b2498eacd1dbdae0230b2b4037063bca999a4ea9 /test/Transforms | |
parent | eb38ebf15c326a5bb45ca9da6329cdf19ad6df95 (diff) | |
download | external_llvm-abb992d6a3d2dc05d3f3c62a367ea8977a7dd070.zip external_llvm-abb992d6a3d2dc05d3f3c62a367ea8977a7dd070.tar.gz external_llvm-abb992d6a3d2dc05d3f3c62a367ea8977a7dd070.tar.bz2 |
change the canonical form of "cond ? -1 : 0" to be
"sext cond" instead of a select. This simplifies some instcombine
code, matches the policy for zext (cond ? 1 : 0 -> zext), and allows
us to generate better code for a testcase on ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/logical-select.ll | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/Transforms/InstCombine/logical-select.ll b/test/Transforms/InstCombine/logical-select.ll index ece8bc3..4e48b2d 100644 --- a/test/Transforms/InstCombine/logical-select.ll +++ b/test/Transforms/InstCombine/logical-select.ll @@ -1,7 +1,4 @@ -; RUN: opt < %s -instcombine -S > %t -; RUN: grep select %t | count 5 -; RUN: not grep and %t -; RUN: not grep or %t +; RUN: opt < %s -instcombine -S > FileCheck %s define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { %e = icmp slt i32 %a, %b @@ -11,6 +8,9 @@ define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { %i = and i32 %d, %h %j = or i32 %g, %i ret i32 %j +; CHECK: %e = icmp slt i32 %a, %b +; CHECK: %j = select i1 %e, i32 %c, i32 %d +; CHECK: ret i32 %j } define i32 @bar(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { %e = icmp slt i32 %a, %b @@ -20,6 +20,9 @@ define i32 @bar(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { %i = and i32 %d, %h %j = or i32 %i, %g ret i32 %j +; CHECK: %e = icmp slt i32 %a, %b +; CHECK: %j = select i1 %e, i32 %c, i32 %d +; CHECK: ret i32 %j } define i32 @goo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { entry: @@ -30,6 +33,9 @@ entry: %2 = and i32 %not, %d %3 = or i32 %1, %2 ret i32 %3 +; CHECK: %0 = icmp slt i32 %a, %b +; CHECK: %1 = select i1 %0, i32 %c, i32 %d +; CHECK: ret i32 %1 } define i32 @poo(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { entry: @@ -40,6 +46,9 @@ entry: %2 = and i32 %iftmp, %d %3 = or i32 %1, %2 ret i32 %3 +; CHECK: %0 = icmp slt i32 %a, %b +; CHECK: %1 = select i1 %0, i32 %c, i32 %d +; CHECK: ret i32 %1 } define i32 @par(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { @@ -51,4 +60,7 @@ entry: %2 = and i32 %not, %d %3 = or i32 %1, %2 ret i32 %3 +; CHECK: %0 = icmp slt i32 %a, %b +; CHECK: %1 = select i1 %0, i32 %c, i32 %d +; CHECK: ret i32 %1 } |