1. Feb 08, 2022
    • Nathan Sidwell's avatar
      [demangler][NFC] Utility header cleanups · f0ef708d
      Nathan Sidwell authored
      a) Using a do...while loop in the number formatter means we do not
      have to special case zero.
      
      b) Let's use 'if (auto size = ...) {}' for appending to the output
      buffer.
      
      c) We should also be using memcpy there, not memmove -- the string
      being appended is never part of the current buffer.
      
      d) Let's put all the operator<< functions together.
      
      e) I find 'if (cond) frob(..., true) ; elseOD frob(..., false)'
      somewhat confusing.  Let's just use std::abs in the signed integer
      printer and let CSE decide about the duplicate < 0 testing.
      
      f) Let's have as many as possible return *this.  That's both more
      consistent, and allows tailcalls in some cases (the actual number
      formatter has a local array though).
      
      These changes removed around 100 bytes from the demangler's
      instructions on x86_64.
      
      Reviewed By: ChuanqiXu
      
      Differential Revision: https://reviews.llvm.org/D119176
      f0ef708d
    • Nikita Popov's avatar
      [OpenCL] Mark kernel arguments as ABI aligned · 18834dca
      Nikita Popov authored
      Following the discussion on D118229, this marks all pointer-typed
      kernel arguments as having ABI alignment, per section 6.3.5 of
      the OpenCL spec:
      
      > For arguments to a __kernel function declared to be a pointer to
      > a data type, the OpenCL compiler can assume that the pointee is
      > always appropriately aligned as required by the data type.
      
      Differential Revision: https://reviews.llvm.org/D118894
      18834dca
    • Nikita Popov's avatar
      [AMDGPURewriteOutArguments] Don't use pointer element type · 99702734
      Nikita Popov authored
      Instead of using the pointer element type, look at how the pointer
      is actually being used in store instructions, while looking through
      bitcasts. This makes the transform compatible with opaque pointers
      and a bit more general.
      
      It's worth noting that I have dropped the 3-vector to 4-vector
      shufflevector special case, because this is now handled in a
      different way: If the value is actually used as a 4-vector, then
      we're directly going to use that type, instead of shuffling to a
      3-vector in between.
      
      Differential Revision: https://reviews.llvm.org/D119237
      99702734
    • Simon Pilgrim's avatar
      [X86] selectLEAAddr - relax heuristic to only require one operand to be a... · 0b00cd19
      Simon Pilgrim authored
      [X86] selectLEAAddr - relax heuristic to only require one operand to be a MathWithFlags op (PR46809)
      
      As suggested by @craig.topper, relaxing LEA matching to only require the ADD to be fed from a single op with EFLAGS helps avoid duplication when the EFLAGS are consumed in a later, dependent instruction.
      
      There was some concern about whether the heuristic is too simple, not taking into account lost loads that can't fold by using a LEA, but some basic tests (included in select-lea.ll) don't suggest that's really a problem.
      
      Differential Revision: https://reviews.llvm.org/D118128
      0b00cd19
    • serge-sans-paille's avatar
      Cleanup LLVMDebugInfoCodeView headers · 81cde474
      serge-sans-paille authored
      Major user-facing changes:
      
      Many headers in llvm/DebugInfo/CodeView no longer include
      llvm/Support/BinaryStreamReader.h or llvm/Support/BinaryStreamWriter.h,
      those headers may need to be included manually.
      
      Several headers in llvm/DebugInfo/CodeView no longer include
      llvm/DebugInfo/CodeView/EnumTables.h or llvm/DebugInfo/CodeView/CodeView.h,
      those headers may need to be included manually.
      
      Some statistics:
      $ clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/DebugInfo/CodeView/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l
      after:  2794466
      before: 2832765
      
      Discourse thread on the topic: https://discourse.llvm.org/t/include-what-you-use-include-cleanup/
      
      Differential Revision: https://reviews.llvm.org/D119092
      81cde474
    • Simon Pilgrim's avatar
      [X86] Remove __builtin_ia32_padd/psub saturated intrinsics and use generic... · 09857a4b
      Simon Pilgrim authored
      [X86] Remove __builtin_ia32_padd/psub saturated intrinsics and use generic __builtin_elementwise_add/sub_sat
      
      D117898 added the generic __builtin_elementwise_add_sat and __builtin_elementwise_sub_sat with the same integer behaviour as the SSE/AVX instructions
      
      This patch removes the __builtin_ia32_padd/psub saturated intrinsics and just uses the generics - the existing tests see no changes:
      
      __m256i test_mm256_adds_epi8(__m256i a, __m256i b) {
        // CHECK-LABEL: test_mm256_adds_epi8
        // CHECK: call <32 x i8> @llvm.sadd.sat.v32i8(<32 x i8> %{{.*}}, <32 x i8> %{{.*}})
        return _mm256_adds_epi8(a, b);
      }
      09857a4b
    • Nikita Popov's avatar
      [AutoUpgrade] Also upgrade intrinsics in invokes · 8398e61f
      Nikita Popov authored
      We currently don't have any specialized upgrades for intrinsics
      that can be used in invokes, but they can still be subject to
      a generic remangling upgrade. In particular, this happens when
      upgrading statepoint intrinsics under -opaque-pointers.
      
      This patch just changes the upgrade code to work on CallBase
      instead of CallInst in particular.
      8398e61f
    • Joseph Huber's avatar
      [OpenMP] Enable new driver tests for AMDGPU · f8ffac59
      Joseph Huber authored
      This patch enables running the new driver tests for AMDGPU. Previously
      this was disabled because some tests failed. This was only because the
      new driver tests hadn't been listed as unsupported or expected to fail.
      
      Reviewed By: JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D119240
      f8ffac59
    • Sanjay Patel's avatar
      [SDAG] move x86 select-with-identity-constant fold behind a target hook; NFC · a68e0980
      Sanjay Patel authored
      This is no-functional-change-intended because only the
      x86 target enables the TLI hook currently.
      
      We can add fmul/fdiv opcodes to the switch similar to the
      proposal D119111, but we don't need to make other changes
      like enabling target-specific combines.
      
      We can also add integer opcodes (add, or, shl, etc.) to
      the switch because this function is called from all of the
      generic binary opcodes.
      
      The goal is to incrementally enable the profitable diffs
      from D90113 while avoiding regressions.
      
      Differential Revision: https://reviews.llvm.org/D119150
      a68e0980
    • Roman Lebedev's avatar
      [SimplifyCFG] 'merge compatible invokes': support normal destination w/ uses · 42ca7cc8
      Roman Lebedev authored
      If the original invokes had uses, the uses must have been in PHI's,
      but that immediately results in the incoming values being incompatible.
      But we'll replace uses of the original invokes with the use of the
      merged invoke, so as long as the incoming values become compatible
      after that, we can merge.
      42ca7cc8
    • Roman Lebedev's avatar
      [SimplifyCFG] 'merge compatible invokes': support normal destination w/ PHIs but no uses · 9986d602
      Roman Lebedev authored
      As long as the incoming values for all the invokes in the set
      are identical, we can merge the invokes.
      9986d602
    • Roman Lebedev's avatar
      [SimplifyCFG] 'merge compatible invokes': support normal destination w/ no uses, no PHI's · 8411560f
      Roman Lebedev authored
      Even if the invokes have normal destination, iff it's the same block,
      we can merge them. For now, require that there are no PHI nodes,
      and the returned values of invokes aren't used.
      8411560f
    • Roman Lebedev's avatar
    • Simon Pilgrim's avatar
      Revert rG6c174ab2 "[X86] Remove... · a59faf27
      Simon Pilgrim authored
      Revert rG6c174ab2 "[X86] Remove __builtin_ia32_padd/psub saturated intrinsics and use generic __builtin_elementwise_add/sub_sat"
      
      Missed some legacy builtin tests that need cleaning up first
      a59faf27
    • Sheng's avatar
      [GlobalISel] Add big endian support in CallLowering · 76c83e74
      Sheng authored
      When splitting values, CallLowering assumes Lo part goes first. But in big endian ISA such as M68k, Hi part goes first.
      
      This patch fixes this.
      
      Differential Revision: https://reviews.llvm.org/D116877
      76c83e74
    • Nathan Sidwell's avatar
      [demangler] Improve ->* & .* demangling · 28669bd0
      Nathan Sidwell authored
      The demangler treats ->* as a BinaryExpr, but .* as a MemberExpr.
      That's inconsistent.  This makes the former a MemberExpr too.
      However, in order to not regress the paren output, MemberExpr::print
      is modified to parenthesize the MemberExpr if the operator ends with
      '*'.  Printing is affected thusly:
      
      Before:
          obj.member
          obj->member
          obj.*member
          (obj) ->* (member)
      
      After:
         obj.member   # Unchanged
         obj->member  # Unchanged
         obj.*(member)  # Added paren member operand
         obj->*(member) # Removed paren on object operand, less whitespace
      
      The right solution to the paren problem is to add some notion of
      precedence (and associativity) to Nodes, but that's a larger change
      that would become simpler once the refactoring I'm doing is completed.
      
      FWIW, binutils' demangler's paren algorithm has a small idea of
      precedence, and will generally not emit parens when the operand is
      unary.
      
      Reviewed By: bruno
      
      Differential Revision: https://reviews.llvm.org/D118486
      28669bd0
    • Simon Pilgrim's avatar
      [X86] Remove __builtin_ia32_padd/psub saturated intrinsics and use generic... · 6c174ab2
      Simon Pilgrim authored
      [X86] Remove __builtin_ia32_padd/psub saturated intrinsics and use generic __builtin_elementwise_add/sub_sat
      
      D117898 added the generic __builtin_elementwise_add_sat and __builtin_elementwise_sub_sat with the same integer behaviour as the SSE/AVX instructions
      
      This patch removes the __builtin_ia32_padd/psub saturated intrinsics and just uses the generics - the existing tests see no changes:
      
      __m256i test_mm256_adds_epi8(__m256i a, __m256i b) {
        // CHECK-LABEL: test_mm256_adds_epi8
        // CHECK: call <32 x i8> @llvm.sadd.sat.v32i8(<32 x i8> %{{.*}}, <32 x i8> %{{.*}})
        return _mm256_adds_epi8(a, b);
      }
      6c174ab2
    • Nikita Popov's avatar
      [AArch64TargetTransformInfo] Avoid pointer element type access · 3196ef8e
      Nikita Popov authored
      Use the element type of the gathered/scattered vector instead.
      3196ef8e
    • Simon Pilgrim's avatar
      d1d7188b
    • Corentin Jabot's avatar
      Add core papers adopted at the february plenary. · 3c17f395
      Corentin Jabot authored
      2 papers are added to the status page, one targeting
      C++23, the other added to the batch of C++20 concept papers.
      3c17f395
    • Nikita Popov's avatar
      [AsmPrinter] Avoid pointer element type access · 924696d2
      Nikita Popov authored
      Instead of checking for a bitcast from a function type, check
      whether the aliasee is a function after stripping bitcasts. This
      is not strictly equivalent, but serves the same purpose.
      924696d2
    • Simon Pilgrim's avatar
      58f944cf
    • Sven van Haastregt's avatar
      [OpenCL] opencl-c.h: remove arg names from arm_dot; NFC · 9b8a93e3
      Sven van Haastregt authored
      This simplifies completeness comparisons against OpenCLBuiltins.td.
      9b8a93e3
    • David Pagan's avatar
      Enable inoutset dependency-type in depend clause. · 0a7cc078
      David Pagan authored
      Done in manner similar to mutexinoutset
      (see https://reviews.llvm.org/D57576)
      
      Runtime support already exists in LLVM OpenMP runtime (see
      https://reviews.llvm.org/D97085).
      
      The value used to identify an inoutset dependency type in the LLVM
      OpenMP runtime is 8.
      
      Some tests updated due to change in dependency type error messages that
      now include new dependency type. Also updated
      test/OpenMP/task_codegen.cpp to verify we emit the right code.
      0a7cc078
  2. Feb 09, 2022
  3. Feb 08, 2022