Displaying 4 results from an estimated 4 matches for "buildsdivpow2".
2015 Aug 20
3
[RFC] Improving integer divide optimization (related to D12082)
...tDivCheap() decision.
>
> In visitSDIV(), checking looks like this when the denominator is a power of 2.
>
> if (TLI.isIntDivCheap(N->getValueType(0), MinSize))
> return SDValue();
>
> // Target-specific implementation of sdiv x, pow2.
> if (SDValue Res = BuildSDIVPow2(N))
> return Res;
>
> How about this for isIntDivCheap?
> 1) pass Function* to allow the target to decide for itself which
> attributes matter, and
If you want the attributes, I think you should pass the attributes and not the whole Function.
I’m not sure why MinSize does not...
2015 Aug 20
2
[RFC] Improving integer divide optimization (related to D12082)
...AG.getConstant(lg2, DL,
> getShiftAmountTy(ADD.getValueType())));
>
> And there’s already a target-specific hook to add a custom implementation (e.g. on PowerPC):
>
> // Target-specific implementation of sdiv x, pow2.
> if (SDValue Res = BuildSDIVPow2(N))
> return Res;
Isn’t the problem the fact that the patch makes it harder for a target to get the generic code to reach its custom hook?
Now the "cheap pow2 sdiv” is merged with the generic “cheap div” you can’t distinguish anymore.
—
Mehdi
-------------- next part ------------...
2015 Aug 19
3
[RFC] Improving integer divide optimization (related to D12082)
Hello LLVM, A recent commit creates the isIntDivCheap() target query.
http://reviews.llvm.org/D12082
The current approach has a couple shortcomings.
First, when targets decide divide is cheap, the DAGCombiner ignores
obvious power-of-2 optimizations. In the targets I know, shifts are
cheaper than divides in both speed and size. The target cannot see
the value in the isIntDivCheap() call, so
2015 Aug 20
2
[RFC] Improving integer divide optimization (related to D12082)
...V(), checking looks like this when the denominator is a power of 2.
>>>
>>> if (TLI.isIntDivCheap(N->getValueType(0), MinSize))
>>> return SDValue();
>>>
>>> // Target-specific implementation of sdiv x, pow2.
>>> if (SDValue Res = BuildSDIVPow2(N))
>>> return Res;
>>>
>>> How about this for isIntDivCheap?
>>> 1) pass Function* to allow the target to decide for itself which
>>> attributes matter, and
>>
>> If you want the attributes, I think you should pass the attributes and n...