- Mar 09, 2022
-
-
Mahesh Ravishankar authored
Commit rG1a2bb03e introduced a pattern to convert dynamic dimensions in operands of `GenericOp`s to static values based on indexing maps and shapes of other operands. The logic is directly usable to any `LinalgOp`. Move that pattern as an `OpInterfaceRewritePattern`. Differential Revision: https://reviews.llvm.org/D120968
-
Lei Zhang authored
This is a pass that can be used by downstream consumers directly to avoid the boilerplate to wrap around the `populate*Patterns`. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D121222
-
Arthur O'Dwyer authored
https://en.wikipedia.org/wiki/Heapsort#Bottom-up_heapsort In `pop_heap` specifically, the item we insert at the top and sift downward is guaranteed to be leaf-sized, so we expect it to go pretty far down. Sift it down as if it were INT_MIN, and then bubble it back up if needed. Also known as "heapsort with bounce." Numbers are here: https://godbolt.org/z/cvfnYW6fe Fixes #10008. Differential Revision: https://reviews.llvm.org/D118003
-
Arthur O'Dwyer authored
Reviewed as part of D118003.
-
Amir Ayupov authored
Convert simple hammocks into cmov based on misprediction rate. Test Plan: - Assembly test: `cmov-conversion.s` - Testing on a binary: # Bootstrap clang with `-x86-cmov-converter-force-all` and `-Wl,--emit-relocs` (Release build) # Collect perf.data: - `clang++ <opts> bolt/lib/Core/BinaryFunction.cpp -E > bf.cpp` - `perf record -e cycles:u -j any,u -- clang-15 bf.cpp -O2 -std=c++14 -c -o bf.o` # Optimize clang-15 with and w/o -cmov-conversion: - `llvm-bolt clang-15 -p perf.data -o clang-15.bolt` - `llvm-bolt clang-15 -p perf.data -cmov-conversion -o clang-15.bolt.cmovconv` # Run perf experiment: - test: `clang-15.bolt.cmovconv`, - control: `clang-15.bolt`, - workload (clang options): `bf.cpp -O2 -std=c++14 -c -o bf.o` Results: ``` task-clock [delta: -360.21 ± 356.75, delta(%): -1.7760 ± 1.7589, p-value: 0.047951, balance: -6] instructions [delta: 44061118 ± 13246382, delta(%): 0.0690 ± 0.0207, p-value: 0.000001, balance: 50] icache-misses [delta: -5534468 ± 2779620, delta(%): -0.4331 ± 0.2175, p-value: 0.028014, balance: -28] branch-misses [delta: -1624270 ± 1113244, delta(%): -0.3456 ± 0.2368, p-value: 0.030300, balance: -22] ``` Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D120177 -
Lang Hames authored
When an external symbol is converted to an absolute it should be demoted to local scope so that the symbol does not become a new definition within this LinkGraph.
-
Mahesh Ravishankar authored
A `tensor.cast` consumer can be folded with its producer. This is beneficial only if the result of the tensor cast is more static than the source. This patch adds a utility function to check that this is the case, and adds a couple of canonicalizations patterns that fold an operation with `tensor.cast` conusmers. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D120950
-
Chia-hung Duan authored
It's valid to create a TypedArrayAttr or MixedContainerType with nullptr, e.g., std::vector<mlir::Attribute> attrs = {mlir::StringAttr()}; builder.createArrayAttr(attrs); The predicate didn't check if it's a nullptr and it ended up a crash in the attribute static verifier. We always check if an attribute is null so it's better to align the check for these two container type attr. Reviewed By: rdzhabarov Differential Revision: https://reviews.llvm.org/D121178 -
Simon Pilgrim authored
[X86] convertIntLogicToFPLogic - enable fp-logic on pre-AVX targets for supported fp predicates (PR34563) If the SETCC fp-condcode is supported on SSE as a single CMPPS/PD op then we can use convertIntLogicToFPLogic to reduce EFLAGS and XMM->GPR traffic like we do for AVX targets. Differential Revision: https://reviews.llvm.org/D121210
-
Simon Pilgrim authored
Identify FP CondCode that can be performed by a non-AVX SSE CMP op Pulled out of D121210
-
Craig Topper authored
Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D120854
-
Craig Topper authored
Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D120785
-
Nicolas Vasilache authored
With the recent improvements to OpDSL it is cheap to reintroduce a linalg.copy operation. This operation is needed in at least 2 cases: 1. for copies that may want to change the elemental type (e.g. cast, truncate, quantize, etc) 2. to specify new tensors that should bufferize to a copy operation. The linalg.generic form always folds away which is not always the right call. Differential Revision: https://reviews.llvm.org/D121230 -
eopXD authored
The crypto extension have several shorthand extensions that don't consist of any extra instructions. Take `zk` for example, while the extension would imply `zkn, zkr, zkt`. The 3 extensions should also combine back into `zk` to maintain the canonical order in isa strings. This patch addresses the above. Reviewed By: VincentWu Differential Revision: https://reviews.llvm.org/D119530
-
Valentin Clement authored
This patch enables the lowering of the `sum` intrinsic. It adds also infrastructure to deal with optional arguments in intrinsics and implied loops. This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D121221 Co-authored-by:
Eric Schweitz <eschweitz@nvidia.com> Co-authored-by:
Jean Perier <jperier@nvidia.com> Co-authored-by:
mleair <leairmark@gmail.com>
-
Akira Hatanaka authored
CGBuiltin.cpp Differential Revision: https://reviews.llvm.org/D121153
-
Philip Reames authored
-
Sanjay Patel authored
This is noted as a missing clang warning in #54222 (and we should still make that enhancement). Alive2 proofs: https://alive2.llvm.org/ce/z/Q8drDq https://alive2.llvm.org/ce/z/pE6LRt I don't see a single conversion for all predicates using "getFCmpCode" logic, so other predicates are left as a TODO item.
-
gysit authored
Allow pointwise operations to take rank zero input tensors similarly to scalar inputs. Use an empty indexing map to broadcast rank zero tensors to the iteration domain of the operation. Depends On D120734 Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D120807
-
Philip Reames authored
As clarified by a recent email chain with Alina.
-
gysit authored
The revision removes the SoftPlus2DOp operation that previously served as a test operation. It has been replaced by the elemwise_unary operation, which is now used to test unary log and exp functions. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D120794
-
Andrzej Warzynski authored
The "FrontendActions.cpp" file (which is one of the source files for the `flangFrontend` library) includes "Passes.h.inc" (indirectly, via "CLOptions.inc"). This file is generated alongside other TableGen outputs from the `FIROptTransformsPassIncGen` CMake target. This patch adds `FIROptTransformsPassIncGen` to the list of build dependencies for `flangFrontend`. The lack of this dependency might cause non-determinstic build failures, e.g. https://lab.llvm.org/buildbot/#/builders/160/builds/6210. Differential Revision: https://reviews.llvm.org/D121218
-
Amir Ayupov authored
Address fuzzer crash on malformed input: ``` BOLT-ERROR: cannot get section contents for .dynsym: The end of the file was unexpectedly encountered. ``` Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D121068
-
gysit authored
Simplify tests that use `linalg.fill_rng_2d` to focus on testing the `const` and `index` functions. Additionally, cleanup emit_misc.py to use simpler test functions and fix an error message in config.py. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D120734
-
Arnold Schwaighofer authored
`swifterror` addresses are only allowed as operands to load, store, and calls. The following transformation is not allowed. It would create a phi with a `swifterror` address operand. ``` %addr = alloca swifterror i8* br %cond, label %bb1, label %b22 bb1: %val1 = load i8*, i8** %addr br exit bb2: %val2 = load i8*, i8** %addr br exit exit: %val = phi [%val1, %bb1] [%val2, %bb2] ``` => ``` %addr = alloca swifterror i8* br %cond, label %bb1, label %b22 bb1: br exit bb2: br exit exit: %val_addr = phi [%addr, %bb1] [%addr, %bb2] %val2 = load i8*, i8** %val_addr ``` rdar://89865485 Differential Revision: https://reviews.llvm.org/D121217
-
Hongtao Yu authored
Previously we initialed the work queue with MST roots based on NodeInfoMap which is an unordered map. This could cause a non-determinism. I'm fixing this by initializing the queue based on SortedEdges. I don't see any performance move with this change. However this helps debugging. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D120670
-
Hongtao Yu authored
CS nested profile has a benefit over the CS flat profile that is to speed up the build while achieve an on-par performance. I'm turning it on by default for CSSPGO. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D121142
-
Masoud Ataei authored
This patch is proposing a fix for patch https://reviews.llvm.org/D101759 on none tail call math function conversion to MASS call. Differential: https://reviews.llvm.org/D121016 reviewer: @nemanjai
-
Fraser Cormack authored
Fix a couple of else-after-return warnings and some unnecessary parentheses.
-
- Mar 08, 2022
-
-
gysit authored
Extend OpDSL with a `defines` method that can set the `hasCanonicalizer` flag for an OpDSL operation. If the flag is set via `defines(Canonicalizer)` the operation needs to implement the `getCanonicalizationPatterns` method. The revision specifies the flag for linalg.fill_tensor and adds an empty `FillTensorOp::getCanonicalizationPatterns` implementation. This revision is a preparation step to replace linalg.fill by its OpDSL counterpart linalg.fill_tensor. The two are only functionally equivalent if both specify the same canonicalization patterns. The revision is thus a prerequisite for the linalg.fill replacement. Depends On D120725 Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D120726
-
gysit authored
Enhance `LinalgTileAndFuseTensorOpsPattern` with an additional rewrite signature that returns the result of the rewrite. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D121212
-
gysit authored
Add a FillOpInterface similar to the contraction and convolution op interfaces. The FillOpInterface is a preparation step to replace linalg.fill by its OpDSL version linalg.fill_tensor. The interface implements the `value()`, `output()`, and `result()` methods that by default are not available on linalg.fill_tensor. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D120725
-
Louis Dionne authored
As a fly-by fix, enable the complexity-changing assertions in __debug_less only when the full debug mode is enabled, since debugging level 0 is usually understood to only contain basic assertions that do not change the complexity of algorithms. Differential Revision: https://reviews.llvm.org/D121129
-
Aaron Ballman authored
We were not creating an evaluation context for the TU scope, so we never popped an evaluation context for it. Popping the evaluation context triggers a number of diagnostics, including warnings about immediate invocations that we were previously missing. Note: I think we have an additional issue that we should solve, but not as part of this patch. I don't think Clang is properly modeling static initialization as happening before constant expression evaluation. I think structure members members are zero initialized per http://eel.is/c++draft/basic.start.static#1, https://eel.is/c++draft/basic.start.static#2.sentence-2, and http://eel.is/c++draft/dcl.init#general-6.2 and the new test case actually should be accepted. However, it's also worth noting that other compilers behave the way this patch makes Clang behave: https://godbolt.org/z/T7noqhdPr
-
Timm Bäder authored
Fix checking for an unsupported stdlib++. Differential Revision: https://reviews.llvm.org/D121209
-
Sanjay Patel authored
-
Nathan Sidwell authored
The existing module symbol mangling scheme turns out to be undemangleable. It is also desirable to switch to the strong-ownership model as the hoped-for C++17 compatibility turns out to be fragile, and we also now have a better way of controlling that. The issue is captured on the ABI list at: https://github.com/itanium-cxx-abi/cxx-abi/issues/134 A document describing the issues and new mangling is at: https://drive.google.com/file/d/1qQjqptzOFT_lfXH8L6-iD9nCRi34wjft/view This patch is the code-generation part. I have a demangler too, but that patch is based on some to-be-landed refactoring of the demangler. The old mangling is unceremoniously dropped. No backwards compatibility, no deprectated old-mangling flag. It was always labelled experimental. (Old and new manglings cannot be confused.) Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D118352
-
Jez Ng authored
ld64 breaks down `__objc_classrefs` on a per-word level and deduplicates them. This greatly reduces the number of bind entries emitted (and therefore the amount of work `dyld` has to do at runtime). For chromium_framework, this change to LLD cuts the number of (non-lazy) binds from 912 to 190, getting us to parity with ld64 in this aspect. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D121053
-
Jez Ng authored
`__cfstring` has embedded addends that foil ICF's hashing / equality checks. (We can ignore embedded addends when doing ICF because the same information gets recorded in our Reloc structs.) Therefore, in order to properly dedup CFStrings, we create a mutable copy of the CFString and zero out the embedded addends before performing any hashing / equality checks. (We did in fact have a partial implementation of CFString deduplication already. However, it only worked when the cstrings they point to are at identical offsets in their object files.) I anticipate this approach can be extended to other similar statically-allocated struct sections in the future. In addition, we previously treated all references with differing addends as unequal. This is not true when the references are to literals: different addends may point to the same literal in the output binary. In particular, `__cfstring` has such references to `__cstring`. I've adjusted ICF's `equalsConstant` logic accordingly, and I've added a few more tests to make sure the addend-comparison code path is adequately covered. Fixes https://github.com/llvm/llvm-project/issues/51281. Reviewed By: #lld-macho, Roger Differential Revision: https://reviews.llvm.org/D120137
-
Simon Pilgrim authored
-