[llvm-dev] ScalarEvolution questions

Nema, Ashutosh via llvm-dev llvm-dev at lists.llvm.org
Wed May 9 03:28:16 PDT 2018


Hi,

I'm new to ScalarEvolution and wanted to explore its capabilities.

I have following few questions:

1) How to compare SCEV expressions.
I have a situation to compare two SCEV to find the min among them.
Found an existing function(getMinFromExprs) in LoopAccessAnalysis which compares two SCEVs.
getMinFromExprs function finds the diff between two SCEV's and then checks for the negative value to find the minimum.
While checking the negative value it specifically look for SCEVConstant.

Do we have anything to find the min in case of NON-SCEVConstant (with some additional information), i.e.:
SCEV1: (sext i32 (-1 + %n.addr.0) to i64)
SCEV2: 0
Extra information "n.addr.0 > 1"

2) How to feed the relational information to SCEV, i.e. "a > b".
This relational information may not be explicitly available in the program.

3) Is there any way in SCEV to force the compute(i.e. add) by ignore the cast(sext, zext, truc)
SCEV: (2 + (sext i32 (-1 + %n.addr.0) to i64))
After force addition expecting something like:  "(1 + %n.addr.0)"

Any help by answer or pointers will be really useful.

Thanks,
Ashutosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180509/400b0616/attachment.html>


More information about the llvm-dev mailing list