The `masked.load`, `masked.store`, `masked.gather` and `masked.scatter` intrinsics currently accept a separate alignment immarg. Replace this with an `align` attribute on the pointer / vector of pointers argument. This is the standard representation for alignment information on intrinsics, and is already used by all other memory intrinsics. This means the signatures now match llvm.expandload, llvm.vp.load, etc. (Things like llvm.memcpy used to have a separate alignment argument as well, but were already migrated a long time ago.) It's worth noting that the masked.gather and masked.scatter intrinsics previously accepted a zero alignment to indicate the ABI type alignment of the element type. This special case is gone now: If the align attribute is omitted, the implied alignment is 1, as usual. If ABI alignment is desired, it needs to be explicitly emitted (which the IRBuilder API already requires anyway).
49 lines
2.5 KiB
LLVM
49 lines
2.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: opt -S --passes=slp-vectorizer -slp-threshold=-99999 -mtriple=riscv64 -mattr=+v < %s | FileCheck %s
|
|
|
|
define void @test(ptr %a, i64 %0) {
|
|
; CHECK-LABEL: define void @test(
|
|
; CHECK-SAME: ptr [[A:%.*]], i64 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x ptr> poison, ptr [[A]], i32 0
|
|
; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x ptr> [[TMP1]], <2 x ptr> poison, <2 x i32> zeroinitializer
|
|
; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x i64> <i64 poison, i64 0>, i64 [[TMP0]], i32 0
|
|
; CHECK-NEXT: br label %[[BB:.*]]
|
|
; CHECK: [[BB]]:
|
|
; CHECK-NEXT: [[TMP5:%.*]] = or disjoint <2 x i64> [[TMP3]], <i64 1, i64 0>
|
|
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr double, <2 x ptr> [[TMP2]], <2 x i64> [[TMP5]]
|
|
; CHECK-NEXT: [[ARRAYIDX17_I28_1:%.*]] = extractelement <2 x ptr> [[TMP6]], i32 0
|
|
; CHECK-NEXT: [[TMP7:%.*]] = call <2 x double> @llvm.masked.gather.v2f64.v2p0(<2 x ptr> align 8 [[TMP6]], <2 x i1> splat (i1 true), <2 x double> poison)
|
|
; CHECK-NEXT: [[TMP8:%.*]] = load <2 x double>, ptr [[A]], align 8
|
|
; CHECK-NEXT: [[TMP9:%.*]] = load <2 x double>, ptr [[A]], align 8
|
|
; CHECK-NEXT: [[TMP10:%.*]] = fsub <2 x double> [[TMP8]], [[TMP9]]
|
|
; CHECK-NEXT: [[TMP11:%.*]] = fsub <2 x double> [[TMP7]], [[TMP10]]
|
|
; CHECK-NEXT: call void @llvm.experimental.vp.strided.store.v2f64.p0.i64(<2 x double> [[TMP11]], ptr align 8 [[ARRAYIDX17_I28_1]], i64 -8, <2 x i1> splat (i1 true), i32 2)
|
|
; CHECK-NEXT: br label %[[BB]]
|
|
;
|
|
entry:
|
|
br label %bb
|
|
|
|
bb:
|
|
%indvars.iv.next239.i = add i64 0, 0
|
|
%arrayidx.i.1 = getelementptr double, ptr %a, i64 %indvars.iv.next239.i
|
|
%1 = load double, ptr %arrayidx.i.1, align 8
|
|
%arrayidx10.i.1 = getelementptr double, ptr %a, i64 %0
|
|
%2 = or disjoint i64 %0, 1
|
|
%arrayidx17.i28.1 = getelementptr double, ptr %a, i64 %2
|
|
%3 = load double, ptr %arrayidx17.i28.1, align 8
|
|
%4 = load double, ptr %a, align 8
|
|
%5 = load double, ptr %a, align 8
|
|
%arrayidx38.i.1 = getelementptr double, ptr %a, i64 1
|
|
%6 = load double, ptr %arrayidx38.i.1, align 8
|
|
%arrayidx41.i.1 = getelementptr double, ptr %a, i64 1
|
|
%7 = load double, ptr %arrayidx41.i.1, align 8
|
|
%sub47.i.1 = fsub double %4, %5
|
|
%sub54.i.1 = fsub double %6, %7
|
|
%sub69.i.1 = fsub double %1, %sub54.i.1
|
|
store double %sub69.i.1, ptr %arrayidx10.i.1, align 8
|
|
%sub72.i.1 = fsub double %3, %sub47.i.1
|
|
store double %sub72.i.1, ptr %arrayidx17.i28.1, align 8
|
|
br label %bb
|
|
}
|