[PATCH] D12882: [SimplifyCFG] do not speculate fdiv by default; it's expensive (PR24818)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 11:31:57 PDT 2015



On 09/23/2015 09:05 AM, Sanjay Patel wrote:
> spatel added a comment.
>
> In http://reviews.llvm.org/D12882#251209, @hfinkel wrote:
>
>>> Is it art or science?
>>
>> Both.
>
> Aha, now it's all starting to make more sense. That's much more fun. :)
> Many thanks to you and Philip for explaining this.
>
> My plan to push this forward is:
>
> 1. Fix up the TTI cost model (this patch and possibly others).
> 2. Add code to CGP that uses the cost model to undo this sort of speculation for targets that don't want it.
> 3. Change this part of SimplifyCFG to not use the TTI cost model for purposes of speculative transforms.
+1  This sounds like the ideal approach to me.
>
> I've just started looking at CGP for the first time...it has this ominous comment:
>
>    // This pass munges the code in the input function to better prepare it for
>    // SelectionDAG-based code generation. This works around limitations in it's
>    // basic-block-at-a-time approach. It should eventually be removed.
>
> Is there a proposed replacement for CGP?
I think this is a maybe someday thing.  There's been discussion of doing 
global instruction selection, but that's years off at best. Today, CGP 
does a bit of global scheduling to maximize the effectiveness of the 
per-block selection; I think we're likely to have something along those 
lines for quite a while.
>
>
> http://reviews.llvm.org/D12882
>
>
>



More information about the llvm-commits mailing list