1. Nov 30, 2023
    • Adrian Prantl's avatar
      [LEB128] Don't initialize error on success · 545c8e00
      Adrian Prantl authored
      This change removes an unnecessary branch from a hot path. It's also
      questionable API to override any previous error unconditonally.
      545c8e00
    • Francesco Petrogalli's avatar
      [llvm][docs] Add example use of `llvm-reduce`. (#73237) · 792253ae
      Francesco Petrogalli authored
      The script is based on an example provided by Tim
      Northover (https://github.com/TNorthover).
      792253ae
    • Vitaly Buka's avatar
      [msan] Intercept mallinfo2 only on GLIBC 2.33+ · 771e9cda
      Vitaly Buka authored
      Followup to #73729
      771e9cda
    • Philip Reames's avatar
      [LSR][TTI][RISCV] Enable terminator folding for RISC-V · e947f953
      Philip Reames authored
      If looking for a miscompile revert candidate, look here!
      
      The transform being enabled prefers comparing to a loop invariant
      exit value for a secondary IV over using an otherwise dead primary
      IV.  This increases register pressure (by requiring the exit value
      to be live through the loop), but reduces the number of instructions
      within the loop by one.
      
      On RISC-V which has a large number of scalar registers, this is
      generally a profitable transform.  We loose the ability to use a beqz
      on what is typically a count down IV, and pay the cost of computing
      the exit value on the secondary IV in the loop preheader, but save
      an add or sub in the loop body.  For anything except an extremely
      short running loop, or one with extreme register pressure, this is
      profitable.  On spec2017, we see a 0.42% geomean improvement in
      dynamic icount, with no individual workload regressing by more than
      0.25%.
      
      Code size wise, we trade a (possibly compressible) beqz and a (possibly
      compressible) addi for a uncompressible beq.  We also add instructions
      in the preheader.  Net result is a slight regression overall, but
      neutral or better inside the loop.
      
      Previous versions of this transform had numerous cornercase correctness
      bugs.  All of them ones I can spot by inspection have been fixed, and I
      have run this through all of spec2017, but there may be further issues
      lurking.  Adding uses to an IV is a fraught thing to do given poison
      semantics, so this transform is somewhat inherently risky.
      
      This patch is a reworked version of D134893 by @eop.  That patch has
      been abandoned since May, so I picked it up, reworked it a bit, and
      am landing it.
      e947f953
    • Slava Zakharin's avatar
      [flang][openacc] Representing Fortran descriptor management with OpenACC. (#72725) · 002c54a2
      Slava Zakharin authored
      This document describes the aspects of Fortran descriptor management
      in the offload data environment and how this semantics can be
      represented using MLIR OpenACC dialect.
      
      In the document I tried to clarify some parts of the OpenACC
      specification that seemed unclear to me, e.g. where the spec allowed different
      interpretations (in my opinion) or did not specify the actual runtime
      behavior. I tried to demonstrate how this ambiguity can affect user
      programs with examples.
      
      The document proposes using `attachRecipe` on the data operations
      to represent the non-trivial pointer attachment semantics for variables
      represented by descriptors. The recipe provides the actual
      implementation of the pointer attachment, e.g. we can call an F18 offload runtime
      function that will perform all necessary checks and actions.
      
      It is unclear at this point if we want to expose the implementation
      details in FIR, otherwise, the recip...
      002c54a2
    • Mehdi Amini's avatar
      [mlir] Adopt `ConvertToLLVMPatternInterface` GpuToLLVMConversionPass to align... · 9e7b6f46
      Mehdi Amini authored
      [mlir] Adopt `ConvertToLLVMPatternInterface` GpuToLLVMConversionPass to align with `convert-to-llvm` (#73761)
      
      This is a follow-up to the introduction of `convert-to-llvm`: it is
      supposed to be a unifying pass through the
      `ConvertToLLVMPatternInterface`, but some specific conversion (like the
      GPU target) aren't vanilla LLVM target. Instead they need extra
      customizations that are specific to LLVM-on-GPUs and our custom runtime
      wrappers.
      This change make the GpuToLLVMConversionPass just as pluggable as the
      `convert-to-llvm` by using the same mechanism.
      9e7b6f46
    • Finn Plummer's avatar
      [mlir][spirv] Add canon patterns for IAddCarry/[S|U]MulExtended (#73340) · 14028ec0
      Finn Plummer authored
      Add missing constant propogation folder for IAddCarry and
      [S|U]MulExtended. Due to currently missing constant value for
      spirv.struct the folding is done using canonicalization patterns.
      
      Implement additional folding when rhs is 0 for all ops and when rhs is 1
      for UMulExt.
      
      This helps for readability of lowered code into SPIR-V.
      
      Part of work for #70704
      14028ec0
    • Greg Clayton's avatar
      Allow lldb to load .dwp files with large .debug_info or .debug_types. (#73736) · ce00133e
      Greg Clayton authored
      A previous patch to llvm allowed the DWARFUnitIndex class to handle
      .debug_info.dwo and .debug_types.dwo sections to go over 4GB by checking
      for this case and fixing up the DWARFUnitIndex. LLDB's DWARF parser
      tries to use the llvm's DWARF parser when it can, and LLDB's DWARF
      parser uses the llvm::DWARFUnitIndex which should allow us to load large
      .dwp files, but there were a few things missing on the LLDB front:
      - support for parsing DWARFUnit objects when the offset exceeds 4GB due
      to a 32 bit truncation issue
      - not populating the required DWARF sections when we call
      DWARFContext::GetAsLLVM() which didn't allow the fixups to happen as the
      data was missing.
      
      This patch fixes these issues and now allows LLDB to parse large .dwp
      files without issues. The issue was discovered when running the "target
      modules dump separate-debug-info" command on one of these binaries that
      used a large .dwp file.
      
      This is unfortunately hard to test without creating a huge .dwp file, so
      there are currently no tests for this that I can think of adding that
      wouldn't cause disk space constraints or making testing times longer by
      producing a huge .dwp file.
      ce00133e
    • Craig Topper's avatar
      [RISCV] Remove reference to non-existant __builtin_riscv_sha512sum0l/__builtin_riscv_sha512sum1l. · 8f564a1f
      Craig Topper authored
      This was a copy/paste mistake from sig0/sig1 which have high and low halves.
      sum0 and sum1 have sum0r and sum1r instead.
      8f564a1f
    • Vitaly Buka's avatar
      [msan] Intercept mallinfo2 (#73729) · 6a634953
      Vitaly Buka authored
      6a634953
    • Vitaly Buka's avatar
    • Ramkumar Ramachandra's avatar
      clang/APINotes: fix parenthesization of &&, || · 2f1399c7
      Ramkumar Ramachandra authored
      Follow up on 59edb432 (clang/APINotes: squelch a -Wparantheses warning
      (NFC)) to fix parenthesization, as requested by David Blaikie.
      2f1399c7
    • Finn Plummer's avatar
      [mlir][spirv] Add folding for [S|U]Mod, [S|U]Div, SRem (#73341) · 5259e14e
      Finn Plummer authored
      Add missing constant propogation folder for [S|U]Mod, [S|U]Div, SRem
      
      Implement additional folding when rhs is 1 for all ops.
      
      This helps for readability of lowered code into SPIR-V.
      
      Part of work for #70704
      5259e14e
    • Teresa Johnson's avatar
      [MemProf][NFC] Correct comment about stripping of suffixes in profile (#73840) · 749d595d
      Teresa Johnson authored
      The comment about the stripping of suffixes when creating the indexed
      MemProf profile was partially incorrect, as we do not strip ".__uniq."
      suffixes by default (by design). Update the comment accordingly.
      749d595d
    • Johannes Doerfert's avatar
      [OpenMP][NFC] Separate OpenMP/OpenACC specific mapping code (#73817) · 40422bf1
      Johannes Doerfert authored
      While this does not really encapsulate the mapping code, it at least
      moves most of the declarations out of the way.
      40422bf1
    • Chris Bieneman's avatar
      [NFC] Fix failing test introduced in #67700 · ff96567b
      Chris Bieneman authored
      This fixes the test to handle the changes in the AST printer.
      ../clang/test/SemaHLSL/Types/BuiltinVector/ScalarSwizzles.hlsl
      ff96567b
    • David Li's avatar
      Enable custom lowering of fabs_v16f16 with AVX and fabs_v32f16 with A… (#73565) · f688e090
      David Li authored
      This is the last patch for fabs lowering. v32f16 works for AVX as well
      with the patch (with type legalization).
      f688e090
    • Chris B's avatar
      [HLSL] Support vector swizzles on scalars (#67700) · 2630d72c
      Chris B authored
      HLSL supports vector swizzles on scalars by implicitly converting the
      scalar to a single-element vector. This syntax is a convienent way to
      initialize vectors based on filling a scalar value.
      
      There are two parts of this change. The first part in the Lexer splits
      numeric constant tokens when a `.x` or `.r` suffix is encountered. This
      splitting is a bit hacky but allows the numeric constant to be parsed
      separately from the vector element expression. There is an ambiguity
      here with the `r` suffix used by fixed point types, however fixed point
      types aren't supported in HLSL so this should not cause any exposable
      problems (a separate issue has been filed to track validating language
      options for HLSL: #67689).
      
      The second part of this change is in Sema::LookupMemberExpr. For HLSL,
      if the base type is a scalar, we implicit cast the scalar to a
      one-element vector then call back to perform the vector lookup.
      
      Fixes #56658 and #67511
      2630d72c
    • Johannes Doerfert's avatar
    • Pete Steinfeld's avatar
      [flang] Cleanup of NYI messages (#73740) · 04b18530
      Pete Steinfeld authored
      This update makes the user visible messages relating to features that
      are not yet implemented be more consistent. I also cleaned up some of
      the code.
      
      For NYI messages that refer to intrinsics, I made sure the the message
      begins with "not yet implemented: intrinsic:" to make them easier to
      recognize.
      
      I created some utility functions for NYI reporting that I put into
      .../include/Optimizer/Support/Utils.h. These mainly convert MLIR types
      to their Fortran equivalents.
      
      I converted the NYI code to use the newly created utility functions.
      04b18530
    • Aaron Ballman's avatar
      Remove an outdated comment; NFC · 2273ee08
      Aaron Ballman authored
      StandardConversionSequence is significantly larger than a word.
      2273ee08
    • Johannes Doerfert's avatar
      [OpenMP][NFC] Put ExponentialBackoff in a Utils header (#73816) · b465f94b
      Johannes Doerfert authored
      "private.h" will go.
      b465f94b
    • Tom Eccles's avatar
      Revert "[flang] Enable alias tags pass by default (#73111)" (#73821) · 5ce5ea37
      Tom Eccles authored
      This reverts commit caba0314.
      
      Serious performance regressions were reported by @vzakhari
      https://github.com/llvm/llvm-project/issues/58303#issuecomment-1830754173
      
      Fixing this doesn't look quick so I will revert for now.
      5ce5ea37
    • Aaron Ballman's avatar
      Correct the documentation category for the 'cleanup' attribute · aeb051af
      Aaron Ballman authored
      It was previously classified as a type attribute when it is actually a
      variable attribute.
      aeb051af
    • jeanPerier's avatar
      740f14ed
    • Mark de Wever's avatar
      [libc++][format] Fixes formatting code units as integers. (#73396) · 16b8c960
      Mark de Wever authored
      This paper was voted in as a DR, so it's retroactively enabled back to
      C++20; the C++ version that introduced std::format.
      
      Implements:
      - P2909R4 Fix formatting of code units as integers (Dude, where’s my
      ``char``?)
      16b8c960
    • Johannes Doerfert's avatar
      [OpenMP][NFC] Rename OmptCallback.cpp into OpenMP/OMPT/Callback.cpp (#73813) · bdecfebc
      Johannes Doerfert authored
      Also revert the ifdef OMPT_SUPPORT order to have the short fallback
      first and not after 400 lines.
      bdecfebc
    • Johannes Doerfert's avatar
      fd2d0bf9
    • Johannes Doerfert's avatar
    • Youngsuk Kim's avatar
      [llvm] Replace uses of Type::getPointerTo (NFC) · 859338a6
      Youngsuk Kim authored
      Work towards removing method Type::getPointerTo.
      Opaque ptr cleanup effort.
      859338a6
    • Jeremy Morse's avatar
      [DebugInfo][RemoveDIs] Extract DPValues in CodeExtractor like dbg.values (#73252) · 3bf72bf4
      Jeremy Morse authored
      CodeExtractor shifts dbg.value intrinsics out of the region being
      extracted and updates them to be appropriate in the extracted function.
      With new non-intrinsic variable locations, we need to manually do this
      too, with DPValues.
      
      Most of this patch shifts and refactors some utilities in
      fixupDebugInfoPostExtraction so that we can add a single extra helper
      lambda that iterates over DPValues and applies update-utilities. We also
      have to assign the IsNewDbgInfoFormat flag in a bunch of places -- this
      normally gets set the moment you insert a block into a function (or
      function into a module), however a few blocks are constructed here
      before being inserted, thus we have to do some manual setup.
      
      Tested via LoopExtractor_alloca.ll, which invokes debugify.
      3bf72bf4
    • Nick Desaulniers's avatar
      [X86InstrInfo] support memfold on spillable inline asm (#70832) · b0533598
      Nick Desaulniers authored
      This enables -regalloc=greedy to memfold spillable inline asm
      MachineOperands.
      
      Because no instruction selection framework marks MachineOperands as
      spillable, no language frontend can observe functional changes from this
      patch. That will change once instruction selection frameworks are
      updated.
      
      Link: https://github.com/llvm/llvm-project/issues/20571
      b0533598
    • Mats Petersson's avatar
      [flang] Make adapt.valuebyref attribute work again (#73658) · 0ccef6a7
      Mats Petersson authored
      This got "lost" in the HLFIR transformation. This patch applies the old
      attribute to the AssociateOp that needs it, and forwards it to the
      AllocaOp that is generated when lowering to FIR.
      0ccef6a7
    • jyu2-git's avatar
      Fix accsessing "PresentModifierLocs" array beyond its end. (#73579) · 953d675c
      jyu2-git authored
      Currently PresentModifierLocs defined with size DefaultmapKindNum; where
      DefaultmapKindNum = OMPC_DEFAULTMAP_pointer + 1
      
      Before 5.0 variable-category can not be omitted. For the test like
      \#pragma omp target map(tofrom: errors) defaultmap(present)
      
      error would be mitted.
      
      After 5.0 that is allowd.
      
      When try to:
      PresentModifierLocs[DMC->getDefaultmapKind()] =
                    DMC->getDefaultmapModifierLoc();
      It is accessed beyond array end.
      
      To fix this using OMPC_DEFAULTMAP_unknow instead OMPC_DEFAULTMAP_poiner.
      953d675c
  2. Nov 29, 2023