[llvm-dev] RFC: Exposing TargetTransformInfo factories from TargetMachine
Hal Finkel via llvm-dev
llvm-dev at lists.llvm.org
Fri Dec 15 05:30:37 PST 2017
On 12/15/2017 01:22 AM, Sanjoy Das via llvm-dev wrote:
> Hi all,
>
> I'd like to be able to use TargetTransformInfo to make architecture
> specific code generation decisions from the XLA LLVM IR emitter[0].
> However, we don't have a great way to do this today --
> TargetTransformInfo is wrapped in a TargetIRAnalysis and getting the
> TargetTransformInfo out of it requires something like:
>
> FunctionAnalysisManager DummyFAM;
> TTI = TIRA.run(F, DummyFAM);
> return *TTI;
>
> which isn't ideal.
>
> Given that all in-tree backends have a factory function to directly
> construct a TargetTransformInfo implementation anyway, what do you
> think about exposing said factory function from the TargetMachine
> subclasses directly? Something conceptually like this
> https://reviews.llvm.org/D41268 but for all backends and will less
> std::function?
Are there reasons why we might not want to do this? Other options we
should consider?
-Hal
>
> [0]: XLA is a machine learning focussed linear algebra compiler
> https://www.tensorflow.org/performance/xla/ that uses LLVM for its CPU
> and GPU backends.
>
> -- Sanjoy
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
More information about the llvm-dev
mailing list