Skip to content
  1. Jun 20, 2013
  2. Jun 19, 2013
  3. Jun 18, 2013
  4. Jun 17, 2013
  5. Jun 15, 2013
  6. Jun 13, 2013
    • Derek Schuff's avatar
      Fix DeleteDeadVarargs not to crash on functions referenced by BlockAddresses · ec9dc01b
      Derek Schuff authored
      This pass was assuming that if hasAddressTaken() returns false for a
      function, the function's only uses are call sites.  That's not true
      because there can be references by BlockAddresses too.
      
      Fix the pass to handle this case.  Fix
      BlockAddress::replaceUsesOfWithOnConstant() to allow a function's type
      to be changed by RAUW'ing the function with a bitcast of the recreated
      function.
      
      Patch by Mark Seaborn.
      
      llvm-svn: 183933
      ec9dc01b
  7. Jun 12, 2013
  8. Jun 11, 2013
    • Rafael Espindola's avatar
      Change how globalopt handles aliases in llvm.used. · a82555c0
      Rafael Espindola authored
      Instead of a custom implementation of replaceAllUsesWith, we just call
      replaceAllUsesWith and recreate llvm.used and llvm.compiler-used.
      
      This change is particularity interesting because it makes llvm see
      through what clang is doing with static used functions in extern "C"
      contexts. With this change, running clang -O2 in
      
      extern "C" {
        __attribute__((used)) static void foo() {}
      }
      
      produces
      
      @llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to
      i8*)], section "llvm.metadata"
      define internal void @foo() #0 {
      entry:
        ret void
      }
      
      llvm-svn: 183756
      a82555c0
  9. Jun 09, 2013
  10. Jun 08, 2013
    • Shuxin Yang's avatar
      Fix a potential bug in r183584. · 140d592d
      Shuxin Yang authored
        r183584 tries to derive some info from the code *AFTER* a call and apply
      these derived info to the code *BEFORE* the call, which is not always safe
      as the call in question may never return, and in this case, the derived
      info is invalid.
        
        Thank Duncan for pointing out this potential bug.
      
      rdar://14073661 
      
      llvm-svn: 183606
      140d592d
    • Shuxin Yang's avatar
      Fix an assertion in MemCpyOpt pass. · bd254f26
      Shuxin Yang authored
        The MemCpyOpt pass is capable of optimizing:
            callee(&S); copy N bytes from S to D.
          into:
            callee(&D);
      subject to some legality constraints. 
      
        Assertion is triggered when the compiler tries to evalute "sizeof(typeof(D))",
      while D is an opaque-typed, 'sret' formal argument of function being compiled.
      i.e. the signature of the func being compiled is something like this:
        T caller(...,%opaque* noalias nocapture sret %D, ...)
      
        The fix is that when come across such situation, instead of calling some
      utility functions to get the size of D's type (which will crash), we simply
      assume D has at least N bytes as implified by the copy-instruction.
      
      rdar://14073661 
      
      llvm-svn: 183584
      bd254f26
  11. Jun 07, 2013
  12. Jun 06, 2013
  13. Jun 05, 2013
  14. Jun 04, 2013
    • David Majnemer's avatar
      IndVarSimplify: check if loop invariant expansion can trap · 29130c5e
      David Majnemer authored
      IndVarSimplify is willing to move divide instructions outside of their
      loop bodies if they are invariant of the loop.  However, it may not be
      safe to expand them if we do not know if they can trap.
      
      Instead, check to see if it is not safe to expand the instruction and
      skip the expansion.
      
      This fixes PR16041.
      
      Testcase by Rafael Ávila de Espíndola.
      
      llvm-svn: 183239
      29130c5e
    • Rafael Espindola's avatar
      Second part of pr16069 · a5e536ab
      Rafael Espindola authored
      The problem this time seems to be a thinko. We were assuming that in the CFG
      
      A
      | \
      |  B
      | /
      C
      
      speculating the basic block B would cause only the phi value for the B->C edge
      to be speculated. That is not true, the phi's are semantically in the edges, so
      if the A->B->C path is taken, any code needed for A->C is not executed and we
      have to consider it too when deciding to speculate B.
      
      llvm-svn: 183226
      a5e536ab
    • Hans Wennborg's avatar
      Typo: s/caes/cases/ in SimplifyCFG · 5cf30be6
      Hans Wennborg authored
      llvm-svn: 183219
      5cf30be6
    • Nick Lewycky's avatar
      Delete dead safety check. · 688d668e
      Nick Lewycky authored
      llvm-svn: 183167
      688d668e
  15. Jun 03, 2013
    • David Majnemer's avatar
      SimplifyCFG: Do not transform PHI to select if doing so would be unsafe · c82f27af
      David Majnemer authored
      PR16069 is an interesting case where an incoming value to a PHI is a
      trap value while also being a 'ConstantExpr'.
      
      We do not consider this case when performing the 'HoistThenElseCodeToIf'
      optimization.
      
      Instead, make our modifications more conservative if we detect that we
      cannot transform the PHI to a select.
      
      llvm-svn: 183152
      c82f27af
Loading