summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2018-10-29 18:38:12 +0000
committerThomas Lively <tlively@google.com>2018-10-29 18:38:12 +0000
commiteb15d00193f75396c69cfa28b314fd5165d4c3fe (patch)
treea314611a0533bcefc10beaa5e8642e4fe47c6f87 /llvm/test/CodeGen/WebAssembly
parent3a2f3c2c0a1accb241726b11780c177f3cd13410 (diff)
downloadbcm5719-llvm-eb15d00193f75396c69cfa28b314fd5165d4c3fe.tar.gz
bcm5719-llvm-eb15d00193f75396c69cfa28b314fd5165d4c3fe.zip
[WebAssembly] Lower away condition truncations for scalar selects
Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D53676 llvm-svn: 345521
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly')
-rw-r--r--llvm/test/CodeGen/WebAssembly/select.ll42
1 files changed, 41 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/select.ll b/llvm/test/CodeGen/WebAssembly/select.ll
index 6f6e95f8418..99b8d45d8e2 100644
--- a/llvm/test/CodeGen/WebAssembly/select.ll
+++ b/llvm/test/CodeGen/WebAssembly/select.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s --check-prefixes CHECK,SLOW
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -fast-isel -fast-isel-abort=1 | FileCheck %s
; Test that wasm select instruction is selected from LLVM select instruction.
@@ -16,6 +16,16 @@ define i32 @select_i32_bool(i1 zeroext %a, i32 %b, i32 %c) {
ret i32 %cond
}
+; CHECK-LABEL: select_i32_bool_nozext:
+; CHECK-NEXT: .param i32, i32, i32{{$}}
+; CHECK-NEXT: .result i32{{$}}
+; SLOW-NEXT: i32.select $push0=, $1, $2, $0{{$}}
+; SLOW-NEXT: return $pop0{{$}}
+define i32 @select_i32_bool_nozext(i1 %a, i32 %b, i32 %c) {
+ %cond = select i1 %a, i32 %b, i32 %c
+ ret i32 %cond
+}
+
; CHECK-LABEL: select_i32_eq:
; CHECK-NEXT: .param i32, i32, i32{{$}}
; CHECK-NEXT: .result i32{{$}}
@@ -48,6 +58,16 @@ define i64 @select_i64_bool(i1 zeroext %a, i64 %b, i64 %c) {
ret i64 %cond
}
+; CHECK-LABEL: select_i64_bool_nozext:
+; CHECK-NEXT: .param i32, i64, i64{{$}}
+; CHECK-NEXT: .result i64{{$}}
+; SLOW-NEXT: i64.select $push0=, $1, $2, $0{{$}}
+; SLOW-NEXT: return $pop0{{$}}
+define i64 @select_i64_bool_nozext(i1 %a, i64 %b, i64 %c) {
+ %cond = select i1 %a, i64 %b, i64 %c
+ ret i64 %cond
+}
+
; CHECK-LABEL: select_i64_eq:
; CHECK-NEXT: .param i32, i64, i64{{$}}
; CHECK-NEXT: .result i64{{$}}
@@ -80,6 +100,16 @@ define float @select_f32_bool(i1 zeroext %a, float %b, float %c) {
ret float %cond
}
+; CHECK-LABEL: select_f32_bool_nozext:
+; CHECK-NEXT: .param i32, f32, f32{{$}}
+; CHECK-NEXT: .result f32{{$}}
+; SLOW-NEXT: f32.select $push0=, $1, $2, $0{{$}}
+; SLOW-NEXT: return $pop0{{$}}
+define float @select_f32_bool_nozext(i1 %a, float %b, float %c) {
+ %cond = select i1 %a, float %b, float %c
+ ret float %cond
+}
+
; CHECK-LABEL: select_f32_eq:
; CHECK-NEXT: .param i32, f32, f32{{$}}
; CHECK-NEXT: .result f32{{$}}
@@ -112,6 +142,16 @@ define double @select_f64_bool(i1 zeroext %a, double %b, double %c) {
ret double %cond
}
+; CHECK-LABEL: select_f64_bool_nozext:
+; CHECK-NEXT: .param i32, f64, f64{{$}}
+; CHECK-NEXT: .result f64{{$}}
+; SLOW-NEXT: f64.select $push0=, $1, $2, $0{{$}}
+; SLOW-NEXT: return $pop0{{$}}
+define double @select_f64_bool_nozext(i1 %a, double %b, double %c) {
+ %cond = select i1 %a, double %b, double %c
+ ret double %cond
+}
+
; CHECK-LABEL: select_f64_eq:
; CHECK-NEXT: .param i32, f64, f64{{$}}
; CHECK-NEXT: .result f64{{$}}
OpenPOWER on IntegriCloud