diff options
author | Dinesh Dwivedi <dinesh.d@samsung.com> | 2014-06-26 08:57:33 +0000 |
---|---|---|
committer | Dinesh Dwivedi <dinesh.d@samsung.com> | 2014-06-26 08:57:33 +0000 |
commit | c2b11baf5fdb26c2bf2c9b02dae9f0f0f61e9f1b (patch) | |
tree | 198b3f7ece1863cdf8dd98b946bf445efb0abec9 /test/Transforms | |
parent | 0bf7c06b639902b378702eed907821f0235a337a (diff) | |
download | llvm-c2b11baf5fdb26c2bf2c9b02dae9f0f0f61e9f1b.tar.gz llvm-c2b11baf5fdb26c2bf2c9b02dae9f0f0f61e9f1b.tar.bz2 llvm-c2b11baf5fdb26c2bf2c9b02dae9f0f0f61e9f1b.tar.xz |
This patch removed duplicate code for matching patterns
which are now handled in SimplifyUsingDistributiveLaws()
(after r211261)
Differential Revision: http://reviews.llvm.org/D4253
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/distribute.ll (renamed from test/Transforms/InstSimplify/2010-12-20-Distribute.ll) | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/Transforms/InstSimplify/2010-12-20-Distribute.ll b/test/Transforms/InstCombine/distribute.ll index 9ea0a5e107..e6360f8ba6 100644 --- a/test/Transforms/InstSimplify/2010-12-20-Distribute.ll +++ b/test/Transforms/InstCombine/distribute.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -instsimplify -S | FileCheck %s +; RUN: opt < %s -instcombine -S | FileCheck %s define i32 @factorize(i32 %x, i32 %y) { ; CHECK-LABEL: @factorize( @@ -28,27 +28,32 @@ define i32 @factorize3(i32 %x, i32 %a, i32 %b) { %r = or i32 %x, %b %z = and i32 %l, %r ret i32 %z -; CHECK: ret i32 %r +; CHECK: %z = or i32 %b, %x +; CHECK: ret i32 %z } define i32 @factorize4(i32 %x, i32 %y) { ; CHECK-LABEL: @factorize4( +; ((Y << 1) * X) - (X * Y) -> (X * (Y * 2 - Y)) -> (X * Y) %sh = shl i32 %y, 1 %ml = mul i32 %sh, %x %mr = mul i32 %x, %y %s = sub i32 %ml, %mr ret i32 %s -; CHECK: ret i32 %mr +; CHECK: %s = mul i32 %y, %x +; CHECK: ret i32 %s } define i32 @factorize5(i32 %x, i32 %y) { ; CHECK-LABEL: @factorize5( +; ((Y * 2) * X) - (X * Y) -> (X * Y) %sh = mul i32 %y, 2 %ml = mul i32 %sh, %x %mr = mul i32 %x, %y %s = sub i32 %ml, %mr ret i32 %s -; CHECK: ret i32 %mr +; CHECK: %s = mul i32 %y, %x +; CHECK: ret i32 %s } define i32 @expand(i32 %x) { @@ -58,5 +63,6 @@ define i32 @expand(i32 %x) { %b = or i32 %a, 2 %c = and i32 %b, 1 ret i32 %c +; CHECK: %a = and i32 %x, 1 ; CHECK: ret i32 %a } |