[llvm-dev] Getting the symbolic expression for an address calculation

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 4 11:56:44 PDT 2016


On 10/4/2016 11:26 AM, Charith Mendis wrote:
> (((15 + %add144.sink230.i) * (%blocksize /u %bytesoftype)) + 
> {%_dest,+,16}<%for.cond1.preheader.i59>)<nsw>

This is a SCEVAddExpr with two operands.  The first is a SCEVMulExpr, 
the second is a SCEVAddRecExpr.  You're ending up with an expression 
like this because one of "%add144.sink230.i", "%blocksize", or 
"%bytesoftype" isn't loop-invariant.  Maybe a load wasn't hoisted where 
you expected it to be.

If you're confused about what kind of expression you're looking at, you 
can use the getSCEVType() method on a SCEV, which returns a member of 
the SCEVTypes enum.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-dev mailing list