[LLVMdev] SCEVTargetDataType

Dan Gohman gohman at apple.com
Mon Apr 19 07:39:30 PDT 2010


On Apr 17, 2010, at 8:42 PM, aparna kotha wrote:

> All,
>
> I had 2 questions for the group.
>
> 1. In llvm-2.6 I am able to identify sizeof(i8) as a  
> SCEVTargetDataType but how can we recover that the size is actually 8.

You need to make TargetData available.  The special "sizeof" and  
"offsetof" expressions
are used to analyze code in a target-independent manner, when the  
memory layouts for
types are not known.  With TargetData information, ScalarEvolution  
will just use integer
constants instead of these special expressions.

> 2. I dont see it in the present doxygen. Has it been discontinued in  
> llvm 2.7 ?

Yes.  They have been replaced with expressions which compute the same  
values,
using lower-level constructs.  It's still the case that  
ScalarEvolution will use integer
constants if TargetData information is available.

Dan




More information about the llvm-dev mailing list