505 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \3// RUN: -disable-O0-optnone \4// RUN: -emit-llvm -o - %s | opt -S -passes=sroa | FileCheck %s5 6// REQUIRES: aarch64-registered-target7 8#include <arm_sve.h>9 10// CHECK-LABEL: @lshift_i8(11// CHECK-NEXT: entry:12// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]13// CHECK-NEXT: ret <vscale x 16 x i8> [[SHL]]14//15svint8_t lshift_i8(svint8_t a, svint8_t b) {16 return a << b;17}18 19// CHECK-LABEL: @rshift_i8(20// CHECK-NEXT: entry:21// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]22// CHECK-NEXT: ret <vscale x 16 x i8> [[SHR]]23//24svint8_t rshift_i8(svint8_t a, svint8_t b) {25 return a >> b;26}27 28// CHECK-LABEL: @lshift_u8(29// CHECK-NEXT: entry:30// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]31// CHECK-NEXT: ret <vscale x 16 x i8> [[SHL]]32//33svuint8_t lshift_u8(svuint8_t a, svuint8_t b) {34 return a << b;35}36 37// CHECK-LABEL: @rshift_u8(38// CHECK-NEXT: entry:39// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 16 x i8> [[A:%.*]], [[B:%.*]]40// CHECK-NEXT: ret <vscale x 16 x i8> [[SHR]]41//42svuint8_t rshift_u8(svuint8_t a, svuint8_t b) {43 return a >> b;44}45 46// CHECK-LABEL: @lshift_i16(47// CHECK-NEXT: entry:48// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]49// CHECK-NEXT: ret <vscale x 8 x i16> [[SHL]]50//51svint16_t lshift_i16(svint16_t a, svint16_t b) {52 return a << b;53}54 55// CHECK-LABEL: @rshift_i16(56// CHECK-NEXT: entry:57// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]58// CHECK-NEXT: ret <vscale x 8 x i16> [[SHR]]59//60svint16_t rshift_i16(svint16_t a, svint16_t b) {61 return a >> b;62}63 64// CHECK-LABEL: @lshift_u16(65// CHECK-NEXT: entry:66// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]67// CHECK-NEXT: ret <vscale x 8 x i16> [[SHL]]68//69svuint16_t lshift_u16(svuint16_t a, svuint16_t b) {70 return a << b;71}72 73// CHECK-LABEL: @rshift_u16(74// CHECK-NEXT: entry:75// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 8 x i16> [[A:%.*]], [[B:%.*]]76// CHECK-NEXT: ret <vscale x 8 x i16> [[SHR]]77//78svuint16_t rshift_u16(svuint16_t a, svuint16_t b) {79 return a >> b;80}81 82// CHECK-LABEL: @lshift_i32(83// CHECK-NEXT: entry:84// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]85// CHECK-NEXT: ret <vscale x 4 x i32> [[SHL]]86//87svint32_t lshift_i32(svint32_t a, svint32_t b) {88 return a << b;89}90 91// CHECK-LABEL: @rshift_i32(92// CHECK-NEXT: entry:93// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]94// CHECK-NEXT: ret <vscale x 4 x i32> [[SHR]]95//96svint32_t rshift_i32(svint32_t a, svint32_t b) {97 return a >> b;98}99 100// CHECK-LABEL: @lshift_u32(101// CHECK-NEXT: entry:102// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]103// CHECK-NEXT: ret <vscale x 4 x i32> [[SHL]]104//105svuint32_t lshift_u32(svuint32_t a, svuint32_t b) {106 return a << b;107}108 109// CHECK-LABEL: @rshift_u32(110// CHECK-NEXT: entry:111// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 4 x i32> [[A:%.*]], [[B:%.*]]112// CHECK-NEXT: ret <vscale x 4 x i32> [[SHR]]113//114svuint32_t rshift_u32(svuint32_t a, svuint32_t b) {115 return a >> b;116}117 118// CHECK-LABEL: @lshift_i64(119// CHECK-NEXT: entry:120// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]121// CHECK-NEXT: ret <vscale x 2 x i64> [[SHL]]122//123svint64_t lshift_i64(svint64_t a, svint64_t b) {124 return a << b;125}126 127// CHECK-LABEL: @rshift_i64(128// CHECK-NEXT: entry:129// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]130// CHECK-NEXT: ret <vscale x 2 x i64> [[SHR]]131//132svint64_t rshift_i64(svint64_t a, svint64_t b) {133 return a >> b;134}135 136// CHECK-LABEL: @lshift_u64(137// CHECK-NEXT: entry:138// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]139// CHECK-NEXT: ret <vscale x 2 x i64> [[SHL]]140//141svuint64_t lshift_u64(svuint64_t a, svuint64_t b) {142 return a << b;143}144 145// CHECK-LABEL: @rshift_u64(146// CHECK-NEXT: entry:147// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 2 x i64> [[A:%.*]], [[B:%.*]]148// CHECK-NEXT: ret <vscale x 2 x i64> [[SHR]]149//150svuint64_t rshift_u64(svuint64_t a, svuint64_t b) {151 return a >> b;152}153 154// CHECK-LABEL: @lshift_i8_rsplat(155// CHECK-NEXT: entry:156// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[B:%.*]], i64 0157// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[SPLAT_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer158// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 16 x i8> [[A:%.*]], [[SPLAT_SPLAT]]159// CHECK-NEXT: ret <vscale x 16 x i8> [[SHL]]160//161svint8_t lshift_i8_rsplat(svint8_t a, int8_t b) {162 return a << b;163}164 165// CHECK-LABEL: @lshift_i8_lsplat(166// CHECK-NEXT: entry:167// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[B:%.*]], i64 0168// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[SPLAT_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer169// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 16 x i8> [[SPLAT_SPLAT]], [[A:%.*]]170// CHECK-NEXT: ret <vscale x 16 x i8> [[SHL]]171//172svint8_t lshift_i8_lsplat(svint8_t a, int8_t b) {173 return b << a;174}175 176// CHECK-LABEL: @rshift_i8_rsplat(177// CHECK-NEXT: entry:178// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[B:%.*]], i64 0179// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[SPLAT_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer180// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 16 x i8> [[A:%.*]], [[SPLAT_SPLAT]]181// CHECK-NEXT: ret <vscale x 16 x i8> [[SHR]]182//183svint8_t rshift_i8_rsplat(svint8_t a, int8_t b) {184 return a >> b;185}186 187// CHECK-LABEL: @rshift_i8_lsplat(188// CHECK-NEXT: entry:189// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[B:%.*]], i64 0190// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[SPLAT_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer191// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 16 x i8> [[SPLAT_SPLAT]], [[A:%.*]]192// CHECK-NEXT: ret <vscale x 16 x i8> [[SHR]]193//194svint8_t rshift_i8_lsplat(svint8_t a, int8_t b) {195 return b >> a;196}197 198// CHECK-LABEL: @lshift_u8_rsplat(199// CHECK-NEXT: entry:200// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[B:%.*]], i64 0201// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[SPLAT_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer202// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 16 x i8> [[A:%.*]], [[SPLAT_SPLAT]]203// CHECK-NEXT: ret <vscale x 16 x i8> [[SHL]]204//205svuint8_t lshift_u8_rsplat(svuint8_t a, uint8_t b) {206 return a << b;207}208 209// CHECK-LABEL: @lshift_u8_lsplat(210// CHECK-NEXT: entry:211// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[B:%.*]], i64 0212// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[SPLAT_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer213// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 16 x i8> [[SPLAT_SPLAT]], [[A:%.*]]214// CHECK-NEXT: ret <vscale x 16 x i8> [[SHL]]215//216svuint8_t lshift_u8_lsplat(svuint8_t a, uint8_t b) {217 return b << a;218}219 220// CHECK-LABEL: @rshift_u8_rsplat(221// CHECK-NEXT: entry:222// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[B:%.*]], i64 0223// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[SPLAT_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer224// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 16 x i8> [[A:%.*]], [[SPLAT_SPLAT]]225// CHECK-NEXT: ret <vscale x 16 x i8> [[SHR]]226//227svuint8_t rshift_u8_rsplat(svuint8_t a, uint8_t b) {228 return a >> b;229}230 231// CHECK-LABEL: @rshift_u8_lsplat(232// CHECK-NEXT: entry:233// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[B:%.*]], i64 0234// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[SPLAT_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer235// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 16 x i8> [[SPLAT_SPLAT]], [[A:%.*]]236// CHECK-NEXT: ret <vscale x 16 x i8> [[SHR]]237//238svuint8_t rshift_u8_lsplat(svuint8_t a, uint8_t b) {239 return b >> a;240}241 242// CHECK-LABEL: @lshift_i16_rsplat(243// CHECK-NEXT: entry:244// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[B:%.*]], i64 0245// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[SPLAT_SPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer246// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 8 x i16> [[A:%.*]], [[SPLAT_SPLAT]]247// CHECK-NEXT: ret <vscale x 8 x i16> [[SHL]]248//249svint16_t lshift_i16_rsplat(svint16_t a, int16_t b) {250 return a << b;251}252 253// CHECK-LABEL: @lshift_i16_lsplat(254// CHECK-NEXT: entry:255// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[B:%.*]], i64 0256// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[SPLAT_SPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer257// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 8 x i16> [[SPLAT_SPLAT]], [[A:%.*]]258// CHECK-NEXT: ret <vscale x 8 x i16> [[SHL]]259//260svint16_t lshift_i16_lsplat(svint16_t a, int16_t b) {261 return b << a;262}263 264// CHECK-LABEL: @rshift_i16_rsplat(265// CHECK-NEXT: entry:266// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[B:%.*]], i64 0267// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[SPLAT_SPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer268// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 8 x i16> [[A:%.*]], [[SPLAT_SPLAT]]269// CHECK-NEXT: ret <vscale x 8 x i16> [[SHR]]270//271svint16_t rshift_i16_rsplat(svint16_t a, int16_t b) {272 return a >> b;273}274 275// CHECK-LABEL: @rshift_i16_lsplat(276// CHECK-NEXT: entry:277// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[B:%.*]], i64 0278// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[SPLAT_SPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer279// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 8 x i16> [[SPLAT_SPLAT]], [[A:%.*]]280// CHECK-NEXT: ret <vscale x 8 x i16> [[SHR]]281//282svint16_t rshift_i16_lsplat(svint16_t a, int16_t b) {283 return b >> a;284}285 286// CHECK-LABEL: @lshift_u16_rsplat(287// CHECK-NEXT: entry:288// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[B:%.*]], i64 0289// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[SPLAT_SPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer290// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 8 x i16> [[A:%.*]], [[SPLAT_SPLAT]]291// CHECK-NEXT: ret <vscale x 8 x i16> [[SHL]]292//293svuint16_t lshift_u16_rsplat(svuint16_t a, uint16_t b) {294 return a << b;295}296 297// CHECK-LABEL: @lshift_u16_lsplat(298// CHECK-NEXT: entry:299// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[B:%.*]], i64 0300// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[SPLAT_SPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer301// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 8 x i16> [[SPLAT_SPLAT]], [[A:%.*]]302// CHECK-NEXT: ret <vscale x 8 x i16> [[SHL]]303//304svuint16_t lshift_u16_lsplat(svuint16_t a, uint16_t b) {305 return b << a;306}307 308// CHECK-LABEL: @rshift_u16_rsplat(309// CHECK-NEXT: entry:310// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[B:%.*]], i64 0311// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[SPLAT_SPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer312// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 8 x i16> [[A:%.*]], [[SPLAT_SPLAT]]313// CHECK-NEXT: ret <vscale x 8 x i16> [[SHR]]314//315svuint16_t rshift_u16_rsplat(svuint16_t a, uint16_t b) {316 return a >> b;317}318 319// CHECK-LABEL: @rshift_u16_lsplat(320// CHECK-NEXT: entry:321// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[B:%.*]], i64 0322// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[SPLAT_SPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer323// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 8 x i16> [[SPLAT_SPLAT]], [[A:%.*]]324// CHECK-NEXT: ret <vscale x 8 x i16> [[SHR]]325//326svuint16_t rshift_u16_lsplat(svuint16_t a, uint16_t b) {327 return b >> a;328}329 330// CHECK-LABEL: @lshift_i32_rsplat(331// CHECK-NEXT: entry:332// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[B:%.*]], i64 0333// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[SPLAT_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer334// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 4 x i32> [[A:%.*]], [[SPLAT_SPLAT]]335// CHECK-NEXT: ret <vscale x 4 x i32> [[SHL]]336//337svint32_t lshift_i32_rsplat(svint32_t a, int32_t b) {338 return a << b;339}340 341// CHECK-LABEL: @lshift_i32_lsplat(342// CHECK-NEXT: entry:343// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[B:%.*]], i64 0344// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[SPLAT_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer345// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 4 x i32> [[SPLAT_SPLAT]], [[A:%.*]]346// CHECK-NEXT: ret <vscale x 4 x i32> [[SHL]]347//348svint32_t lshift_i32_lsplat(svint32_t a, int32_t b) {349 return b << a;350}351 352// CHECK-LABEL: @rshift_i32_rsplat(353// CHECK-NEXT: entry:354// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[B:%.*]], i64 0355// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[SPLAT_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer356// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 4 x i32> [[A:%.*]], [[SPLAT_SPLAT]]357// CHECK-NEXT: ret <vscale x 4 x i32> [[SHR]]358//359svint32_t rshift_i32_rsplat(svint32_t a, int32_t b) {360 return a >> b;361}362 363// CHECK-LABEL: @rshift_i32_lsplat(364// CHECK-NEXT: entry:365// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[B:%.*]], i64 0366// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[SPLAT_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer367// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 4 x i32> [[SPLAT_SPLAT]], [[A:%.*]]368// CHECK-NEXT: ret <vscale x 4 x i32> [[SHR]]369//370svint32_t rshift_i32_lsplat(svint32_t a, int32_t b) {371 return b >> a;372}373 374// CHECK-LABEL: @lshift_u32_rsplat(375// CHECK-NEXT: entry:376// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[B:%.*]], i64 0377// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[SPLAT_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer378// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 4 x i32> [[A:%.*]], [[SPLAT_SPLAT]]379// CHECK-NEXT: ret <vscale x 4 x i32> [[SHL]]380//381svuint32_t lshift_u32_rsplat(svuint32_t a, uint32_t b) {382 return a << b;383}384 385// CHECK-LABEL: @lshift_u32_lsplat(386// CHECK-NEXT: entry:387// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[B:%.*]], i64 0388// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[SPLAT_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer389// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 4 x i32> [[SPLAT_SPLAT]], [[A:%.*]]390// CHECK-NEXT: ret <vscale x 4 x i32> [[SHL]]391//392svuint32_t lshift_u32_lsplat(svuint32_t a, uint32_t b) {393 return b << a;394}395 396// CHECK-LABEL: @rshift_u32_rsplat(397// CHECK-NEXT: entry:398// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[B:%.*]], i64 0399// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[SPLAT_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer400// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 4 x i32> [[A:%.*]], [[SPLAT_SPLAT]]401// CHECK-NEXT: ret <vscale x 4 x i32> [[SHR]]402//403svuint32_t rshift_u32_rsplat(svuint32_t a, uint32_t b) {404 return a >> b;405}406 407// CHECK-LABEL: @rshift_u32_lsplat(408// CHECK-NEXT: entry:409// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[B:%.*]], i64 0410// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[SPLAT_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer411// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 4 x i32> [[SPLAT_SPLAT]], [[A:%.*]]412// CHECK-NEXT: ret <vscale x 4 x i32> [[SHR]]413//414svuint32_t rshift_u32_lsplat(svuint32_t a, uint32_t b) {415 return b >> a;416}417 418// CHECK-LABEL: @lshift_i64_rsplat(419// CHECK-NEXT: entry:420// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[B:%.*]], i64 0421// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[SPLAT_SPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer422// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 2 x i64> [[A:%.*]], [[SPLAT_SPLAT]]423// CHECK-NEXT: ret <vscale x 2 x i64> [[SHL]]424//425svint64_t lshift_i64_rsplat(svint64_t a, int64_t b) {426 return a << b;427}428 429// CHECK-LABEL: @lshift_i64_lsplat(430// CHECK-NEXT: entry:431// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[B:%.*]], i64 0432// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[SPLAT_SPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer433// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 2 x i64> [[SPLAT_SPLAT]], [[A:%.*]]434// CHECK-NEXT: ret <vscale x 2 x i64> [[SHL]]435//436svint64_t lshift_i64_lsplat(svint64_t a, int64_t b) {437 return b << a;438}439 440// CHECK-LABEL: @rshift_i64_rsplat(441// CHECK-NEXT: entry:442// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[B:%.*]], i64 0443// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[SPLAT_SPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer444// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 2 x i64> [[A:%.*]], [[SPLAT_SPLAT]]445// CHECK-NEXT: ret <vscale x 2 x i64> [[SHR]]446//447svint64_t rshift_i64_rsplat(svint64_t a, int64_t b) {448 return a >> b;449}450 451// CHECK-LABEL: @rshift_i64_lsplat(452// CHECK-NEXT: entry:453// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[B:%.*]], i64 0454// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[SPLAT_SPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer455// CHECK-NEXT: [[SHR:%.*]] = ashr <vscale x 2 x i64> [[SPLAT_SPLAT]], [[A:%.*]]456// CHECK-NEXT: ret <vscale x 2 x i64> [[SHR]]457//458svint64_t rshift_i64_lsplat(svint64_t a, int64_t b) {459 return b >> a;460}461 462// CHECK-LABEL: @lshift_u64_rsplat(463// CHECK-NEXT: entry:464// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[B:%.*]], i64 0465// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[SPLAT_SPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer466// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 2 x i64> [[A:%.*]], [[SPLAT_SPLAT]]467// CHECK-NEXT: ret <vscale x 2 x i64> [[SHL]]468//469svuint64_t lshift_u64_rsplat(svuint64_t a, uint64_t b) {470 return a << b;471}472 473// CHECK-LABEL: @lshift_u64_lsplat(474// CHECK-NEXT: entry:475// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[B:%.*]], i64 0476// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[SPLAT_SPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer477// CHECK-NEXT: [[SHL:%.*]] = shl <vscale x 2 x i64> [[SPLAT_SPLAT]], [[A:%.*]]478// CHECK-NEXT: ret <vscale x 2 x i64> [[SHL]]479//480svuint64_t lshift_u64_lsplat(svuint64_t a, uint64_t b) {481 return b << a;482}483 484// CHECK-LABEL: @rshift_u64_rsplat(485// CHECK-NEXT: entry:486// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[B:%.*]], i64 0487// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[SPLAT_SPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer488// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 2 x i64> [[A:%.*]], [[SPLAT_SPLAT]]489// CHECK-NEXT: ret <vscale x 2 x i64> [[SHR]]490//491svuint64_t rshift_u64_rsplat(svuint64_t a, uint64_t b) {492 return a >> b;493}494 495// CHECK-LABEL: @rshift_u64_lsplat(496// CHECK-NEXT: entry:497// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i64> poison, i64 [[B:%.*]], i64 0498// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <vscale x 2 x i64> [[SPLAT_SPLATINSERT]], <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer499// CHECK-NEXT: [[SHR:%.*]] = lshr <vscale x 2 x i64> [[SPLAT_SPLAT]], [[A:%.*]]500// CHECK-NEXT: ret <vscale x 2 x i64> [[SHR]]501//502svuint64_t rshift_u64_lsplat(svuint64_t a, uint64_t b) {503 return b >> a;504}505