[LLVMdev] llc -fast generating incorrect assembly

Tamir Sen tamirs at andrew.cmu.edu
Sun Dec 7 12:38:56 PST 2008


When compiling to the x86-64 architecture, llc -fast generates incorrect
assembly for the getlementptr instruction. This only seems to occur when llc
is passed the fast flag.

 
[tamirs at tuna compiler]$ cat jonx.ll 
; ModuleID = '<stdin>'

define i32 @main() {
    ret i32 0
}

define i32 @_l5_get(i32 %t3, i32* %t1) {
	%t9 = getelementptr i32* %t1, i32 %t3		; <i32*> [#uses=1]
	%t15 = load i32* %t9		; <i32> [#uses=1]
	ret i32 %t15
}
[tamirs at tuna compiler]$ llvm-as -f jonx.ll
[tamirs at tuna compiler]$ llc -march=x86-64 -fast -f jonx.bc
[tamirs at tuna compiler]$ gcc jonx.s
jonx.s: Assembler messages:
jonx.s:22: Error: `(%rsi,%edi,4)' is not a valid base/index expression

-- 
View this message in context: http://www.nabble.com/llc--fast-generating-incorrect-assembly-tp20885569p20885569.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list