Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions llvm/test/Transforms/PhaseOrdering/AArch64/reduce_muladd.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target triple = "aarch64"

; This function (a 16x reduction of a[i] * b[i]) should be vectorized successfully.

define dso_local nofpclass(nan inf) float @vmlaq(ptr noundef %0, ptr noundef %1) #0 {
define dso_local nofpclass(nan inf) float @vmlaq(ptr noundef %0, ptr noundef %1) {
; CHECK-LABEL: define dso_local nofpclass(nan inf) float @vmlaq
; CHECK-SAME: (ptr noundef readonly captures(none) [[TMP0:%.*]], ptr noundef readonly captures(none) [[TMP1:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: [[TMP3:%.*]] = load <16 x float>, ptr [[TMP0]], align 4, !tbaa [[TBAA4:![0-9]+]]
Expand All @@ -21,9 +21,9 @@ define dso_local nofpclass(nan inf) float @vmlaq(ptr noundef %0, ptr noundef %1)
%6 = alloca i32, align 4
store ptr %0, ptr %3, align 8, !tbaa !4
store ptr %1, ptr %4, align 8, !tbaa !4
call void @llvm.lifetime.start.p0(ptr %5) #2
call void @llvm.lifetime.start.p0(ptr %5)
store float 0.000000e+00, ptr %5, align 4, !tbaa !9
call void @llvm.lifetime.start.p0(ptr %6) #2
call void @llvm.lifetime.start.p0(ptr %6)
store i32 0, ptr %6, align 4, !tbaa !11
br label %7

Expand All @@ -33,7 +33,7 @@ define dso_local nofpclass(nan inf) float @vmlaq(ptr noundef %0, ptr noundef %1)
br i1 %9, label %11, label %10

10: ; preds = %7
call void @llvm.lifetime.end.p0(ptr %6) #2
call void @llvm.lifetime.end.p0(ptr %6)
br label %28

11: ; preds = %7
Expand Down Expand Up @@ -61,16 +61,12 @@ define dso_local nofpclass(nan inf) float @vmlaq(ptr noundef %0, ptr noundef %1)

28: ; preds = %10
%29 = load float, ptr %5, align 4, !tbaa !9
call void @llvm.lifetime.end.p0(ptr %5) #2
call void @llvm.lifetime.end.p0(ptr %5)
ret float %29
}

declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
declare void @llvm.lifetime.end.p0(ptr captures(none)) #1

attributes #0 = { nounwind uwtable "frame-pointer"="non-leaf" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+v8a,-fmv" "unsafe-fp-math"="true" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind }
declare void @llvm.lifetime.start.p0(ptr captures(none))
declare void @llvm.lifetime.end.p0(ptr captures(none))

!llvm.module.flags = !{!0, !1, !2}
!llvm.ident = !{!3}
Expand Down
45 changes: 20 additions & 25 deletions llvm/test/Transforms/PhaseOrdering/AArch64/reduce_submuladd.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target triple = "aarch64"

; This function (a more complex reduction of (a[i] - b[i]) * itself) should be vectorized successfully.

define dso_local noundef nofpclass(nan inf) float @_Z4testPKfS0_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #0 {
define dso_local noundef nofpclass(nan inf) float @_Z4testPKfS0_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) {
; CHECK-LABEL: define dso_local noundef nofpclass(nan inf) float @_Z4testPKfS0_ii
; CHECK-SAME: (ptr noundef readonly captures(none) [[TMP0:%.*]], ptr noundef readonly captures(none) [[TMP1:%.*]], i32 noundef [[TMP2:%.*]], i32 noundef [[TMP3:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: .preheader.i:
Expand Down Expand Up @@ -125,7 +125,7 @@ define dso_local noundef nofpclass(nan inf) float @_Z4testPKfS0_ii(ptr noundef %
ret float %13
}

define internal noundef nofpclass(nan inf) float @_ZL6reduceILi7EEfPKfS1_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #1 {
define internal noundef nofpclass(nan inf) float @_ZL6reduceILi7EEfPKfS1_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) {
%5 = alloca ptr, align 8
%6 = alloca ptr, align 8
%7 = alloca i32, align 4
Expand All @@ -143,15 +143,15 @@ define internal noundef nofpclass(nan inf) float @_ZL6reduceILi7EEfPKfS1_ii(ptr
store ptr %1, ptr %6, align 8, !tbaa !4
store i32 %2, ptr %7, align 4, !tbaa !9
store i32 %3, ptr %8, align 4, !tbaa !9
call void @llvm.lifetime.start.p0(ptr %9) #3
call void @llvm.lifetime.start.p0(ptr %9)
store i32 3, ptr %9, align 4, !tbaa !9
call void @llvm.lifetime.start.p0(ptr %10) #3
call void @llvm.lifetime.start.p0(ptr %10)
store i32 3, ptr %10, align 4, !tbaa !9
call void @llvm.lifetime.start.p0(ptr %11) #3
call void @llvm.lifetime.start.p0(ptr %11)
store i32 7, ptr %11, align 4, !tbaa !9
call void @llvm.lifetime.start.p0(ptr %12) #3
call void @llvm.lifetime.start.p0(ptr %12)
store float 0.000000e+00, ptr %12, align 4, !tbaa !11
call void @llvm.lifetime.start.p0(ptr %13) #3
call void @llvm.lifetime.start.p0(ptr %13)
store i32 0, ptr %13, align 4, !tbaa !9
br label %18

Expand All @@ -162,13 +162,13 @@ define internal noundef nofpclass(nan inf) float @_ZL6reduceILi7EEfPKfS1_ii(ptr

21: ; preds = %18
store i32 2, ptr %14, align 4
call void @llvm.lifetime.end.p0(ptr %13) #3
call void @llvm.lifetime.end.p0(ptr %13)
br label %62

22: ; preds = %18
call void @llvm.lifetime.start.p0(ptr %15) #3
call void @llvm.lifetime.start.p0(ptr %15)
store float 0.000000e+00, ptr %15, align 4, !tbaa !11
call void @llvm.lifetime.start.p0(ptr %16) #3
call void @llvm.lifetime.start.p0(ptr %16)
store i32 0, ptr %16, align 4, !tbaa !9
br label %23

Expand All @@ -179,11 +179,11 @@ define internal noundef nofpclass(nan inf) float @_ZL6reduceILi7EEfPKfS1_ii(ptr

26: ; preds = %23
store i32 5, ptr %14, align 4
call void @llvm.lifetime.end.p0(ptr %16) #3
call void @llvm.lifetime.end.p0(ptr %16)
br label %47

27: ; preds = %23
call void @llvm.lifetime.start.p0(ptr %17) #3
call void @llvm.lifetime.start.p0(ptr %17)
%28 = load ptr, ptr %5, align 8, !tbaa !4
%29 = load i32, ptr %16, align 4, !tbaa !9
%30 = sext i32 %29 to i64
Expand All @@ -202,7 +202,7 @@ define internal noundef nofpclass(nan inf) float @_ZL6reduceILi7EEfPKfS1_ii(ptr
%42 = load float, ptr %15, align 4, !tbaa !11
%43 = fadd fast float %42, %41
store float %43, ptr %15, align 4, !tbaa !11
call void @llvm.lifetime.end.p0(ptr %17) #3
call void @llvm.lifetime.end.p0(ptr %17)
br label %44

44: ; preds = %27
Expand All @@ -226,7 +226,7 @@ define internal noundef nofpclass(nan inf) float @_ZL6reduceILi7EEfPKfS1_ii(ptr
%57 = load float, ptr %12, align 4, !tbaa !11
%58 = fadd fast float %57, %56
store float %58, ptr %12, align 4, !tbaa !11
call void @llvm.lifetime.end.p0(ptr %15) #3
call void @llvm.lifetime.end.p0(ptr %15)
br label %59

59: ; preds = %47
Expand All @@ -238,20 +238,15 @@ define internal noundef nofpclass(nan inf) float @_ZL6reduceILi7EEfPKfS1_ii(ptr
62: ; preds = %21
%63 = load float, ptr %12, align 4, !tbaa !11
store i32 1, ptr %14, align 4
call void @llvm.lifetime.end.p0(ptr %12) #3
call void @llvm.lifetime.end.p0(ptr %11) #3
call void @llvm.lifetime.end.p0(ptr %10) #3
call void @llvm.lifetime.end.p0(ptr %9) #3
call void @llvm.lifetime.end.p0(ptr %12)
call void @llvm.lifetime.end.p0(ptr %11)
call void @llvm.lifetime.end.p0(ptr %10)
call void @llvm.lifetime.end.p0(ptr %9)
ret float %63
}

declare void @llvm.lifetime.start.p0(ptr captures(none)) #2
declare void @llvm.lifetime.end.p0(ptr captures(none)) #2

attributes #0 = { mustprogress uwtable "frame-pointer"="non-leaf" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+v8a,-fmv" "unsafe-fp-math"="true" }
attributes #1 = { inlinehint mustprogress nounwind uwtable "frame-pointer"="non-leaf" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+v8a,-fmv" "unsafe-fp-math"="true" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }
declare void @llvm.lifetime.start.p0(ptr captures(none))
declare void @llvm.lifetime.end.p0(ptr captures(none))

!llvm.module.flags = !{!0, !1, !2}
!llvm.ident = !{!3}
Expand Down
80 changes: 38 additions & 42 deletions llvm/test/Transforms/PhaseOrdering/AArch64/slpordering.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "aarch64"

; Function Attrs: nounwind uwtable
define i32 @slpordering(ptr noundef %p1, i32 noundef %ip1, ptr noundef %p2, i32 noundef %ip2) #0 {
define i32 @slpordering(ptr noundef %p1, i32 noundef %ip1, ptr noundef %p2, i32 noundef %ip2) {
; CHECK-LABEL: define range(i32 0, 65536) i32 @slpordering(
; CHECK-SAME: ptr noundef readonly captures(none) [[P1:%.*]], i32 noundef [[IP1:%.*]], ptr noundef readonly captures(none) [[P2:%.*]], i32 noundef [[IP2:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: [[ENTRY:.*:]]
Expand Down Expand Up @@ -136,14 +136,14 @@ entry:
store i32 %ip1, ptr %ip1.addr, align 4, !tbaa !8
store ptr %p2, ptr %p2.addr, align 8, !tbaa !4
store i32 %ip2, ptr %ip2.addr, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %emp) #2
call void @llvm.lifetime.start.p0(ptr %r0) #2
call void @llvm.lifetime.start.p0(ptr %r1) #2
call void @llvm.lifetime.start.p0(ptr %r2) #2
call void @llvm.lifetime.start.p0(ptr %r3) #2
call void @llvm.lifetime.start.p0(ptr %sum) #2
call void @llvm.lifetime.start.p0(ptr %emp)
call void @llvm.lifetime.start.p0(ptr %r0)
call void @llvm.lifetime.start.p0(ptr %r1)
call void @llvm.lifetime.start.p0(ptr %r2)
call void @llvm.lifetime.start.p0(ptr %r3)
call void @llvm.lifetime.start.p0(ptr %sum)
store i32 0, ptr %sum, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %i) #2
call void @llvm.lifetime.start.p0(ptr %i)
store i32 0, ptr %i, align 4, !tbaa !8
br label %for.cond

Expand All @@ -153,7 +153,7 @@ for.cond: ; preds = %for.inc, %entry
br i1 %cmp, label %for.body, label %for.cond.cleanup

for.cond.cleanup: ; preds = %for.cond
call void @llvm.lifetime.end.p0(ptr %i) #2
call void @llvm.lifetime.end.p0(ptr %i)
br label %for.end

for.body: ; preds = %for.cond
Expand Down Expand Up @@ -241,22 +241,22 @@ for.body: ; preds = %for.cond
%shl42 = shl i32 %sub41, 16
%rdd43 = add nsw i32 %sub36, %shl42
store i32 %rdd43, ptr %r3, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %e0) #2
call void @llvm.lifetime.start.p0(ptr %e0)
%33 = load i32, ptr %r0, align 4, !tbaa !8
%34 = load i32, ptr %r1, align 4, !tbaa !8
%rdd44 = add i32 %33, %34
store i32 %rdd44, ptr %e0, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %e1) #2
call void @llvm.lifetime.start.p0(ptr %e1)
%35 = load i32, ptr %r0, align 4, !tbaa !8
%36 = load i32, ptr %r1, align 4, !tbaa !8
%sub45 = sub i32 %35, %36
store i32 %sub45, ptr %e1, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %e2) #2
call void @llvm.lifetime.start.p0(ptr %e2)
%37 = load i32, ptr %r2, align 4, !tbaa !8
%38 = load i32, ptr %r3, align 4, !tbaa !8
%rdd46 = add i32 %37, %38
store i32 %rdd46, ptr %e2, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %e3) #2
call void @llvm.lifetime.start.p0(ptr %e3)
%39 = load i32, ptr %r2, align 4, !tbaa !8
%40 = load i32, ptr %r3, align 4, !tbaa !8
%sub47 = sub i32 %39, %40
Expand Down Expand Up @@ -293,10 +293,10 @@ for.body: ; preds = %for.cond
%rrrayidx61 = getelementptr inbounds [4 x [4 x i32]], ptr %emp, i64 0, i64 %idxprom60
%rrrayidx62 = getelementptr inbounds [4 x i32], ptr %rrrayidx61, i64 0, i64 3
store i32 %sub59, ptr %rrrayidx62, align 4, !tbaa !8
call void @llvm.lifetime.end.p0(ptr %e3) #2
call void @llvm.lifetime.end.p0(ptr %e2) #2
call void @llvm.lifetime.end.p0(ptr %e1) #2
call void @llvm.lifetime.end.p0(ptr %e0) #2
call void @llvm.lifetime.end.p0(ptr %e3)
call void @llvm.lifetime.end.p0(ptr %e2)
call void @llvm.lifetime.end.p0(ptr %e1)
call void @llvm.lifetime.end.p0(ptr %e0)
br label %for.inc

for.inc: ; preds = %for.body
Expand All @@ -316,7 +316,7 @@ for.inc: ; preds = %for.body
br label %for.cond, !llvm.loop !11

for.end: ; preds = %for.cond.cleanup
call void @llvm.lifetime.start.p0(ptr %i65) #2
call void @llvm.lifetime.start.p0(ptr %i65)
store i32 0, ptr %i65, align 4, !tbaa !8
br label %for.cond66

Expand All @@ -326,11 +326,11 @@ for.cond66: ; preds = %for.inc114, %for.en
br i1 %cmp67, label %for.body70, label %for.cond.cleanup69

for.cond.cleanup69: ; preds = %for.cond66
call void @llvm.lifetime.end.p0(ptr %i65) #2
call void @llvm.lifetime.end.p0(ptr %i65)
br label %for.end116

for.body70: ; preds = %for.cond66
call void @llvm.lifetime.start.p0(ptr %e071) #2
call void @llvm.lifetime.start.p0(ptr %e071)
%rrrayidx72 = getelementptr inbounds [4 x [4 x i32]], ptr %emp, i64 0, i64 0
%59 = load i32, ptr %i65, align 4, !tbaa !8
%idxprom73 = sext i32 %59 to i64
Expand All @@ -343,7 +343,7 @@ for.body70: ; preds = %for.cond66
%62 = load i32, ptr %rrrayidx77, align 4, !tbaa !8
%rdd78 = add i32 %60, %62
store i32 %rdd78, ptr %e071, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %e179) #2
call void @llvm.lifetime.start.p0(ptr %e179)
%rrrayidx80 = getelementptr inbounds [4 x [4 x i32]], ptr %emp, i64 0, i64 0
%63 = load i32, ptr %i65, align 4, !tbaa !8
%idxprom81 = sext i32 %63 to i64
Expand All @@ -356,7 +356,7 @@ for.body70: ; preds = %for.cond66
%66 = load i32, ptr %rrrayidx85, align 4, !tbaa !8
%sub86 = sub i32 %64, %66
store i32 %sub86, ptr %e179, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %e287) #2
call void @llvm.lifetime.start.p0(ptr %e287)
%rrrayidx88 = getelementptr inbounds [4 x [4 x i32]], ptr %emp, i64 0, i64 2
%67 = load i32, ptr %i65, align 4, !tbaa !8
%idxprom89 = sext i32 %67 to i64
Expand All @@ -369,7 +369,7 @@ for.body70: ; preds = %for.cond66
%70 = load i32, ptr %rrrayidx93, align 4, !tbaa !8
%rdd94 = add i32 %68, %70
store i32 %rdd94, ptr %e287, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %e395) #2
call void @llvm.lifetime.start.p0(ptr %e395)
%rrrayidx96 = getelementptr inbounds [4 x [4 x i32]], ptr %emp, i64 0, i64 2
%71 = load i32, ptr %i65, align 4, !tbaa !8
%idxprom97 = sext i32 %71 to i64
Expand Down Expand Up @@ -398,10 +398,10 @@ for.body70: ; preds = %for.cond66
%82 = load i32, ptr %e395, align 4, !tbaa !8
%sub106 = sub nsw i32 %81, %82
store i32 %sub106, ptr %r3, align 4, !tbaa !8
call void @llvm.lifetime.end.p0(ptr %e395) #2
call void @llvm.lifetime.end.p0(ptr %e287) #2
call void @llvm.lifetime.end.p0(ptr %e179) #2
call void @llvm.lifetime.end.p0(ptr %e071) #2
call void @llvm.lifetime.end.p0(ptr %e395)
call void @llvm.lifetime.end.p0(ptr %e287)
call void @llvm.lifetime.end.p0(ptr %e179)
call void @llvm.lifetime.end.p0(ptr %e071)
%83 = load i32, ptr %r0, align 4, !tbaa !8
%call = call i32 @twoabs(i32 noundef %83)
%84 = load i32, ptr %r1, align 4, !tbaa !8
Expand Down Expand Up @@ -432,28 +432,28 @@ for.end116: ; preds = %for.cond.cleanup69
%shr = lshr i32 %90, 16
%rdd119 = add i32 %conv118, %shr
%shr120 = lshr i32 %rdd119, 1
call void @llvm.lifetime.end.p0(ptr %sum) #2
call void @llvm.lifetime.end.p0(ptr %r3) #2
call void @llvm.lifetime.end.p0(ptr %r2) #2
call void @llvm.lifetime.end.p0(ptr %r1) #2
call void @llvm.lifetime.end.p0(ptr %r0) #2
call void @llvm.lifetime.end.p0(ptr %emp) #2
call void @llvm.lifetime.end.p0(ptr %sum)
call void @llvm.lifetime.end.p0(ptr %r3)
call void @llvm.lifetime.end.p0(ptr %r2)
call void @llvm.lifetime.end.p0(ptr %r1)
call void @llvm.lifetime.end.p0(ptr %r0)
call void @llvm.lifetime.end.p0(ptr %emp)
ret i32 %shr120
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(ptr nocapture) #1
declare void @llvm.lifetime.start.p0(ptr nocapture)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(ptr nocapture) #1
declare void @llvm.lifetime.end.p0(ptr nocapture)

; Function Attrs: nounwind uwtable
define internal i32 @twoabs(i32 noundef %r) #0 {
define internal i32 @twoabs(i32 noundef %r) {
entry:
%r.addr = alloca i32, align 4
%s = alloca i32, align 4
store i32 %r, ptr %r.addr, align 4, !tbaa !8
call void @llvm.lifetime.start.p0(ptr %s) #2
call void @llvm.lifetime.start.p0(ptr %s)
%0 = load i32, ptr %r.addr, align 4, !tbaa !8
%shr = lshr i32 %0, 15
%rnd = and i32 %shr, 65537
Expand All @@ -464,14 +464,10 @@ entry:
%rdd = add i32 %1, %2
%3 = load i32, ptr %s, align 4, !tbaa !8
%xor = xor i32 %rdd, %3
call void @llvm.lifetime.end.p0(ptr %s) #2
call void @llvm.lifetime.end.p0(ptr %s)
ret i32 %xor
}

attributes #0 = { nounwind uwtable "frame-pointer"="non-leaf" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+v8a,-fmv" "unsafe-fp-math"="true" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind }

!4 = !{!5, !5, i64 0}
!5 = !{!"any pointer", !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
Expand Down
Loading