[llvm-dev] Signed Div SCEVs

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Sun May 5 12:38:36 PDT 2019


On Fri, Apr 12, 2019 at 5:48 PM Alexandre Isoard
<alexandre.isoard at gmail.com> wrote:
> Hi Dangeti and Sanjoy,
>
> We have had issues with sdiv/srem creeping in due to address computation being "signed".
> We work around that by running a transformation passe that transform sdiv/srem into udiv/urem when we can prove they work on non-negative values.
>
> The cost you are talking about is development cost, or do you expect a runtime cost too?

Development cost (I expect the actual runtime cost to be small).  OTOH
Keno just made a patch to add smin and umin expressions, and it wasn't
that bad, although arguably min expressions are less complicated than
div expressions.

Are you running into limitations of what can be done with this
sdiv->udiv inference pass?

-- Sanjoy


-- Sanjoy

>
> On Sat, Mar 23, 2019 at 11:30 AM Sanjoy Das via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>
>> The short answer is that introducing new operations to SCEV has a high
>> cost, and we have not seen use cases that justify paying that cost.
>>
>> Have you run into situations where an sdiv operation would help?
>>
>> -- Sanjoy
>>
>> On Thu, Mar 21, 2019 at 6:01 AM Dangeti Tharun kumar via llvm-dev
>> <llvm-dev at lists.llvm.org> wrote:
>> >
>> > Hi,
>> >
>> > I am working with SCEVs, I see the unsigned division of SCEVs, it is not immediately clear to me why the signed division of SCEV expressions is not supported by SE?
>> >
>> > I would appreciate if some could clarify or point me to some links.
>> >
>> > --
>> > Regards,
>> > DTharun
>> > _______________________________________________
>> > LLVM Developers mailing list
>> > llvm-dev at lists.llvm.org
>> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
>
> --
> Alexandre Isoard


More information about the llvm-dev mailing list