xref: /llvm-project/llvm/test/Transforms/InstCombine/AArch64/VectorUtils_heuristics.ll (revision fd07b8f809eb64af9b29331ff6b94904b3159f84)
1; RUN: opt -S -passes=instcombine < %s | FileCheck %s
2
3target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4target triple = "aarch64-unknown-linux-gnu"
5
6; This test checks that instcombine does not crash while invoking
7; maskIsAllOneOrUndef, maskIsAllZeroOrUndef, or possiblyDemandedEltsInMask.
8
9; CHECK-LABEL: novel_algorithm
10; CHECK: unreachable
11define void @novel_algorithm() {
12entry:
13  %a = call <vscale x 16 x i8> @llvm.masked.load.nxv16i8.p0(ptr undef, i32 1, <vscale x 16 x i1> splat (i1 true), <vscale x 16 x i8> undef)
14  %b = add <vscale x 16 x i8> undef, %a
15  call void @llvm.masked.store.nxv16i8.p0(<vscale x 16 x i8> %b, ptr undef, i32 1, <vscale x 16 x i1> splat (i1 true))
16  unreachable
17}
18
19declare <vscale x 16 x i8> @llvm.masked.load.nxv16i8.p0(ptr, i32 immarg, <vscale x 16 x i1>, <vscale x 16 x i8>)
20
21declare void @llvm.masked.store.nxv16i8.p0(<vscale x 16 x i8>, ptr, i32 immarg, <vscale x 16 x i1>)
22