1. Jul 22, 2020
    • Hiroshi Yamauchi's avatar
    • Marco Vanotti's avatar
      [compiler-rt][asan] decommit shadow memory for unmaps in fuchsia. · db00fac2
      Marco Vanotti authored
      This CL allows asan allocator in fuchsia to decommit shadow memory
      for memory allocated using mmap.
      
      Big allocations in asan end up being allocated via `mmap` and freed with
      `munmap`. However, when that memory is freed, asan returns the
      corresponding shadow memory back to the OS via a call to
      `ReleaseMemoryPagesToOs`.
      
      In fuchsia, `ReleaseMemoryPagesToOs` is a no-op: to be able to free
      memory back to the OS, you have to hold a handle to the vmo you want to
      modify, which is tricky at the ReleaseMemoryPagesToOs level as that
      function is not exclusively used for shadow memory.
      
      The function `__sanitizer_fill_shadow` fills a given shadow memory range
      with a specific value, and if that value is 0 (unpoison) and the memory
      range is bigger than a threshold parameter, it will decommit that memory
      if it is all zeroes.
      
      This CL modifies the `FlushUnneededASanShadowMemory` function in
      `asan_poisoning.cpp` to add a call to `__sanitizer_fill_shadow` with
      value and threshold = 0. This way, all the unneeded shadow memory gets
      returned back to the OS.
      
      A test for this behavior can be found in fxrev.dev/391974
      
      Differential Revision: https://reviews.llvm.org/D80355
      
      Change-Id: Id6dd85693e78a222f0329d5b2201e0da753e01c0
      db00fac2
    • Andy Soffer's avatar
      [libTooling] In Clang Transformer, change `Metadata` field to deferred evaluation. · e5b3202b
      Andy Soffer authored
      `Metadata` is being changed from an `llvm::Any` to a `MatchConsumer<llvm::Any>`
      so that it's evaluation can be be dependent on on `MatchResult`s passed in.
      
      Reviewed By: ymandel, gribozavr2
      
      Differential Revision: https://reviews.llvm.org/D83820
      e5b3202b
    • Serge Pavlov's avatar
      ac0edc55
    • Jon Roelofs's avatar
      [compiler-rt][test][profile] Fix missing include · b9fc20eb
      Jon Roelofs authored
      ... on systems where wait() isn't one of the declarations transitively included
      via unistd.h (i.e. Darwin).
      
      Differential Revision: https://reviews.llvm.org/D84207
      b9fc20eb
    • aartbik's avatar
      [mlir] [VectorOps] Add scatter/gather operations to Vector dialect · 19dbb230
      aartbik authored
      Introduces the scatter/gather operations to the Vector dialect
      (important memory operations for sparse computations), together
      with a first reference implementation that lowers to the LLVM IR
      dialect to enable running on CPU (and other targets that support
      the corresponding LLVM IR intrinsics).
      
      The operations can be used directly where applicable, or can be used
      during progressively lowering to bring other memory operations closer to
      hardware ISA support for a gather/scatter. The semantics of the operation
      closely correspond to those of the corresponding llvm intrinsics.
      
      Note that the operation allows for a dynamic index vector (which is
      important for sparse computations). However, this first reference
      lowering implementation "serializes" the address computation when
      base + index_vector is converted to a vector of pointers. Exploring
      how to use SIMD properly during these step is TBD. More general
      memrefs and idiomatic versions of striding are also TBD.
      
      Reviewed By: arpith-jacob
      
      Differential Revision: https://reviews.llvm.org/D84039
      19dbb230
    • Stefan Pintilie's avatar
      [NFC][PowerPC] Updated a number of Power PC tests used for PC Relative · 0d3a5d09
      Stefan Pintilie authored
      Updated the tests to use -mcpu=pwr10 instead of -mcpu=future.
      Updated the tests to include Big Endian testing.
      0d3a5d09
    • Fangrui Song's avatar
      aa830e97
    • Jonas Devlieghere's avatar
      [lldb] Add missing member initialziation list · dd064afe
      Jonas Devlieghere authored
      My previous commit added the default arguments but didn't use them in
      the member initialization list...
      dd064afe
    • Raphael Isemann's avatar
      Revert "[lldb] Unify type name matching in FormattersContainer" · e031eda0
      Raphael Isemann authored
      This reverts commit 5b0de575.
      
      Apparently that caused some test to get stuck on Linuxx. Reverting for now.
      e031eda0
    • Nico Weber's avatar
      Build: Move TF source file inclusion from build system to source files · 4fe912f1
      Nico Weber authored
      Outside of compiler-rt (where it's arguably an anti-pattern too),
      LLVM tries to keep its build files as simple as possible. See e.g.
      llvm/docs/SupportLibrary.rst, "Code Organization".
      
      Differential Revision: https://reviews.llvm.org/D84243
      4fe912f1
    • Kevin P. Neal's avatar
    • Arthur Eubanks's avatar
      [NewPM] Support optnone under new pass manager · b13b8581
      Arthur Eubanks authored
      OptNoneInstrumentation is part of StandardInstrumentations. It skips
      functions (or loops) that are marked optnone.
      
      The feature of skipping optional passes for optnone functions under NPM
      is gated on a -enable-npm-optnone flag. Currently it is by default
      false. That is because we still need to mark all required passes to be
      required. Otherwise optnone functions will start having incorrect
      semantics.  After that is done in following changes, we can remove the
      flag and always enable this.
      
      Reviewed By: ychen
      
      Differential Revision: https://reviews.llvm.org/D83519
      b13b8581
    • Jonas Devlieghere's avatar
      [lldb] Change the CommandArgumentData ctor (NFC) · 98efa3d5
      Jonas Devlieghere authored
      By using default arguments the caller can specify a subset without the
      need for overloads. This is particularly useful in combination with
      emplace_back as these objects are generally stored in a vector.
      98efa3d5
    • Raphael Isemann's avatar
      [lldb] Unify type name matching in FormattersContainer · 5b0de575
      Raphael Isemann authored
      Summary:
      
      FormattersContainer stores LLDB's formatters. It's implemented as a templated
      map-like data structures that supports any kind of value type and only allows
      ConstString and RegularExpression as the key types. The keys are used for
      matching type names (e.g., the ConstString key `std::vector` matches the type
      with the same name while RegularExpression keys match any type where the
      RegularExpression instance matches).
      
      The fact that a single FormattersContainer can only match either by string
      comparison or regex matching (depending on the KeyType) causes us to always have
      two FormatterContainer instances in all the formatting code. This also leads to
      us having every type name matching logic in LLDB twice. For example,
      TypeCategory has to implement every method twice (one string matching one, one
      regex matching one).
      
      This patch changes FormattersContainer to instead have a single `TypeMatcher`
      key that wraps the logic for string-based and regex-based type matching and is
      now the only possible KeyType for the FormattersContainer. This means that a
      single FormattersContainer can now match types with both regex and string
      comparison.
      
      To summarize the changes in this patch:
      * Remove all the `*_Impl` methods from `FormattersContainer`
      * Instead call the FormatMap functions from `FormattersContainer` with a
        `TypeMatcher` type that does the respective matching.
      * Replace `ConstString` with `TypeMatcher` in the few places that directly
        interact with `FormattersContainer`.
      
      I'm working on some follow up patches that I split up because they deserve their
      own review:
      
      * Unify FormatMap and FormattersContainer (they are nearly identical now).
      * Delete the duplicated half of all the type matching code that can now use one
        interface.
      * Propagate TypeMatcher through all the formatter code interfaces instead of
        always offering two functions for everything.
      
      There is one ugly design part that I couldn't get rid of yet and that is that we
      have to support getting back the string used to construct a `TypeMatcher` later
      on. The reason for this is that LLDB only supports referencing existing type
      matchers by just typing their respective input string again (without even
      supplying if it's a regex or not).
      
      Reviewers: davide, mib
      
      Reviewed By: mib
      
      Subscribers: mgorny, JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D84151
      5b0de575
    • Jordan Rupprecht's avatar
      [NFC] Fix unused var warning · 1ee1da1e
      Jordan Rupprecht authored
      1ee1da1e
    • Jonas Devlieghere's avatar
    • Logan Smith's avatar
      [clang-tools-extra] Disable -Wsuggest-override for unittests/ · fa42b7cf
      Logan Smith authored
      This avoids massive warning spam due to the unit tests' use of gtest and gmock, which do not use the 'override' keyword in their sources.
      
      Differential Revision: https://reviews.llvm.org/D84213
      fa42b7cf
  2. Jul 21, 2020
  3. Jul 22, 2020
    • Jonas Devlieghere's avatar
      [lldb/Reproducers] Don't recursively record everything in the CWD · 9f8d481d
      Jonas Devlieghere authored
      RecordInterestingDirectory was added to collect dSYM bundles and their
      content. For the current working directory we only want the directory to
      be part of the VFS, not necessarily its contents. This patch renames the
      current method to RecordInterestingDirectoryRecursively and adds a new
      one that's not recursive.
      9f8d481d
  4. Jul 21, 2020