-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix fundamental confusion about target/tune CPU #6765
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
Changes from all commits
aecd903
48eeae8
f266f48
9e9ce36
381645a
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 |
|---|---|---|
|
|
@@ -106,11 +106,21 @@ class CodeGen_LLVM : public IRVisitor { | |
| virtual void end_func(const std::vector<LoweredArgument> &args); | ||
| // @} | ||
|
|
||
| /** What should be passed as -mcpu, -mattrs, and related for | ||
| * compilation. The architecture-specific code generator should | ||
| * define these. */ | ||
| /** What should be passed as -mcpu (warning: implies attrs!), -mattrs, | ||
|
LebedevRI marked this conversation as resolved.
|
||
| * and related for compilation. The architecture-specific code generator | ||
| * should define these. | ||
| * | ||
| * `mcpu_target()` - target this specific CPU, in the sense of the allowed | ||
| * ISA sets *and* the CPU-specific tuning/assembly instruction scheduling. | ||
| * | ||
| * `mcpu_tune()` - expect that we will be running on this specific CPU, | ||
| * so perform CPU-specific tuning/assembly instruction scheduling, *but* | ||
| * DON'T sacrifice the portability, support running on other CPUs, only | ||
| * make use of the ISAs that are enabled by `mcpu_target()`+`mattrs()`. | ||
| */ | ||
| // @{ | ||
| virtual std::string mcpu() const = 0; | ||
| virtual std::string mcpu_target() const = 0; | ||
|
Contributor
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. Possibly-dumb question: would it make sense to refactor all of these into a single virtual method returning a struct? How common is it to override only one of target/tune/attrs without affecting the others?
Contributor
Author
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. No idea, you are asking wrong person :) |
||
| virtual std::string mcpu_tune() const = 0; | ||
| virtual std::string mattrs() const = 0; | ||
| virtual std::string mabi() const; | ||
| virtual bool use_soft_float_abi() const = 0; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
To explicitly call this out: yes, none of this should be done here, ideally,
as much of this as possible should be ported into
set_function_attributes_from_halide_target_options().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.
Does that warrant a follow-up tracking issue? Why not go ahead and do it now?
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.
I haven't checked if/which of these can actually be migrated out of here.
E.g. it does not look like neither soft-float not mabi can be encoded into proper IR metadata...
It seems like only
per_instruction_fast_math_flags//could// be lowered.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.
I've filed #6769 for now.