diff options
| author | Matthias Braun <matze@braunis.de> | 2016-01-23 04:05:22 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2016-01-23 04:05:22 +0000 |
| commit | fdef49b183692cb9df7519e95739b1a1c4e6d3b0 (patch) | |
| tree | 22cf0e0d9a6857bb4202e076758c317ef08c55f2 /llvm/test/CodeGen | |
| parent | 985bdf90847994ae1e0bf99cdcb7a4274ac1748a (diff) | |
| download | bcm5719-llvm-fdef49b183692cb9df7519e95739b1a1c4e6d3b0.tar.gz bcm5719-llvm-fdef49b183692cb9df7519e95739b1a1c4e6d3b0.zip | |
AArch64ISel: Fix ccmp code selection matching deep expressions.
Some of the conditions necessary to produce ccmp sequences were only
checked in recursive calls to emitConjunctionDisjunctionTree() after
some of the earlier expressions were already built. Move all checks over
to isConjunctionDisjunctionTree() so they are all checked before we
start emitting instructions.
Also rename some variable to better reflect their usage.
llvm-svn: 258605
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/arm64-ccmp.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/arm64-ccmp.ll b/llvm/test/CodeGen/AArch64/arm64-ccmp.ll index cd25eb43216..767df7416cb 100644 --- a/llvm/test/CodeGen/AArch64/arm64-ccmp.ll +++ b/llvm/test/CodeGen/AArch64/arm64-ccmp.ll @@ -426,6 +426,25 @@ define i64 @select_noccmp2(i64 %v1, i64 %v2, i64 %v3, i64 %r) { ret i64 %sel } +; The following is not possible to implement with a single cmp;ccmp;csel +; sequence. +; CHECK-LABEL: select_noccmp3 +define i32 @select_noccmp3(i32 %v0, i32 %v1, i32 %v2) { + %c0 = icmp slt i32 %v0, 0 + %c1 = icmp sgt i32 %v0, 13 + %c2 = icmp slt i32 %v0, 22 + %c3 = icmp sgt i32 %v0, 44 + %c4 = icmp eq i32 %v0, 99 + %c5 = icmp eq i32 %v0, 77 + %or0 = or i1 %c0, %c1 + %or1 = or i1 %c2, %c3 + %and0 = and i1 %or0, %or1 + %or2 = or i1 %c4, %c5 + %and1 = and i1 %and0, %or2 + %sel = select i1 %and1, i32 %v1, i32 %v2 + ret i32 %sel +} + ; Test the IR CCs that expand to two cond codes. ; CHECK-LABEL: select_and_olt_one: |

