1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/AArch64/scalable-vector-promotion.ll
Huihui Zhang 58a931b286 [SVE] Update API ConstantVector::getSplat() to use ElementCount.
Summary:
Support ConstantInt::get() and Constant::getAllOnesValue() for scalable
vector type, this requires ConstantVector::getSplat() to take in 'ElementCount',
instead of 'unsigned' number of element count.

This change is needed for D73753.

Reviewers: sdesmalen, efriedma, apazos, spatel, huntergr, willlovett

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74386
2020-03-12 13:22:41 -07:00

24 lines
1.1 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -mtriple=aarch64 -codegenprepare -S < %s | FileCheck %s
; This test intends to check vector promotion for scalable vector. Current target lowering
; rejects scalable vector before reaching getConstantVector() in CodeGenPrepare. This test
; will assert once target lowering is ready, then we can bring in implementation for non-splat
; codepath for scalable vector.
define void @simpleOneInstructionPromotion(<vscale x 2 x i32>* %addr1, i32* %dest) {
; CHECK-LABEL: @simpleOneInstructionPromotion(
; CHECK-NEXT: [[IN1:%.*]] = load <vscale x 2 x i32>, <vscale x 2 x i32>* [[ADDR1:%.*]], align 8
; CHECK-NEXT: [[EXTRACT:%.*]] = extractelement <vscale x 2 x i32> [[IN1]], i32 1
; CHECK-NEXT: [[OUT:%.*]] = or i32 [[EXTRACT]], 1
; CHECK-NEXT: store i32 [[OUT]], i32* [[DEST:%.*]], align 4
; CHECK-NEXT: ret void
;
%in1 = load <vscale x 2 x i32>, <vscale x 2 x i32>* %addr1, align 8
%extract = extractelement <vscale x 2 x i32> %in1, i32 1
%out = or i32 %extract, 1
store i32 %out, i32* %dest, align 4
ret void
}