1. Mar 23, 2023
    • Jakub Kuderski's avatar
      [mlir][arith] Add `sitofp` support to WIE · abfc358c
      Jakub Kuderski authored
      This depends on the handling of `uitofp` in D146606.
      
      Reviewed By: antiagainst
      
      Differential Revision: https://reviews.llvm.org/D146597
      abfc358c
    • Jakub Kuderski's avatar
      [mlir][arith] Add `uitofp` support to WIE · 909e5ce4
      Jakub Kuderski authored
      This includes standard LIT tests and integration tests with the LLVM CPU
      runner.
      
      I plan to use this to implement `sitofp` in D146597.
      
      Reviewed By: antiagainst
      
      Differential Revision: https://reviews.llvm.org/D146606
      909e5ce4
    • MalavikaSamak's avatar
      [-Wunsafe-buffer-usage] Add Fixable for simple pointer dereference · e7596a99
      MalavikaSamak authored
      This patch introduces PointerDereferenceGadget, a FixableGadget that emits
      fixits to handle cases where a pointer that is identified as unsafe is
      dereferenced. The current implementation only handles cases where the strategy
      is to change the type of the raw pointer to std::span. The fixit for this
      strategy is to fetch the first element from the corresponding span instance.
      
      For example for the code below, the PointerDereferenceGadget emits a fixit for
      S3 (S1, S2 are to be handled by other gadgets):
      
        S1: int *ptr = new int[10];
        S2: int val1 = ptr[k]; // Unsafe operation
        S3: int val2 = *ptr; => Fixit: int val2 = ptr[0];
      
      Differential revision: https://reviews.llvm.org/D143206
      e7596a99
    • Peter Collingbourne's avatar
      libclang: Pass Clang install directory to driver via argv[0]. · 201fdef4
      Peter Collingbourne authored
      Various driver features, such as the sysroot path detection for Android
      targets, rely on being able to find the Clang install directory (look
      for callers of `getDriver().getInstalledDir()`). However, the install
      directory isn't currently being plumbed through to the driver, which is
      conventionally done via the argv[0] passed to the Driver constructor.
      
      It looks like D14695 attempted to fix this by adding another API that
      allows specifying the argv[0]. However, rather than requiring every
      user of libclang to switch to this API for correct behavior, let's have
      the other existing APIs work by default, by using the existing logic in
      libclang for finding the install directory.
      
      Differential Revision: https://reviews.llvm.org/D146497
      201fdef4
    • Teresa Johnson's avatar
      [MemProf] Context disambiguation cloning pass [patch 1b/3] · fe27495b
      Teresa Johnson authored
      Adds support for building the graph in ThinLTO from MemProf summaries.
      
      Follow-on patches will contain the support for cloning on the graph and
      in the IR.
      
      Depends on D140908.
      
      Differential Revision: https://reviews.llvm.org/D145836
      fe27495b
    • Chia-hung Duan's avatar
      [scudo] Early exit from the case can't do page release. · fb8d894f
      Chia-hung Duan authored
      There are heuristics to avoid marking blocks if there's little chance
      to release pages. So far, those logics only exist in block-marking
      section and we didn't leverage the results of those logics. For example,
      in a round of releaseToOS try, we know it's still 128 KB away from the
      release threshold. In the next round of releaseToOS, we can early exit
      if the number of pushed bytes is smaller than 128 KB without looping
      each memory group. This CL adds this heuristic and has reduced amount of
      time in checking the status of each memory group.
      
      This CL only applies this heuristic on SizeClassAllocator64.
      SizeClassAllocator32 has a smaller region/group size and has little
      impact on the default value.
      
      Reviewed By: cferris
      
      Differential Revision: https://reviews.llvm.org/D146312
      fb8d894f
    • Dave Lee's avatar
      4d18d97b
    • Nikolas Klauser's avatar
      [libc++] Remove __mutex_base header · 71a59584
      Nikolas Klauser authored
      This header should have been removed in
      https://reviews.llvm.org/D146228, but there was a merge conflict.
      71a59584
    • Mark de Wever's avatar
      [libc++] Qualifies intptr_t and uintptr_t. · d59a43fe
      Mark de Wever authored
      This has been done using the following command
      
        find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)(?<!::u)u?intptr_t)|\1std::\2|' \{} \;
      
      The std module doesn't export declarations in the global namespaace.
      This is a preparation for that module.
      
      Reviewed By: #libc, ldionne
      
      Differential Revision: https://reviews.llvm.org/D146643
      d59a43fe
    • Stefan Gränitz's avatar
      [JITLink] Deterministic JITDylib symbol table dumps · e7318679
      Stefan Gränitz authored
      Sort symbols before dumping so we get a deterministic order and can check them in tests.
      
      Reviewed By: lhames
      
      Differential Revision: https://reviews.llvm.org/D146658
      e7318679
    • Philip Reames's avatar
      [MSAN] Update vector load/store tests to use proper attribute · 473e9adb
      Philip Reames authored
      I had made a mistake when pre-committing the tests; caught in review of D146157.
      473e9adb
    • Ethan Luis McDonough's avatar
      Revert "[flang] Feature list plugin" due to failing build · 22293a3d
      Ethan Luis McDonough authored
      This reverts commit 823ddba1.
      22293a3d
    • Christopher Ferris's avatar
      [docs][scudo] Add information about M_PURGE_ALL. · 0433abc8
      Christopher Ferris authored
      Add information about M_PURGE_ALL
      
      Reviewed By: Chia-hungDuan
      
      Differential Revision: https://reviews.llvm.org/D146336
      0433abc8
    • Louis Dionne's avatar
      [libc++] Remove availability markup for std::format · 3d334df5
      Louis Dionne authored
      std::format is currently experimental, so there is technically no
      deployment target requirement for it (since the only symbols required
      for it are in `libc++experimental.a`).
      
      However, some parts of std::format depend indirectly on the floating
      point std::to_chars implementation, which does have deployment target
      requirements.
      
      This patch removes all the availability format for std::format and
      updates the XFAILs in the tests to properly explain why they fail
      on old deployment targets, when they do. It also changes a couple
      of tests to avoid depending on floating-point std::to_chars when
      it isn't fundamental to the test.
      
      Finally, some tests are marked as XFAIL but I added a comment saying
      
         TODO FMT This test should not require std::to_chars(floating-point)
      
      These tests do not fundamentally depend on floating-point std::to_chars,
      however they end up failing because calling std::format even without a
      floating-point argument to format will end up requiring floating-point
      std::to_chars. I believe this is an implementation artifact that could
      be avoided in all cases where we know the format string at compile-time.
      In the tests, I added the TODO comment only to the places where we could
      do better and actually avoid relying on floating-point std::to_chars
      because we know the format string at compile-time.
      
      Differential Revision: https://reviews.llvm.org/D134598
      3d334df5
    • Fangrui Song's avatar
    • Stefan Gränitz's avatar
      [JITLink] Introduce target flags for Symbol and prepare ObjectLinkingLayer to account for them · cf8dc9df
      Stefan Gränitz authored
      AArch32 branch offsets explicitly encode the target instruction subset (Arm/Thumb) in their least significant bit. We want this bit set (or clear) in addreses we hand out, but the addresses in the LinkGraph should be the real/physical addresses.
      
      This patch allows ELFLinkGraphBuilder's to set target-specific flags in jitlink::Symbol and prepares ObjectLinkingLayer to account for them.
      
      Reviewed By: lhames
      
      Differential Revision: https://reviews.llvm.org/D146641
      cf8dc9df
    • LLVM GN Syncbot's avatar
      [gn build] Port e655d8a5 · 587b3713
      LLVM GN Syncbot authored
      587b3713
    • Jeff Byrnes's avatar
      Precommit tests for D146327 · 08622314
      Jeff Byrnes authored
      08622314
    • Philip Reames's avatar
      [LFTR] Simplify integer case for genLoopLimit [nfc-ish] · 0766c1bd
      Philip Reames authored
      The integer case in genLoopLimit reduces down to a special case for narrowing the bitwidth of the limit, and then performing the same expansion we would for a pointer IV.
      
      Differential Revision: https://reviews.llvm.org/D146638
      0766c1bd
    • Nikolas Klauser's avatar
      [libc++] Granularize __mutex_base · e655d8a5
      Nikolas Klauser authored
      This also updates the moved code to the current style. (i.e. `_VSTD` -> `std`, `_LIBCPP_INLINE_VISIBILITY` -> `_LIBCPP_HIDE_FROM_ABI`, clang-format).
      
      Reviewed By: Mordante, #libc, EricWF
      
      Spies: arichardson, libcxx-commits, mikhail.ramalho
      
      Differential Revision: https://reviews.llvm.org/D146228
      e655d8a5
    • Philip Reames's avatar
      [SCEV] Infer no-self-wrap via constant ranges · 6afcc54a
      Philip Reames authored
      Without this, pointer IVs in loops with small constant trip counts couldn't be proven no-self-wrap. This came up in a new LSR transform, but may also benefit other SCEV consumers as well.
      
      Differential Revision: https://reviews.llvm.org/D146596
      6afcc54a
    • Carlos Galvez's avatar
      [clang-tidy][NFC] Move avoid-underscore-in-googletest-name to google folder · 7e5c48b8
      Carlos Galvez authored
      Since the check belongs to the google module, it makes sense
      that the corresponding test also belongs to the google module.
      
      Differential Revision: https://reviews.llvm.org/D146653
      7e5c48b8
    • Jay Foad's avatar
      [CodeGen] Fix type of MachineRegisterInfo::RegAllocHints. NFC. · eac8e25e
      Jay Foad authored
      The first member of the pair should be unsigned instead of Register
      because it is the hint type, 0 for simple (target independent) hints and
      other values for target dependent hints.
      
      Differential Revision: https://reviews.llvm.org/D146646
      eac8e25e
    • Fangrui Song's avatar
    • Jorge Gorbe Moya's avatar
      [lldb] Update some uses of Python2 API in typemaps. · 984354fb
      Jorge Gorbe Moya authored
      Python 3 doesn't have a distinction between PyInt and PyLong, it's all
      PyLong now.
      
      This also fixes a bug in SetNumberFromObject. This used to crash LLDB:
      ```
      lldb -o "script data=lldb.SBData(); data.SetDataFromUInt64Array([2**63])"
      ```
      
      The problem happened in the PyInt path:
      ```
        if (PyInt_Check(obj))
            number = static_cast<T>(PyInt_AsLong(obj));
      ```
      when obj doesn't fit in a signed long, `PyInt_AsLong` would fail with
      "OverflowError: Python int too large to convert to C long".
      
      The existing long path does the right thing, as it will call
      `PyLong_AsUnsignedLongLong` for uint64_t.
      
      Differential Revision: https://reviews.llvm.org/D146590
      984354fb
    • Emilia Dreamer's avatar
      [clang-format] Annotate noexcept, explicit specifiers as containing expressions · ead96446
      Emilia Dreamer authored
      The noexcept specifier and explicit specifier can optionally include a
      boolean expression to make these specifiers apply conditionally,
      however, clang-format didn't set the context for the parenthesized
      content of these specifiers, meaning they inherited the parent context,
      which usually isn't an expressions, leading to misannotated binary
      operators.
      
      This patch applies expression context to the content of these
      specifiers, making them similar to the static_assert keyword.
      
      Fixes https://github.com/llvm/llvm-project/issues/44543
      
      Reviewed By: owenpan, MyDeveloperDay
      
      Differential Revision: https://reviews.llvm.org/D146284
      ead96446
    • Saleem Abdulrasool's avatar
      SymbolFile: ensure that we have a value before invoking `getBitWidth` · 16b7cf24
      Saleem Abdulrasool authored
      Ensure that the variant returned by `member->getValue()` has a value and
      is not `Empty`.  Failure to do so will trigger an assertion failure in
      `llvm::pdb::Variant::getBitWidth()`.  This can occur when the `static`
      member is a forward declaration.
      
      Differential Revision: https://reviews.llvm.org/D146536
      Reviewed By: sgraenitz
      16b7cf24
    • Julian Lettner's avatar
      [TSan] Avoid deadlock between ReportRace() and dlopen() interceptor · 24e3102e
      Julian Lettner authored
      This change prevents rare deadlocks observed for specific macOS/iOS GUI
      applications which issue many `dlopen()` calls from multiple different
      threads at startup and where TSan finds and reports a race during
      startup.  Providing a reliable test for this has been deemed infeasible.
      
      Although I've only observed this deadlock on Apple platforms,
      conceptually the cause is not confined to Apple code so the fix lives in
      platform-independent code.
      
      Deadlock scenario:
      ```
      Thread 2                    | Thread 4
      ReportRace()                |
      Lock internal TSan mutexes  |
        &ctx->slot_mtx            |
                                  | dlopen() interceptor
                                  | OnLibraryLoaded()
                                  | MemoryMappingLayout::DumpListOfModules()
                                  | calls dyld API, which takes internal lock
                                  | lock() interceptor
                                  | TSan tries to take internal mutexes again
                                  |   &ctx->slot_mtx
      call into symbolizer        |
      MemoryMappingLayout::DumpListOfModules()
      calls dyld API, which hangs on trying to take lock
      ```
      Resulting in:
      * Thread 2 has internal TSan mutex, blocked on dyld lock
      * Thread 4 has dyld lock, blocked on internal TSan mutex
      
      The fix prevents this situation by not intercepting any of the calls
      originating from `MemoryMappingLayout::DumpListOfModules()`.
      
      Stack traces for deadlock between ReportRace() and dlopen() interceptor:
      ```
      thread #2, queue = 'com.apple.root.default-qos'
        frame #0: libsystem_kernel.dylib
        frame #1: libclang_rt.tsan_osx_dynamic.dylib`::wrap_os_unfair_lock_lock_with_options(lock=<unavailable>, options=<unavailable>) at tsan_interceptors_mac.cpp:306:3
        frame #2: dyld`dyld4::RuntimeLocks::withLoadersReadLock(this=0x000000016f21b1e0, work=0x00000001814523c0) block_pointer) at DyldRuntimeState.cpp:227:28
        frame #3: dyld`dyld4::APIs::_dyld_get_image_header(this=0x0000000101012a20, imageIndex=614) at DyldAPIs.cpp:240:11
        frame #4: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::CurrentImageHeader(this=<unavailable>) at sanitizer_procmaps_mac.cpp:391:35
        frame #5: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::Next(this=0x000000016f2a2800, segment=0x000000016f2a2738) at sanitizer_procmaps_mac.cpp:397:51
        frame #6: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::DumpListOfModules(this=0x000000016f2a2800, modules=0x00000001011000a0) at sanitizer_procmaps_mac.cpp:460:10
        frame #7: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::ListOfModules::init(this=0x00000001011000a0) at sanitizer_mac.cpp:610:18
        frame #8: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Symbolizer::FindModuleForAddress(unsigned long) [inlined] __sanitizer::Symbolizer::RefreshModules(this=0x0000000101100078) at sanitizer_symbolizer_libcdep.cpp:185:12
        frame #9: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Symbolizer::FindModuleForAddress(this=0x0000000101100078, address=6465454512) at sanitizer_symbolizer_libcdep.cpp:204:5
        frame #10: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Symbolizer::SymbolizePC(this=0x0000000101100078, addr=6465454512) at sanitizer_symbolizer_libcdep.cpp:88:15
        frame #11: libclang_rt.tsan_osx_dynamic.dylib`__tsan::SymbolizeCode(addr=6465454512) at tsan_symbolize.cpp:106:35
        frame #12: libclang_rt.tsan_osx_dynamic.dylib`__tsan::SymbolizeStack(trace=StackTrace @ 0x0000600002d66d00) at tsan_rtl_report.cpp:112:28
        frame #13: libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedReportBase::AddMemoryAccess(this=0x000000016f2a2a90, addr=4381057136, external_tag=<unavailable>, s=<unavailable>, tid=<unavailable>, stack=<unavailable>, mset=0x00000001012fc310) at tsan_rtl_report.cpp:190:16
        frame #14: libclang_rt.tsan_osx_dynamic.dylib`__tsan::ReportRace(thr=0x00000001012fc000, shadow_mem=0x000008020a4340e0, cur=<unavailable>, old=<unavailable>, typ0=1) at tsan_rtl_report.cpp:795:9
        frame #15: libclang_rt.tsan_osx_dynamic.dylib`__tsan::DoReportRace(thr=0x00000001012fc000, shadow_mem=0x000008020a4340e0, cur=Shadow @ x22, old=Shadow @ 0x0000600002d6b4f0, typ=1) at tsan_rtl_access.cpp:166:3
        frame #16: libclang_rt.tsan_osx_dynamic.dylib`::__tsan_read8(void *) at tsan_rtl_access.cpp:220:5
        frame #17: libclang_rt.tsan_osx_dynamic.dylib`::__tsan_read8(void *) [inlined] __tsan::MemoryAccess(thr=0x00000001012fc000, pc=<unavailable>, addr=<unavailable>, size=8, typ=1) at tsan_rtl_access.cpp:442:3
        frame #18: libclang_rt.tsan_osx_dynamic.dylib`::__tsan_read8(addr=<unavailable>) at tsan_interface.inc:34:3
        <call into TSan from from instrumented code>
      
      thread #4, queue = 'com.apple.dock.fullscreen'
        frame #0:  libsystem_kernel.dylib
        frame #1:  libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::FutexWait(p=<unavailable>, cmp=<unavailable>) at sanitizer_mac.cpp:540:3
        frame #2:  libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Semaphore::Wait(this=<unavailable>) at sanitizer_mutex.cpp:35:7
        frame #3:  libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::Mutex::Lock(this=0x0000000102992a80) at sanitizer_mutex.h:196:18
        frame #4:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() [inlined] __sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock(this=<unavailable>, mu=0x0000000102992a80) at sanitizer_mutex.h:383:10
        frame #5:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() [inlined] __sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock(this=<unavailable>, mu=0x0000000102992a80) at sanitizer_mutex.h:382:77
        frame #6:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() at tsan_rtl.h:708:10
        frame #7:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() [inlined] __tsan::TryTraceFunc(thr=0x000000010f084000, pc=0) at tsan_rtl.h:751:7
        frame #8:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor() [inlined] __tsan::FuncExit(thr=0x000000010f084000) at tsan_rtl.h:798:7
        frame #9:  libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor(this=0x000000016f3ba280) at tsan_interceptors_posix.cpp:300:5
        frame #10: libclang_rt.tsan_osx_dynamic.dylib`__tsan::ScopedInterceptor::~ScopedInterceptor(this=<unavailable>) at tsan_interceptors_posix.cpp:293:41
        frame #11: libclang_rt.tsan_osx_dynamic.dylib`::wrap_os_unfair_lock_lock_with_options(lock=0x000000016f21b1e8, options=OS_UNFAIR_LOCK_NONE) at tsan_interceptors_mac.cpp:310:1
        frame #12: dyld`dyld4::RuntimeLocks::withLoadersReadLock(this=0x000000016f21b1e0, work=0x00000001814525d4) block_pointer) at DyldRuntimeState.cpp:227:28
        frame #13: dyld`dyld4::APIs::_dyld_get_image_vmaddr_slide(this=0x0000000101012a20, imageIndex=412) at DyldAPIs.cpp:273:11
        frame #14: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::Next(__sanitizer::MemoryMappedSegment*) at sanitizer_procmaps_mac.cpp:286:17
        frame #15: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::Next(this=0x000000016f3ba560, segment=0x000000016f3ba498) at sanitizer_procmaps_mac.cpp:432:15
        frame #16: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::MemoryMappingLayout::DumpListOfModules(this=0x000000016f3ba560, modules=0x000000016f3ba618) at sanitizer_procmaps_mac.cpp:460:10
        frame #17: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::ListOfModules::init(this=0x000000016f3ba618) at sanitizer_mac.cpp:610:18
        frame #18: libclang_rt.tsan_osx_dynamic.dylib`__sanitizer::LibIgnore::OnLibraryLoaded(this=0x0000000101f3aa40, name="<some library>") at sanitizer_libignore.cpp:54:11
        frame #19: libclang_rt.tsan_osx_dynamic.dylib`::wrap_dlopen(filename="<some library>", flag=<unavailable>) at sanitizer_common_interceptors.inc:6466:3
        <library code>
      ```
      
      rdar://106766395
      
      Differential Revision: https://reviews.llvm.org/D146593
      24e3102e
    • Heejin Ahn's avatar
      Revert "Remove the LINK_COMPONENTS entry from lldb-instr CMakery" · c4125a37
      Heejin Ahn authored
      This reverts commit e12a950d.
      
      D142241 broke `-sBUILD_SHARED_LIBS=ON` build. After investigations in
      https://github.com/llvm/llvm-project/issues/60314, the issue that
      prompted D142441 now seems gone.
      
      Fixes https://github.com/llvm/llvm-project/issues/60314.
      
      Reviewed By: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D145181
      c4125a37
    • Craig Topper's avatar
      [RISCV] Remove AnyReg RegisterClass used by .insn instructions. Use custom operand instead. · 84de0190
      Craig Topper authored
      The fake register class interferes too much with the autogenerated
      register class tables. Especially the fake spill size.
      
      I'm working on .insn support for compressed instructions and adding
      AnyRegC broke CodeGen.
      84de0190
    • Petr Hosek's avatar
      [CMake] Build runtimes for riscv64-unknown-fuchsia · 77044a47
      Petr Hosek authored
      This is necessary to have a complete RISC-V toolchain for Fuchsia.
      
      Differential Revision: https://reviews.llvm.org/D146608
      77044a47
    • LLVM GN Syncbot's avatar
      [gn build] Port 700cd990 · 96449fa5
      LLVM GN Syncbot authored
      96449fa5
    • Teresa Johnson's avatar
      Restore "[MemProf] Context disambiguation cloning pass [patch 1a/3]" · 700cd990
      Teresa Johnson authored
      This restores commit d6ad4f01, which was
      reverted in commit 883dbb9c, along with
      a fix for gcc 12.2 build errors in the original commit.
      
      Support for building, printing, and displaying CallsiteContextGraph
      which represents the MemProf metadata contexts. Uses CRTP to enable
      support for both IR (regular LTO) and summary (ThinLTO). This patch
      includes the support for building it in regular LTO mode (from
      memprof and callsite metadata), and the next patch will add the
      handling for building it from ThinLTO summaries.
      
      Also includes support for dumping the graph to text and to dot files.
      
      Follow-on patches will contain the support for cloning on the graph and
      in the IR.
      
      The graph represents the call contexts in all memprof metadata on
      allocation calls, with nodes for the allocations themselves, as well as
      for the calls in each context. The graph is initially built from the
      allocation memprof metadata (or summary) MIBs. It is then updated to
      match calls with callsite metadata onto the nodes, updating it to
      reflect any inlining performed on those calls.
      
      Each MIB (representing an allocation's call context with allocation
      behavior) is assigned a unique context id during the graph build. The
      edges and nodes in the graph are decorated with the context ids they
      carry. This is used to correctly update the graph when cloning is
      performed so that we can uniquify the context for a single (possibly
      cloned) allocation.
      
      Differential Revision: https://reviews.llvm.org/D140908
      700cd990
    • Craig Topper's avatar
      [RISCV] Add FallbackRegAltNameIndex to ABIRegAltName. · a67e989c
      Craig Topper authored
      Remove now redundant fake ABI names from vector registers.
      
      This also fixes a crash that occurs if you use fflags as an instruction
      operand in the assembly and use -debug. It's not a valid register
      for any instruction since this wouldn't be common. It doesn't have
      an ABI name so it crashes the register printing in the debug output.
      a67e989c
    • Craig Topper's avatar
      [RISCV] Convert segment registers to VR registers in RISCVMCInstLower. · 164b046e
      Craig Topper authored
      Similar to what we do for the LMUL>1 register classes. The printing
      is only working today because the segment registers have "ABI" names
      set to their base register name.
      164b046e
    • Luke Hutton's avatar
      [mlir][tosa] Canonicalize concatenate->slice sequence · 9e3ca798
      Luke Hutton authored
      
      
      Adds a canonicalizer for the concatenate->slice sequence where
      an output of slice can be replaced with an input of concatenate.
      
      This is useful in the context of operations with complex inputs
      and outputs that are legalized from a framework such as TFL.
      For example, a TFL graph (FFT->FFT) will be legalized to the
      following TOSA graph:
      
           <complex input>
               /     \
           slice    slice
               \     /
                 FFT
                /   \     -+
             concatenate   |
               /     \     |  Redundant
           slice    slice  |
               \     /    -+
                 FFT
               /     \
             concatenate
                  |
           <complex output>
      
      Concatenate and slice operations at the boundaries of the graph are
      useful as they maintain the correct correspondance of input/output
      tensors to the original TFL graph. However, consecutive
      complex operations will result in redundant concatenate->slice
      sequences which should be removed from the final TOSA graph.
      
      The canonicalization does not currently handle dynamic types.
      
      Signed-off-by: default avatarLuke Hutton <luke.hutton@arm.com>
      
      Reviewed By: rsuderman
      
      Differential Revision: https://reviews.llvm.org/D144545
      9e3ca798
    • Craig Topper's avatar
      [Constant] Inline ConstantInt::getSigned · 83e420c6
      Craig Topper authored
      ConstantInt::getSigned calls ConstantInt::get with the IsSigned flag set to true.
      That flag normally defaults to false.
      
      For always signed constants the code base is not consistent about whether
      it uses ConstantInt::getSigned or ConstantInt::get with IsSigned set to true.
      And it's not clear how to decide which way to use.
      
      By making getSigned inline, both ways should generate the same code in
      the end.
      
      Reviewed By: nikic
      
      Differential Revision: https://reviews.llvm.org/D146598
      83e420c6
    • Benjamin Maxwell's avatar
      [DebugInfo] Allow parsing line tables aligned to 4 or 8-byte boundaries · 8eb464f5
      Benjamin Maxwell authored
      This allows the DWARFDebugLine::SectionParser to try parsing line tables
      at 4 or 8-byte boundaries if the unaligned offset appears invalid. If
      aligning the offset does not reduce errors the offset is used unchanged.
      
      This is needed for llvm-dwarfdump to be able to extract the line tables
      (with --debug-lines) from binaries produced by certain compilers that
      like to align each line table in the .debug_line section. Note that this
      alignment does not seem to be invalid since the units do point to the
      correct line table offsets via the DW_AT_stmt_list attribute.
      
      Differential Revision: https://reviews.llvm.org/D143513
      8eb464f5
    • Thomas Lively's avatar
      [WebAssembly] Fix epilogue insertion for indirect tail calls · dd0bbae5
      Thomas Lively authored
      Previously epilogues were incorrectly inserted after indirect tail calls because
      they did not have the `isTerminator` property. Add that property and test that
      they get correct epilogues. To be safe, also add other properties that were
      defined for direct tail calls.
      
      Differential Revision: https://reviews.llvm.org/D146569
      dd0bbae5
    • Mark de Wever's avatar
      [libc++] Qualifies ptrdiff_t and max_align_t. · d8681356
      Mark de Wever authored
      This has been done using the following commands
        find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)ptrdiff_t)|\1std::\2|' \{} \;
        find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)max_align_t)|\1std::\2|' \{} \;
      
      The std module doesn't export declarations in the global namespaace.,
      This is a preparation for that module.
      
      Reviewed By: #libc, ldionne
      
      Differential Revision: https://reviews.llvm.org/D146550
      d8681356