Skip to content
  1. Aug 03, 2007
  2. Jul 21, 2007
  3. Jul 18, 2007
  4. Jul 16, 2007
  5. Jul 13, 2007
  6. Jul 12, 2007
  7. Jul 10, 2007
  8. Jun 29, 2007
  9. Jun 23, 2007
  10. Jun 22, 2007
  11. Jun 20, 2007
  12. Jun 16, 2007
  13. Jun 15, 2007
    • Chris Lattner's avatar
      implement codegen of calls. We can now compile: · 2b228c95
      Chris Lattner authored
      double foo( int (*FP)(int, int, int)) {
        return FP(1, 2, 3);
      }
      
      to:
      
      define double @foo(i32 (i32, i32, i32)* %FP) {
      entry:
              %call = tail call i32 %FP( i32 1, i32 2, i32 3 )
              %conv = sitofp i32 %call to double
              ret double %conv
      }
      
      llvm-svn: 39658
      2b228c95
  14. Jun 13, 2007
    • Chris Lattner's avatar
      Implement support for formal arguments. We can now compile this: · 53621a53
      Chris Lattner authored
      int test(int X, short Y, float Z) {
        return (int)(X*Y+Z);
      }
      
      to:
      
      define i32 @test(i32 %X, i16 %Y, float %Z) {
      entry:
              %promote = sext i16 %Y to i32           ; <i32> [#uses=1]
              %mul = mul i32 %promote, %X             ; <i32> [#uses=1]
              %promote3 = sitofp i32 %mul to float            ; <float> [#uses=1]
              %add = add float %promote3, %Z          ; <float> [#uses=1]
              %conv = fptosi float %add to i32                ; <i32> [#uses=1]
              ret i32 %conv
      }
      
      with:
      
      $ clang -emit-llvm t.c | llvm-as | opt -std-compile-opts | llvm-dis
      
      llvm-svn: 39652
      53621a53
  15. Jun 09, 2007
  16. Jun 06, 2007
  17. Jun 05, 2007
  18. Jun 03, 2007
    • Chris Lattner's avatar
      Implement EmitUsualArithmeticConversions, so we can add shorts to floats and · cf250248
      Chris Lattner authored
      ints to long long etc.  For int to longlong, we now get:
      
              %tmp = load i64* %F             ; <i64> [#uses=1]
              %tmp1 = load i32* %D            ; <i32> [#uses=1]
              %promote = sext i32 %tmp1 to i64                ; <i64> [#uses=1]
              %tmp2 = add i64 %tmp, %promote          ; <i64> [#uses=0]
      
      llvm-svn: 39576
      cf250248
    • Chris Lattner's avatar
      implement a first hack at codegen'ing the usual unary conversions. · 6db1fb84
      Chris Lattner authored
      This allows us to compile:
      
      int func() {
        int A[10];
        if (!A) {
      
      to:
      
      define i32 @func() {
      entry:
              %A = alloca [10 x i32]          ; <[10 x i32]*> [#uses=1]
              %arraydecay = getelementptr [10 x i32]* %A, i32 0, i32 0                ; <i32*> [#uses=1]
              %tobool = icmp ne i32* %arraydecay, null                ; <i1> [#uses=1]
              %lnot = xor i1 %tobool, true            ; <i1> [#uses=1]
              br i1 %lnot, label %ifthen, label %ifend
      
      -Chris
      
      llvm-svn: 39564
      6db1fb84
  19. Jun 02, 2007
    • Chris Lattner's avatar
      Implement translation of pointer, reference and simple array types. We now · 2b4e21ac
      Chris Lattner authored
      compile:
      
      void foo() {
        int A[10];
        int *P;
      
      into:
      
      entry:
              %A = alloca [10 x i32]          ; <[10 x i32]*> [#uses=0]
              %P = alloca i32*                ; <i32**> [#uses=0]
      
      llvm-svn: 39561
      2b4e21ac
    • Chris Lattner's avatar
      Refactor EvaluateScalarValueToBool out of if statement emission, so it can · f0106d25
      Chris Lattner authored
      be shared.
      
      Implement infrastructure for unary operator emission.
      
      Implement basic logical not support.  We now compile:
      
        register short X;
      
        if (!X) {
      
      into:
      
              %tmp = load i16* %X             ; <i16> [#uses=1]
              %tobool = icmp ne i16 %tmp, 0           ; <i1> [#uses=1]
              %lnot = xor i1 %tobool, true            ; <i1> [#uses=1]
              zext i1 %lnot to i32            ; <i32>:0 [#uses=1]
              %tobool1 = icmp ne i32 %0, 0            ; <i1> [#uses=1]
              br i1 %tobool1, label %ifthen, label %ifend
      
      llvm-svn: 39559
      f0106d25
    • Chris Lattner's avatar
      Implement scaffolding for lvalues. Implement block vardecl lvalues. · d7f58867
      Chris Lattner authored
      This allows us to translate:
      
      int func() {
        register int X;
        {
          int Y;
          return 1+X+Y;
        }
      }
      
      into:
      
      define i32 @func() {
      entry:
              %X = alloca i32         ; <i32*> [#uses=1]
              %Y = alloca i32         ; <i32*> [#uses=1]
              %allocapt = bitcast i32 undef to i32            ; <i32> [#uses=0]
              %tmp = load i32* %X             ; <i32> [#uses=1]
              %tmp1 = add i32 1, %tmp         ; <i32> [#uses=1]
              %tmp2 = load i32* %Y            ; <i32> [#uses=1]
              %tmp3 = add i32 %tmp1, %tmp2            ; <i32> [#uses=1]
              ret i32 %tmp3
                      ; No predecessors!
              ret i32 undef
      }
      
      llvm-svn: 39555
      d7f58867
Loading