[LLVMdev] llvm-as and implicit value naming

Mark Shannon marks at dcs.gla.ac.uk
Thu Sep 25 07:10:32 PDT 2008


Hi everyone,

I don't know if this is a bug or I am misunderstanding things.
I couldn't find anything in the Bugzilla database.

The following code:

1 @sp = external global i8**		; <i8***> 
2
3 define void @test(i8* %x) {
4 entry:
5	load i8*** @sp	; <i8**>:1 
6	getelementptr i8** %1, i32 1 ; <i8**>:2
7	store i8** %2, i8*** @sp, align 4 
8	ret void
9 }

causes llvm-as (version 2.3) to choke:
llvm-as: test.ll:7,0: Reference to an invalid definition: #2 of type 'i8 * *'

There are variations, such as:

1 @sp = external global i8**		; <i8***> 
2
3 define void @test(i32 %X) {
4 entry:
5	load i8*** @sp	; <i8**>:1 
6	getelementptr i8** %1, i32 -1		; <i8**> :2
7	store i8** %2, i8*** @sp, align 4 
8	inttoptr i32 %X to i8*		; <i8*> :3
9	store i8* %3, i8** %2, align 4
10 	ret void
11}

which produces
llvm-as: test.ll:9,0: Numbered value (%2) of type 'i8 *' does not match expected type, 'i8 * *'

I originally found this error when trying to assemble code produce by the PrintModule pass manager on code (many thousands of lines long) that had passed verification.

Mark.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2994 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080925/e59ae21d/attachment.bin>


More information about the llvm-dev mailing list