llvm-project/llvm/test/Transforms/InstCombine/scalable-bitcast-inseltpoison.ll
Bjorn Pettersson acdc419c89 [test] Use -passes=instcombine instead of -instcombine in lots of tests. NFC
Another step moving away from the deprecated syntax of specifying
pass pipeline in opt.

Differential Revision: https://reviews.llvm.org/D119081
2022-02-07 14:26:59 +01:00

14 lines
565 B
LLVM

; RUN: opt -passes=instcombine -S < %s | FileCheck %s
; We shouldn't fold bitcast(insert <vscale x 1 x iX> .., iX %val, i32 0)
; into bitcast(iX %val) for scalable vectors.
define <vscale x 2 x i8> @bitcast_of_insert_i8_i16(i16 %val) #0 {
; CHECK-LABEL: @bitcast_of_insert_i8_i16(
; CHECK-NOT: bitcast i16 %val to <vscale x 2 x i8>
; CHECK: bitcast <vscale x 1 x i16> %op2 to <vscale x 2 x i8>
entry:
%op2 = insertelement <vscale x 1 x i16> poison, i16 %val, i32 0
%0 = bitcast <vscale x 1 x i16> %op2 to <vscale x 2 x i8>
ret <vscale x 2 x i8> %0
}