-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add vscale_range attribute to functions with sve #58433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,17 @@ bool lowerCPUFeatures(Module &M) JL_NOTSAFEPOINT | |
Materialized.push_back(I); | ||
} | ||
} | ||
if (TT.isAArch64()) { | ||
Attribute FSAttr = F.getFnAttribute("target-features"); | ||
StringRef FS = | ||
FSAttr.isValid() ? FSAttr.getValueAsString() : jl_ExecutionEngine->getTargetFeatureString(); | ||
SmallVector<StringRef, 128> Features; | ||
FS.split(Features, ','); | ||
for (StringRef Feature : Features) { | ||
if (Feature == "sve") | ||
F.addFnAttr(llvm::Attribute::getWithVScaleRangeArgs(M.getContext(), 1, 16)); //Hardcode for now | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is relevant for risc-v, too. I've got access to a chip with scalable vector registers (RVV extension), now, if only we could compile julia for that architecture: #57569 😇 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe there's a way to check if the target supports vscale? Is https://github.com/llvm/llvm-project/blob/689a960b693446f0d258240fea0c844b6e685d6e/clang/lib/CodeGen/CodeGenFunction.cpp#L1124-L1130 relevant? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't look at how that function is implemented, you will find something similar :) |
||
} | ||
} | ||
} | ||
|
||
if (!Materialized.empty()) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this the function gets the attribute vscale_range
but there's still not vscale in the vector body.