1. Jun 26, 2022
    • Kazu Hirata's avatar
      Don't use Optional::hasValue (NFC) · aa8feeef
      Kazu Hirata authored
      aa8feeef
    • Kazu Hirata's avatar
    • Sunho Kim's avatar
      [ORC][LLJIT] Define atexit symbol in GenericLLVMIRPlatformSupport. · 7d101e43
      Sunho Kim authored
      Define atexit symbol in GenericLLVMIRPlatformSupport so that it doesn't need to be defined by user.
      
      On windows, llvm codegen emits atexit runtime calls to support global deinitializers as there is no lower function like cxa_atexit as in Itanium C++ ABI. ORC JIT user had to define custom atexit symbol manually. This was a hassle as it has to deal with dso_handle and cxa_atexit internals of LLJIT. If client didn't provide atexit definition, the default behaviour is just linking with host atexit function which is destined to fail as it calls dtors when the host program exits. This is after jit instances and buffers are freed, so users would see weird access violation exception from the uknown location. (in console application, the debugger thinks exception happened in scrt_common_main_seh)
      
      This is a hack that has some caveats. (e.g. memory address is not identical) But, it's better than the situation described in the above. Ultimately, we will move on to ORC runtime that is able to solve the memory address issue properly.
      
      Reviewed By: sgraenitz
      
      Differential Revision: https://reviews.llvm.org/D128037
      7d101e43
    • Philip Reames's avatar
      [RISCV] Implement getVScaleForTuning and thus prefer scalable vectorization when enabled · 9803b0d1
      Philip Reames authored
      LoopVectorizer uses getVScaleForTuning for deciding how to discount the cost of a potential vector factor by the amount of work performed. Without the callback implemented, the vectorizer was defaulting to an estimated vscale of 1. This results in fixed vectorization looking falsely profitable (since it used the command line VLEN).
      
      The test change is pretty limited since a) we don't have much coverage of the vectorizer with scalable vectors at all, and b) what little coverage we have mostly uses i64 element types. There's a separate issue with <vscale x 1 x i64> which prevents us from getting to this stage of costing, and thus only the one test explicitly written to avoid that is visible in the diff. However, this is actually a very wide impact change as it changes the practical vectorization result when both fixed and scalable is enabled to scalable.
      
      As an aside, I think the vectorizer is at little too strongly biased towards scalable when both are legal, but we can explore that separately. For now, let's just get the cost model working the way it was intended.
      
      Differential Revision: https://reviews.llvm.org/D128547
      9803b0d1
    • Kazu Hirata's avatar
      d152e50c
    • Philip Reames's avatar
      [BasicTTI] Account for vector of pointers in getMemoryOpCost · ab736a27
      Philip Reames authored
      By using getPrimitiveSizeInBits, we were getting 0 for every pointer type. This code is trying to account for the cost of truncating a store or extending a load to convert from the source vector element type to the legal vector element type.
      
      I'd originally seen this as a crash when trying to scalarize a <vscale x 1 x ptr> type coming from the vectorizer. Here's a minimum reproducer to exercise the code in question.
      
      void e(int *argv[], int *p) {
        for (int i = 0; i < 1024; i++)
          argv[i] = p;
      }
      
      This was checked in as the splat_ptr test in 2cf320d4. After bbf3fd, this no longer crashes since we correctly return invalid if the extending load/truncating store isn't legal.
      
      Differential Revision: https://reviews.llvm.org/D128228
      ab736a27
    • Philip Reames's avatar
      [RISCV] Make getMinRVVVectorSizeInBits and getMaxRVVVectorSizeInBits protected [nfc] · 767ba58f
      Philip Reames authored
      These are now only used in the implementation of getRealMinVLen and getRealMaxVLEn, and useRVVForFixedLengthVectors; make them protected to discourage new users.
      767ba58f
    • Casey Carter's avatar
      [libcxx][test] MaybePOCCAAllocator should meet the Cpp17Allocator requirements · c5ba46ea
      Casey Carter authored
      Implement `rebind`, the rebinding constructor, and rebind-compatible comparison operators.
      
      Differential Revision: https://reviews.llvm.org/D118279
      c5ba46ea
    • Guillaume Chatelet's avatar
      [NFC] Remove dead code · 1baf1fc2
      Guillaume Chatelet authored
      1baf1fc2
    • LLVM GN Syncbot's avatar
      [gn build] Port c92056d0 · 303b2146
      LLVM GN Syncbot authored
      303b2146
    • Corentin Jabot's avatar
      [Clang][C++23] P2071 Named universal character escapes · c92056d0
      Corentin Jabot authored
      Implements [[ https://wg21.link/p2071r1  | P2071 Named Universal Character Escapes ]] - as an extension in all language mode, the patch  not warn in c++23 mode will be done later once this paper is plenary approved (in July).
      
      We add
      
       * A code generator that transforms `UnicodeData.txt` and `NameAliases.txt` to a space efficient data structure that can be queried in `O(NameLength)`
       * A set of functions in `Unicode.h` to query that data, including
      
         * A function to find an exact match of a given Unicode character name
         * A function to perform a loose (ignoring case, space, underscore, medial hyphen) matching
         * A function returning the best matching codepoint for a given string per edit distance
      
       * Support of `\N{}` escape sequences in String and character Literals, with loose and typos diagnostics/fixits
       * Support of `\N{}` as UCN with loose matching diagnostics/fixits.
      
      Loose matching is considered an error to match closely the semantics of P2071.
      
      The generated data contributes to 280kB of data to the binaries.
      
      `UnicodeData.txt` and `NameAliases.txt`  are not committed to the repository in this patch, and regenerating the data is a manual process.
      
      Reviewed By: tahonermann
      
      Differential Revision: https://reviews.llvm.org/D123064
      c92056d0
    • Kazu Hirata's avatar
      [mlir] Fix a warning · f8c1c9af
      Kazu Hirata authored
      This patch fixes:
      
        llvm-project/mlir/lib/Dialect/Linalg/Transforms/SplitReduction.cpp:300:26:
        error: comparison of integers of different signs: 'int64_t' (aka
        'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
      f8c1c9af
    • Jacques Pienaar's avatar
      [mlir][shape] Switch types to ODS generated (NFC) · 701051a8
      Jacques Pienaar authored
      These were already pretty simple, so just switching to generated.
      701051a8
  2. Jun 25, 2022