1. Nov 24, 2022
    • Fangrui Song's avatar
      [modules] Support zstd in .pcm file · fa7bc386
      Fangrui Song authored
      Extend SM_SLOC_BUFFER_BLOB_COMPRESSED to allow zstd, which is much faster
      (compression/decompression) than zlib with a similar compression ratio.
      
      An alternative is to add a value beside SM_SLOC_BUFFER_BLOB_COMPRESSED, but
      reusing SM_SLOC_BUFFER_BLOB_COMPRESSED slightly simplifies the implementation
      and leads to better diagnostics when a slightly older Clang consumes zstd
      compressed blob.
      
      Compressing AST takes a small portion of WriteAST, so we can pick a higher
      compression level.
      
      Compiling a relatively large .pcm (absl endian) with -fmodules-embed-all-files,
      zstd level 9 has comparable performance with zlib-chromium level 6 (default),
      but provides smaller output (5809156 => 5796016). Higher zstd levels will make
      "Compress AST" notably slower and do not provide significant more size saving.
      
      ```
      2.219345 Total ExecuteCompiler
      0.746799 Total Frontend
      0.736862 Total Source
      0.339434 Total ReadAST
      0.165452 Total WriteAST
      0.043045 Total Compress AST
      0.008236 Total ParseClass
      0.00633 Total InstantiateClass
      0.001887 Total isPotentialConstantExpr
      0.001808 Total InstantiateFunction
      0.001535 Total EvaluateForOverflow
      0.000986 Total EvaluateAsRValue
      0.000536 Total EvaluateAsBooleanCondition
      0.000308 Total EvaluateAsConstantExpr
      0.000156 Total EvaluateAsInt
      3.4e-05 Total EvaluateKnownConstInt
      8e-06 Total EvaluateAsInitializer
      0 Total PerformPendingInstantiations
      ```
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D137885
      fa7bc386
    • Luca Boasso's avatar
      [mlir][index] Add and, or, and xor ops · 4f9c9295
      Luca Boasso authored
      This patch adds the and, or, and xor bitwise operations to
      the index dialects with folders and LLVM lowerings.
      
      Reviewed By: rriddle
      
      Differential Revision: https://reviews.llvm.org/D138590
      4f9c9295
    • Snehasish Kumar's avatar
      [memprof] Fix RAII usage of SpinMutexLock, remove unused headers. · cf5c5372
      Snehasish Kumar authored
      For the RAII lock usage we need to create a local var. There were some headers which clang-tidy identified as unused.
      
      Reviewed By: tejohnson
      
      Differential Revision: https://reviews.llvm.org/D138593
      cf5c5372
    • Uday Bondhugula's avatar
      [MLIR] Fix bug in simplify affine map with operands · e3b02be5
      Uday Bondhugula authored
      Fix bug in simplify affine map with operands utility; the wrong LHS and
      RHS were being used in some cases post simplification. While on this,
      also handle a corner case of undefined expressions.
      
      Differential Revision: https://reviews.llvm.org/D138584
      e3b02be5
    • Hanhan Wang's avatar
      [mlir][linalg] Add a new pattern to handle folding unit reduction dims. · 6eee66d1
      Hanhan Wang authored
      The output operands will be added to input operands if the generic op (on tensors)
      becomes an elementwise operation. The outputs of the generic op is still the same.
      They will be cleaned up by ReplaceWithEmptyTensorIfUnused pattern.
      
      Reviewed By: mravishankar
      
      Differential Revision: https://reviews.llvm.org/D138251
      6eee66d1
    • Alexey Kreshchuk's avatar
      Do not suggest taking the address of a const pointer to get void* · 2cea4c23
      Alexey Kreshchuk authored
      It's more likely the user needs a const cast, but probably not sure
      enough that we should suggest that either - so err on the side of
      caution and offer no suggestion.
      
      Fixes pr58958
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D138426
      2cea4c23
    • Alexander Belyaev's avatar
      f286af29
    • Greg Clayton's avatar
      Add the ability to see when a type in incomplete. · d941fcec
      Greg Clayton authored
      -flimit-debug-info and other compiler options might end up removing debug info that is needed for debugging. LLDB marks these types as being forcefully completed in the metadata in the TypeSystem. These types should have been complete in the debug info but were not because the compiler omitted them to save space. When we can't find a suitable replacement for the type, we should let the user know that these types are incomplete to indicate there was an issue instead of just showing nothing for a type.
      
      The solution is to display presented in this patch is to display "<incomplete type>" as the summary for any incomplete types. If there is a summary string or function that is provided for a type, but the type is currently forcefully completed, the installed summary will be ignored and we will display "<incomplete type>". This patch also exposes the ability to ask a SBType if it was forcefully completed with:
      
        bool SBType::IsTypeForcefullyCompleted();
      
      This will allow the user interface for a debugger to also detect this issue and possibly mark the variable display up on some way to indicate to the user the type is incomplete.
      
      To show how this is diplayed, we can look at the existing output first for the example source file from the file: lldb/test/API/functionalities/limit-debug-info/main.cpp
      
      (lldb) frame variable inherits_from_one inherits_from_two one_as_member two_as_member array_of_one array_of_two shadowed_one
      (InheritsFromOne) ::inherits_from_one = (member = 47)
      (InheritsFromTwo) ::inherits_from_two = (member = 47)
      (OneAsMember) ::one_as_member = (one = member::One @ 0x0000000100008028, member = 47)
      (TwoAsMember) ::two_as_member = (two = member::Two @ 0x0000000100008040, member = 47)
      (array::One [3]) ::array_of_one = ([0] = array::One @ 0x0000000100008068, [1] = array::One @ 0x0000000100008069, [2] = array::One @ 0x000000010000806a)
      (array::Two [3]) ::array_of_two = ([0] = array::Two @ 0x0000000100008098, [1] = array::Two @ 0x0000000100008099, [2] = array::Two @ 0x000000010000809a)
      (ShadowedOne) ::shadowed_one = (member = 47)
      (lldb) frame variable --show-types inherits_from_one inherits_from_two one_as_member two_as_member array_of_one array_of_two shadowed_one
      (InheritsFromOne) ::inherits_from_one = {
        (int) member = 47
      }
      (InheritsFromTwo) ::inherits_from_two = {
        (int) member = 47
      }
      (OneAsMember) ::one_as_member = {
        (member::One) one = {}
        (int) member = 47
      }
      (TwoAsMember) ::two_as_member = {
        (member::Two) two = {}
        (int) member = 47
      }
      (array::One [3]) ::array_of_one = {
        (array::One) [0] = {}
        (array::One) [1] = {}
        (array::One) [2] = {}
      }
      (array::Two [3]) ::array_of_two = {
        (array::Two) [0] = {}
        (array::Two) [1] = {}
        (array::Two) [2] = {}
      }
      (ShadowedOne) ::shadowed_one = {
        (int) member = 47
      }
      
      With this patch in place we can now see any classes that were forcefully completed to let us know that we are missing information:
      
      (lldb) frame variable inherits_from_one inherits_from_two one_as_member two_as_member array_of_one array_of_two shadowed_one
      (InheritsFromOne) ::inherits_from_one = (One = <incomplete type>, member = 47)
      (InheritsFromTwo) ::inherits_from_two = (Two = <incomplete type>, member = 47)
      (OneAsMember) ::one_as_member = (one = <incomplete type>, member = 47)
      (TwoAsMember) ::two_as_member = (two = <incomplete type>, member = 47)
      (array::One[3]) ::array_of_one = ([0] = <incomplete type>, [1] = <incomplete type>, [2] = <incomplete type>)
      (array::Two[3]) ::array_of_two = ([0] = <incomplete type>, [1] = <incomplete type>, [2] = <incomplete type>)
      (ShadowedOne) ::shadowed_one = (func_shadow::One = <incomplete type>, member = 47)
      (lldb) frame variable --show-types inherits_from_one inherits_from_two one_as_member two_as_member array_of_one array_of_two shadowed_one
      (InheritsFromOne) ::inherits_from_one = {
        (One) One = <incomplete type> {}
        (int) member = 47
      }
      (InheritsFromTwo) ::inherits_from_two = {
        (Two) Two = <incomplete type> {}
        (int) member = 47
      }
      (OneAsMember) ::one_as_member = {
        (member::One) one = <incomplete type> {}
        (int) member = 47
      }
      (TwoAsMember) ::two_as_member = {
        (member::Two) two = <incomplete type> {}
        (int) member = 47
      }
      (array::One[3]) ::array_of_one = {
        (array::One) [0] = <incomplete type> {}
        (array::One) [1] = <incomplete type> {}
        (array::One) [2] = <incomplete type> {}
      }
      (array::Two[3]) ::array_of_two = {
        (array::Two) [0] = <incomplete type> {}
        (array::Two) [1] = <incomplete type> {}
        (array::Two) [2] = <incomplete type> {}
      }
      (ShadowedOne) ::shadowed_one = {
        (func_shadow::One) func_shadow::One = <incomplete type> {}
        (int) member = 47
      }
      
      Differential Revision: https://reviews.llvm.org/D138259
      d941fcec
    • Paulo Matos's avatar
      [WebAssembly] Remove unnecessary GEP insts from table tests · bab98395
      Paulo Matos authored
      Removes the unnecessary GEP instructions from WebAssembly Table tests.
      
      Differential Revision: https://reviews.llvm.org/D138569
      bab98395
    • Matt Arsenault's avatar
      CloneModule: Handling cloning ifuncs · f0693277
      Matt Arsenault authored
      This is tested in a future llvm-reduce patch.
      f0693277
  2. Nov 23, 2022