1. Mar 27, 2024
    • Paul Kirth's avatar
      [𝘀𝗽𝗿] initial version · eebffcd3
      Paul Kirth authored
      Created using spr 1.3.4
      eebffcd3
    • Florian Mayer's avatar
      [NFC] [HWASan] make getAndroidSlotPtr function generic (#86200) · 880eb339
      Florian Mayer authored
      This is so we can use a different slot for stack MTE.
      880eb339
    • Florian Mayer's avatar
    • Craig Topper's avatar
      [RISCV] Check that the stack adjust immediate for cm.push/pop* has the correct... · 15840149
      Craig Topper authored
      [RISCV] Check that the stack adjust immediate for cm.push/pop* has the correct sign and is divisible by 16. (#85295)
      
      To do this I've added a new AsmOperand for cm.push to expect a negative
      value. We also use that to customize the print function so that we don't
      need to detect cm.push opcode to add the negative sign.
      
      I've renamed some places that used Spimm to be StackAdj since that's
      what is being parsed. I'm still not about where we should use Spimm or
      StackAdj.
      
      I've removed the printSpimm helper function which in one usage printed
      the sp[5:4]<<4 value and the other usage printed the full stack
      adjustment. There wasn't anything interesting about how it was printed
      it just passed the value to the raw_stream. If there was something
      special needed, it's unclear whether it would be the same for the two
      different usages so I inlined it.
      
      One open question is whether we need to support stack adjustments
      expressed as an expression rather than a literal integer.
      15840149
    • OverMighty's avatar
      ac1af750
    • Vinayak Dev's avatar
      [libc] Remove LIBC_HAS_ATTRIBUTE macro (#86656) · a3f21a32
      Vinayak Dev authored
      Resolves #86547
      
      Replace occurrences of the macro `LIBC_HAS_ATTRIBUTE` with `__has_attribute`.
      a3f21a32
    • Vinayak Dev's avatar
      [libc]: Remove unused includes from strfrom*.cpp (#86657) · 2d97ba22
      Vinayak Dev authored
      Removes unused header includes from `strfrom*()` implementation files.
      2d97ba22
    • Björn Pettersson's avatar
      [X86] Fix miscompile in combineShiftRightArithmetic (#86597) · 3e6e54eb
      Björn Pettersson authored
      When folding (ashr (shl, x, c1), c2) we need to treat c1 and c2
      as unsigned to find out if the combined shift should be a left
      or right shift.
      Also do an early out during pre-legalization in case c1 and c2
      has differet types, as that otherwise complicated the comparison
      of c1 and c2 a bit.
      3e6e54eb
    • Razvan Lupusoru's avatar
      [flang][acc] Add support for lowering combined constructs (#86696) · 14e17ea1
      Razvan Lupusoru authored
      PR#80319 added support to record combined construct semantics via an
      attribute. Add lowering support for this.
      14e17ea1
    • Michael Jones's avatar
      [libc] Remove definition of LIBC_NAMESPACE in test (#86704) · 4c72cfa3
      Michael Jones authored
      The canonicalize test added in #85940 defined the LIBC_NAMESPACE macro.
      this macro is intended to be set only by the build system and never in
      the code.
      4c72cfa3
    • Bjorn Pettersson's avatar
      [X86] Pre-commit test case for bug in combineShiftRightArithmetic · 982ebeb2
      Bjorn Pettersson authored
      It has been noticed that combineShiftRightArithmetic isn't dealing
      properly with large shift amounts, as demonstrated by the test
      case added in this commit.
      
      I think the problem partly is related to X86 using i8 as shift amount
      type during ISel. So shift amount larger then 127 may be treated
      as negative shift amounts if not being careful.
      982ebeb2
    • Peter Klausler's avatar
      [flang] Dodge bogus GCC 13.2.0 error message in new code (#86708) · 8a845963
      Peter Klausler authored
      Rearrange some new code a little bit to avoid a bogus error message
      coming out from GCC 13.2.0 about an uninitialized data member in a
      parser.
      8a845963
    • Félix-Antoine Constantin's avatar
      [clang-tidy] Improved modernize-use-using by fixing a false-negative (#82947) · 8ea94b61
      Félix-Antoine Constantin authored
      The check needs a parent decl to match but if the typedef is in a
      function, the parent is a declStmt which is not a decl by itself.
      Improved the matcher to match on either a decl or a declstmt and extract
      the decl from the stmt in the latter case.
      
      Fixes #72179
      8ea94b61
    • Jonas Devlieghere's avatar
      [lldb] Implement coalescing of disjoint progress events (#84854) · 156c2907
      Jonas Devlieghere authored
      This implements coalescing of progress events using a timeout, as
      discussed in the RFC on Discourse [1]. This PR consists of two commits
      which, depending on the feedback, I may split up into two PRs. For now,
      I think it's easier to review this as a whole.
      
      1. The first commit introduces a new generic `Alarm` class. The class
      lets you to schedule a function (callback) to be executed after a given
      timeout expires. You can cancel and reset a callback before its
      corresponding timeout expires. It achieves this with the help of a
      worker thread that sleeps until the next timeout expires. The only
      guarantee it provides is that your function is called no sooner than the
      requested timeout. Because the callback is called directly from the
      worker thread, a long running callback could potentially block the
      worker thread. I intentionally kept the implementation as simple as
      possible while addressing the needs for the `ProgressManager` use case.
      If we want to rely on this somewhere else, we can reassess whether we
      need to address those limitations.
      
      2. The second commit uses the Alarm class to coalesce progress events.
      To recap the Discourse discussion, when multiple progress events with
      the same title execute in close succession, they get broadcast as one to
      `eBroadcastBitProgressCategory`. The `ProgressManager` keeps track of
      the in-flight progress events and when the refcount hits zero, the Alarm
      class is used to schedule broadcasting the event. If a new progress
      event comes in before the alarm fires, the alarm is reset (and the
      process repeats when the new progress event ends). If no new event comes
      in before the timeout expires, the progress event is broadcast.
      
      [1]
      https://discourse.llvm.org/t/rfc-improve-lldb-progress-reporting/75717/
      156c2907
    • Piotr Zegar's avatar
      [clang-tidy] Improve performance of google-runtime-int (#86596) · 5e6e40fe
      Piotr Zegar authored
      Main problem with performance of this check is caused by hasAncestor
      matcher, and to be more precise by an llvm::DenseSet and std::deque in
      matchesAnyAncestorOf.
      
      To reduce impact of this matcher, multiple conditions that were checked
      in check method were copied into AST matcher that is now checked before
      hasAncestor.
      
      Using custom getCheckTraversalKind to exclude template instances that
      shouldn't be checked anyway is an additional improvement, but gain from
      that one is low.
      
      Tested on ffl_tests.cc, visible reduction from ~442 seconds to ~15
      seconds (~96% reduction).
      
      Closes #86553
      5e6e40fe
    • Chris B's avatar
      [NFC] Refactor ConstantArrayType size storage (#85716) · 28ddbd4a
      Chris B authored
      In PR #79382, I need to add a new type that derives from
      ConstantArrayType. This means that ConstantArrayType can no longer use
      `llvm::TrailingObjects` to store the trailing optional Expr*.
      
      This change refactors ConstantArrayType to store a 60-bit integer and
      4-bits for the integer size in bytes. This replaces the APInt field
      previously in the type but preserves enough information to recreate it
      where needed.
      
      To reduce the number of places where the APInt is re-constructed I've
      also added some helper methods to the ConstantArrayType to allow some
      common use cases that operate on either the stored small integer or the
      APInt as appropriate.
      
      Resolves #85124.
      28ddbd4a
    • Emil Pedersen's avatar
      [DebugInfo] [SelectionDAG] Fix handling of duplicate dbg values (#86598) · 0e5c504d
      Emil Pedersen authored
      Before this fix, a duplicate llvm.dbg.value intrinsic referring to an
      argument, after an alloca, would be generated with `$noreg`, losing
      debug information. Instead, we silently drop the second debug info, so
      it doesn't break the first one.
      
      rdar://125375717
      0e5c504d
    • Karthika Devi C's avatar
      [polly] Add polly-debug flag to print debug info from all parts of polly (#78549) · 601d7eab
      Karthika Devi C authored
      This flag enable the user to print debug Info from all the passes and
      helpers inside polly at once. This will help a novice user as well to
      work in polly without explicitly having to know which parts of polly has
      actually kicked in and pass them via -debug-only.
      601d7eab
    • Krzysztof Parzyszek's avatar
      [flang][OpenMP] Make OpenMP clause representation language-agnostic (#86289) · 148a5579
      Krzysztof Parzyszek authored
      The clause templates defined in ClauseT.h were originally based on
      flang's parse tree nodes. Since those representations are going to be
      reused for clang (together with the clause splitting code), it makes
      sense to separate them from flang, and instead have them based on the
      actual OpenMP spec (v5.2).
      
      The member names in the templates follow the naming presented in the
      spec, and the representation (e.g. members) is derived from the clause
      definitions as described in the spec.
      
      Since the representations of some clauses has changed (while preserving
      the information), the current code using the clauses (especially the
      code converting parser::OmpClause to omp::Clause) needs to be adjusted.
      
      This patch does not make any functional changes.
      148a5579
    • Craig Topper's avatar
      [RISCV] Split compound if statement to fix a crash. · 2fbc40d3
      Craig Topper authored
      We're not allowed to call getELEN when the vector extension
      is not enabled. If we're looking at a vector type, isTypeLegal would
      only return true if the vector extensions are enabled. So early out
      for non-vector types before we call isTypeLegal and getELEN.
      2fbc40d3
    • Alex Zinenko's avatar
    • Noah Goldstein's avatar
      [IR] Add `m_c_BitwiseLogic` in pattern match; NFC · 8edb12fe
      Noah Goldstein authored
      Just a missing matcher that came up in #73362
      
      Closes #86632
      8edb12fe
    • Simon Pilgrim's avatar
    • Alexey Bataev's avatar
      [SLP]Fix PR86620: check final minbitwidth for truncs/exts before · 342f7d0d
      Alexey Bataev authored
      accepting it.
      
      If the minbitwidth is deduced from the demanded elements, need to check
      the final bitwidthfor trunc/ext instruction, bot blindly accepting
      the used one.
      342f7d0d
    • Alexey Bataev's avatar
      [SLP][NFC]Add a test with truncated loads, but incorrect trunc after · 1ad29a5c
      Alexey Bataev authored
      minbitwidth analysis.
      1ad29a5c
    • Ella Ma's avatar
      [analyzer] Allow egraph rewriter not to open the generated HTML directly (#85515) · 0c3e24f7
      Ella Ma authored
      When developing on a headless device through SSH, we do not have a
      browser or even an X environment. Hence, it would be more convenient if
      the rewriter could stop before attempting to open the generated HTML
      file. Then, it can be opened remotely through an HTML server.
      
      This patch adds a new option `--dump-html-only` to make the rewriter
      stop before opening the generated HTML in a browser. The new option is
      marked in conflict with the existing `--dump-dot-only` option to prevent
      unexpected behaviors.
      0c3e24f7
    • Jason Molenda's avatar
      [lldb] Remove test for add-symbol-file adds unwind source · 29318abe
      Jason Molenda authored
      In
      
      commit 2f63718f
      Author: Jason Molenda <jmolenda@apple.com>
      Date:   Tue Mar 26 09:07:15 2024 -0700
      
          [lldb] Don't clear a Module's UnwindTable when adding a SymbolFile (#86603)
      
      I changed lldb to not clear a Module's UnwindTable when we add a
      SymbolFile to a binary, because the added benefit is marginal, and
      handling this reconstruction correctly is difficult.  This test was
      written to explicitly create a test without unwind info in the
      binary, then add a symbol file with the unwind info, and check that
      it is present.  I've intentionally broken this, so I'm removing the
      test.
      29318abe
    • Thorsten Schütt's avatar
      [CodeGen] Add nneg and disjoint flags (#86650) · da6cc4a2
      Thorsten Schütt authored
      MachineInstr learned the new flags.
      da6cc4a2
    • Kazu Hirata's avatar
      [ArithToSPIRV] Fix a warning (#86702) · d0e97fe3
      Kazu Hirata authored
      mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp:995:11: error:
        unused variable 'converter' [-Werror,-Wunused-variable]
      d0e97fe3
    • Craig Topper's avatar
      [RISCV] Remove unneeded VAESKF_MV_I tablegen class. NFC · 8cb4eb99
      Craig Topper authored
      It is identical to PALUVINoVm so we can use that instead.
      8cb4eb99
    • Kazu Hirata's avatar
      [TosaToTensor] Fix a warning (#86703) · 1eaef445
      Kazu Hirata authored
      This patch fixes:
      
        mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp:76:46: error:
        'multiplies' may not intend to support class template argument
        deduction [-Werror,-Wctad-maybe-unsupported]
      1eaef445
    • Alexey Bataev's avatar
      [SLP]Do not propagate nuw/nsw flags for alt nodes, affected by · 26dd1287
      Alexey Bataev authored
      minbitwidth analysis.
      
      Need to drop nuw/nsw flags, if the alternate node is resized after the
      minbitwidth analysis, to avoid producing poison values in corner cases.
      26dd1287
    • Piotr Zegar's avatar
      [clang-tidy] Fix fix-it overlaps in readability-static-definition-in-anonymous-namespace (#86599) · 31373479
      Piotr Zegar authored
      Because check emitted multiple warnings for every template instance
      fix-it couldn't be applied due to overlaps.
      
      Using TK_IgnoreUnlessSpelledInSource and restricting check to C++ only.
      31373479
    • Peter Klausler's avatar
      [flang] Catch impossible but necessary TBP override (#86558) · f4fc959c
      Peter Klausler authored
      An apparent attempt to override a type-bound procedure is not allowed to
      be interpreted as on override when the procedure is PRIVATE and the
      override attempt appears in another module. However, if the TBP that
      would have been overridden is a DEFERRED procedure in an abstract base
      type, the override must take place. PRIVATE DEFERRED procedures must
      therefore have all of their overrides appear in the same module as the
      abstract base type.
      f4fc959c
    • Ivan Butygin's avatar
      [mlir][spirv] Remove `enableFastMathMode` flag from SPIR-V conversion (#86578) · f050a098
      Ivan Butygin authored
      Most of arith/math ops support fastmath attribute, use it instead of
      global flag.
      f050a098
    • smanna12's avatar
      [NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (#85962) · 4c4ea249
      smanna12 authored
      Reported by Static Analyzer Tool:
      In clang::dataflow::Environment::initialize(): Using the auto keyword
      without an & causes the copy of an object of type LambdaCapture
      4c4ea249
    • Jonas Hahnfeld's avatar
      [unittests] Fix `TableGenTests` with `LLVM_LINK_LLVM_DYLIB` (#86664) · 81fc43a3
      Jonas Hahnfeld authored
      Since the restructuring in commit fa3d789d, the option
      DISABLE_LLVM_LINK_LLVM_DYLIB is counter-productive and leads to
      CommandLine Error: Option 'debug-counter' registered more than once!
      81fc43a3
    • Peter Klausler's avatar
      [flang][NFC] Address reported "possible missing return" (#86523) · f92f7752
      Peter Klausler authored
      A function uses "if constexpr" to consider all possible types in a
      variant, but looks as if it can fall out without returning an
      expression. Add a final "else" with a crash to make things more clear
      and to protect against unlikely future extensions of the type.
      
      Fixes https://github.com/llvm/llvm-project/issues/86391.
      f92f7752
    • Andrzej Warzyński's avatar
      [mlir][vector] Refactor linearize.mlir (#86648) · bf4fc00b
      Andrzej Warzyński authored
      This patch refactors the `linearize.mlir` test - currently it contains
      some duplication and can be tricky to follow.
      
      Summary of changes:
        * reduce duplication by introducing a shared check prefix (`ALL`) and
          by introducing `-check-prefixes`,
        * make sure that every "check" line is directly above the
          corresponding line of input MLIR,
        * group check lines corresponding to a particular prefix together (so
          that it's easier to see the expected output for a particular
          prefix),
        * remove `CHECK` from prefix names (with multiple prefixes that's just
          noise that can be avoided) and use a bit more descriptive prefixes
          instead (`CHECK0` -> `BW-0`, where `BW` stands for bitwidth),
        * unify indentation,
        * `nonvec_result` -> `test_tensor_no_linearize` (for consistency with
          `test_index_no_linearize`).
      
      NOTE: This change only updates the format of the "CHECK" lines and
      doesn't affect what's being tested.
      
      This change is intended as preparation for adding support for scalable
      vectors to `LinearizeConstant` and `LinearizeVectorizable` - i.e.
      patterns that `linearlize.mlir` is meant to test.
      bf4fc00b
    • Craig Topper's avatar