1. Dec 05, 2021
    • Peter Klausler's avatar
      [flang] Fix folding of EXPONENT() intrinsic function · e337dc8b
      Peter Klausler authored
      The definition of the EXPONENT() intrinsic function differs by one
      from the real arithmetic folding templates concept of an unbiased
      exponent, and also needs special handling for zero.  Fix, and add
      more tests.
      
      Differential Revision: https://reviews.llvm.org/D115084
      e337dc8b
    • Saleem Abdulrasool's avatar
      Windows: support `DoLoadImage` · f1585a4b
      Saleem Abdulrasool authored
      This implements `DoLoadImage` and `UnloadImage` in the Windows platform
      plugin modelled after the POSIX platform plugin.  This was previously
      unimplemented and resulted in a difficult to decipher error without any
      logging.
      
      This implementation is intended to support enables the use of LLDB's
      Swift REPL on Windows.
      
      Paths which are added to the library search path are persistent and
      applied to all subsequent loads.  This can be adjusted in the future by
      storing all the cookies and restoring the path prior to returning from
      the helper.  However, the dynamic path count makes this a bit more
      challenging.
      
      Reviewed By: @JDevlieghere
      Differential Revision: https://reviews.llvm.org/D77287
      f1585a4b
    • Dimitry Andric's avatar
      [XRay] fix more -Wformat warnings · bbba9d8c
      Dimitry Andric authored
      Building xray with recent clang on a 64-bit system results in a number
      of -Wformat warnings:
      
          compiler-rt/lib/xray/xray_allocator.h:70:11: warning: format specifies type 'int' but the argument has type '__sanitizer::uptr' (aka 'unsigned long') [-Wformat]
                    RoundedSize, B);
                    ^~~~~~~~~~~
          compiler-rt/lib/xray/xray_allocator.h:119:11: warning: format specifies type 'int' but the argument has type '__sanitizer::uptr' (aka 'unsigned long') [-Wformat]
                    RoundedSize, B);
                    ^~~~~~~~~~~
      
      Since `__sanitizer::uptr` has the same size as `size_t`, these can be
      fixed by using the printf specifier `%zu`.
      
          compiler-rt/lib/xray/xray_basic_logging.cpp:348:46: warning: format specifies type 'int' but the argument has type '__sanitizer::tid_t' (aka 'unsigned long long') [-Wformat]
                Report("Cleaned up log for TID: %d\n", GetTid());
                                                ~~     ^~~~~~~~
                                                %llu
          compiler-rt/lib/xray/xray_basic_logging.cpp:353:62: warning: format specifies type 'int' but the argument has type '__sanitizer::tid_t' (aka 'unsigned long long') [-Wformat]
                Report("Skipping buffer for TID: %d; Offset = %llu\n", GetTid(),
                                                 ~~                    ^~~~~~~~
                                                 %llu
      
      Since `__sanitizer::tid_t` is effectively declared as `unsigned long
      long`, these can be fixed by using the printf specifier `%llu`.
      
          compiler-rt/lib/xray/xray_basic_logging.cpp:354:14: warning: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                       TLD.BufferOffset);
                       ^~~~~~~~~~~~~~~~
      
      Since `BufferOffset` is declared as `size_t`, this one can be fixed by
      using `%zu` as a printf specifier.
      
          compiler-rt/lib/xray/xray_interface.cpp:172:50: warning: format specifies type 'int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Wformat]
              Report("Unsupported sled kind '%d' @%04x\n", Sled.Address, int(Sled.Kind));
                                             ~~            ^~~~~~~~~~~~
                                             %lu
      
      Since ``xray::SledEntry::Address` is declared as `uint64_t`, this one
      can be fixed by using `PRIu64`, and adding `<cinttypes>`.
      
          compiler-rt/lib/xray/xray_interface.cpp:308:62: warning: format specifies type 'long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
              Report("System page size is not a power of two: %lld\n", PageSize);
                                                              ~~~~     ^~~~~~~~
                                                              %zu
          compiler-rt/lib/xray/xray_interface.cpp:359:64: warning: format specifies type 'long long' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
              Report("Provided page size is not a power of two: %lld\n", PageSize);
                                                                ~~~~     ^~~~~~~~
                                                                %zu
      
      Since `PageSize` is declared as `size_t`, these can be fixed by using
      `%zu` as a printf specifier.
      
      Reviewed By: vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D114469
      bbba9d8c
    • Nikita Popov's avatar
      [llvm-c] Avoid deprecated APIs in tests · 573a9bc4
      Nikita Popov authored
      Avoid the use of deprecated (opaque pointer incompatible) APIs
      in C API tests, in preparation for header deprecation. Add a
      LLVMGetGEPSourceElementType() to cover a bit of functionality
      that is necessary for the echo test.
      
      This change is split out from https://reviews.llvm.org/D114936.
      573a9bc4
    • Kazu Hirata's avatar
      [CodeGen] Use range-based for loops (NFC) · ca2f5389
      Kazu Hirata authored
      ca2f5389
    • Nikita Popov's avatar
      [NewPM] Test more options in pipeline test (NFC) · 8bd62119
      Nikita Popov authored
      As suggested on D115098, this tests the positioning of
      HotColdSplitting, IROutliner and MergeFunctions in the optimization
      pipeline.
      8bd62119
    • Nikita Popov's avatar
      [NewPM] Fix MergeFunctions scheduling · ae7f4680
      Nikita Popov authored
      MergeFunctions (as well as HotColdSplitting an IROutliner) are
      incorrectly scheduled under the new pass manager. The code makes
      it look like they run towards the end of the module optimization
      pipeline (as they should), while in reality the run at the start.
      This is because the OptimizePM populated around them is only
      scheduled later.
      
      I'm fixing this by moving these three passes until after OptimizePM
      to avoid splitting the function pass pipeline. It doesn't seem
      important to me that some of the function passes run after these
      late module passes.
      
      Differential Revision: https://reviews.llvm.org/D115098
      ae7f4680
    • Matt Arsenault's avatar
      Attributor: Fix typo in function name · a25111c9
      Matt Arsenault authored
      a25111c9
    • Matt Arsenault's avatar
      OpenMP: Un-xfail tests that pass now · 90f914c8
      Matt Arsenault authored
      729bf9b2 should have fixed these
      90f914c8
    • Kristina Bessonova's avatar
      Revert "[DwarfDebug] Support emitting function-local declaration for a lexical block" · a9616048
      Kristina Bessonova authored
      This reverts commits
      * ee691970 (D113741),
      * 79d31329 (D114705)
      
      due to lldb and dexter test failures.
      a9616048
  2. Dec 04, 2021