1. Mar 10, 2022
  2. Mar 09, 2022
    • Pavel Labath's avatar
      49cffe3c
    • Andrzej Warzynski's avatar
      [flang][driver] Add support for -S and implement -c/-emit-obj · 38101b4e
      Andrzej Warzynski authored
      This patch adds support for:
        * `-S` in Flang's compiler and frontend drivers,
      and implements:
        * `-emit-obj` in Flang's frontend driver and `-c` in Flang's compiler
          driver (this is consistent with Clang).
      (these options were already available before, but only as placeholders).
      The semantics of these options in Clang and Flang are identical.
      
      The `EmitObjAction` frontend action is renamed as `BackendAction`. This
      new name more accurately reflects the fact that this action will
      primarily run the code-gen/backend pipeline in LLVM. It also makes more
      sense as an action implementing both `-emit-obj` and `-S` (originally,
      it was just `-emit-obj`).
      
      `tripleName` from FirContext.cpp is deleted and, when a target triple is
      required, `mlir::LLVM::LLVMDialect::getTargetTripleAttrName()` is used
      instead. In practice, this means that `fir.triple` is replaced with
      `llvm.target_triple`. The former was effectively ignored. The latter is
      used when lowering from the LLVM dialect in MLIR to LLVM IR (i.e. it's
      embedded in the generated LLVM IR module). The driver can then re-use
      it when configuring the backend. With this change, the LLVM IR files
      generated by e.g. `tco` will from now on contain the correct target
      triple.
      
      The code-gen.f90 test is replaced with code-gen-x86.f90 and
      code-gen-aarch64.f90. With 2 seperate files we can verify that
      `--target` is correctly taken into account. LIT configuration is updated
      to enable e.g.:
      ```
      ! REQUIRES: aarch64-registered-target
      ```
      
      Differential Revision: https://reviews.llvm.org/D120568
      38101b4e
    • Stanislav Gatev's avatar
      3dd7877b
    • Stanislav Gatev's avatar
      [clang][dataflow] Move dataflow testing support out of unittests · 26bbde26
      Stanislav Gatev authored
      This enables tests out of clang/unittests/Analysis/FlowSensitive to
      use the testing support utilities.
      
      Reviewed-by: ymandel, gribozavr2
      
      Differential Revision: https://reviews.llvm.org/D121285
      26bbde26
    • Thomas Preud'homme's avatar
      [MachinePipeliner] Fix isPseduo typo. · 67c14d5c
      Thomas Preud'homme authored
      67c14d5c
    • Aaron Ballman's avatar
      c233c1ac
    • Pavel Labath's avatar
      [lldb] Remove the global platform list · ffb9429b
      Pavel Labath authored
      This patch moves the platform creation and selection logic into the
      per-debugger platform lists. I've tried to keep functional changes to a
      minimum -- the main (only) observable difference in this change is that
      APIs, which select a platform by name (e.g.,
      Debugger::SetCurrentPlatform) will not automatically pick up a platform
      associated with another debugger (or no debugger at all).
      
      I've also added several tests for this functionality -- one of the
      pleasant consequences of the debugger isolation is that it is now
      possible to test the platform selection and creation logic.
      
      This is a product of the discussion at
      <https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>.
      
      Differential Revision: https://reviews.llvm.org/D120810
      ffb9429b
    • Louis Dionne's avatar
      [libc++] Don't manually override NDEBUG in the dylib build · 0f622bd2
      Louis Dionne authored
      LIBCXX_ENABLE_ASSERTIONS does not have any relationship to the `assert`
      macro -- it only controls assertions that are internal to the library.
      Playing around with `NDEBUG` only muddies the picture further than it
      already is.
      
      Also, remove a failing assertion in the benchmarks. That assertion had
      never been exercised because we defined `NDEBUG` manually, and it was
      failing since we introduced the ability to generate a benchmark vector
      with the Quicksort adversary ordering (which is obviously not sorted).
      
      This was split off of https://llvm.org/D121123.
      
      Differential Revision: https://reviews.llvm.org/D121244
      0f622bd2
    • Shraiysh Vaishay's avatar
      [mlir][OpenMP] Generating enums in accordance with the guidelines · 7c385c4b
      Shraiysh Vaishay authored
      This patch changes the enums generated from `OMP.td` for MLIR according
      to the enum naming guidelines in LLVM Coding Standards.
      
      This also helps the issues we had with `static` being a C++ keyword and
      also a value for the schedule clause.
      
      Enumerator naming guidelines: https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly
      
      Reviewed By: kiranchandramohan
      
      Differential Revision: https://reviews.llvm.org/D120825
      7c385c4b
    • Simon Pilgrim's avatar
      [X86] Add shift identity select tests · 36e4ad1e
      Simon Pilgrim authored
      Extension to D119654
      36e4ad1e
    • fourdim's avatar
      [JITLink][RISCV] Refactor range checking and alignment checking · 16dc90cb
      fourdim authored
      This patch refactors the range checking function to make it compatible with all relocation types and supports range checking for R_RISCV_BRANCH. Moreover, it refactors the alignment check functions.
      
      Reviewed By: StephenFan
      
      Differential Revision: https://reviews.llvm.org/D117946
      16dc90cb
    • Florian Hahn's avatar
      [PassManager] Another adjustment to account for different printing. · add0c585
      Florian Hahn authored
      On some system, there's extra `class` specifiers when printing pass
      manager types.
      add0c585
    • Timm Bäder's avatar
      [clang][sema] Enable first-class bool support for C2x · e5ccd668
      Timm Bäder authored
      Implement N2395 for C2x.
      
      This also covers adding "bool", which is part of N2394.
      
      Differential Revision: https://reviews.llvm.org/D120244
      e5ccd668
    • Dmitry Vassiliev's avatar
    • Nikita Popov's avatar
      [Coroutines] Avoid pointer element access for resume function type · e81f566d
      Nikita Popov authored
      For switch ABI, the function type is always "void (%frame*)", so
      just hardcode that rather than fetching it from a pointer element
      type.
      e81f566d
    • Pavel Labath's avatar
      [lldb] Don't print *trailing* nuls in char arrays · acf77bd2
      Pavel Labath authored
      Embedded nul characters are still printed, and they don't terminate the
      string. See also D111634.
      
      Differential Revision: https://reviews.llvm.org/D120803
      acf77bd2
    • Pavel Labath's avatar
      [lldb/driver] Fix SIGTSTP handling · 4bcadd66
      Pavel Labath authored
      Our SIGTSTP handler was working, but that was mostly accidental.
      
      The reason it worked is because lldb is multithreaded for most of its
      lifetime and the OS is reasonably fast at responding to signals. So,
      what happened was that the kill(SIGTSTP) which we sent from inside the
      handler was delivered to another thread while the handler was still set
      to SIG_DFL (which then correctly put the entire process to sleep).
      
      Sometimes it happened that the other thread got the second signal after
      the first thread had already restored the handler, in which case the
      signal handler would run again, and it would again attempt to send the
      SIGTSTP signal back to itself.
      
      Normally it didn't take many iterations for the signal to be delivered
      quickly enough. However, if you were unlucky (or were playing around
      with pexpect) you could get SIGTSTP while lldb was single-threaded, and
      in that case, lldb would go into an endless loop because the second
      SIGTSTP could only be handled on the main thread, and only after the
      handler for the first signal returned (and re-installed itself). In that
      situation the handler would keep re-sending the signal to itself.
      
      This patch fixes the issue by implementing the handler the way it
      supposed to be done:
      - before sending the second SIGTSTP, we unblock the signal (it gets
        automatically blocked upon entering the handler)
      - we use raise to send the signal, which makes sure it gets delivered to
        the thread which is running the handler
      
      This also means we don't need the SIGCONT handler, as our TSTP handler
      resumes right after the entire process is continued, and we can do the
      required work there.
      
      I also include a test case for the SIGTSTP flow. It uses pexpect, but it
      includes a couple of extra twists. Specifically, I needed to create an
      extra process on top of lldb, which will run lldb in a separate process
      group and simulate the role of the shell. This is needed because SIGTSTP
      is not effective on a session leader (the signal gets delivered, but it
      does not cause a stop) -- normally there isn't anyone to notice the
      stop.
      
      Differential Revision: https://reviews.llvm.org/D120320
      4bcadd66
    • Pavel Labath's avatar
      [lldb] Warn when we fail to find dwo/dwp files · 8f6ee17f
      Pavel Labath authored
      This ensures that the user is aware that many commands will not work
      correctly.
      
      We print the warning only once (per module) to avoid spamming the user
      with potentially thousands of error messages.
      
      Differential Revision: https://reviews.llvm.org/D120892
      8f6ee17f
    • Florian Hahn's avatar
      [PassManager] Adjust check lines to account for different printing. · 2c7afadb
      Florian Hahn authored
      Relax some checks to account for types being printed differently on
      different platforms, surfaced by different buildbots.
      2c7afadb
    • Florian Hahn's avatar
      [PassManager] Add pretty stack entries before P->run() call. · 128745cc
      Florian Hahn authored
      This patch adds PrettyStackEntries before running passes. The entries
      include the pass name and the IR unit the pass runs on.
      
      The information is used the print additional information when a pass
      crashes, including the name and a reference to the IR unit on which it
      crashed. This is similar to the behavior of the legacy pass manager.
      
      The improved stack trace now includes:
      
      Stack dump:
      0.	Program arguments: bin/opt -loop-vectorize -force-vector-width=4 crash.ll
      1.	Running pass 'ModuleToFunctionPassAdaptor' on module 'crash.ll'
      2.	Running pass 'LoopVectorizePass' on function '@a'
      
      Reviewed By: aeubanks
      
      Differential Revision: https://reviews.llvm.org/D120993
      128745cc