- Mar 12, 2024
-
-
Matthias Springer authored
This commit makes `rewriterImpl` private in `IRRewrite`. This ensures that only the conversion value mapping and the dialect conversion configuration can be accessed from an IR rewrite object.
-
- Mar 11, 2024
-
-
Matthias Springer authored
This commit adds support for `RewriterBase::replaceAllUsesWith` to the dialect conversion. Uses are not immediately replaced, but in a delayed fashion during the "commit" phase. No type conversions are performed; this is consistent with `ConversionPatternRewriter::replaceUsesOfBlockArgument`. - `RewriterBase::replaceAllUsesWith` is now virtual, so that it can be overridden in the dialect conversion. Note: `RewriterBase::replaceOp` can now be turned into a non-virtual function in a follow-up commit. - `ConversionPatternRewriter::replaceUsesOfBlockArgument` is generalized to `ConversionPatternRewriter::replaceAllUsesWith`, following the same implementation strategy. - A new kind of "IR rewrite" is added: `ValueRewrite` with `ReplaceAllUsesRewrite` (replacing `ReplaceBlockArgRewrite`) as the only value rewrite for now. - `replacedOps` is renamed to `erasedOps` to better capture its meaning. BEGIN_PUBLIC No public commit message needed for presubmit. END_PUBLIC
-
Matthias Springer authored
Turn `RewriterBase::replaceAllUsesWith` into a non-templatized implementation, so that it can be made virtual and be overridden in the `ConversionPatternRewriter` in a subsequent change. This change is in preparation of adding dialect conversion support for `replaceAllUsesWith`.
-
Matthias Springer authored
Before this change: `notifyOperationReplaced` was triggered when calling `RewriteBase::replaceOp`. After this change: `notifyOperationReplaced` is triggered when `RewriterBase::replaceAllOpUsesWith` or `RewriterBase::replaceOp` is called. Until now, every `notifyOperationReplaced` was always sent together with a `notifyOperationErased`, which made that `notifyOperationErased` callback irrelevant. More importantly, when a user called `RewriterBase::replaceAllOpUsesWith`+`RewriterBase::eraseOp` instead of `RewriterBase::replaceOp`, no `notifyOperationReplaced` callback was sent, even though the two notations are semantically equivalent. As an example, this can be a problem when applying patterns with the transform dialect because the `TrackingListener` will only see the `notifyOperationErased` callback and the payload op is dropped from the mappings. Note: It is still possible to write semantically equivalent code that does not trigger a `notifyOperationReplaced` (e.g., when op results are replaced one-by-one), but this commit already improves the situation a lot.
-
- Mar 09, 2024
-
-
Matthias Springer authored
#82629 added additional overloads to `replaceAllUsesWith` and `replaceUsesWithIf`. This caused a build breakage with MSVC when called with ops that can implicitly convert to `Value`. ``` external/llvm-project/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp(881): error C2666: 'mlir::RewriterBase::replaceAllUsesWith': 2 overloads have similar conversions external/llvm-project/mlir/include\mlir/IR/PatternMatch.h(631): note: could be 'void mlir::RewriterBase::replaceAllUsesWith(mlir::Operation *,mlir::ValueRange)' external/llvm-project/mlir/include\mlir/IR/PatternMatch.h(626): note: or 'void mlir::RewriterBase::replaceAllUsesWith(mlir::ValueRange,mlir::ValueRange)' external/llvm-project/mlir/include\mlir/IR/PatternMatch.h(616): note: or 'void mlir::RewriterBase::replaceAllUsesWith(mlir::Value,mlir::Value)' external/llvm-project/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp(882): note: while trying to match the argument list '(mlir::tensor::ExtractSliceOp, T)' with [ T=mlir::Value ] ``` Note: The LLVM build bots (Linux and Windows) did not break, this seems to be an issue with `Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe`. This change renames the newly added overloads to `replaceAllOpUsesWith` and `replaceOpUsesWithIf`. -
Nikolas Klauser authored
In valid code, there should only be a very specific set of members in a lambda definition. If the user tries to define something inside the lambda class, this assumption is violated and causes an assertion error. This can be fixed by checking whether the members are valid, and if not, ignore that the class members are potentially unexpected. I've come across this while working on implementing lambdas in C++03.
-
Nikolas Klauser authored
We've talked about allowing extensions on [discourse](https://discourse.llvm.org/t/rfc-use-language-extensions-from-future-standards-in-libc/71898/5) and in a libc++ monthly meeting and agreed to test it out in the LLVM 18 release. We've done that with the `tuple` constructor overload set (using conditional `explicit`). Since we haven't heard about any breakages, it seems safe to do. This patch enables the use of extension from later C++ standards inside the versioned `std` namespaces. This should be good enough, since almost all of our code is inside that namespace. This approach also avoids the use of extensions inside the test `std` suite. That part of the code base should stay clean, since it's a test suite that is also used by other vendors to test their implementations.
-
Adrian Prantl authored
Change GetNumChildren()/CalculateNumChildren() methods return llvm::Expected This is an NFC change that does not yet add any error handling or change any code to return any errors. This is the second big change in the patch series started with https://github.com/llvm/llvm-project/pull/83501 A follow-up PR will wire up error handling.
-
Daniel Thornburgh authored
…efault (#83201)" This reverts commit 062cfada. See issue #84574.
-
Kojo Acquah authored
This patch adds a the `LowerVectorToArmNeonPattern` patterns to the ArmNeon. This pattern inspects `vector.contract` ops that can be 1-1 mapped to an `arm.neon.smmla` intrinsic. The contract ops must be separated into tiles who's inputs must fit that of a single smmla op (`2x8xi32` inputs and `2x2xi32` output). The `vector.contract` inputs must be sign extended from narrow types (<=i8) to be converted. If all conditions are met, an smmla op is inserted with additional `vector.shape_casts` to handle linearizing the input and output dimension.
-
Jakub Kuderski authored
-
Florian Mayer authored
Tested in AOSP.
-
Peiming Liu authored
…ning when unittest is enabled
-
Florian Mayer authored
-
Joseph Huber authored
Summary: We previously changed the data layout for the RPC buffer to make it lane size agnostic. I put off changing the size for the server case to make the patch smaller. This patch simply reorganizes code by making the lane size an argument to the port rather than a templtae size. Heavily simplifies a lot of code, no more `std::variant`.
-
Louis Dionne authored
The libc++ CMake build aims to provide a general-purpose configuration that matches the canonical LLVM setup (libc++ / libc++abi / libunwind), not the configuration used for compatibility on any given system. For these "compatibility" configurations, we use CMake caches like Apple.cmake and FreeBSD.cmake. Defaulting to libcxxrt on FreeBSD makes it look as though we're trying to build the system compatible configuration on FreeBSD, which isn't really correct and causes confusion more than anything else. Fixes #84476
-
Florian Hahn authored
Without this bail out, we may generate fields with null nodes as tags are generated by using getTypeInfo which has the same bail out. PR: https://github.com/llvm/llvm-project/pull/84386
-
yingopq authored
Add sign extension "SEB/SEH" before compare. Fix #61881
-
David CARLIER authored
Also fixing OpenMP build itself for this platform.
-
Teresa Johnson authored
Enable temporary support to ease use of new llvm-profdata with slightly older indexed profiles after 16e74fd4, which bumped the indexed format for type profiling.
-
Florian Mayer authored
This reverts commit 99118c80.
-
Florian Mayer authored
Reverts llvm/llvm-project#83171 broke sanitizer buildbot https://lab.llvm.org/buildbot/#/builders/168/builds/19110/steps/10/logs/stdio
-
LLVM GN Syncbot authored
-
David Majnemer authored
v8f16 is a legal type but promoting to v16f16 would result in an illegal type. Let's legalize these by a combination of splitting+promoting resulting in a pair of v4f16. Also, we were being overly cautious with different v4f16 nodes. Mark more of them safe to promote to v4f32.
-
David Majnemer authored
Legalization would result in needless scalarization. Add some DAGCombines to fix this up.
-
Shilei Tian authored
The current implementation of `isInlinableLiteral16` assumes, a 16-bit inlinable literal is either an `i16` or a `fp16`. This is not always true because of `bf16`. However, we can't tell `fp16` and `bf16` apart by just looking at the value. This patch splits `isInlinableLiteral16` into three versions, `i16`, `fp16`, `bf16` respectively, and call the corresponding version.
-
Fangrui Song authored
-
Nikolas Klauser authored
-
Mads Marquart authored
`CPUFAMILY_ARM_BLIZZARD_AVALANCHE` and `CPUFAMILY_ARM_EVEREST_SAWTOOTH` are taken from `<mach/machine.h>` in `Kernel.framework`.
-
Jay Foad authored
Abstracting out a new base class VBUFFER_Real_gfx12 just highlights that the only difference between the MUBUF and MTBUF forms is in the handling of the "format" field.
-
Jay Foad authored
-
Tom Stellard authored
Since aa020024 we weren't installing the correct dependencies, and since 2836d8ed we must pass a custom token to github-upload-release.py for verifying permissions.
-
Andrew Browne authored
-
Alexey Bataev authored
This improves overall analysis for minbitwidth in SLP. It allows to analyze the trees with store/insertelement root nodes. Also, instead of using single minbitwidth, detected from the very first analysis stage, it tries to detect the best one for each trunc/ext subtree in the graph and use it for the subtree. Results in better code and less vector register pressure. Metric: size..text Program size..text results results0 diff test-suite :: SingleSource/Benchmarks/Adobe-C++/simple_types_loop_invariant.test 92549.00 92609.00 0.1% test-suite :: External/SPEC/CINT2017speed/625.x264_s/625.x264_s.test 663381.00 663493.00 0.0% test-suite :: External/SPEC/CINT2017rate/525.x264_r/525.x264_r.test 663381.00 663493.00 0.0% test-suite :: MultiSource/Benchmarks/Bullet/bullet.test 307182.00 307214.00 0.0% test-suite :: External/SPEC/CFP2017speed/638.imagick_s/638.imagick_s.test 1394420.00 1394484.00 0.0% test-suite :: External/SPEC/CFP2017rate/538.imagick_r/538.imagick_r.test 1394420.00 1394484.00 0.0% test-suite :: External/SPEC/CFP2017rate/510.parest_r/510.parest_r.test 2040257.00 2040273.00 0.0% test-suite :: External/SPEC/CFP2017rate/526.blender_r/526.blender_r.test 12396098.00 12395858.00 -0.0% test-suite :: External/SPEC/CINT2006/445.gobmk/445.gobmk.test 909944.00 909768.00 -0.0% SingleSource/Benchmarks/Adobe-C++/simple_types_loop_invariant - 4 scalar instructions remain scalar (good). Spec2017/x264 - the whole function idct4x4dc is vectorized using <16 x i16> instead of <16 x i32>, also zext/trunc are removed. In other places last vector zext/sext removed and replaced by extractelement + scalar zext/sext pair. MultiSource/Benchmarks/Bullet/bullet - reduce or <4 x i32> replaced by reduce or <4 x i8> Spec2017/imagick - Removed extra zext from 2 packs of the operations. Spec2017/parest - Removed extra zext, replaced by extractelement+scalar zext Spec2017/blender - the whole bunch of vector zext/sext replaced by extractelement+scalar zext/sext, some extra code vectorized in smaller types. Spec2006/gobmk - fixed cost estimation, some small code remains scalar. Original Pull Request: https://github.com/llvm/llvm-project/pull/84334 The patch has the same functionality (no test changes, no changes in benchmarks) as the original patch, just has some compile time improvements + fixes for xxhash unittest, discovered earlier in the previous version of the patch. Reviewers: Pull Request: https://github.com/llvm/llvm-project/pull/84536 -
Changpeng Fang authored
-
Adrian Prantl authored
Change GetNumChildren()/CalculateNumChildren() methods return llvm::Expected This is an NFC change that does not yet add any error handling or change any code to return any errors. This is the second big change in the patch series started with https://github.com/llvm/llvm-project/pull/83501 A follow-up PR will wire up error handling.
-
Changpeng Fang authored
We usually expect to copy SubtargetPredicate (and OtherPredicates) from pseudo to real. However, in dpp16 and dpp8, there are assignments like SubtargetPredicate = HasDPP/HasDPP16/HasDpp8. These assignments override predicates copied from pseudo, and thus the predicates used to define pseudo get lost. Losing predicates is a subtle issue usually not easy to be found. It may result in instructions being generated on GPUs that do not support the features to generate them. https://github.com/llvm/llvm-project/pull/84354 addressed one of such issues, and inspired this work. Fortunately, we found that the assignment of SubtargetPredicate usually comes together with assignment of AssemblerPredicate, and with the same value. For example: let AssemblerPredicate = HasDPP16; let SubtargetPredicate = HasDPP16; One of them is redundant and can be removed. In this work, we remove the redundant assignment of SubtargetPredicate, and then copy it from pseudo for VOP*_DPP and VOP*_DPP8. With this change, we can safely use SubtargetPredicate to define pseudo instructions.
-
Craig Topper authored
Teach canCreateUndefOrPoison that ISD::SETCC with integer operands can never create undef/poison. FP SETCC is more complicated and will be handled in a future patch. Teach isGuaranteedNotToBeUndefOrPoison that ISD::CONDCODE is not poison/undef. Its a special constant only used by setcc/select_cc like nodes. This is needed since the hoisting will only hoist if exactly one operand might be poison. setcc has 3 operand including the condition code. Recovers some regression from #84232. -
erichkeane authored
This was replaced with tablegen anyway, so it just contained a stale comment. This patch removes it.
-
Chris B authored
This just seeks to give a high level overview of the current state of the DirectX backend. It doesn't go in too deep, but should be a starting point for further documentation. --------- Co-authored-by:S. Bharadwaj Yadavalli <Bharadwaj.Yadavalli@microsoft.com>
-