[LLVMdev] about llvm2.7's inline assembly

Sang Kil Cha sangkilc at cmu.edu
Sun Jul 11 21:27:51 PDT 2010


Whenever I compile a C program containing "FD_SET" function using llvm-gcc
2.7 (with -emit-llvm option), I got the following inline assembly in my
llvm byte code:

  %asmtmp = call %struct.__mbstate_t asm sideeffect "cld; rep; stosl",
"={cx},={di},{ax},0,1,~{dirflag},~{fpsr},~{flags},~{memory}"(i32 0, i32
32, i32* getelementptr inbounds (%struct.__sigset_t* @socks, i32 0, i32
0, i32 0)) nounwind ; <%struct.__mbstat  %asmresult = extractvalue
%struct.__mbstate_t %asmtmp, 0 ; <i32> [#uses=1]  store i32 %asmresult,
i32* %__d0
  %asmresult1 = extractvalue %struct.__mbstate_t %asmtmp, 1 ; <i32> [#uses=1]
  store i32 %asmresult1, i32* %__d1
  %0 = load i32* @sock, align 4

However, if I use llvm-gcc 2.6, this inline assembly function is not
generated in the byte code.

I was wondering if there is any way to "not generating" this inline
assembly function call in 2.7. Any comments will be appreciated.

Thank you!

More information about the llvm-dev mailing list