diff options
| author | Evandro Menezes <e.menezes@samsung.com> | 2018-02-23 19:27:43 +0000 |
|---|---|---|
| committer | Evandro Menezes <e.menezes@samsung.com> | 2018-02-23 19:27:43 +0000 |
| commit | 1afffac05b37af21c6df63ef5e662e2e1b81c2f8 (patch) | |
| tree | d645b7355b9adb592ec738225da898622cbc74fa /llvm/test | |
| parent | d6ba3dbbbd9c327f853907ad2eb603899ceacf3a (diff) | |
| download | bcm5719-llvm-1afffac05b37af21c6df63ef5e662e2e1b81c2f8.tar.gz bcm5719-llvm-1afffac05b37af21c6df63ef5e662e2e1b81c2f8.zip | |
[PATCH] [AArch64] Add new target feature to fuse conditional select
This feature enables the fusion of the comparison and the conditional select
instructions together.
Differential revision: https://reviews.llvm.org/D42392
llvm-svn: 325939
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/misched-fusion-csel.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/misched-fusion-csel.ll b/llvm/test/CodeGen/AArch64/misched-fusion-csel.ll new file mode 100644 index 00000000000..c41f0629ce8 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/misched-fusion-csel.ll @@ -0,0 +1,30 @@ +; RUN: llc %s -o - -mtriple=aarch64-unknown -mattr=fuse-csel | FileCheck %s +; RUN: llc %s -o - -mtriple=aarch64-unknown -mcpu=exynos-m3 | FileCheck %s + +target triple = "aarch64-unknown" + +define i32 @test_sub_cselw(i32 %a0, i32 %a1, i32 %a2) { +entry: + %v0 = sub i32 %a0, 13 + %cond = icmp eq i32 %v0, 0 + %v1 = add i32 %a1, 7 + %v2 = select i1 %cond, i32 %a0, i32 %v1 + ret i32 %v2 + +; CHECK-LABEL: test_sub_cselw: +; CHECK: cmp {{w[0-9]}}, #13 +; CHECK-NEXT: csel {{w[0-9]}} +} + +define i64 @test_sub_cselx(i64 %a0, i64 %a1, i64 %a2) { +entry: + %v0 = sub i64 %a0, 13 + %cond = icmp eq i64 %v0, 0 + %v1 = add i64 %a1, 7 + %v2 = select i1 %cond, i64 %a0, i64 %v1 + ret i64 %v2 + +; CHECK-LABEL: test_sub_cselx: +; CHECK: cmp {{x[0-9]}}, #13 +; CHECK-NEXT: csel {{x[0-9]}} +} |

