Skip to content
  1. Aug 30, 2012
  2. Aug 29, 2012
    • Andrew Trick's avatar
      Preserve branch profile metadata during switch formation. · 3051aa1c
      Andrew Trick authored
      Patch by Michael Ilseman!
      This fixes SimplifyCFGOpt::FoldValueComparisonIntoPredecessors to preserve metata when folding conditional branches into switches.
      
      void foo(int x) {
        if (x == 0)
          bar(1);
        else if (__builtin_expect(x == 10, 1))
          bar(2);
        else if (x == 20)
          bar(3);
      }
      
      CFG:
      
      B0
      |  \
      |   X0
      B10
      |  \
      |   X10
      B20
      |  \
      E   X20
      
      Merge B0-B10:
      w(B0-X0) = w(B0-X0)*sum-weights(B10) = w(B0-X0) * (w(B10-X10) + w(B10-B20))
      w(B0-X10) = w(B0-B10) * w(B10-X10)
      w(B0-B20) = w(B0-B10) * w(B10-B20)
      
      B0 __
      | \  \
      | X10 X0
      B20
      |  \
      E  X20
      
      Merge B0-B20:
      w(B0-X0) = w(B0-X0) * sum-weights(B20) = w(B0-X0) * (w(B20-E) + w(B20-X20))
      w(B0-X10) = w(B0-X10) * sum-weights(B20) = ...
      w(B0-X20) = w(B0-B20) * w(B20-X20)
      w(B0-E) = w(B0-B20) * w(B20-E)
      
      llvm-svn: 162868
      3051aa1c
    • Andrew Trick's avatar
      whitespace · f3cf1932
      Andrew Trick authored
      llvm-svn: 162867
      f3cf1932
    • Eli Friedman's avatar
      Fix PR reference in test. · 8087378f
      Eli Friedman authored
      llvm-svn: 162866
      8087378f
    • Eli Friedman's avatar
      Fix run-line for test. · 9a38121f
      Eli Friedman authored
      llvm-svn: 162865
      9a38121f
    • Anna Zaks's avatar
      [analyzer]Fix typo, unbreak static analyzer BuildBot (at least · f329823d
      Anna Zaks authored
      partially).
      
      (Addresses a regression from r162790.)
      
      llvm-svn: 162864
      f329823d
    • Anna Zaks's avatar
      [analyzer] Improved diagnostic pruning for calls initializing values. · 5d4ec363
      Anna Zaks authored
      This heuristic addresses the case when a pointer (or ref) is passed
      to a function, which initializes the variable (or sets it to something
      other than '0'). On the branch where the inlined function does not
      set the value, we report use of undefined value (or NULL pointer
      dereference). The access happens in the caller and the path
      through the callee would get pruned away with regular path pruning. To
      solve this issue, we previously disabled diagnostic pruning completely
      on undefined and null pointer dereference checks, which entailed very
      verbose diagnostics in most cases. Furthermore, not all of the
      undef value checks had the diagnostic pruning disabled.
      
      This patch implements the following heuristic: if we pass a pointer (or
      ref) to the region (on which the error is reported) into a function and
      it's value is either undef or 'NULL' (and is a pointer), do not prune
      the function.
      
      llvm-svn: 162863
      5d4ec363
    • Eli Friedman's avatar
      Make alignment computation for pointer values for builtins handle · 504f9a28
      Eli Friedman authored
      non-pointer types with a pointer representation correctly. PR13660.
      
      llvm-svn: 162862
      504f9a28
    • Jakob Stoklund Olesen's avatar
      Rename hasVolatileMemoryRef() to hasOrderedMemoryRef(). · cea3e774
      Jakob Stoklund Olesen authored
      Ordered memory operations are more constrained than volatile loads and
      stores because they must be ordered with respect to all other memory
      operations.
      
      llvm-svn: 162861
      cea3e774
Loading