[PATCH] D120585: make TargetMachine visible from TargetTransformInfo
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 28 10:29:28 PST 2022
craig.topper added a comment.
In D120585#3349242 <https://reviews.llvm.org/D120585#3349242>, @vtjnash wrote:
> TargetMachine is nearly always a required argument here, so clearly the analysis already does depend on the the TargetMachine. Sometimes the information we (aka JuliaLang) need is available in the "target-features" function attribute (which is always available), but we want to compare that against the TargetMachine's notion of the TargetFeatures during optimization. Those together are then nearly the complete set of arguments to the TargetMachine, so it seemed more logical to me to expose the TM directly, rather than separately exposing all of the information needed to reconstruct a copy of it. I don't think we should obfuscate this just for the sake of obfuscation, do you?
The internals of the target implementation of TTI need TargetMachine, but it wasn't supposed to be exposed. That's why clang and opt have to create the TTI object outside of the pass manager.
Why does the TargetMachine's notion of target features matter if the "target-attribute" is present? If the "target-attribute" is present the TargetMachine features are ignored for that function.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120585/new/
https://reviews.llvm.org/D120585
More information about the llvm-commits
mailing list