Skip to content
  1. Dec 21, 2008
  2. Dec 20, 2008
  3. Dec 13, 2008
  4. Dec 12, 2008
  5. Nov 22, 2008
  6. Nov 15, 2008
  7. Nov 13, 2008
  8. Nov 12, 2008
    • Daniel Dunbar's avatar
      IRgen improvements on unreachable code: · 5fc28718
      Daniel Dunbar authored
       - Split out "simple" statements which can easily handle IR generation
         when there is no insert point. These are generally statements which
         start by emitting a new block or are only containers for other
         statements.
      
       - This fixes a regression in emitting dummy blocks, notably for case
         statements.
      
       - This also fixes spurious emission of a number of debug stoppoint
         intrinsic instructions.
      
      Remove unneeded sw.body block, just clear the insertion point.
      
      Lift out CodeGenFunction::EmitStopPoint which calls into the
      CGDebugInfo class when generating debug info.
      
      Normalize definitions of Emit{Break,Continue}Stmt and usage of
      ErrorUnsupported.
      
      llvm-svn: 59118
      5fc28718
    • Chris Lattner's avatar
      Move EmitBranchOnBoolExpr and ConstantFoldsToSimpleInteger to · cd439299
      Chris Lattner authored
      CodeGenFunction.cpp.  Change VisitConditionalOperator to use
      constant fold instead of codegen'ing a constant conditional.
      
      Change ForStmt to use EmitBranchOnBoolExpr, this shrinks
      expr.c very slightly to 40239 lines.
      
      llvm-svn: 59113
      cd439299
    • Chris Lattner's avatar
      Make emission of 'if' conditions much more sophisticated when we · b7a9e164
      Chris Lattner authored
      have a condition that is an &&/||.  Before we used to compile things like this:
      
      int test() {
        if (x && y) foo(); else bar();
      }
      
      into:
      
      	%0 = load i32* @x		; <i32> [#uses=1]
      	%1 = icmp ne i32 %0, 0		; <i1> [#uses=1]
      	br i1 %1, label %land_rhs, label %land_cont
      
      land_rhs:		; preds = %entry
      	%2 = load i32* @y		; <i32> [#uses=1]
      	%3 = icmp ne i32 %2, 0		; <i1> [#uses=1]
      	br label %land_cont
      
      land_cont:		; preds = %land_rhs, %entry
      	%4 = phi i1 [ false, %entry ], [ %3, %land_rhs ]		; <i1> [#uses=1]
      	br i1 %4, label %ifthen, label %ifelse
      
      ifthen:		; preds = %land_cont
      	%call = call i32 (...)* @foo()		; <i32> [#uses=0]
      	br label %ifend
      
      ifelse:		; preds = %land_cont
      	%call1 = call i32 (...)* @bar()		; <i32> [#uses=0]
      	br label %ifend
      
      ifend:		; preds = %ifelse, %ifthen
      
      
      Now we turn it into the much more svelte code:
      
              %0 = load i32* @x               ; <i32> [#uses=1]
              %1 = icmp ne i32 %0, 0          ; <i1> [#uses=1]
              br i1 %1, label %land_lhs_true, label %ifelse
      
      land_lhs_true:          ; preds = %entry
              %2 = load i32* @y               ; <i32> [#uses=1]
              %3 = icmp ne i32 %2, 0          ; <i1> [#uses=1]
              br i1 %3, label %ifthen, label %ifelse
      
      ifthen:         ; preds = %land_lhs_true
              %call = call i32 (...)* @foo()          ; <i32> [#uses=0]
              br label %ifend
      
      ifelse:         ; preds = %land_lhs_true, %entry
              %call1 = call i32 (...)* @bar()         ; <i32> [#uses=0]
              br label %ifend
      
      ifend:          ; preds = %ifelse, %ifthen
      
      Note the lack of a phi node.
      
      This shrinks the -O0 .ll file for 176.gcc/expr.c from 43176 to 40267 lines.
      
      llvm-svn: 59111
      b7a9e164
    • Chris Lattner's avatar
      Clean up some code to use isZero instead of calling getZExtValue. · 4ad31fcc
      Chris Lattner authored
      llvm-svn: 59103
      4ad31fcc
    • Daniel Dunbar's avatar
      Rework IRgen invariant w.r.t. current insert point. · 5c7e3935
      Daniel Dunbar authored
       - EmitStmt is no longer required to finish with a current insertion
         point defined (i.e. it does not need to make dummy
         blocks). Instead, it can clear the insertion point in the builder
         which indicates that the current insertion point is unreachable.
       - CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint
         which respectively test if there is an insert point and ensure an
         insertion point exists (by making a dummy block).
       - Clearly mark functions in CodeGenFunction which can be called with
         no insertion point defined. Currently this is a limited set, and
         EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR.
      
      Remove EmitDummyBlock, which is no longer needed. Clients who haven't
      already cleared the insertion point (typically via EmitBranch) can do
      so by hand.
      
      Remove isDummyBlock, which has effectively been renamed to
      HaveInsertPoint.
      
      The main thrust of this change is that we no longer have create dummy
      blocks just to destroy them a short time later in EmitBlock in the
      common case that there is no unreachable code following something like
      a goto. 
      
      Additionally, this means that we are not using the hokey condition in
      isDummyBlock that a block without a name is a dummy block. Guess how
      well that works when we never emit block names!
      
      llvm-svn: 59089
      5c7e3935
  9. Nov 11, 2008
  10. Nov 09, 2008
  11. Oct 17, 2008
  12. Oct 12, 2008
  13. Oct 06, 2008
  14. Oct 02, 2008
  15. Sep 30, 2008
    • Daniel Dunbar's avatar
      Add infrastructure for proper @finally support. · 2efd538f
      Daniel Dunbar authored
       - Provides a basic primitive to jump to an arbitrary basic block,
         through the finally code.
      
       - Only used for return statements and rethrow currently. Still need
         to handle break, continue and goto.
      
       - Code still needs to be shuffled around to live elsewhere.
      
      llvm-svn: 56827
      2efd538f
  16. Sep 28, 2008
  17. Sep 24, 2008
    • Daniel Dunbar's avatar
      Refactor some CodeGen functionality: · 1c64e5d1
      Daniel Dunbar authored
       - Add CodeGenFunction::{EmitReturnOfRValue, EmitIvarOffset}
       - Factor EmitLValueForIvar out of EmitObjCIvarRefLValue.
      
      No non-error functionality change (some unsupported errors are
      degraded to asserts for the time being).
      
      llvm-svn: 56543
      1c64e5d1
  18. Sep 11, 2008
  19. Sep 09, 2008
  20. Aug 30, 2008
  21. Aug 29, 2008
  22. Aug 23, 2008
    • Daniel Dunbar's avatar
      Implement Obj-C ivar references to aggregates. · c8317a44
      Daniel Dunbar authored
      Implement Obj-C lvalue message sends (aggregate returns).
      
      Update several places to emit more precise ErrorUnsupported warnings
        for currently unimplemented Obj-C features (main missing chunks are
        property references, Obj-C exception handling, and the for ... in
        syntax).
      
      llvm-svn: 55234
      c8317a44
Loading