Skip to content
  1. Nov 18, 2010
    • Chris Lattner's avatar
      allow eliminating an alloca that is just copied from an constant global · ac570131
      Chris Lattner authored
      if it is passed as a byval argument.  The byval argument will just be a
      read, so it is safe to read from the original global instead.  This allows
      us to promote away the %agg.tmp alloca in PR8582
      
      llvm-svn: 119686
      ac570131
    • Chris Lattner's avatar
      enhance the "alloca is just a memcpy from constant global" · f183d5c4
      Chris Lattner authored
      to ignore calls that obviously can't modify the alloca
      because they are readonly/readnone.
      
      llvm-svn: 119683
      f183d5c4
    • Chris Lattner's avatar
      fix a small oversight in the "eliminate memcpy from constant global" · 7aeae25c
      Chris Lattner authored
      optimization.  If the alloca that is "memcpy'd from constant" also has
      a memcpy from *it*, ignore it: it is a load.  We now optimize the testcase to:
      
      define void @test2() {
        %B = alloca %T
        %a = bitcast %T* @G to i8*
        %b = bitcast %T* %B to i8*
        call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 124, i32 4, i1 false)
        call void @bar(i8* %b)
        ret void
      }
      
      previously we would generate:
      
      define void @test() {
        %B = alloca %T
        %b = bitcast %T* %B to i8*
        %G.0 = getelementptr inbounds %T* @G, i32 0, i32 0
        %tmp3 = load i8* %G.0, align 4
        %G.1 = getelementptr inbounds %T* @G, i32 0, i32 1
        %G.15 = bitcast [123 x i8]* %G.1 to i8*
        %1 = bitcast [123 x i8]* %G.1 to i984*
        %srcval = load i984* %1, align 1
        %B.0 = getelementptr inbounds %T* %B, i32 0, i32 0
        store i8 %tmp3, i8* %B.0, align 4
        %B.1 = getelementptr inbounds %T* %B, i32 0, i32 1
        %B.12 = bitcast [123 x i8]* %B.1 to i8*
        %2 = bitcast [123 x i8]* %B.1 to i984*
        store i984 %srcval, i984* %2, align 1
        call void @bar(i8* %b)
        ret void
      }
      
      llvm-svn: 119682
      7aeae25c
    • Chris Lattner's avatar
      filecheckize · 94341841
      Chris Lattner authored
      llvm-svn: 119681
      94341841
  2. Nov 17, 2010
  3. Nov 16, 2010
    • Duncan Sands's avatar
      In which I discover the existence of loops. Threading an operation · 5ffc298b
      Duncan Sands authored
      over a phi node by applying it to each operand may be wrong if the
      operation and the phi node are mutually interdependent (the testcase
      has a simple example of this).  So only do this transform if it would
      be correct to perform the operation in each predecessor of the block
      containing the phi, i.e. if the other operands all dominate the phi.
      This should fix the FFMPEG snow.c regression reported by İsmail Dönmez.
      
      llvm-svn: 119347
      5ffc298b
  4. Nov 15, 2010
  5. Nov 14, 2010
  6. Nov 13, 2010
    • Duncan Sands's avatar
      Testcase to go along with commit 118923 ("Have GVN simplify instructions · 8c58ba41
      Duncan Sands authored
      as it goes").  Before -std-compile-opts only got it down to
        %a = tail call i32 @foo(i32 0) readnone
        %x = tail call i32 @foo(i32 %a) readnone
        %y = tail call i32 @foo(i32 %a) readnone
        %z = icmp eq i32 %x, %y
        ret i1 %z
      while now -basicaa -gvn alone reduce it to
        %a = call i32 @foo(i32 0) readnone
        %x = call i32 @foo(i32 %a) readnone
        ret i1 true
      
      llvm-svn: 119009
      8c58ba41
    • Duncan Sands's avatar
      Generalize the reassociation transform in SimplifyCommutative (now renamed to · 641baf16
      Duncan Sands authored
      SimplifyAssociativeOrCommutative) "(A op C1) op C2" -> "A op (C1 op C2)",
      which previously was only done if C1 and C2 were constants, to occur whenever
      "C1 op C2" simplifies (a la InstructionSimplify).  Since the simplifying operand
      combination can no longer be assumed to be the right-hand terms, consider all of
      the possible permutations.  When compiling "gcc as one big file", transform 2
      (i.e. using right-hand operands) fires about 4000 times but it has to be said
      that most of the time the simplifying operands are both constants.  Transforms
      3, 4 and 5 each fired once.  Transform 6, which is an existing transform that
      I didn't change, never fired.  With this change, the testcase is now optimized
      perfectly with one run of instcombine (previously it required instcombine +
      reassociate + instcombine, and it may just have been luck that this worked).
      
      llvm-svn: 119002
      641baf16
  7. Nov 12, 2010
  8. Nov 11, 2010
    • Dan Gohman's avatar
      Factor out Instruction::isSafeToSpeculativelyExecute's code for · a826a887
      Dan Gohman authored
      testing for dereferenceable pointers into a helper function,
      isDereferenceablePointer.  Teach it how to reason about GEPs
      with simple non-zero indices.
      
      Also eliminate ArgumentPromtion's IsAlwaysValidPointer,
      which didn't check for weak externals or out of range gep
      indices.
      
      llvm-svn: 118840
      a826a887
  9. Nov 10, 2010
  10. Nov 08, 2010
  11. Nov 07, 2010
  12. Nov 01, 2010
  13. Oct 30, 2010
  14. Oct 29, 2010
  15. Oct 28, 2010
  16. Oct 25, 2010
  17. Oct 24, 2010
    • Duncan Sands's avatar
      Fix PR8445: a block with no predecessors may be the entry block, in which case · 31c803b2
      Duncan Sands authored
      it isn't unreachable and should not be zapped.  The check for the entry block
      was missing in one case: a block containing a unwind instruction.  While there,
      do some small cleanups: "M" is not a great name for a Function* (it would be
      more appropriate for a Module*), change it to "Fn"; use Fn in more places.
      
      llvm-svn: 117224
      31c803b2
  18. Oct 22, 2010
  19. Oct 19, 2010
  20. Oct 18, 2010
  21. Oct 16, 2010
  22. Oct 14, 2010
Loading