1. Feb 15, 2024
  2. Feb 14, 2024
    • Matthias Springer's avatar
      [mlir][Transforms][NFC] Improve listener layering in dialect conversion (#81236) · ea2d9383
      Matthias Springer authored
      Context: Conversion patterns provide a `ConversionPatternRewriter` to
      modify the IR. `ConversionPatternRewriter` provides the public API. Most
      function calls are forwarded/handled by `ConversionPatternRewriterImpl`.
      The dialect conversion uses the listener infrastructure to get notified
      about op/block insertions.
      
      In the current design, `ConversionPatternRewriter` inherits from both
      `PatternRewriter` and `Listener`. The conversion rewriter registers
      itself as a listener. This is problematic because listener functions
      such as `notifyOperationInserted` are now part of the public API and can
      be called from conversion patterns; that would bring the dialect
      conversion into an inconsistent state.
      
      With this commit, `ConversionPatternRewriter` no longer inherits from
      `Listener`. Instead `ConversionPatternRewriterImpl` inherits from
      `Listener`. This removes the problematic public API and also simplifies
      the code a bit: block/op insertion notifications were previously
      forwarded to the `ConversionPatternRewriterImpl`. This is no longer
      needed.
      ea2d9383
    • Christian Sigg's avatar
      [bazel][mlir] Fix after 232cf949 · 995c9061
      Christian Sigg authored
      995c9061
    • Chris B's avatar
      [NFC] Add API documentation and annotations (#78635) · 457c1794
      Chris B authored
      This change adds SM 6.2 availability annotation to 16-bit APIs (16-bit
      types require SM 6.2), and adds Doxygen API documentation.
      457c1794
    • Jay Foad's avatar
      [AMDGPU] Refactor export instruction definitions. NFC. (#81738) · 9c06b079
      Jay Foad authored
      Using multiclasses for the Real instruction definitions has a couple of
      benefits:
      - It avoids repeating information that was already specified when
        defining the corresponding pseudo, like the row and done bits.
      - It allows commoning up the Real definitions for architectures which
        are mostly the same, like GFX11 and GFX12.
      9c06b079
    • Alex Zinenko's avatar
      [mlir] update bazel for bd8fcf75 · 232cf949
      Alex Zinenko authored
      232cf949
    • Timm Bäder's avatar
      [clang][Interp][NFC] Add missing special cases for implicit functions · b37bd78e
      Timm Bäder authored
      We have this special case in getSource() and getRange(), but we
      were missing it in getExpr() and getLocation().
      b37bd78e
    • Orlando Cazalet-Hyams's avatar
      [RemoveDIs] Replicate dbg intrinsic movement pattern in SelectOptimize (#81737) · a50bd0d7
      Orlando Cazalet-Hyams authored
      Fix crash mentioned in comments on
      d759618d.
      
      The assertion being hit was complaining that we had dangling DPValues;
      the DPValues attached to the terminator of StartBlock become dangling
      after the terminator is erased, and they're never "flushed" back onto
      the new terminator once it's added. Doing that makes the crash go away,
      but doesn't replicate existing dbg.* behaviour. See the comment in the
      patch.
      
      This change both fixes the crash (because there are now no DPValues left
      on the terminator to dangle) and replicates existing behaviour (moves
      those DPValues down to the new block).
      a50bd0d7
    • Nico Weber's avatar
      [gn] port 09e98950 (InstallAPI) · 2d7fdfa6
      Nico Weber authored
      2d7fdfa6
    • Philipp Tomsich's avatar
      [AArch64] Initial Ampere1B scheduling model (#81341) · dd1897c6
      Philipp Tomsich authored
      The Ampere1B core is enabled with a new scheduling/pipeline model, as it
      provides significant updates over the Ampere1 core; it reduces latencies
      on many instructions, has some micro-ops reassigned between the XY and X
      units, and provides modelling for the instructions added since Ampere1
      and Ampere1A.
      
      As this is the first model implementing the CSSC instructions, we update
      the UnsupportedFeatures on all other models (that have CompleteModel
      set).
          
      Testcases are added under llvm-mca: these showed the FullFP16 feature
      missing, so we are adding it in as part of this commit.
      
      This *adds tests and additional fixes* compared to the reverted #81338.
      dd1897c6
    • Pierre van Houtryve's avatar
      [AMDGPU] Replace '.' with '-' in generic target names (#81718) · 43c7eb5d
      Pierre van Houtryve authored
      The dot is too confusing for tools. Output temporaries would have
      '10.3-generic' so tools could parse it as an extension, device libs &
      the associated clang driver logic are also confused by the dot.
      
      After discussions, we decided it's better to just remove the '.' from
      the target name than fix each issue one by one.
      43c7eb5d
    • NAKAMURA Takumi's avatar
      [MC/DC] Refactor: Introduce `ConditionIDs` as `std::array<2>` (#81221) · 1a1fcacb
      NAKAMURA Takumi authored
      Its 0th element corresponds to `FalseID` and 1st to `TrueID`.
      
      CoverageMappingGen.cpp: `DecisionIDPair` is replaced with `ConditionIDs`
      1a1fcacb
    • Aaron Ballman's avatar
      [C23] Do not diagnose binary literals as an extension (#81658) · 8e24bc09
      Aaron Ballman authored
      We previously would diagnose them as a GNU extension in C mode, but they
      are now a feature of C23. The -Wgnu-binary-literal warning group no
      longer controls any diagnostics as this is no longer a GNU extension.
      The warning group is retained as a noop to help avoid "unknown warning"
      diagnostics.
      
      This also adds the companion compatibility warning which existed for C++
      but not for C.
      
      Fixes https://github.com/llvm/llvm-project/issues/72017
      8e24bc09
    • Oleksandr "Alex" Zinenko's avatar
      [mlir][python] expose LLVMStructType API (#81672) · bd8fcf75
      Oleksandr "Alex" Zinenko authored
      Expose the API for constructing and inspecting StructTypes from the LLVM
      dialect. Separate constructor methods are used instead of overloads for
      better readability, similarly to IntegerType.
      bd8fcf75
    • David Green's avatar
      [AArch64] Materialize constants via fneg. (#80641) · 6c84709e
      David Green authored
      This is something that is already done as a special case for copysign,
      this patch extends it to be more generally applied. If we are trying to
      matrialize a negative constant (notably -0.0, 0x80000000), then there
      may be no movi encoding that creates the immediate, but a fneg(movi)
      might.
      
      Some of the existing patterns for RADDHN needed to be adjusted to keep
      them in line with the new immediates.
      6c84709e
    • Jay Foad's avatar
      [TableGen] Stop using make_pair and make_tuple. NFC. (#81730) · f723260a
      Jay Foad authored
      These are unnecessary since C++17.
      f723260a
    • Guillaume Chatelet's avatar
      [libc] Add user defined literals to initialize `BigInt` and `__uint128_t` constants (#81267) · 03232350
      Guillaume Chatelet authored
      Adds user defined literal to construct unsigned integer constants. This
      is useful when constructing constants for non native C++ types like
      `__uint128_t` or our custom `BigInt` type.
      03232350
    • Yingwei Zheng's avatar
      [ValueTracking] Compute known FPClass from signbit idiom (#80740) · 16a0629e
      Yingwei Zheng authored
      This patch improves `computeKnownFPClass` by using context-sensitive
      information from `DomConditionCache`.
      The motivation of this patch is to optimize the following case found in
      [fmt/format.h](https://github.com/fmtlib/fmt/blob/e17bc67547a66cdd378ca6a90c56b865d30d6168/include/fmt/format.h#L3555-L3566):
      ```
      define float @test(float %x, i1 %cond) {
        %i32 = bitcast float %x to i32
        %cmp = icmp slt i32 %i32, 0
        br i1 %cmp, label %if.then1, label %if.else
      
      if.then1:
        %fneg = fneg float %x
        br label %if.end
      
      if.else:
        br i1 %cond, label %if.then2, label %if.end
      
      if.then2:
        br label %if.end
      
      if.end:
        %value = phi float [ %fneg, %if.then1 ], [ %x, %if.then2 ], [ %x, %if.else ]
        %ret = call float @llvm.fabs.f32(float %value)
        ret float %ret
      }
      ```
      We can prove the sign bit of %value is always zero. Then the fabs can be
      eliminated.
      
      This pattern also exists in cpython/duckdb/oiio/openexr.
      
      Compile-time impact:
      https://llvm-compile-time-tracker.com/compare.php?from=f82e0809ba12170e2f648f8a1ac01e78ef06c958&to=041218bf5491996edd828cc15b3aec5a59ddc636&stat=instructions:u
      
      
      |stage1-O3|stage1-ReleaseThinLTO|stage1-ReleaseLTO-g|stage1-O0-g|stage2-O3|stage2-O0-g|stage2-clang|
      |--|--|--|--|--|--|--|
      |-0.00%|+0.01%|+0.00%|-0.03%|+0.00%|+0.00%|+0.02%|
      16a0629e
    • David Spickett's avatar
      [clang][docs] Remove trailing whitespace · c5e13840
      David Spickett authored
      Which is causing CI checks to fail.
      
      clang/docs/LanguageExtensions.rst:2794:takes no arguments and produces an unsigned long long result. The builtin does
      clang/docs/LanguageExtensions.rst:2795:not guarantee any particular frequency, only that it is stable. Knowledge of the
      + echo '*** Trailing whitespace has been found in Clang source files as described above ***'
      c5e13840
    • Vlad Serebrennikov's avatar
      [clang][NFC] Use "notable" for "interesting" identifiers in `IdentifierInfo` (#81542) · 50275690
      Vlad Serebrennikov authored
      This patch expands notion of "interesting" in `IdentifierInto` it to
      also cover ObjC keywords and builtins, which matches notion of
      "interesting" in serialization layer. What was previously "interesting"
      in `IdentifierInto` is now called "notable".
      
      Beyond clearing confusion between serialization and the rest of the
      compiler, it also resolved a naming problem: ObjC keywords, notable
      identifiers, and builtin IDs are all stored in the same bit-field. Now
      we can use "interesting" to name it and its corresponding type, instead
      of `ObjCKeywordOrInterestingOrBuiltin` abomination.
      50275690
    • Florian Hahn's avatar
      [VPlan] Move dropping of poison flags to VPlanTransforms. (NFC) · debca7ee
      Florian Hahn authored
      Move collectPoisonGeneratingFlags from InnerLoopVectorizer to
      VPlanTransforms and also update its name. collectPoisonGeneratingFlags
      already directly drops poison-generating flags, not only collecting it.
      This means it is more appropriate to integerate it directly into the
      VPlan transform pipeline.
      
      The current implementation still calls back to legal to check if a block
      needs predication, which should be improved in the future.
      debca7ee
    • Philipp Tomsich's avatar
      [AArch64] Add tests for fusion on Ampere1/1A/1B (#81725) · 6cab375b
      Philipp Tomsich authored
      As commented on the PR #81293, the Ampere1-family does not have test
      cases for the common fusion cases it implements. This adds the Ampere1
      targets to the relevant misched-fusion testcases:
       * addadrp
       * addr
       * aes
      6cab375b
    • Sergei Lebedev's avatar
      [MLIR][Python] Added a base class to all builtin floating point types (#81720) · 82f3cbc8
      Sergei Lebedev authored
      This allows to
      
      * check if a given ir.Type is a floating point type via isinstance() or
      issubclass()
      * get the bitwidth of a floating point type
      
      See motivation and discussion in
      https://discourse.llvm.org/t/add-floattype-to-mlir-python-bindings/76959.
      82f3cbc8