diff options
author | Dylan Fleming <Dylan.Fleming@arm.com> | 2021-08-17 14:00:47 +0100 |
---|---|---|
committer | Dylan Fleming <Dylan.Fleming@arm.com> | 2021-08-17 14:42:47 +0100 |
commit | ef198cd99e6bac3a2e87adb6c8a18fb461056fa6 (patch) | |
tree | d7fda068350afe94214bba5d16f62194c3cb2f4e /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 9de882fdbf7436c9ddd9b35b335ec91a524353a5 (diff) | |
download | llvm-ef198cd99e6bac3a2e87adb6c8a18fb461056fa6.zip llvm-ef198cd99e6bac3a2e87adb6c8a18fb461056fa6.tar.gz llvm-ef198cd99e6bac3a2e87adb6c8a18fb461056fa6.tar.bz2 |
[SVE] Remove usage of getMaxVScale for AArch64, in favour of IR Attribute
Removed AArch64 usage of the getMaxVScale interface, replacing it with
the vscale_range(min, max) IR Attribute.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D106277
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index f5eed85..dca4204 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -484,11 +484,13 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { // function. CurFn->addFnAttr("min-legal-vector-width", llvm::utostr(LargestVectorWidth)); - // Add vscale attribute if appropriate. - if (getLangOpts().ArmSveVectorBits) { - unsigned VScale = getLangOpts().ArmSveVectorBits / 128; - CurFn->addFnAttr(llvm::Attribute::getWithVScaleRangeArgs(getLLVMContext(), - VScale, VScale)); + // Add vscale_range attribute if appropriate. + Optional<std::pair<unsigned, unsigned>> VScaleRange = + getContext().getTargetInfo().getVScaleRange(getLangOpts()); + if (VScaleRange) { + CurFn->addFnAttr(llvm::Attribute::getWithVScaleRangeArgs( + getLLVMContext(), VScaleRange.getValue().first, + VScaleRange.getValue().second)); } // If we generated an unreachable return block, delete it now. |