// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -no-opaque-pointers -triple riscv32 -target-feature +experimental-zbp -emit-llvm %s -o - \
// RUN: | FileCheck %s -check-prefix=RV32ZBP
// RV32ZBP-LABEL: @grev(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP2:%.*]] = call i32 @llvm.riscv.grev.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBP-NEXT: ret i32 [[TMP2]]
//
long
// RV32ZBP-LABEL: @grevi(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[I:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 13, i32* [[I]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = call i32 @llvm.riscv.grev.i32(i32 [[TMP0]], i32 13)
// RV32ZBP-NEXT: ret i32 [[TMP1]]
//
long
// RV32ZBP-LABEL: @gorc(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP2:%.*]] = call i32 @llvm.riscv.gorc.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBP-NEXT: ret i32 [[TMP2]]
//
long
// RV32ZBP-LABEL: @gorci(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[I:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 13, i32* [[I]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = call i32 @llvm.riscv.gorc.i32(i32 [[TMP0]], i32 13)
// RV32ZBP-NEXT: ret i32 [[TMP1]]
//
long
// RV32ZBP-LABEL: @shfl(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP2:%.*]] = call i32 @llvm.riscv.shfl.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBP-NEXT: ret i32 [[TMP2]]
//
long
// RV32ZBP-LABEL: @shfli(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[I:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 13, i32* [[I]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = call i32 @llvm.riscv.shfl.i32(i32 [[TMP0]], i32 13)
// RV32ZBP-NEXT: ret i32 [[TMP1]]
//
long
// RV32ZBP-LABEL: @unshfl(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP2:%.*]] = call i32 @llvm.riscv.unshfl.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBP-NEXT: ret i32 [[TMP2]]
//
long
// RV32ZBP-LABEL: @unshfli(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[I:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 13, i32* [[I]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = call i32 @llvm.riscv.unshfl.i32(i32 [[TMP0]], i32 13)
// RV32ZBP-NEXT: ret i32 [[TMP1]]
//
long
// RV32ZBP-LABEL: @xperm_n(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP2:%.*]] = call i32 @llvm.riscv.xperm.n.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBP-NEXT: ret i32 [[TMP2]]
//
long
// RV32ZBP-LABEL: @xperm_b(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP2:%.*]] = call i32 @llvm.riscv.xperm.b.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBP-NEXT: ret i32 [[TMP2]]
//
long
// RV32ZBP-LABEL: @xperm_h(
// RV32ZBP-NEXT: entry:
// RV32ZBP-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV32ZBP-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV32ZBP-NEXT: [[TMP2:%.*]] = call i32 @llvm.riscv.xperm.h.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBP-NEXT: ret i32 [[TMP2]]
//
long