Signed Div SCEVs

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.

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

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?

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