diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 2f50918b527be9..3638d07cc3b353 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -608,6 +608,8 @@ def err_cc1_round_trip_ok_then_fail : Error< "generated arguments parse failed in round-trip">; def err_cc1_round_trip_mismatch : Error< "generated arguments do not match in round-trip">; +def err_cc1_unbounded_vscale_min : Error< + "minimum vscale must be an unsigned integer greater than 0">; def err_drv_ssp_missing_offset_argument : Error< "'%0' is used without '-mstack-protector-guard-offset', and there is no default">; diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 9d5f021102a5e3..e9c3ece3d16347 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3357,8 +3357,7 @@ def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">, Group, + HelpText<"Specify the vscale minimum. Defaults to \"1\". (AArch64 only)">, MarshallingInfoInt>; def mvscale_max_EQ : Joined<["-"], "mvscale-max=">, Group, Flags<[NoXarchOption,CC1Option]>, diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp index 4d403ae1809d47..02128898114861 100644 --- a/clang/lib/Basic/Targets/AArch64.cpp +++ b/clang/lib/Basic/Targets/AArch64.cpp @@ -474,10 +474,12 @@ ArrayRef AArch64TargetInfo::getTargetBuiltins() const { Optional> AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts) const { if (LangOpts.VScaleMin || LangOpts.VScaleMax) - return std::pair(LangOpts.VScaleMin, - LangOpts.VScaleMax); + return std::pair( + LangOpts.VScaleMin ? LangOpts.VScaleMin : 1, LangOpts.VScaleMax); + if (hasFeature("sve")) - return std::pair(0, 16); + return std::pair(1, 16); + return None; } diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c104a6f40e20f9..f760eb284e75f0 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -4123,6 +4123,13 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, {std::string(Split.first), std::string(Split.second)}); } + // Error if -mvscale-min is unbounded. + if (Arg *A = Args.getLastArg(options::OPT_mvscale_min_EQ)) { + unsigned VScaleMin; + if (StringRef(A->getValue()).getAsInteger(10, VScaleMin) || VScaleMin == 0) + Diags.Report(diag::err_cc1_unbounded_vscale_min); + } + return Diags.getNumErrors() == NumErrorsBefore; } diff --git a/clang/test/CodeGen/arm-sve-vector-bits-vscale-range.c b/clang/test/CodeGen/arm-sve-vector-bits-vscale-range.c index 210251d765f491..5f17800cb34703 100644 --- a/clang/test/CodeGen/arm-sve-vector-bits-vscale-range.c +++ b/clang/test/CodeGen/arm-sve-vector-bits-vscale-range.c @@ -10,12 +10,13 @@ // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=4 -S -emit-llvm -o - %s | FileCheck %s -D#VBITS=4 --check-prefix=CHECK-NOMAX // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=8 -S -emit-llvm -o - %s | FileCheck %s -D#VBITS=8 --check-prefix=CHECK-NOMAX // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=16 -S -emit-llvm -o - %s | FileCheck %s -D#VBITS=16 --check-prefix=CHECK-NOMAX -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -mvscale-min=0 -mvscale-max=0 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-NONE -// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=0 -mvscale-max=0 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-NONE +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -mvscale-min=1 -mvscale-max=0 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-UNBOUNDED +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -mvscale-min=1 -mvscale-max=0 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-UNBOUNDED // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-NONE // CHECK-LABEL: @func() #0 // CHECK: attributes #0 = { {{.*}} vscale_range([[#VBITS]],[[#VBITS]]) {{.*}} } // CHECK-NOMAX: attributes #0 = { {{.*}} vscale_range([[#VBITS]],0) {{.*}} } -// CHECK-NONE: attributes #0 = { {{.*}} vscale_range(0,16) {{.*}} } +// CHECK-UNBOUNDED: attributes #0 = { {{.*}} vscale_range(1,0) {{.*}} } +// CHECK-NONE: attributes #0 = { {{.*}} vscale_range(1,16) {{.*}} } void func() {} diff --git a/clang/test/Frontend/aarch64-vscale-min.c b/clang/test/Frontend/aarch64-vscale-min.c new file mode 100644 index 00000000000000..4cf9badc78b742 --- /dev/null +++ b/clang/test/Frontend/aarch64-vscale-min.c @@ -0,0 +1,10 @@ +// ----------------------------------------------------------------------------- +// Tests for the -mvscale-min flag +// ----------------------------------------------------------------------------- + +// Error out if value is unbounded. +// ----------------------------------------------------------------------------- +// RUN: not %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \ +// RUN: -mvscale-min=0 2>&1 | FileCheck %s + +// CHECK: error: minimum vscale must be an unsigned integer greater than 0 diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 92aa8f7f1efda5..af2b0aee44e92c 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -2134,9 +2134,10 @@ example: duplicate definitions are linked together with differing values. ``vscale_range([, ])`` This attribute indicates the minimum and maximum vscale value for the given - function. A value of 0 means unbounded. If the optional max value is omitted - then max is set to the value of min. If the attribute is not present, no - assumptions are made about the range of vscale. + function. The min must be greater than 0. A maximum value of 0 means + unbounded. If the optional max value is omitted then max is set to the + value of min. If the attribute is not present, no assumptions are made + about the range of vscale. Call Site Attributes ---------------------- diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h index 282be640d8be70..906aba02644910 100644 --- a/llvm/include/llvm/IR/Attributes.h +++ b/llvm/include/llvm/IR/Attributes.h @@ -216,7 +216,7 @@ class Attribute { /// if not known). std::pair> getAllocSizeArgs() const; - /// Returns the argument numbers for the vscale_range attribute (or pair(0, 0) + /// Returns the argument numbers for the vscale_range attribute (or pair(1, 0) /// if not known). std::pair getVScaleRangeArgs() const; @@ -1054,7 +1054,7 @@ class AttrBuilder { std::pair> getAllocSizeArgs() const; /// Retrieve the vscale_range args, if the vscale_range attribute exists. If - /// it doesn't exist, pair(0, 0) is returned. + /// it doesn't exist, pair(1, 0) is returned. std::pair getVScaleRangeArgs() const; /// Add integer attribute with raw value (packed/encoded if necessary). diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index f81a446d6e46d0..d0bc53bc8e4f8a 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -719,7 +719,7 @@ std::pair> AttributeSet::getAllocSizeArgs() const { std::pair AttributeSet::getVScaleRangeArgs() const { return SetNode ? SetNode->getVScaleRangeArgs() - : std::pair(0, 0); + : std::pair(1, 0); } std::string AttributeSet::getAsString(bool InAttrGrp) const { @@ -900,7 +900,7 @@ AttributeSetNode::getAllocSizeArgs() const { std::pair AttributeSetNode::getVScaleRangeArgs() const { if (auto A = findEnumAttribute(Attribute::VScaleRange)) return A->getVScaleRangeArgs(); - return std::make_pair(0, 0); + return std::make_pair(1, 0); } std::string AttributeSetNode::getAsString(bool InAttrGrp) const { diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 154b59835b01f7..1290f5e08d2500 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -2058,6 +2058,9 @@ void Verifier::verifyFunctionAttrs(FunctionType *FT, AttributeList Attrs, std::pair Args = Attrs.getFnAttrs().getVScaleRangeArgs(); + if (Args.first == 0) + CheckFailed("'vscale_range' minimum must be greater than 0", V); + if (Args.first > Args.second && Args.second != 0) CheckFailed("'vscale_range' minimum cannot be greater than maximum", V); } diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-gather.ll b/llvm/test/Analysis/CostModel/AArch64/sve-gather.ll index b932a980c9aa96..61cd1750d69399 100644 --- a/llvm/test/Analysis/CostModel/AArch64/sve-gather.ll +++ b/llvm/test/Analysis/CostModel/AArch64/sve-gather.ll @@ -104,8 +104,8 @@ define void @masked_gathers_no_vscale_range() #2 { ret void } -attributes #0 = { "target-features"="+sve" vscale_range(0, 8) } -attributes #1 = { "target-features"="+sve" vscale_range(0, 16) "tune-cpu"="generic" } +attributes #0 = { "target-features"="+sve" vscale_range(1, 8) } +attributes #1 = { "target-features"="+sve" vscale_range(1, 16) "tune-cpu"="generic" } attributes #2 = { "target-features"="+sve" } declare @llvm.masked.gather.nxv4i32(, i32, , ) diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-scatter.ll b/llvm/test/Analysis/CostModel/AArch64/sve-scatter.ll index a3454084e5f5e2..9e2948cc46893b 100644 --- a/llvm/test/Analysis/CostModel/AArch64/sve-scatter.ll +++ b/llvm/test/Analysis/CostModel/AArch64/sve-scatter.ll @@ -104,8 +104,8 @@ define void @masked_scatters_no_vscale_range() #2 { ret void } -attributes #0 = { "target-features"="+sve" vscale_range(0, 8) } -attributes #1 = { "target-features"="+sve" vscale_range(0, 16) "tune-cpu"="generic" } +attributes #0 = { "target-features"="+sve" vscale_range(1, 8) } +attributes #1 = { "target-features"="+sve" vscale_range(1, 16) "tune-cpu"="generic" } attributes #2 = { "target-features"="+sve" } declare void @llvm.masked.scatter.nxv4i32(, , i32, ) diff --git a/llvm/test/Bitcode/attributes.ll b/llvm/test/Bitcode/attributes.ll index 611871c6064bfd..5a24b097beb44c 100644 --- a/llvm/test/Bitcode/attributes.ll +++ b/llvm/test/Bitcode/attributes.ll @@ -440,13 +440,6 @@ define void @f74() vscale_range(1,0) ret void } -; CHECK: define void @f75() -; CHECK-NOT: define void @f75() # -define void @f75() vscale_range(0,0) -{ - ret void -} - ; CHECK: define void @f76(i8* swiftasync %0) define void @f76(i8* swiftasync %0) { diff --git a/llvm/test/Transforms/InstCombine/icmp-vscale.ll b/llvm/test/Transforms/InstCombine/icmp-vscale.ll index 4079577f6ca75a..18f551723b5d0a 100644 --- a/llvm/test/Transforms/InstCombine/icmp-vscale.ll +++ b/llvm/test/Transforms/InstCombine/icmp-vscale.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -instcombine -S < %s | FileCheck %s -define i1 @ugt_vscale64_x_32() vscale_range(0,16) { +define i1 @ugt_vscale64_x_32() vscale_range(1,16) { ; CHECK-LABEL: @ugt_vscale64_x_32( ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i1 false @@ -13,7 +13,7 @@ entry: ret i1 %res } -define i1 @ugt_vscale64_x_31() vscale_range(0,16) { +define i1 @ugt_vscale64_x_31() vscale_range(1,16) { ; CHECK-LABEL: @ugt_vscale64_x_31( ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i1 false @@ -25,7 +25,7 @@ entry: ret i1 %res } -define i1 @ugt_vscale16_x_32() vscale_range(0,16) { +define i1 @ugt_vscale16_x_32() vscale_range(1,16) { ; CHECK-LABEL: @ugt_vscale16_x_32( ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i1 false @@ -37,7 +37,7 @@ entry: ret i1 %res } -define i1 @ult_vscale16() vscale_range(0,16) { +define i1 @ult_vscale16() vscale_range(1,16) { ; CHECK-LABEL: @ult_vscale16( ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i1 false @@ -48,7 +48,7 @@ entry: ret i1 %res } -define i1 @ule_vscale64() vscale_range(0,16) { +define i1 @ule_vscale64() vscale_range(1,16) { ; CHECK-LABEL: @ule_vscale64( ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i1 false @@ -70,7 +70,7 @@ entry: ret i1 %res } -define i1 @ne_vscale64_x_32() vscale_range(0,16) { +define i1 @ne_vscale64_x_32() vscale_range(1,16) { ; CHECK-LABEL: @ne_vscale64_x_32( ; CHECK-NEXT: entry: ; CHECK-NEXT: ret i1 true diff --git a/llvm/test/Transforms/InstCombine/vscale_sext_and_zext.ll b/llvm/test/Transforms/InstCombine/vscale_sext_and_zext.ll index 26fa24cec3b9aa..b97a81159673c9 100644 --- a/llvm/test/Transforms/InstCombine/vscale_sext_and_zext.ll +++ b/llvm/test/Transforms/InstCombine/vscale_sext_and_zext.ll @@ -5,7 +5,7 @@ ; Sign-extend ; -define i32 @vscale_SExt_i8toi32() vscale_range(0, 127) { +define i32 @vscale_SExt_i8toi32() vscale_range(1, 127) { ; CHECK-LABEL: @vscale_SExt_i8toi32( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.vscale.i32() @@ -17,7 +17,7 @@ entry: ret i32 %1 } -define i32 @vscale_SExt_i8toi32_poison() vscale_range(0, 128) { +define i32 @vscale_SExt_i8toi32_poison() vscale_range(1, 128) { ; CHECK-LABEL: @vscale_SExt_i8toi32_poison( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8() @@ -34,7 +34,7 @@ define i32 @vscale_SExt_i8toi32_poison() vscale_range(0, 128) { ; Zero-extend ; -define i32 @vscale_ZExt_i8toi32() vscale_range(0, 128) { +define i32 @vscale_ZExt_i8toi32() vscale_range(1, 128) { ; CHECK-LABEL: @vscale_ZExt_i8toi32( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.vscale.i32() @@ -46,7 +46,7 @@ entry: ret i32 %1 } -define i32 @vscale_ZExt_i8toi32_poison() vscale_range(0, 256) { +define i32 @vscale_ZExt_i8toi32_poison() vscale_range(1, 256) { ; CHECK-LABEL: @vscale_ZExt_i8toi32_poison( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8() @@ -80,7 +80,7 @@ define i32 @vscale_ZExt_i8toi32_unknown() { ; unbounded vscale_range maximum (0) ; -define i32 @vscale_SExt_i8toi32_unbounded() vscale_range(0, 0) { +define i32 @vscale_SExt_i8toi32_unbounded() vscale_range(1, 0) { ; CHECK-LABEL: @vscale_SExt_i8toi32_unbounded( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8() @@ -93,7 +93,7 @@ define i32 @vscale_SExt_i8toi32_unbounded() vscale_range(0, 0) { ret i32 %1 } -define i32 @vscale_ZExt_i8toi32_unbounded() vscale_range(0, 0) { +define i32 @vscale_ZExt_i8toi32_unbounded() vscale_range(1, 0) { ; CHECK-LABEL: @vscale_ZExt_i8toi32_unbounded( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8() diff --git a/llvm/test/Transforms/InstCombine/vscale_trunc.ll b/llvm/test/Transforms/InstCombine/vscale_trunc.ll index 040476ce558c89..c3cec9638a3047 100644 --- a/llvm/test/Transforms/InstCombine/vscale_trunc.ll +++ b/llvm/test/Transforms/InstCombine/vscale_trunc.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s -define i8 @vscale_trunc_i32toi8() vscale_range(0, 255) { +define i8 @vscale_trunc_i32toi8() vscale_range(1, 255) { ; CHECK-LABEL: @vscale_trunc_i32toi8( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8() @@ -13,7 +13,7 @@ entry: } -define i8 @vscale_trunc_i32toi8_poison() vscale_range(0, 256) { +define i8 @vscale_trunc_i32toi8_poison() vscale_range(1, 256) { ; CHECK-LABEL: @vscale_trunc_i32toi8_poison( ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.vscale.i32() diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/first-order-recurrence.ll b/llvm/test/Transforms/LoopVectorize/AArch64/first-order-recurrence.ll index f9065a61265744..4f9ae235a61532 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/first-order-recurrence.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/first-order-recurrence.ll @@ -100,6 +100,6 @@ for.end: ret void } -attributes #0 = { vscale_range(0, 16) } +attributes #0 = { vscale_range(1, 16) } !0 = distinct !{!0, !1} !1 = !{!"llvm.loop.vectorize.scalable.enable", i1 true} diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll index b80b2113e2cd58..091fe92bdd4383 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll @@ -552,7 +552,7 @@ for.end: declare float @llvm.fmuladd.f32(float, float, float) -attributes #0 = { vscale_range(0, 16) } +attributes #0 = { vscale_range(1, 16) } !0 = distinct !{!0, !3, !6, !8} !1 = distinct !{!1, !3, !7, !8} !2 = distinct !{!2, !4, !6, !8} diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization.ll b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization.ll index ea9860c73f999d..2c0518bbd851f8 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization.ll @@ -173,4 +173,4 @@ exit: ret void } -attributes #0 = { vscale_range(0, 16) } +attributes #0 = { vscale_range(1, 16) } diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll index 73b9853b7171bb..b08f7b9fc6b2b0 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-vf-hint.ll @@ -378,7 +378,7 @@ exit: ret void } -attributes #0 = { vscale_range(0, 16) } +attributes #0 = { vscale_range(1, 16) } !21 = !{!21, !22, !23} !22 = !{!"llvm.loop.vectorize.width", i32 4} !23 = !{!"llvm.loop.vectorize.scalable.enable", i1 true} diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/sve-cond-inv-loads.ll b/llvm/test/Transforms/LoopVectorize/AArch64/sve-cond-inv-loads.ll index 1f0453011aba79..98acd07df33849 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/sve-cond-inv-loads.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/sve-cond-inv-loads.ll @@ -117,7 +117,7 @@ for.end: ret void } -attributes #0 = { vscale_range(0, 16) } +attributes #0 = { vscale_range(1, 16) } !0 = distinct !{!0, !1, !2, !3, !4, !5} !1 = !{!"llvm.loop.mustprogress"} !2 = !{!"llvm.loop.vectorize.width", i32 4} diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter.ll b/llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter.ll index a2760c79a838e4..e5bbcd881163fb 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter.ll @@ -153,7 +153,7 @@ for.cond.cleanup: ; preds = %for.cond.cleanup.lo ret void } -attributes #0 = { vscale_range(0, 16) } +attributes #0 = { vscale_range(1, 16) } !0 = distinct !{!0, !1, !2, !3, !4, !5} !1 = !{!"llvm.loop.mustprogress"} diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/sve-inv-store.ll b/llvm/test/Transforms/LoopVectorize/AArch64/sve-inv-store.ll index 3945804d6e4842..ca73ad4b060bdd 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/sve-inv-store.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/sve-inv-store.ll @@ -59,7 +59,7 @@ for.end: ; preds = %for.inc, %entry ret void } -attributes #0 = { "target-features"="+neon,+sve" vscale_range(0, 16) } +attributes #0 = { "target-features"="+neon,+sve" vscale_range(1, 16) } !0 = distinct !{!0, !1, !2, !3, !4, !5} !1 = !{!"llvm.loop.mustprogress"} diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/sve-large-strides.ll b/llvm/test/Transforms/LoopVectorize/AArch64/sve-large-strides.ll index 23eb2d0b0aba07..1001a22822d9fc 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/sve-large-strides.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/sve-large-strides.ll @@ -90,7 +90,7 @@ for.end: ; preds = %for.end.loopexit, % ret void } -attributes #0 = { vscale_range(0, 16) } +attributes #0 = { vscale_range(1, 16) } !0 = distinct !{!0, !1, !2, !3, !4, !5} !1 = !{!"llvm.loop.mustprogress"} !2 = !{!"llvm.loop.vectorize.width", i32 4} diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/sve-strict-fadd-cost.ll b/llvm/test/Transforms/LoopVectorize/AArch64/sve-strict-fadd-cost.ll index 89162d238f8cfa..84fc77cedd37de 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/sve-strict-fadd-cost.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/sve-strict-fadd-cost.ll @@ -53,7 +53,7 @@ for.end: ret double %add } -attributes #0 = { "target-features"="+sve" vscale_range(0, 16) } +attributes #0 = { "target-features"="+sve" vscale_range(1, 16) } !0 = distinct !{!0, !1} !1 = !{!"llvm.loop.vectorize.scalable.enable", i1 true} diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-phi.ll b/llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-phi.ll index c7cba533fcea2c..a11ac0e87b6284 100644 --- a/llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-phi.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-phi.ll @@ -210,7 +210,7 @@ for.end: ; preds = %if.end, %for.end ret void } -attributes #0 = { vscale_range(0, 16) } +attributes #0 = { vscale_range(1, 16) } !0 = distinct !{!0, !1, !2, !3, !4, !5} !1 = !{!"llvm.loop.mustprogress"} diff --git a/llvm/test/Verifier/vscale_range.ll b/llvm/test/Verifier/vscale_range.ll index 58c1bc0127619d..b85f151bcf21ae 100644 --- a/llvm/test/Verifier/vscale_range.ll +++ b/llvm/test/Verifier/vscale_range.ll @@ -1,4 +1,7 @@ ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; CHECK: 'vscale_range' minimum must be greater than 0 +declare i8* @a(i32*) vscale_range(0, 1) + ; CHECK: 'vscale_range' minimum cannot be greater than maximum declare i8* @b(i32*) vscale_range(8, 1)