RFC: min/max/abs IR intrinsics

Gerolf Hoflehner ghoflehner at apple.com
Mon Apr 27 12:11:04 PDT 2015


IMHO the current plan at least gives an improvement over what there is right now. When the current parts are done I guess time will have come re-assess:

a) complex pattern matching capability (clamp etc) + speculation in SimplifyCFG
"
> 5. To make sure the clamp() idiom got matched, I upped the amount that SimplifyCFG would speculate (in r229099). This caused some slight controversy - it is still in-tree but there is still the potential of pulling it out if it is found that it was too aggressive. The IR approach means we don't actually need it and can pattern match across basic blocks, which we can't do in ISel (and it'd be too late by then because all the vectorizers will have bailed out).

That is the strongest argument I see so far. There is a dependence between optimizations. And the example will come where there is just not enough speculation in SimplifyCFG for the next pattern to get recognized.
Right. min+min+min (horizontal reduce) won't currently get speculated. "

b) remaining issues w/ code hygiene and cost model.


Cheers
Gerolf


> On Apr 26, 2015, at 2:15 AM, James Molloy <james at jamesmolloy.co.uk> wrote:
> 
>> 
>> 5. To make sure the clamp() idiom got matched, I upped the amount that SimplifyCFG would speculate (in r229099). This caused some slight controversy - it is still in-tree but there is still the potential of pulling it out if it is found that it was too aggressive. The IR approach means we don't actually need it and can pattern match across basic blocks, which we can't do in ISel (and it'd be too late by then because all the vectorizers will have bailed out).
> 
> That is the strongest argument I see so far. There is a dependence between optimizations. And the example will come where there is just not enough speculation in SimplifyCFG for the next pattern to get recognized.
> Right. min+min+min (horizontal reduce) won't currently get speculated. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150427/fa94d44c/attachment.html>


More information about the llvm-commits mailing list