Skip to content
  1. Nov 19, 2016
  2. Nov 18, 2016
  3. Nov 17, 2016
  4. Nov 16, 2016
  5. Nov 15, 2016
    • Filipe Cabecinhas's avatar
      [AddressSanitizer] Add support for (constant-)masked loads and stores. · ec350b71
      Filipe Cabecinhas authored
      This patch adds support for instrumenting masked loads and stores under
      ASan, if they have a constant mask.
      
      isInterestingMemoryAccess now supports returning a mask to be applied to
      the loads, and instrumentMop will use it to generate additional checks.
      
      Added tests for v4i32 v8i32, and v4p0i32 (~v4i64) for both loads and
      stores (as well as a test to verify we don't add checks to non-constant
      masks).
      
      Differential Revision: https://reviews.llvm.org/D26230
      
      llvm-svn: 287047
      ec350b71
    • Kostya Serebryany's avatar
      [sanitizer-coverage] make sure asan does not instrument coverage guards... · 9d6dc7b1
      Kostya Serebryany authored
      [sanitizer-coverage] make sure asan does not instrument coverage guards (reported in https://github.com/google/oss-fuzz/issues/84)
      
      llvm-svn: 287030
      9d6dc7b1
    • Wei Mi's avatar
    • Wei Mi's avatar
      [LSR] Allow formula containing Reg for SCEVAddRecExpr related with outerloop. · 7ccf7651
      Wei Mi authored
      In RateRegister of existing LSR, if a formula contains a Reg which is a SCEVAddRecExpr,
      and this SCEVAddRecExpr's loop is an outerloop, the formula will be marked as Loser
      and dropped.
      
      Suppose we have an IR that %for.body is outerloop and %for.body2 is innerloop. LSR only
      handle inner loop now so only %for.body2 will be handled.
      
      Using the logic above, formula like
      reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) will be dropped
      no matter what because reg({1,+, %size}<%for.body>) is a SCEVAddRecExpr type reg related
      with outerloop. Only formula like
      reg(%array) + 1*reg({{1,+, %size}<%for.body>,+,1}<nuw><nsw><%for.body2>) will be kept
      because the SCEVAddRecExpr related with outerloop is folded into the initial value of the
      SCEVAddRecExpr related with current loop.
      
      But in some cases, we do need to share the basic induction variable
      reg{0 ,+, 1}<%for.body2> among LSR Uses to reduce the final total number of induction
      variables used by LSR, so we don't want to drop the formula like
      reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) unconditionally.
      
      From the existing comment, it tries to avoid considering multiple level loops at the same time.
      However, existing LSR only handles innermost loop, so for any SCEVAddRecExpr with a loop other
      than current loop, it is an invariant and will be simple to handle, and the formula doesn't have
      to be dropped.
      
      Differential Revision: https://reviews.llvm.org/D26429
      
      llvm-svn: 286999
      7ccf7651
    • Wei Mi's avatar
      [IndVars] Change the order to compute WidenAddRec in widenIVUse. · d2948cef
      Wei Mi authored
      When both WidenIV::getWideRecurrence and WidenIV::getExtendedOperandRecurrence
      return non-null but different WideAddRec, if getWideRecurrence is called
      before getExtendedOperandRecurrence, we won't bother to call
      getExtendedOperandRecurrence again. But As we know it is possible that after
      SCEV folding, we cannot prove the legality using the SCEVAddRecExpr returned
      by getWideRecurrence. Meanwhile if getExtendedOperandRecurrence returns non-null
      WideAddRec, we know for sure that it is legal to do widening for current instruction.
      So it is better to put getExtendedOperandRecurrence before getWideRecurrence, which
      will increase the chance of successful widening.
      
      Differential Revision: https://reviews.llvm.org/D26059
      
      llvm-svn: 286987
      d2948cef
    • Craig Topper's avatar
      [AVX-512] Add AVX-512 vector shift intrinsics to memory santitizer. · c7486af9
      Craig Topper authored
      Just needed to add the intrinsics to the exist switch. The code is generic enough to support the wider vectors with no changes.
      
      llvm-svn: 286980
      c7486af9
    • Pablo Barrio's avatar
      Revert "[JumpThreading] Unfold selects that depend on the same condition" · 4f80c93a
      Pablo Barrio authored
      This reverts commit ac54d0066c478a09c7cd28d15d0f9ff8af984afc.
      
      llvm-svn: 286976
      4f80c93a
    • Pablo Barrio's avatar
      Revert "[JumpThreading] Prevent non-deterministic use lists" · 5f782bb0
      Pablo Barrio authored
      This reverts commit f2c2f5354070469dac253373c66527ca971ddc66.
      
      llvm-svn: 286975
      5f782bb0
    • Robert Lougher's avatar
      [LoopVectorizer] When estimating reg usage, unused insts may "end" another use · b0905209
      Robert Lougher authored
      The register usage algorithm incorrectly treats instructions whose value is
      not used within the loop (e.g. those that do not produce a value).
      
      The algorithm first calculates the usages within the loop.  It iterates over
      the instructions in order, and records at which instruction index each use
      ends (in fact, they're actually recorded against the next index, as this is
      when we want to delete them from the open intervals).
      
      The algorithm then iterates over the instructions again, adding each
      instruction in turn to a list of open intervals.  Instructions are then
      removed from the list of open intervals when they occur in the list of uses
      ended at the current index.
      
      The problem is, instructions which are not used in the loop are skipped.
      However, although they aren't used, the last use of a value may have been
      recorded against that instruction index.  In this case, the use is not deleted
      from the open intervals, which may then bump up the estimated register usage.
      
      This patch fixes the issue by simply moving the "is used" check after the loop
      which erases the uses at the current index.
      
      Differential Revision: https://reviews.llvm.org/D26554
      
      llvm-svn: 286969
      b0905209
    • Florian Hahn's avatar
      Test commit, remove trailing space. · 4b4dc172
      Florian Hahn authored
      This commit is used to test commit access.
      
      llvm-svn: 286957
      4b4dc172
  6. Nov 14, 2016
    • Kuba Brecka's avatar
      [tsan] Add support for C++ exceptions into TSan (call __tsan_func_exit during unwinding), LLVM part · ddfdba3b
      Kuba Brecka authored
      This adds support for TSan C++ exception handling, where we need to add extra calls to __tsan_func_exit when a function is exitted via exception mechanisms. Otherwise the shadow stack gets corrupted (leaked). This patch moves and enhances the existing implementation of EscapeEnumerator that finds all possible function exit points, and adds extra EH cleanup blocks where needed.
      
      Differential Revision: https://reviews.llvm.org/D26177
      
      llvm-svn: 286893
      ddfdba3b
    • Teresa Johnson's avatar
      [ThinLTO] Only promote exported locals as marked in index · 4fef68cb
      Teresa Johnson authored
      Summary:
      We have always speculatively promoted all renamable local values
      (except const non-address taken variables) for both the exporting
      and importing module. We would then internalize them back based on
      the ThinLink results if they weren't actually exported. This is
      inefficient, and results in unnecessary renames. It also meant we
      had to check the non-renamability of a value in the summary, which
      was already checked during function importing analysis in the ThinLink.
      
      Made renameModuleForThinLTO (which does the promotion/renaming) instead
      use the index when exporting, to avoid unnecessary renames/promotions.
      For importing modules, we can simply promoted all values as any local
      we import by definition is exported and needs promotion.
      
      This required changes to the method used by the FunctionImport pass
      (only invoked from 'opt' for testing) and when invoked from llvm-link,
      since neither does a ThinLink. We simply conservatively mark all locals
      in the index as promoted, which preserves the current aggressive
      promotion behavior.
      
      I also needed to change an llvm-lto based test where we had previously
      been aggressively promoting values that weren't importable (aliasees),
      but now will not promote.
      
      Reviewers: mehdi_amini
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D26467
      
      llvm-svn: 286871
      4fef68cb
    • Teresa Johnson's avatar
      [ThinLTO] Make inline assembly handling more efficient in summary · d5033a45
      Teresa Johnson authored
      Summary:
      The change in r285513 to prevent exporting of locals used in
      inline asm added all locals in the llvm.used set to the reference
      set of functions containing inline asm. Since these locals were marked
      NoRename, this automatically prevented importing of the function.
      
      Unfortunately, this caused an explosion in the summary reference lists
      in some cases. In my particular example, it happened for a large protocol
      buffer generated C++ file, where many of the generated functions
      contained an inline asm call. It was exacerbated when doing a ThinLTO
      PGO instrumentation build, where the PGO instrumentation included
      thousands of private __profd_* values that were added to llvm.used.
      
      We really only need to include a single llvm.used local (NoRename) value
      in the reference list of a function containing inline asm to block it
      being imported. However, it seems cleaner to add a flag to the summary
      that explicitly describes this situation, which is what this patch does.
      
      Reviewers: mehdi_amini
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D26402
      
      llvm-svn: 286840
      d5033a45
    • Simon Pilgrim's avatar
      Remove redundant condition (PR28352) NFCI. · 475b40da
      Simon Pilgrim authored
      We were already testing is the op was not a leaf, so need to then test if it was a leaf (added it to the assert instead).
      
      llvm-svn: 286817
      475b40da
    • Pablo Barrio's avatar
      [JumpThreading] Prevent non-deterministic use lists · 7ce2c5ec
      Pablo Barrio authored
      Summary:
      Unfolding selects was previously done with the help of a vector
      of pointers that was then sorted to be able to remove duplicates.
      As this sorting depends on the memory addresses, it was
      non-deterministic. A SetVector is used now so that duplicates are
      removed without the need of sorting first.
      
      Reviewers: mgrang, efriedma
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D26450
      
      llvm-svn: 286807
      7ce2c5ec
  7. Nov 13, 2016
  8. Nov 12, 2016
    • Sanjay Patel's avatar
      [InstCombine] use dyn_cast rather isa+cast; NFC · 84ae943f
      Sanjay Patel authored
      Follow-up to r286664 cleanup as suggested by Eli. Thanks!
      
      llvm-svn: 286671
      84ae943f
    • Sanjay Patel's avatar
      [InstCombine] clean up foldSelectOpOp(); NFC · cb2199b2
      Sanjay Patel authored
      llvm-svn: 286664
      cb2199b2
    • Anna Zaks's avatar
      [tsan][llvm] Implement the function attribute to disable TSan checking at run time · 3c437378
      Anna Zaks authored
      This implements a function annotation that disables TSan checking for the
      function at run time. The benefit over attribute((no_sanitize("thread")))
      is that the accesses within the callees will also be suppressed.
      
      The motivation for this attribute is a guarantee given by the objective C
      language that the calls to the reference count decrement and object
      deallocation will be synchronized. To model this properly, we would need
      to intercept all ref count decrement calls (which are very common in ObjC
      due to use of ARC) and also every single message send. Instead, we propose
      to just ignore all accesses made from within dealloc at run time. The main
      downside is that this still does not introduce any synchronization, which
      means we might still report false positives if the code that relies on this
      synchronization is not executed from within dealloc. However, we have not seen
      this in practice so far and think these cases will be very rare.
      
      Differential Revision: https://reviews.llvm.org/D25858
      
      llvm-svn: 286663
      3c437378
  9. Nov 11, 2016
    • Adam Nemet's avatar
      [LV] Stop saying "use -Rpass-analysis=loop-vectorize" · 9bfbf8bb
      Adam Nemet authored
      This is PR28376.
      
      Unfortunately given the current structure of optimization diagnostics we
      lack the capability to tell whether the user has
      passed -Rpass-analysis=loop-vectorize since this is local to the
      front-end (BackendConsumer::OptimizationRemarkHandler).
      
      So rather than printing this even if the user has already
      passed -Rpass-analysis, this patch just punts and stops recommending
      this option.  I don't think that getting this right is worth the
      complexity.
      
      Differential Revision: https://reviews.llvm.org/D26563
      
      llvm-svn: 286662
      9bfbf8bb
    • Erik Eckstein's avatar
      FunctionComparator: don't rely on argument evaluation order. · c1d52e5c
      Erik Eckstein authored
      This is a follow-up on the recent refactoring of the FunctionMerge pass.
      It should fix a fail of the new FunctionComparator unittest whe compiling with MSVC.
      
      llvm-svn: 286648
      c1d52e5c
Loading