llvm-project/llvm/test/CodeGen/WebAssembly/fast-isel-simd128.ll
Hongyu Chen 9697f4b9e4
[WebAssembly][FastISel] Bail out on meeting non-integer type in selectTrunc (#167165)
Fixes https://github.com/llvm/llvm-project/issues/165438
With `simd128` enabled, we may meet vector type truncation in FastISel.
To respect #138479, this patch merely bails out on non-integer IR types,
though I prefer bailing out for all non-simple types as most targets
(X86, AArch64) do.
2025-11-12 04:33:41 +08:00

24 lines
810 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
; RUN: llc < %s -fast-isel -fast-isel-abort=0 -mattr=+simd128 -verify-machineinstrs | FileCheck %s
target triple = "wasm32-unknown-unknown"
define i8 @pr165438(<4 x i32> %0) {
; CHECK-LABEL: pr165438:
; CHECK: .functype pr165438 (v128) -> (i32)
; CHECK-NEXT: # %bb.0: # %entry
; CHECK-NEXT: local.get 0
; CHECK-NEXT: local.get 0
; CHECK-NEXT: i8x16.shuffle 0, 4, 8, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; CHECK-NEXT: i8x16.extract_lane_u 0
; CHECK-NEXT: # fallthrough-return
entry:
%conv = trunc <4 x i32> %0 to <4 x i8>
br label %cond.true
cond.true: ; preds = %entry
%vecext = extractelement <4 x i8> %conv, i32 0
ret i8 %vecext
}