29 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes='require<profile-summary>,function(codegenprepare)' < %s | FileCheck %s3 4target triple = "riscv64-unknown-unknown"5 6; Check that despeculating count-zeros intrinsics doesn't crash when those7; intrinsics use scalable types.8 9define <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]]13;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> %z16}17 18define <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]]22;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> %z25}26 27declare <vscale x 4 x i64> @llvm.cttz.nxv4i64(<vscale x 4 x i64>, i1)28declare <vscale x 4 x i64> @llvm.ctlz.nxv4i64(<vscale x 4 x i64>, i1)29