1. Nov 28, 2023
    • Florian Hahn's avatar
      [MTE] Regenerate MIR checks. · 6f25ae3e
      Florian Hahn authored
      Regenerate the check lines for some MIR tests as it looks like the
      auto-generate checks have been improved since the checks in the tests
      have been generated.
      6f25ae3e
  2. Nov 27, 2023
    • David Spickett's avatar
      [lldb][AArch64][Linux] Correct name of FPCR field · 772f2962
      David Spickett authored
      It should be "RMode" as in "rounding mode" not "RMMode".
      772f2962
    • David Spickett's avatar
      [lldb] Improve error message for script commands when there's no interpreter (#73321) · 81679344
      David Spickett authored
      It was:
      ```
      error: there is no embedded script interpreter in this mode.
      ```
      
      1. What does "mode" mean?
      2. It implies there might be an embedded script interpreter for some
      other "mode", whatever that would be.
      
      So I'm simplifying it and noting the most common reason for this which
      is that lldb wasn't built with a scripting language enabled in the first
      place.
      
      There are other tips for dealing with this, but I'm not sure this
      message is the best place for them.
      81679344
    • Florian Hahn's avatar
      [ConstraintElim] Refactor GEP offset collection. · d045e23c
      Florian Hahn authored
      Move GEP offset collection to separate helper function and collect
      variable and constant offsets in OffsetResult. For now, this only
      supports 1 VariableOffset, but the new code structure can be more easily
      extended to handle more offsets in the future.
      
      The refactoring drops the check that the VariableOffset >= -1 * constant
      offset. This is not needed to check whether the constraint is
      monotonically increasing. The constant factors can be ignored, the
      constraint will be monotonically increasing if all variables are
      positive.
      
      See https://alive2.llvm.org/ce/z/ah2uSQ,
          https://alive2.llvm.org/ce/z/NCADNZ
      d045e23c
    • Nikita Popov's avatar
      [InstCombine] Add more inbounds tests for indexed compare fold (NFC) · 57a0a9aa
      Nikita Popov authored
      Don't only test the case where all GEPs are missing inbounds, also
      test inbounds only being present on some of them. The fold should
      not be performed in either case.
      57a0a9aa
    • Nikita Popov's avatar
      [DomTree] Reduce number of hash table lookups (NFC) (#73097) · 553f8853
      Nikita Popov authored
      Inside runSemiNCA(), create a direct mapping from node number of node
      info, so we can save the node number -> node pointer -> node info lookup
      in many cases.
      
      To allow this in more cases, change Label to a node number instead of
      node pointer.
      
      I've limited this to runSemiNCA() for now, because we have the
      convenient property there that no new node infos will be added, so we
      don't have to worry about pointer invalidation.
      
      This gives a pretty nice compile-time improvement of about 0.4%.
      553f8853
    • David Green's avatar
      [AArch64][GlobalISel] Better vecreduce.fadd lowering. (PR #73294) · 295edaab
      David Green authored
      This changes the fadd legalization to handle fp16 types, and treats more types
      as legal so that the backend can produce the correct patterns. This is
      currently a missing identity fold for `fadd x -0.0 -> x`
      295edaab
    • Aiden Grossman's avatar
      [JumpThreading] Remove LVI printer flag (#73426) · 5eb85c05
      Aiden Grossman authored
      This patch removes the -print-lvi-after-jump-threading flag now that we
      can print everything in the LVI cache using the print<lazy-value-info>
      pass.
      5eb85c05
    • Nikita Popov's avatar
      [CVP] Don't try to fold load/store operands to constant (#73338) · 2b646b59
      Nikita Popov authored
      CVP currently tries to fold load/store pointer operands to constants
      using LVI. If there is a dominating condition of the form `icmp eq ptr
      %p, @g`, then `%p` will be replaced with `@g`.
      
      LVI is geared towards range-based optimizations, and is *very*
      inefficient at handling simple pointer equality conditions. We have
      other passes that can handle this optimization in a more efficient way,
      such as IPSCCP and GVN.
      
      Removing this optimization gives a geomean 0.4-1.2% compile-time
      improvement depending on configuration. At the same time, there
      is no impact on codegen.
      2b646b59
    • Hsiangkai Wang's avatar
      [mlir][affine][gpu] Replace DivSIOp to CeilDivSIOp when lowering to GPU launch (#73328) · 477c0b67
      Hsiangkai Wang authored
      When converting affine.for to GPU launch operator, we have to calculate
      the block dimension and thread dimension for the launch operator.
      
      The formula of the dimension size is
      
      (upper_bound - lower_bound) / step_size
      
      When the difference is indivisible by step_size, we use rounding-to-zero
      as the division result. However, the block dimension and thread
      dimension is right-open range, i.e., [0, block_dim) and [0, thread_dim).
      So, we will get the wrong result if we use DivSIOp. In this patch, we
      replace it with CeilDivSIOp to get the correct block and thread
      dimension values.
      477c0b67
    • Shengchen Kan's avatar
      [X86][MC] Allow to specify any of the 8/16/32/64 register names... · 27c0bc9c
      Shengchen Kan authored
      [X86][MC] Allow to specify any of the 8/16/32/64 register names interchangeably for R16-R31 (#73421)
      
      27c0bc9c
    • Owen Pan's avatar
    • LLVM GN Syncbot's avatar
      [gn build] Port f8afc53d · 681d02d0
      LLVM GN Syncbot authored
      681d02d0
    • Dmitry Vyukov's avatar
      [libc++] Speed up classic locale (#72112) · f8afc53d
      Dmitry Vyukov authored
      
      
      Locale objects use atomic reference counting, which may be very
      expensive in parallel applications. The classic locale is used by
      default by all streams and can be very contended. But it's never
      destroyed, so the reference counting is also completely pointless on the
      classic locale. Currently ~70% of time in the parallel stringstream
      benchmarks is spent in locale ctor/dtor. And the execution radically
      slows down with more threads.
      
      Avoid reference counting on the classic locale. With this change
      parallel benchmarks start to scale with threads.
      
      Co-authored-by: default avatarLouis Dionne <ldionne.2@gmail.com>
      
      ```
                                    │   baseline   │    optimized                            │
                                    │    sec/op    │    sec/op      vs base                  │
      Istream_numbers/0/threads:1      4.672µ ± 0%   4.419µ ± 0%     -5.42% (p=0.000 n=30+39)
      Istream_numbers/0/threads:72   539.817µ ± 0%   9.842µ ± 1%    -98.18% (p=0.000 n=30+40)
      Istream_numbers/1/threads:1      4.890µ ± 0%   4.750µ ± 0%     -2.85% (p=0.000 n=30+40)
      Istream_numbers/1/threads:72     66.44µ ± 1%   10.14µ ± 1%    -84.74% (p=0.000 n=30+40)
      Istream_numbers/2/threads:1      4.888µ ± 0%   4.746µ ± 0%     -2.92% (p=0.000 n=30+40)
      Istream_numbers/2/threads:72     494.8µ ± 0%   410.2µ ± 1%    -17.11% (p=0.000 n=30+40)
      Istream_numbers/3/threads:1      4.697µ ± 0%   4.695µ ± 5%          ~ (p=0.391 n=30+37)
      Istream_numbers/3/threads:72     421.5µ ± 7%   421.9µ ± 9%          ~ (p=0.665 n=30)
      Ostream_number/0/threads:1       183.0n ± 0%   141.0n ± 2%    -22.95% (p=0.000 n=30)
      Ostream_number/0/threads:72    24196.5n ± 1%   343.5n ± 3%    -98.58% (p=0.000 n=30)
      Ostream_number/1/threads:1       250.0n ± 0%   196.0n ± 2%    -21.60% (p=0.000 n=30)
      Ostream_number/1/threads:72    16260.5n ± 0%   407.0n ± 2%    -97.50% (p=0.000 n=30)
      Ostream_number/2/threads:1       254.0n ± 0%   196.0n ± 1%    -22.83% (p=0.000 n=30)
      Ostream_number/2/threads:72      28.49µ ± 1%   18.89µ ± 5%    -33.72% (p=0.000 n=30)
      Ostream_number/3/threads:1       185.0n ± 0%   185.0n ± 0%      0.00% (p=0.017 n=30)
      Ostream_number/3/threads:72      19.38µ ± 4%   19.33µ ± 5%          ~ (p=0.425 n=30)
      ```
      f8afc53d
    • Zi Xuan Wu (Zeson)'s avatar
      [RISCV] Don't combine store of vmv.x.s/vfmv.f.s to vp_store with VL of 1 when... · e8932421
      Zi Xuan Wu (Zeson) authored
      [RISCV] Don't combine store of vmv.x.s/vfmv.f.s to vp_store with VL of 1 when it's indexed store (#73219)
      
      Because we can't support vp_store with indexed address mode by lowering to vse intrinsic later.
      e8932421
    • Kazu Hirata's avatar
      [mlir] Fix a warning · 6318dd82
      Kazu Hirata authored
      This patch fixes:
      
       mlir/lib/Pass/PassRegistry.cpp:376:37: error: ISO C++ requires the
       name after '::~' to be found in the same scope as the name before
       '::~' [-Werror,-Wdtor-name]
      6318dd82
    • Jakub Kuderski's avatar
      [mlir][spirv] Add missing group non-uniform bitwise and logical ops (#73475) · 77167687
      Jakub Kuderski authored
      This covers the following ops:
      `spirv.GroupNonUniform` x {`Bitwise`, `Logical`} x {`And`, `Or`, `Xor`}
      
      We need these to efficiently lower from the `gpu.subgroup_reduce` op.
      77167687
    • Wang Pengcheng's avatar
      [SelectionDAG] Add instantiated OPC_EmitInteger and OPC_EmitStringInteger (#73241) · 2e6c01be
      Wang Pengcheng authored
      These two opcodes are used to be followed by a MVT operand, which is
      always one of i8/i16/i32/i64.
      
      We add instantiated `OPC_EmitInteger` and `OPC_EmitStringInteger` with
      i8/i16/i32/i64 so that we can reduce one byte.
      
      We reserve `OPC_EmitInteger` and `OPC_EmitStringInteger` in case that
      we may need them someday, though I haven't found one usage after this
      change.
      
      Overall this reduces the llc binary size with all in-tree targets by
      about 200K.
      2e6c01be
    • Fangrui Song's avatar
      [Driver] Allow -e entry but reject -eentry (#72804) · 282201dc
      Fangrui Song authored
      This short option taking an argument is unfortunate.
      
      * If a cc1-only option starts with `-e`, using it for driver will not be
        reported as an error (e.g. commit
        6cd9886c88d16d288c74846495d89f2fe84ff827).
      * If another `-e` driver option is intended but a typo is made, the
        option will be recognized as a `-e`.
      
      `gcc -export-dynamic` passes `-export-dynamic` to ld. It's not clear
      whether some options behave this way.
      
      It seems `-Wl,-eentry` and `-Wl,--entry=entry` are primarily used. There
      may also be a few `gcc -e entry`, but `gcc -eentry` is extremely rare or
      not used at all. Therefore, we probably should reject the Joined form of
      `-e`.
      282201dc
    • XinWang10's avatar
      [X86][MC] Update condition about ExplicitVEXPrefix (#73312) · a77ea94c
      XinWang10 authored
      After #72835, ExplicitVEXPrefix has changed and it is not a bit now, but
      in scope ExplicitOpPrefix, so the bitwise op of ExplicitVEXPrefix may
      need to update.
      a77ea94c
    • Youngsuk Kim's avatar
      [llvm][SROA] Replace calls to Type::getPointerTo (NFC) · c419f3e1
      Youngsuk Kim authored
      NFC cleanup towards removing method Type::getPointerTo.
      
      * Remove unnecessary call to Type::getPointerTo
      * Replace call to Type::getPointerTo with IRB.getPtrTy
      c419f3e1
    • Matt Arsenault's avatar
      AMDGPU: Move intrinsic definition out of subtarget specific section · 6c462fe2
      Matt Arsenault authored
      This was at the end of the subtarget specific intrinsics and
      before backend internal intrinsics. Move it with other genericish
      synthetic intrinsics.
      6c462fe2
    • Stephan T. Lavavej's avatar
      [libc++][test] Use `LIBCPP_STATIC_ASSERT` for `std::__mdspan_detail` (#73436) · b84cb9c2
      Stephan T. Lavavej authored
      Found while running libc++'s test suite against MSVC's STL.
      
      `libcxx/test/std` should be portable, so these lines checking
      `std::__mdspan_detail` machinery should be using `LIBCPP_STATIC_ASSERT`.
      
      I checked for other occurrences and these appear to be the only ones
      which have appeared since our last libc++ test suite update.
      b84cb9c2
    • Stephan T. Lavavej's avatar
      [libc++][test] Cleanup typos and unnecessary semicolons (#73435) · f5832bab
      Stephan T. Lavavej authored
      I've structured this into a series of commits for even easier reviewing,
      if that helps. I could easily split this up into separate PRs if
      desired, but as this is low-risk with simple edits, I thought one PR
      would be easiest.
      
      * Drop unnecessary semicolons after function definitions.
      * Cleanup comment typos.
      * Cleanup `static_assert` typos.
      * Cleanup test code typos.
      + There should be no functional changes, assuming I've changed all
      occurrences.
      * ~~Fix massive test code typos.~~
      + This was a real problem, but needed more surgery. I reverted those
      changes here, and @philnik777 is fixing this properly with #73444.
      * clang-formatting as requested by the CI.
      f5832bab
    • Caroline Tice's avatar
      Revert "[LLDB] Add more helper functions to CompilerType class." · af3c5a7c
      Caroline Tice authored
      PR 73467 was committed by accident. This undoes the premature commit.
      af3c5a7c
    • Jakub Kuderski's avatar
      [mlir][spirv] Update integer dot product op syntax (#73468) · 1b70587c
      Jakub Kuderski authored
      Make the syntax more concise and aligned with the `spirv.Dot` syntax in
      https://github.com/llvm/llvm-project/pull/73466.
      
      Move some type verification from C++ to ODS.
      
      Regexes to update existing code and tests:
      `(\s*\{format\s+=\s+#spirv.packed_vector_format([^}]+)\})`
      ==>
      `, $2`
      
      `(spirv.[SU]+Dot[a-zA-Z]*[^:]+:)(\s*\(([^,]+),[^\)]+\))(.+)`
      ==>
      `$1 $3$4`
      1b70587c
    • cmtice's avatar
      [LLDB] Add more helper functions to CompilerType class. (#73467) · 42d669f8
      cmtice authored
      This adds 23 new helper functions to LLDB's CompilerType class, things
      like IsSmartPtrType, IsPromotableIntegerType,
      GetNumberofNonEmptyBaseClasses, and GetTemplateArgumentType (to name a
      few).
      
      These helper functions are needed as part of the implementation for the
      Data Inspection Language, (see
      https://discourse.llvm.org/t/rfc-data-inspection-language/69893).
      42d669f8
    • Jakub Kuderski's avatar
      [mlir][spirv] Add floating point dot product (#73466) · 89714144
      Jakub Kuderski authored
      Because `OpDot` does not require any extra capabilities or extensions,
      enable it by default in the vector to spirv conversion.
      89714144
    • Owen Pan's avatar
      [clang-format] Fix a bug in formating `#define A x:` (#73220) · a369a594
      Owen Pan authored
      Fixed #70789.
      a369a594
    • Raghu Maddhipatla's avatar
    • philnik777's avatar
      [libc++] Add missing headers to the modulemap (#71127) · 1314e877
      philnik777 authored
      I don't know when, but at some point we lost test coverage to ensue that
      all the headers are in the modulemap. This adds a test to make sure all
      the headers (excluding a few which shouldn't be part of the modulemap)
      are at least mentioned. This also fixes a few headers which bit-rotted
      while we were missing the coverage.
      1314e877
    • Jeremy Morse's avatar
      [DebugInfo][RemoveDIs] Instrument loop-rotate for DPValues (#72997) · f0b5527b
      Jeremy Morse authored
      Loop-rotate manually maintains dbg.value intrinsics -- it also needs to
      manually maintain the replacement for dbg.value intrinsics, DPValue
      objects. For the most part this patch adds parallel implementations
      using the new type Some extra juggling is needed when loop-rotate hoists
      loop-invariant instructions out of the loop: the DPValues attached to
      such an instruction need to get rotated but not hoisted. Exercised by
      the new test function invariant_hoist in dbgvalue.ll.
      
      There's also a "don't insert duplicate debug intrinsics" facility in
      LoopRotate. The value and correctness of this isn't clear, but to
      continue preserving behaviour that's now tested in the "tak_dup"
      function in dbgvalue.ll.
      
      Other things in this patch include a helper DebugVariable constructor
      for DPValues, a insertDebugValuesForPHIs handler for RemoveDIs
      (exercised by the new tests), and beefing up the dbg.value checking in
      dbgvalue.ll to ensure that each record is tested (and that there's an
      implicit check-not).
      f0b5527b
    • Jeremy Morse's avatar
      Suppressed unused-var warning from c672ba7d · 1a088877
      Jeremy Morse authored
      1a088877
    • Nico Weber's avatar
      [gn] manually re-sync llvm-exegesis tool deps · acdd3cc1
      Nico Weber authored
      As far as I can tell, the non-lib part never depended on MCJIT,
      so I'm not sure why I added that. While here, re-sync some other
      deps.
      
      Since there's no shared library build for the gn build, no real
      behavior change.
      acdd3cc1
    • Nico Weber's avatar
      [gn] port 92b821f2 · 580858ad
      Nico Weber authored
      580858ad
    • Jeremy Morse's avatar
      [DebugInfo][RemoveDIs] Instrument inliner for non-instr debug-info (#72884) · c672ba7d
      Jeremy Morse authored
      With intrinsics representing debug-info, we just clone all the
      intrinsics when inlining a function and don't think about it any
      further. With non-instruction debug-info however we need to be a bit
      more careful and manually move the debug-info from one place to another.
      For the most part, this means keeping a "cursor" during block cloning of
      where we last copied debug-info from, and performing debug-info copying
      whenever we successfully clone another instruction.
      
      There are several utilities in LLVM for doing this, all of which now
      need to manually call cloneDebugInfo. The testing story for this is not
      well covered as we could rely on normal instruction-cloning mechanisms
      to do all the hard stuff. Thus, I've added a few tests to explicitly
      test dbg.value behaviours, ahead of them becoming not-instructions.
      c672ba7d
    • Aiden Grossman's avatar
      [NewPM] Remove StripGCRelocatesLegacyPass (#73403) · f4a4e2f8
      Aiden Grossman authored
      This pass isn't used anywhere upstream and thus has no test coverage.
      For these reasons, remove it.
      f4a4e2f8
    • Aiden Grossman's avatar
      [LVI] Add NewPM printer pass (#73425) · 5a74805b
      Aiden Grossman authored
      This patch adds a NewPM printer pass for the LazyValueAnalysis.
      5a74805b
    • philnik777's avatar
      [libc++][NFC] Use __construct_at and __destroy_at instead of using... · cd9829c2
      philnik777 authored
      [libc++][NFC] Use __construct_at and __destroy_at instead of using preprocessor conditionals (#70866)
      
      cd9829c2
    • philnik777's avatar
      [libc++] Fix a few tests that are missing proper suffixes (#73444) · 2c545131
      philnik777 authored
      The tests were missing the `.pass.cpp` suffix to be recognized as tests.
      As a result, they were never run and some are completely broken.
      2c545131