1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -codegenprepare < %s | FileCheck %s
4 target triple = "riscv64-unknown-unknown"
6 ; Check that despeculating count-zeros intrinsics doesn't crash when those
7 ; intrinsics use scalable types.
9 define <vscale x 4 x i64> @cttz_nxv4i64(<vscale x 4 x i64> %x) {
10 ; CHECK-LABEL: @cttz_nxv4i64(
11 ; CHECK-NEXT: [[Z:%.*]] = call <vscale x 4 x i64> @llvm.cttz.nxv4i64(<vscale x 4 x i64> [[X:%.*]], i1 false)
12 ; CHECK-NEXT: ret <vscale x 4 x i64> [[Z]]
14 %z = call <vscale x 4 x i64> @llvm.cttz.nxv4i64(<vscale x 4 x i64> %x, i1 false)
15 ret <vscale x 4 x i64> %z
18 define <vscale x 4 x i64> @ctlz_nxv4i64(<vscale x 4 x i64> %x) {
19 ; CHECK-LABEL: @ctlz_nxv4i64(
20 ; CHECK-NEXT: [[Z:%.*]] = call <vscale x 4 x i64> @llvm.ctlz.nxv4i64(<vscale x 4 x i64> [[X:%.*]], i1 false)
21 ; CHECK-NEXT: ret <vscale x 4 x i64> [[Z]]
23 %z = call <vscale x 4 x i64> @llvm.ctlz.nxv4i64(<vscale x 4 x i64> %x, i1 false)
24 ret <vscale x 4 x i64> %z
27 declare <vscale x 4 x i64> @llvm.cttz.nxv4i64(<vscale x 4 x i64>, i1)
28 declare <vscale x 4 x i64> @llvm.ctlz.nxv4i64(<vscale x 4 x i64>, i1)