1. Sep 03, 2021
  2. Sep 02, 2021
    • Craig Topper's avatar
      [RISCV] Add Zba command line to rv64i-exhaustive-w-insts.ll · 498e8ae4
      Craig Topper authored
      Zba adds a zext.w pseudoinstruction using ADDUW. This can simplify
      the generated code for many of these tests.
      
      There are at least 2 suboptimal cases in this config that I've marked
      with TODOs.
      498e8ae4
    • Craig Topper's avatar
      [RISCV] Remove stale TODOs from test. NFC · eaa56058
      Craig Topper authored
      These were fixed by D106230.
      eaa56058
    • Nico Weber's avatar
      Try to unbreak lldb build after 97351982 · 7f544f76
      Nico Weber authored
      7f544f76
    • Wenlei He's avatar
      [CSSPGO] Honor preinliner decision for ThinLTO importing · a2768b47
      Wenlei He authored
      When pre-inliner decision is used for CSSPGO, we should take that into account for ThinLTO importing as well, so post-link sample loader inliner can favor that decision. This is handled by a small tweak in this patch. It also includes a change to transfer preinliner decision when merging context.
      
      Differential Revision: https://reviews.llvm.org/D109088
      a2768b47
    • Kristóf Umann's avatar
      Revert "[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check... · 3891b45a
      Kristóf Umann authored
      Revert "[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it"
      
      This reverts commit 7d0e62bf.
      3891b45a
    • Ivan Zhechev's avatar
      [flang] Fix non-deterministic line output function · e962718d
      Ivan Zhechev authored
      The evaluation order for the `|` operator is undefined
      (in contrast to the short-circuiting `||` operator). The arguments are
      stored in variables to force a specific evaluation order.
      
      A test in D107575 relies on this change.
      
      Reviewed By: kiranchandramohan, klausler
      
      Differential Revision: https://reviews.llvm.org/D108623
      e962718d
    • Bradley Smith's avatar
      [AArch64][SVE] Workaround incorrect types when lowering fixed length gather/scatter · 14e1a4a6
      Bradley Smith authored
      When lowering a fixed length gather/scatter the index type is assumed to
      be the same as the memory type, this is incorrect in cases where the
      extension of the index has been folded into the addressing mode.
      
      For now add a temporary workaround to fix the codegen faults caused by
      this by preventing the removal of this extension. At a later date the
      lowering for SVE gather/scatters will be redesigned to improve the way
      addressing modes are handled.
      
      As a short term side effect of this change, the addressing modes
      generated for fixed length gather/scatters will not be optimal.
      
      Differential Revision: https://reviews.llvm.org/D109145
      14e1a4a6
    • Jinsong Ji's avatar
      3fd27ec7
    • Kristóf Umann's avatar
      [analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire... · 7d0e62bf
      Kristóf Umann authored
      [analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it
      
      D105553 added NoStateChangeFuncVisitor, an abstract class to aid in creating
      notes such as "Returning without writing to 'x'", or "Returning without changing
      the ownership status of allocated memory". Its clients need to define, among
      other things, what a change of state is.
      
      For code like this:
      
      f() {
        g();
      }
      
      foo() {
        f();
        h();
      }
      
      We'd have a path in the ExplodedGraph that looks like this:
      
                   -- <g> -->
                  /          \
               ---     <f>    -------->        --- <h> --->
              /                        \      /            \
      --------        <foo>             ------    <foo>     -->
      
      When we're interested in whether f neglected to change some property,
      NoStateChangeFuncVisitor asks these questions:
      
                             ÷×~
                      -- <g> -->
                 ß   /          \$    @&#*
                  ---     <f>    -------->        --- <h> --->
                 /                        \      /            \
         --------        <foo>             ------    <foo>     -->
      
      Has anything changed in between # and *?
      Has anything changed in between & and *?
      Has anything changed in between @ and *?
      ...
      Has anything changed in between $ and *?
      Has anything changed in between × and ~?
      Has anything changed in between ÷ and ~?
      ...
      Has anything changed in between ß and *?
      ...
      This is a rather thorough line of questioning, which is why in D105819, I was
      only interested in whether state *right before* and *right after* a function
      call changed, and early returned to the CallEnter location:
      
      if (!CurrN->getLocationAs<CallEnter>())
        return;
      Except that I made a typo, and forgot to negate the condition. So, in this
      patch, I'm fixing that, and under the same hood allow all clients to decide to
      do this whole-function check instead of the thorough one.
      
      Differential Revision: https://reviews.llvm.org/D108695
      7d0e62bf
    • Craig Topper's avatar
      [RISCV] Teach instruction selection to elide sext.w in some cases. · b5fd6b46
      Craig Topper authored
      If a sext_inreg is up for isel, and all its users are W instructions,
      we can skip emitting the sext_inreg. This helpful if the producing
      instruction can't become a W instruction.
      
      Reviewed By: asb
      
      Differential Revision: https://reviews.llvm.org/D108966
      b5fd6b46
    • Evandro Menezes's avatar
      [RISCV] Enable shrink wrap by default · 5ebdb07e
      Evandro Menezes authored
      Differential Revision: https://reviews.llvm.org/D109037
      5ebdb07e
    • Craig Topper's avatar
      [RISCV] Split PseudoVSETVLI into 2 instructions to allow different register classes for rs1. · e4e69ba4
      Craig Topper authored
      X0 has special meaning for vsetvli, we need to make sure we never
      create it a vsetvli that uses it by accident. This could happen
      if the register coalescer coalesces a copy from X0 into this
      instruction.
      
      This patch splits the instruction so that we can have GPRNoX0
      register class to use for the cases where we don't want the source
      to be X0. The verifier won't let us explicitly use X0 on a GPRNoX0
      operand so we need a separate pseudo for those cases.
      
      I don't currently have a failing example for this. There was a
      failure in D107957, but the coalescable copy from that example
      should have been optimized away much earlier so I've fixed that.
      
      This is not a complete fix. We still need to prevent the same
      possible issue on the AVL operand of all of the vector instruction
      pseudos. I don't want to make two versions of all of those so we
      need to find a different solution for those. I have an idea I'm
      going to try.
      
      Differential Revision: https://reviews.llvm.org/D109110
      e4e69ba4
    • Nico Weber's avatar
      [clang-cl] Emit nicer warning on unknown /arch: arguments · 97351982
      Nico Weber authored
      Now prints the list of known archs. This requires plumbing a Driver
      arg through a few functions.
      
      Also add two more convenience insert() overlods to StringMap.
      
      Differential Revision: https://reviews.llvm.org/D109105
      97351982
    • Kiran Chandramohan's avatar
      [MLIR][OpenMP] Add support for declaring critical construct names · 711aa357
      Kiran Chandramohan authored
      Add an operation omp.critical.declare to declare names/symbols of
      critical sections. Named omp.critical operations should use symbols
      declared by omp.critical.declare. Having a declare operation ensures
      that the names of critical sections are global and unique. In the
      lowering flow to LLVM IR, the OpenMP IRBuilder creates unique names
      for critical sections.
      
      Reviewed By: ftynse, jeanPerier
      
      Differential Revision: https://reviews.llvm.org/D108713
      711aa357
    • Piotr Sobczak's avatar
      [AMDGPU] Add merging into S_BUFFER_LOAD_DWORDX8_IMM · 30d6c39b
      Piotr Sobczak authored
      Extend SILoadStoreOptimizer to merge into DWORDX8 variant of S_BUFFER_LOAD.
      
      Merging into DWORDX2 and DWORDX4 variants is handled already.
      
      Differential Revision: https://reviews.llvm.org/D108909
      30d6c39b
    • Marius Brehler's avatar
      [mlir] Add Cpp emitter · 2f0750dd
      Marius Brehler authored
      This upstreams the Cpp emitter, initially presented with [1], from [2]
      to MLIR core. Together with the previously upstreamed EmitC dialect [3],
      the target allows to translate MLIR to C/C++.
      
      [1] https://reviews.llvm.org/D76571
      [2] https://github.com/iml130/mlir-emitc
      [3] https://reviews.llvm.org/D103969
      
      
      
      Co-authored-by: default avatarJacques Pienaar <jpienaar@google.com>
      Co-authored-by: default avatarSimon Camphausen <simon.camphausen@iml.fraunhofer.de>
      Co-authored-by: default avatarOliver Scherf <oliver.scherf@iml.fraunhofer.de>
      
      Reviewed By: jpienaar
      
      Differential Revision: https://reviews.llvm.org/D104632
      2f0750dd
    • Alex Zinenko's avatar
      [mlir] support translating OpenMP loops with reductions · 8647e4c3
      Alex Zinenko authored
      Use the recently introduced OpenMPIRBuilder facility to transate OpenMP
      workshare loops with reductions to LLVM IR calling OpenMP runtime. Most of the
      heavy lifting is done at the OpenMPIRBuilder. When other OpenMP dialect
      constructs grow support for reductions, the translation can be updated to
      operate on, e.g., an operation interface for all reduction containers instead
      of workshare loops specifically. Designing such a generic translation for the
      single operation that currently supports reductions is premature since we don't
      know how the reduction modeling itself will be generalized.
      
      Reviewed By: kiranchandramohan
      
      Differential Revision: https://reviews.llvm.org/D107343
      8647e4c3
    • Raphael Isemann's avatar
      Revert "[lldb server] Tidy up LLDB server return codes and associated tests" · bbcb4d6b
      Raphael Isemann authored
      This reverts commit e387c8c4. The
      TestErrorMessages.test is failing on the Linux bots.
      bbcb4d6b
    • David Green's avatar
      [ARM] Add a tail-predication loop predicate register · 9cb8f4d1
      David Green authored
      The semantics of tail predication loops means that the value of LR as an
      instruction is executed determines the predicate. In other words:
      
      mov r3, #3
      DLSTP lr, r3        // Start tail predication, lr==3
      VADD.s32 q0, q1, q2 // Lanes 0,1 and 2 are updated in q0.
      mov lr, #1
      VADD.s32 q0, q1, q2 // Only first lane is updated.
      
      This means that the value of lr cannot be spilled and re-used in tail
      predication regions without potentially altering the behaviour of the
      program. More lanes than required could be stored, for example, and in
      the case of a gather those lanes might not have been setup, leading to
      alignment exceptions.
      
      This patch adds a new lr predicate operand to MVE instructions in order
      to keep a reference to the lr that they use as a tail predicate. It will
      usually hold the zeroreg meaning not predicated, being set to the LR phi
      value in the MVETPAndVPTOptimisationsPass. This will prevent it from
      being spilled anywhere that it needs to be used.
      
      A lot of tests needed updating.
      
      Differential Revision: https://reviews.llvm.org/D107638
      9cb8f4d1
    • Jan Svoboda's avatar
      [clang] NFC: Extract DiagnosticOptions parsing · 555a817d
      Jan Svoboda authored
      The way we parse `DiagnosticOptions` is a bit involved.
      
      `DiagnosticOptions` are parsed as part of the cc1-parsing function `CompilerInvocation::CreateFromArgs` which takes `DiagnosticsEngine` as an argument to be able to report errors in command-line arguments. But to create `DiagnosticsEngine`, `DiagnosticOptions` are needed. This is solved by exposing the `ParseDiagnosticArgs` to clients and making its `DiagnosticsEngine` argument optional, essentially breaking the dependency cycle.
      
      The `ParseDiagnosticArgs` function takes `llvm::opt::ArgList &`, which each client needs to create from the command-line (typically represented as `std::vector<const char *>`). Creating this data structure in this context is somewhat particular. This code pattern is copy-pasted in some places across the upstream code base and also in downstream repos. To make things a bit more uniform, this patch extracts the code into a new reusable function: `CreateAndPopulateDiagOpts`.
      
      Reviewed By: dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D108918
      555a817d
    • Roman Lebedev's avatar
      Revert @llvm.isnan intrinsic patchset. · 3f1f08f0
      Roman Lebedev authored
      Please refer to
      https://lists.llvm.org/pipermail/llvm-dev/2021-September/152440.html
      (and that whole thread.)
      
      TLDR: the original patch had no prior RFC, yet it had some changes that
      really need a proper RFC discussion. It won't be productive to discuss
      such an RFC, once it's actually posted, while said patch is already
      committed, because that introduces bias towards already-committed stuff,
      and the tree is potentially in broken state meanwhile.
      
      While the end result of discussion may lead back to the current design,
      it may also not lead to the current design.
      
      Therefore i take it upon myself
      to revert the tree back to last known good state.
      
      This reverts commit 4c4093e6.
      This reverts commit 0a2b1ba3.
      This reverts commit d9873711.
      This reverts commit 791006fb.
      This reverts commit c22b64ef.
      This reverts commit 72ebcd31.
      This reverts commit 5fa6039a.
      This reverts commit 9efda541.
      This reverts commit 94d3ff09.
      3f1f08f0
    • Cullen Rhodes's avatar
      [clang] NFC: Remove duplicate DependentSizedMatrixType methods · 9722e8ff
      Cullen Rhodes authored
      Inherited from MatrixType.
      
      Reviewed By: fhahn
      
      Differential Revision: https://reviews.llvm.org/D109137
      9722e8ff
    • Michał Górny's avatar
      [lldb] [client] Implement follow-fork-mode · 4a2a9473
      Michał Górny authored
      Implement a new target.process.follow-fork-mode setting to control
      LLDB's behavior on fork.  If set to 'parent', the forked child is
      detached and parent continues being traced.  If set to 'child',
      the parent is detached and child becomes traced instead.
      
      Differential Revision: https://reviews.llvm.org/D100503
      4a2a9473
    • Jon Chesterfield's avatar
      [libomptarget][amdgpu] Drop env variables · 3153bdd5
      Jon Chesterfield authored
      Use the same debug print as the rest of libomptarget plugins with
      the same environment control. Also drop the max queue size debugging hook as
      I don't believe it is still in use, can bring it back near the rest of the env
      handling in rtl.cpp if someone objects.
      
      That makes most of rt.h and all of utils.cpp unused. Clean that up and simplify
      control flow in a couple of places.
      
      Behaviour change is that debug prints that used to use the old environment
      variable now use the new one and print in slightly different format, and the
      removal of the max queue size variable.
      
      Reviewed By: pdhaliwal
      
      Differential Revision: https://reviews.llvm.org/D108784
      3153bdd5
    • Simon Pilgrim's avatar
      [X86] Fold PMADD(x,0) or PMADD(0,x) -> 0 · b0acd6c3
      Simon Pilgrim authored
      Pulled out of D108522 - handle zero-operand cases for PMADDWD/VPMADDUBSW ops
      b0acd6c3
    • Simon Pilgrim's avatar
      [X86][SSE] Add combine-pmadd.ll for PMADDWD/VPMADDUBSW combines · a84c0841
      Simon Pilgrim authored
      Pre-commit for D108522 to show failure to fold multiply by zero operands
      a84c0841
    • Daniel Kiss's avatar
      [libunwind] Compile with -Wunused-but-set-variable · d212bdf8
      Daniel Kiss authored
      -Wunused-but-set-variable triggers a warning even the block of code is effectively dead.
      
      Reviewed By: MaskRay
      
      Differential Revision: https://reviews.llvm.org/D107835
      d212bdf8
    • Roman Lebedev's avatar
      Revert "[OpenMP][OpenMPIRBuilder] Implement loop unrolling." · 50634dea
      Roman Lebedev authored
      Breaks build with -DBUILD_SHARED_LIBS=ON
      ```
      CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
        "LLVMFrontendOpenMP" of type SHARED_LIBRARY
          depends on "LLVMPasses" (weak)
        "LLVMipo" of type SHARED_LIBRARY
          depends on "LLVMFrontendOpenMP" (weak)
        "LLVMCoroutines" of type SHARED_LIBRARY
          depends on "LLVMipo" (weak)
        "LLVMPasses" of type SHARED_LIBRARY
          depends on "LLVMCoroutines" (weak)
          depends on "LLVMipo" (weak)
      At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies are allowed only among static libraries.
      CMake Generate step failed.  Build files cannot be regenerated correctly.
      ```
      
      This reverts commit 707ce34b.
      50634dea