[LLVMdev] Question about the new version of LLVM GCC

Chris Lattner sabre at nondot.org
Sun May 20 23:27:44 PDT 2007


On Sun, 20 May 2007, Ben Chambers wrote:

> I noticed the following line in the output of LLVM GCC and was
> wondering what it meant:
>   "alloca point" = bitcast i32 0 to i32   ; <i32> [#uses=0]
> I wasn't aware that a string was a valid left hand side, but

LLVM allows arbitrary characters to be in the names of values.  For simple 
things, it uses %foo, for complex things, it uses quoted strings (in this 
case, due to the space).

> considering the fact that the instruction is basically pointless
> (doesn't do anything, and is never used), I'm guessing that it instead
> serves to mark the end of the allocas for that function.  Is this
> correct?  If not, what does the instruction mean/do?

The LLVM APIs make it easy, fast and convenient to insert an instruction 
before another one.  The llvm-gcc f.e. uses this bitcast as an anchor to 
insert (you guessed it) allocas.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list