[LLVMdev] Is 'Implicit def' bug fixed in LLVM 2.0?

Seung Jae Lee lee225 at uiuc.edu
Fri May 25 10:21:42 PDT 2007


Hello, guys.
I remember that Jeffrey Poznanovic posted ths issue about 'Implicit def' on Apr. 29 and Chris Lattner mentioned it seemed to be a bug.

I am using ver 1.9 and also found 'Implicit def' while using codegen for the code follows:

-------------------------------------------------------------
#define f c_f
#define fs c_fs
 
int f(int x1) {
    return x1;
}

int fs(){
    int i, sum;
    for (i=0; i<10; i++)
      sum +=  f(i);
    return sum;
}
#ifdef LINUX
#include <stdio.h>
#include <stdlib.h>

int c_f(int);
int c_fs();

int main (int argc, char* argv[]) {
    int j;
    j = c_fs();

    printf ("%i\n",j);
    printf ("You got it\n");

}
#endif
-------------------------------------------------------------
The code above was converted to LLVM assembly as follows:

-------------------------------------------------------------
implementation   ; Functions:

int %c_f(int %x1) {
entry:
        ret int %x1
}

int %c_fs() {
entry:
        ret int undef
}

-------------------------------------------------------------

You can see 'int undef' at the end of this assembly which is shown as 'Implicit def' in target specific assembly code.

I just wonder if this is fixed in the newer version.
Have a good weekend.

Thanks,
Seung J. Lee



More information about the llvm-dev mailing list