diff options
| author | Weiming Zhao <weimingz@codeaurora.org> | 2014-05-13 00:40:58 +0000 |
|---|---|---|
| committer | Weiming Zhao <weimingz@codeaurora.org> | 2014-05-13 00:40:58 +0000 |
| commit | dd83691cc3f99670d6ae399e20954e2d52434ae3 (patch) | |
| tree | aa571ddd223dc08e0b27427a3ebff2a48e6d1b30 /llvm/test/CodeGen/ARM64 | |
| parent | cddb255b5dcf8c114df119e45b4e586d25ba7093 (diff) | |
| download | bcm5719-llvm-dd83691cc3f99670d6ae399e20954e2d52434ae3.tar.gz bcm5719-llvm-dd83691cc3f99670d6ae399e20954e2d52434ae3.zip | |
Folding into CSEL when there is ZEXT between SETCC and ADD
Normally, patterns like (add x, (setcc cc ...)) will be folded into
(csel x, x+1, not cc). However, if there is a ZEXT after SETCC, they
won't be folded. This patch recognizes the ZEXT and allows the
generation of CSINC.
This patch fixes bug 19680.
llvm-svn: 208660
Diffstat (limited to 'llvm/test/CodeGen/ARM64')
| -rw-r--r-- | llvm/test/CodeGen/ARM64/csel.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM64/csel.ll b/llvm/test/CodeGen/ARM64/csel.ll index 975056bfa2c..98eba30f119 100644 --- a/llvm/test/CodeGen/ARM64/csel.ll +++ b/llvm/test/CodeGen/ARM64/csel.ll @@ -217,3 +217,14 @@ entry: %. = select i1 %cmp, i64 1, i64 2 ret i64 %. } + +define i64 @foo19(i64 %a, i64 %b, i64 %c) { +entry: +; CHECK-LABEL: foo19: +; CHECK: cinc x0, x2 +; CHECK-NOT: add + %cmp = icmp ult i64 %a, %b + %inc = zext i1 %cmp to i64 + %inc.c = add i64 %inc, %c + ret i64 %inc.c +} |

