1. Dec 24, 2021
  2. Dec 23, 2021
    • Craig Topper's avatar
      [RISCV] Support strict FP conversion operations. · b7b260e1
      Craig Topper authored
      This adds support for strict conversions between fp types and between
      integer and fp.
      
      NOTE: RISCV has static rounding mode instructions, but the constrainted
      intrinsic metadata is not used to select static rounding modes. Dynamic
      rounding mode is always used.
      
      Differential Revision: https://reviews.llvm.org/D115997
      b7b260e1
    • Alexandros Lamprineas's avatar
      [AArch64] Add a tablegen pattern for SQXTN2. · e70ef6d9
      Alexandros Lamprineas authored
      Converts concat_vectors(Vd, trunc(smin(smax Vm, -2^n), 2^n-1) to
      sqxtn2(Vd, Vm). Deliberately not handling v2i64 ~> v2i32 as the
      min/max nodes are not legal (same thing we did for the SQXTN
      patterns in https://reviews.llvm.org/D103263).
      
      Differential Revision: https://reviews.llvm.org/D116105
      e70ef6d9
    • Petar Avramovic's avatar
      AMDGPU/GlobalISel: Fix attempt to select non-legal instr in mir test · fd3cde60
      Petar Avramovic authored
      Delete inst-select-insert.xfail.mir.
      G_INSERT instructions in inst-select-insert.xfail.mir are no longer
      legal after D114198. This breaks build bots, since builds with
      LLVM_ENABLE_ASSERTIONS=Off don't check for legality and report cannot
      select while build with LLVM_ENABLE_ASSERTIONS=On reports instruction
      is not legal.
      fd3cde60
    • Anastasia Stulova's avatar
      [SPIR-V] Add a toolchain for SPIR-V in clang · 0045d01a
      Anastasia Stulova authored
      This patch adds a toolchain (TC) for SPIR-V along with the
      following changes in Driver and base ToolChain and Tool.
      This is required to provide a mechanism in clang to bypass
      SPIR-V backend in LLVM for SPIR-V until it lands in LLVM and
      matures.
      
      The SPIR-V code is generated by the SPIRV-LLVM translator tool
      named 'llvm-spirv' that is sought in 'PATH'.
      
      The compilation phases/actions should be bound for SPIR-V in
      the meantime as following:
      
          compile -> tools::Clang
          backend -> tools::SPIRV::Translator
          assemble -> tools::SPIRV::Translator
      
      However, Driver’s ToolSelector collapses compile-backend-assemble
      and compile-backend sequences to tools::Clang. To prevent this,
      added new {use,has}IntegratedBackend properties in ToolChain and
      Tool to which the ToolSelector reacts on, and which SPIR-V TC
      overrides.
      
      Linking of multiple input files is currently not supported but
      can be added separately.
      
      Differential Revision: https://reviews.llvm.org/D112410
      
      
      
      Co-authored-by: default avatarHenry Linjamäki <henry.linjamaki@parmance.com>
      0045d01a
    • Simon Pilgrim's avatar
      [X86][SSE] Add ISD::ROTR support · 71fc4bbd
      Simon Pilgrim authored
      Fix issue in TargetLowering::expandROT where we only attempt to flip a rotation if the other direction has better support - this matches TargetLowering::expandFunnelShift
      
      This allows us to enable ISD::ROTR lowering on SSE targets, which particularly simplifies/improves codegen for splat amount and AVX2 per-element shifts.
      71fc4bbd
    • Mehrnoosh Heidarpour's avatar
      [InstSimplify] Fold logic AND to zero · 0ff20f2f
      Mehrnoosh Heidarpour authored
      Adding following fold opportunity:
      ((A | B) ^ A) & ((A | B) ^ B) --> 0
      
      Reviewed By: spatel, rampitec
      
      Differential Revision: https://reviews.llvm.org/D115755
      0ff20f2f
    • Craig Topper's avatar
      [RISCV] Disable interleaving scalar loops in the loop vectorizer. · a9486a40
      Craig Topper authored
      The loop vectorizer can interleave scalar loops even if it doesn't
      vectorize them. I don't believe we intended to enable this when
      we enabled interleaving for vector instructions.
      
      Disable interleaving for VF=1 like X86 and AMDGPU already do. Test
      lifted from AMDGPU.
      
      Differential Revision: https://reviews.llvm.org/D115975
      a9486a40
    • Simon Pilgrim's avatar
      [X86] isVectorShiftByScalarCheap - vXi8... · a3f50fb0
      Simon Pilgrim authored
      [X86] isVectorShiftByScalarCheap - vXi8 select(shift(x,splat0),shift(x,splat1)) is better than shift(x,select(splat0,splat1))
      
      Even though we don't have vXi8 vector shifts (apart from XOP), it is still better to prefer shift (or funnel-shift/rotate) by scalar where possible.
      
      https://llvm.godbolt.org/z/6ss6ffTxv
      
      Differential Revision: https://reviews.llvm.org/D116191
      a3f50fb0
    • Nikita Popov's avatar
      [OpenMP] Remove no-op cast (NFC) · 7977fd7c
      Nikita Popov authored
      This was casting the address to its own element type, which is
      a no-op.
      7977fd7c
    • Nikita Popov's avatar
      [CodeGen] Use CreateConstInBoundsGEP() in one more place · bf2b5551
      Nikita Popov authored
      This does exactly what this code manually implemented.
      bf2b5551
    • Nikita Popov's avatar
      [CGBuilder] Add CreateGEP() overload that accepts an Address · 2c7dc131
      Nikita Popov authored
      Add an overload for an Address and a single non-constant offset.
      This makes it easier to preserve the element type and adjust the
      alignment appropriately.
      2c7dc131
    • Petar Avramovic's avatar
      [GlobalISel] Rework more/fewer elements for vectors · 29f88b93
      Petar Avramovic authored
      Artifact combiner is not able to access individual elements after using
      LCMTy style merge/unmerge, extract and insert to change vector number of
      elements (pad with undef or split to sub-vector instructions).
      Use unmerge to individual elements instead and then merge elements into
      requested types.
      Change argument lowering for vectors and moreElementsVector to use
      buildPadVectorWithUndefElements and buildDeleteTrailingVectorElements.
      FewerElementsVector had a few helpers that had different behavior,
      introduce new helper for most of the opcodes.
      FewerElementsVector helper is more flexible since it can create leftover
      instruction smaller then requested type (useful in case target wants to
      avoid pad with undef and use fewer registers). If target does not want
      leftover of different type it should call more elements first.
      Some helpers were performing more elements first to have split without
      leftover. Opcodes that used this helper use clampMaxNumElementsStrict
      (does more elements first) in LegalizerInfo to avoid test changes.
      Fixes failures caused by failing to combine artifacts created during
      more/fewer elements vector.
      
      Differential Revision: https://reviews.llvm.org/D114198
      29f88b93
    • Petar Avramovic's avatar
      GlobalISel: Regen vector mir tests, add tests for vector arg lowering · d2863088
      Petar Avramovic authored
      Precommit for D114198 (Rework more/fewer elements for vectors).
      Regenerate auto-generated mir tests for vectors (use CHECK-NEXT instead
      of CHECK). Remove -global-isel-abort=0 where it is no longer needed.
      Add mir tests for different AMDGPU sub-targets and they way they lower
      function vector arguments (tests for legalization artifact combiner).
      d2863088
    • Simon Moll's avatar
      [VE] Add manuals to CompilerWriterInfo · 3d36da77
      Simon Moll authored
      Reference VE manual and documentations in CompilerWriterInfo.
      
      Reviewed By: kaz7
      
      Differential Revision: https://reviews.llvm.org/D116212
      3d36da77