<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think that would make a lot of sense and avoid a lot of the complicated code. Though I think I’d rather see a function in TargetMachine taking a const Function argument, rather than a SubtargetInfo function[1] (you can still implement the TargetMachine function via a sub target function behind the scenes of course).<div class=""><br class=""></div><div class="">- Matthias<br class=""><div class=""><br class=""></div><div class="">[1] At least seeing that the SubtargetInfo has a number of lib/CodeGen specific interfaces in it so it had to be moved to include/llvm/CodeGen I’d rather not see it is used in code outside lib/CodeGen or lib/Target.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 18, 2017, at 6:26 PM, Eric Christopher via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Instead, is there any reason why TTI for a given Subtarget shouldn't live on the Subtarget? Just construct it the same way we do TargetLowering, etc?<div class=""><br class=""></div><div class="">-eric<br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Dec 15, 2017 at 10:13 AM Sanjoy Das via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Dec 15, 2017 at 5:30 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>> wrote:<br class="">
> Are there reasons why we might not want to do this? Other options we should<br class="">
> consider?<br class="">
<br class="">
It does make the TargetMachine -> TargetIRAnalysis path less abstract,<br class="">
but given that all targets have the same pattern of instantiating a<br class="">
TargetIRAnalysis with a Function->TargetTransformInfo hook, the<br class="">
abstraction does not seem particularly useful.<br class="">
<br class="">
I might do even a simpler form of the patch though -- instead of<br class="">
returning a function pointer from TargetMachine, just add a virtual<br class="">
function to TargetMachine that creates the TargetTransformInfo<br class="">
directly from a Function.<br class="">
<br class="">
-- Sanjoy<br class="">
<br class="">
><br class="">
>  -Hal<br class="">
><br class="">
>><br class="">
>> [0]:  XLA is a machine learning focussed linear algebra compiler<br class="">
>> <a href="https://www.tensorflow.org/performance/xla/" rel="noreferrer" target="_blank" class="">https://www.tensorflow.org/performance/xla/</a> that uses LLVM for its CPU<br class="">
>> and GPU backends.<br class="">
>><br class="">
>> -- Sanjoy<br class="">
>> _______________________________________________<br class="">
>> LLVM Developers mailing list<br class="">
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
><br class="">
><br class="">
> --<br class="">
> Hal Finkel<br class="">
> Lead, Compiler Technology and Programming Languages<br class="">
> Leadership Computing Facility<br class="">
> Argonne National Laboratory<br class="">
><br class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</blockquote></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></div></body></html>