1. May 14, 2024
    • Amir Ayupov's avatar
      [BOLT] Preserve Offset annotation in fixDoubleJumps (#91898) · 54b17fa4
      Amir Ayupov authored
      Offset annotation was missed when optimizing an unconditional branch to
      a tail call.
      
      Test Plan: update bb-with-two-tail-calls.s
      54b17fa4
    • Lei Zhang's avatar
      [mlir][gpu] Support extf before contract when converting to MMA ops (#91988) · a037d889
      Lei Zhang authored
      This commit allows `inferFragType` to see through all arith.ext op
      and other elementwise users before reaching contract op for
      figuring out the fragment type.
      a037d889
    • LLVM GN Syncbot's avatar
      [gn build] Port af79372d · 5944579a
      LLVM GN Syncbot authored
      5944579a
    • Mike Crowe's avatar
      [clang-tidy] Add modernize-use-std-format check (#90397) · af79372d
      Mike Crowe authored
      Add a new clang-tidy check that converts absl::StrFormat (and similar
      functions) to std::format (and similar functions.)
      
      Split the configuration of FormatStringConverter out to a separate
      Configuration class so that we don't risk confusion by passing two
      boolean configuration parameters into the constructor. Add
      AllowTrailingNewlineRemoval option since we never want to remove
      trailing newlines in this check.
      af79372d
    • Piotr Zegar's avatar
      [clang-tidy] Ignore unevaluated context in bugprone-optional-value-conversion (#90410) · 69937982
      Piotr Zegar authored
      Ignore optionals in unevaluated context, like static_assert or decltype.
      
      Closes #89593
      69937982
    • Leon Clark's avatar
      bd679865
    • Fangrui Song's avatar
      [test] Fix check prefixes · 4a67f809
      Fangrui Song authored
      4a67f809
    • Michael Buch's avatar
      [lldb][TypeSystem][NFCI] Log creation of new TypeSystem instances to expression log (#91985) · dc7ce3b4
      Michael Buch authored
      We emit `ASTContext` and `TypeSystem` pointers into the `expr` log but
      there is no easy way (that I know of) to correlate the pointer value
      back to an easily readible form. This patch simply logs the name of the
      `TypeSystem` and the associated `ASTContext` into the `expr` channel
      whenever we create a new `TypeSystemClang`.
      
      The following is an example of the new log entries:
      ```
      $ grep Created /tmp/lldb.log 
       Created new TypeSystem for (ASTContext*)0x0000000101a2e200 'ASTContext for '/Users/michaelbuch/a.out''
       Created new TypeSystem for (ASTContext*)0x0000000102512a00 'scratch ASTContext'
       Created new TypeSystem for (ASTContext*)0x0000000102116a00 'ClangModulesDeclVendor ASTContext'
       Created new TypeSystem for (ASTContext*)0x00000001022e8c00 'Expression ASTContext for '<user expression 0>''
       Created new TypeSystem for (ASTContext*)0x00000001103e7200 'AppleObjCTypeEncodingParser ASTContext'
       Created new TypeSystem for (ASTContext*)0x00000001103f7000 'AppleObjCDeclVendor AST'
       Created new TypeSystem for (ASTContext*)0x00000001104bfe00 'Expression ASTContext for '<clang expression>''
       Created new TypeSystem for (ASTContext*)0x0000000101f01000 'Expression ASTContext for '<clang expression>''
       Created new TypeSystem for (ASTContext*)0x00000001025d3c00 'Expression ASTContext for '<clang expression>''
       Created new TypeSystem for (ASTContext*)0x0000000110422400 'Expression ASTContext for '<clang expression>''
       Created new TypeSystem for (ASTContext*)0x000000011602c200 'Expression ASTContext for '<user expression 1>''
       Created new TypeSystem for (ASTContext*)0x0000000110641600 'Expression ASTContext for '<clang expression>''
       Created new TypeSystem for (ASTContext*)0x0000000110617400 'Expression ASTContext for '<clang expression>''
      ```
      dc7ce3b4
    • Daniel Thornburgh's avatar
      Reland: [LLD] Implement --enable-non-contiguous-regions (#90007) · 66466ff1
      Daniel Thornburgh authored
      When enabled, input sections that would otherwise overflow a memory
      region are instead spilled to the next matching output section.
      
      This feature parallels the one in GNU LD, but there are some differences
      from its documented behavior:
      
      - /DISCARD/ only matches previously-unmatched sections (i.e., the flag
      does not affect it).
      
      - If a section fails to fit at any of its matches, the link fails
      instead of discarding the section.
      
      - The flag --enable-non-contiguous-regions-warnings is not implemented,
      as it exists to warn about such occurrences.
      
      The implementation places stubs at possible spill locations, and
      replaces them with the original input section when effecting spills.
      Spilling decisions occur after address assignment. Sections are spilled
      in reverse order of assignment, with each spill naively decreasing the
      size of the affected memory regions. This continues until the memory
      regions are brought back under size. Spilling anything causes another
      pass of address assignment, and this continues to fixed point.
      
      Spilling after rather than during assignment allows the algorithm to
      consider the size effects of unspillable input sections that appear
      later in the assignment. Otherwise, such sections (e.g. thunks) may
      force an overflow, even if spilling something earlier could have avoided
      it.
      
      A few notable feature interactions occur:
      
      - Stubs affect alignment, ONLY_IF_RO, etc, broadly as if a copy of the
      input section were actually placed there.
      
      - SHF_MERGE synthetic sections use the spill list of their first
      contained input section (the one that gives the section its name).
      
      - ICF occurs oblivious to spill sections; spill lists for merged-away
      sections become inert and are removed after assignment.
      
      - SHF_LINK_ORDER and .ARM.exidx are ordered according to the final
      section ordering, after all spilling has completed.
      
      - INSERT BEFORE/AFTER and OVERWRITE_SECTIONS are explicitly disallowed.
      66466ff1
    • Craig Topper's avatar
      [RISCV] Don't add getFrameIndexInstrOffset in RISCVRegisterInfo::needsFrameBaseReg. · 026686ba
      Craig Topper authored
      It's already added in isFrameOffsetLegal so adding it in needsFrameBaseReg
      causes it to be double counted.
      026686ba
    • Craig Topper's avatar
      [RISCV] Improve testing of loads with offset in local-stack-slot-allocation.ll. NFC · 08177541
      Craig Topper authored
      The test we had didn't match it's description.
      
      Now we have one test with a large offset that requires a virtual base register
      and a test with a smaller offset that should not.
      
      There is currently a bug that causes the offset to double counted
      leading to the small case also using a virtual base register.
      08177541
    • Yingwei Zheng's avatar
      [ValueTracking] Compute knownbits from known fp classes (#86409) · d03a1a6e
      Yingwei Zheng authored
      This patch calculates knownbits from fp instructions/dominating fcmp
      conditions. It will enable more optimizations with signbit idioms.
      d03a1a6e
    • Benoit Jacob's avatar
      Revert "[mlir][vector] Add Vector-dialect interleave-to-shuffle pattern,... · 5df01ed7
      Benoit Jacob authored
      Revert "[mlir][vector] Add Vector-dialect interleave-to-shuffle pattern, enable in VectorToSPIRV" (#92006)
      
      Reverts llvm/llvm-project#91800
      
      Reason: https://lab.llvm.org/buildbot/#/builders/268/builds/13935
      5df01ed7
    • Matheus Izvekov's avatar
      Revert "[clang] Revert default behavior change of P0522R0 implementation (#91811)" (#91837) · 0df67fa2
      Matheus Izvekov authored
      With blocking issues fixed, re-enable relaxed template template argument
      matching by reverting these commits.
      
      This reverts commit 4198aebc.
      This reverts commit 2d5634a4.
      0df67fa2
    • Michael Buch's avatar
      [lldb][ExpressionParser][NFCI] Log pointers as hex (#91989) · 276c0bd4
      Michael Buch authored
      This ensures that we log pointers as lower-case hex. E.g., instead of:
      ```
       LayoutRecordType on (ASTContext*)0x000000010E78D600 'scratch ASTContext' for (RecordDecl*)0x000000010E797
      ```
      we now log:
      ```
       LayoutRecordType on (ASTContext*)0x000000010e78d600 'scratch ASTContext' for (RecordDecl*)0x000000010e797
      ```
      
      Which is consistent with how the AST dump gets emitted into the log.
      This makes it easier to correlate pointers we log from LLDB and pointers
      that are part of any AST dumps in the same `expr` log.
      276c0bd4
    • Daniel Thornburgh's avatar
      Revert "[LLD] Implement --enable-non-contiguous-regions" (#92005) · 81f34afa
      Daniel Thornburgh authored
      Reverts llvm/llvm-project#90007
      
      Broke in merging I think.
      81f34afa
    • Daniel Thornburgh's avatar
      [LLD] Implement --enable-non-contiguous-regions (#90007) · 67311444
      Daniel Thornburgh authored
      When enabled, input sections that would otherwise overflow a memory
      region are instead spilled to the next matching output section.
      
      This feature parallels the one in GNU LD, but there are some differences
      from its documented behavior:
      
      - /DISCARD/ only matches previously-unmatched sections (i.e., the flag
      does not affect it).
      
      - If a section fails to fit at any of its matches, the link fails
      instead of discarding the section.
      
      - The flag --enable-non-contiguous-regions-warnings is not implemented,
      as it exists to warn about such occurrences.
      
      The implementation places stubs at possible spill locations, and
      replaces them with the original input section when effecting spills.
      Spilling decisions occur after address assignment. Sections are spilled
      in reverse order of assignment, with each spill naively decreasing the
      size of the affected memory regions. This continues until the memory
      regions are brought back under size. Spilling anything causes another
      pass of address assignment, and this continues to fixed point.
      
      Spilling after rather than during assignment allows the algorithm to
      consider the size effects of unspillable input sections that appear
      later in the assignment. Otherwise, such sections (e.g. thunks) may
      force an overflow, even if spilling something earlier could have avoided
      it.
      
      A few notable feature interactions occur:
      
      - Stubs affect alignment, ONLY_IF_RO, etc, broadly as if a copy of the
      input section were actually placed there.
      
      - SHF_MERGE synthetic sections use the spill list of their first
      contained input section (the one that gives the section its name).
      
      - ICF occurs oblivious to spill sections; spill lists for merged-away
      sections become inert and are removed after assignment.
      
      - SHF_LINK_ORDER and .ARM.exidx are ordered according to the final
      section ordering, after all spilling has completed.
      
      - INSERT BEFORE/AFTER and OVERWRITE_SECTIONS are explicitly disallowed.
      67311444
    • erichkeane's avatar
      Reapply "[OpenACC] device_type clause Sema for Compute constructs" · 8ef2011b
      erichkeane authored
      device_type, also spelled as dtype, specifies the applicability of the
      clauses following it, and takes a series of identifiers representing the
      architectures it applies to.  As we don't have a source for the valid
      architectures yet, this patch just accepts all.
      
      Semantically, this also limits the list of clauses that can be applied
      after the device_type, so this implements that as well.
      
      This reverts commit 06f04b2e.
      This reapplies commit c4a9a374.
      The build failures were caused by the patch depending on the order of
      evaluation of arguments to a function. This reapplication separates out
      the capture of one of the values.
      8ef2011b
    • Matheus Izvekov's avatar
      [clang] Allow pack expansions when partial ordering against template template parameters (#91833) · b8f802f7
      Matheus Izvekov authored
      When partial ordering alias templates against template template
      parameters, allow pack expansions when the alias has a fixed-size
      parameter list.
      
      These expansions were generally disallowed by proposed resolution for
      CWG1430.
      
      By previously diagnosing these when checking template template
      parameters, we would be too strict in trying to prevent any potential
      invalid use.
      
      This flows against the more general idea that template template
      parameters are weakly typed, that we would rather allow an argument that
      might be possibly misused, and only diagnose the actual misuses during
      instantiation.
      
      Since this interaction between P0522R0 and CWG1430 is also a
      backwards-compat breaking change, we implement provisional wording to
      allow these.
      
      Fixes https://github.com/llvm/llvm-project/issues/62529
      b8f802f7
    • Felix Schneider's avatar
      [mlir][intrange] Fix `arith.shl` inference in case of overflow (#91737) · 0f790664
      Felix Schneider authored
      When an overflow happens during shift left, i.e. the last sign bit or
      the most significant data bit gets shifted out, the current approach of
      inferring the range of results does not work anymore.
      
      This patch checks for possible overflow and returns the max range in
      that case.
      
      Fix https://github.com/llvm/llvm-project/issues/82158
      0f790664
    • Benoit Jacob's avatar
      [mlir][vector] Add Vector-dialect interleave-to-shuffle pattern, enable in VectorToSPIRV (#91800) · cf40c93b
      Benoit Jacob authored
      Context: https://github.com/iree-org/iree/issues/17346.
      
      Test IREE integrate showing it's fixing the problem it's intended to
      fix, i.e. it allows IREE to drop its local revert of
      https://github.com/llvm/llvm-project/pull/89131:
      
      https://github.com/iree-org/iree/pull/17359
      
      This is added to VectorToSPIRV because SPIRV doesn't currently handle
      `vector.interleave` (see motivating context above).
      
      This is limited to 1D, non-scalable vectors.
      cf40c93b
    • Jeremy Kun's avatar
      Revert "Support polynomial attributes with floating point coefficients (#91137)" (#92001) · ad727b1a
      Jeremy Kun authored
      This reverts commit 91a14dbf.
      
      Not sure how to fix the build error this introduced, so reverting until
      I can figure it out
      
      https://lab.llvm.org/buildbot/#/builders/264/builds/10468
      
      
      
      Co-authored-by: default avatarJeremy Kun <j2kun@users.noreply.github.com>
      ad727b1a
    • Jover's avatar
      2a114d17
    • Peiming Liu's avatar
      [mlir][tensor][sparse] don't drop encoding when infer result type (#91817) · 37ffbbb1
      Peiming Liu authored
      A general question is: is it possible to support hooks here to infer the
      encoding? E.g., when the extracted tensor slice is rank-reduced, the
      encoding need to be updated accordingly as well.
      37ffbbb1
    • Philip Reames's avatar
      [RISCV] Use RISCVISD::SHL_ADD in transformAddShlImm (#89832) · 6140b5ba
      Philip Reames authored
      Doing so avoids negative interactions with other combines which don't
      know the shl_add is a single instruction. From the commit log, we've had
      several combine loops already.
      
      This was originally posted as part of #88791, where a bug was pointed
      out. That bug was fixed by #89789 which hits the same issue from another
      angle. To confirm the fix, I included the reduced test case here.
      6140b5ba
    • Jeremy Kun's avatar
      Support polynomial attributes with floating point coefficients (#91137) · 91a14dbf
      Jeremy Kun authored
      
      
      In summary:
      
      - `Monomial` -> `MonomialBase` with two inheriting `IntMonomial` and
      `FloatMonomial` for the different coefficient types
      - `Polynomial` -> `PolynomialBase` with `IntPolynomial` and
      `FloatPolynomial` inheriting
      - `PolynomialAttr` -> `IntPolynomialAttr`, and new `FloatPolynomialAttr`
      attribute, both of which may be input to `polynomial.constant`
      - Refactoring common parts of attribute parsers.
      
      ---------
      
      Co-authored-by: default avatarJeremy Kun <j2kun@users.noreply.github.com>
      91a14dbf
    • chenlin's avatar
      [LoopUnroll] Remove redundant debug instructions after blocks have been merged (#91246) · 79643565
      chenlin authored
      Remove redundant debug instructions after blocks have been merged into
      the predecessor, It can reduce some compile time in some cases.
      
      This change only fixes the situation of loop unrolling, and other
      situations are not considered. "RemoveRedundantDbgInstrs" seems to be
      very time-consuming. Thus, we just add here after the "Dest" has been
      merged into the "Fold", this may be a more targeted solution!!!
      
      fixes: https://github.com/llvm/llvm-project/issues/89073
      79643565
    • Kazu Hirata's avatar
      [flang] Fix a warning · 1066eb55
      Kazu Hirata authored
      This patch fixes:
      
        flang/lib/Lower/OpenMP/OpenMP.cpp:2346:14: error: unused variable
        'origDirective' [-Werror,-Wunused-variable]
      1066eb55
    • Krystian Stasiowski's avatar
      [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (#91972) · 596a9c1f
      Krystian Stasiowski authored
      #90152 introduced a bug that occurs when typo-correction attempts to fix a reference to a
      non-existent member of the current instantiation (even though
      `operator->` may return a different type than the object type). This
      patch fixes it by simply considering the object expression to be of type
      `ASTContext::DependentTy` when the arrow operator is used with a
      dependent non-pointer non-function operand (after any implicit
      conversions).
      596a9c1f
    • Paul Kirth's avatar
    • Alex Bradbury's avatar
      [TableGen][RISCV] Use getAllDerivedDefinitionsIfDefined in RISCVTargetDefEmitter (#91941) · 754ff0f5
      Alex Bradbury authored
      getAllDerivedDefinitions produces a fatal error if there are no
      definitions. In practice this isn't much of a problem for
      llvm/lib/Target/RISCV/*.td where it's hard to imagine not having at
      least one of the required defitions. But it limits our ability to
      structure and maintain tests (which is how I came across this issue).
      
      This commit moves to using getAllDerivedDefinitionsIfDefined and aims to
      skip emission of data structures that make no sense if no definitions
      were found.
      754ff0f5
  2. May 13, 2024