- Feb 26, 2024
-
-
Nathan Sidwell authored
Some CGRecordLowering functions either do not need the object or do not mutate it. Thus marking static or const as appropriate.
-
Orlando Cazalet-Hyams authored
Enables conversion between llvm.dbg.label and DPLabel.
-
Orlando Cazalet-Hyams authored
-
Clement Courbet authored
This uses a more systematic approach for determining whcich `DeclRefExpr`s mutate the underlying object: Instead of using a few matchers, we walk up the AST until we find a parent that we can prove cannot change the underlying object. This allows us to handle most address taking and dereference, bindings to value and const& variables, and track constness of pointee (see changes in DeclRefExprUtilsTest.cpp). This allows supporting more patterns in `performance-unnecessary-copy-initialization`. Those two patterns are relatively common: ``` const auto e = (*vector_ptr)[i] ``` and ``` const auto e = vector_ptr->at(i); ``` In our codebase, we have around 25% additional findings from `performance-unnecessary-copy-initialization` with this change. I did not see any additional false positives.
-
Timm Bäder authored
This is also what the current interpreter does and a couple of test cases expect that.
-
Yeting Kuo authored
RISC-V implements vector lrint/llrint by vfcvt.x.f.v.
-
Wang Pengcheng authored
This reduces some lines.
-
Timm Bäder authored
Either LHS or RHS might be non-complex, but not both.
-
Yingwei Zheng authored
[GVN] Drop nsw/nuw flags when replacing the result of a with.overflow intrinsic with a overflowing binary operator (#82935) Alive2: https://alive2.llvm.org/ce/z/gyL7mn Fixes https://github.com/llvm/llvm-project/issues/82884.
-
NAKAMURA Takumi authored
- Introduce `createDecision(E)` for the root node of `VisitBin`. - Handle `mcdc::DecisionParameters` for each Decision method.
-
Dominik Wójt authored
The deduced "-march=" option always started with aarch64, which is not a valid value. There was also no way to distinguish between armv8-r and armv8-a. After this commit, the deduced "-march=" option will start with greatest available "armv*-a" value or "armv8-r".
-
Aiden Grossman authored
This patch removes the exegesis:: prefix within the exegesis namespace in llvm-exegesis.cpp as it isn't necessary due to the code already being wrapped in the namespace.
-
Timm Bäder authored
Implement constexpr checking for null pointers being passed to arguments annotated as nonnull.
-
Jason Eckhardt authored
Currently the DecoderEmitter spends a fair amount of cycles performing repeated linear walks over the entire instruction list. This patch eliminates one such walk during HwMode collection for EncodingInfos. The eliminated traversal visits every instruction and then every EncodingInfos entry for that instruction merely to collect all referenced HwModes. That information already happens to be present in the HwModeSelects created during the one-time construction of CodeGenHwModes. We instead traverse the HwModeSelects, collecting each one referenced as an encoding select. This set is a small constant in size and does not generally grow with the size of the instruction set.
-
Mehdi Amini authored
std::string was used here, likely by mistake. The usual convention for attributes is to use StringAttr.
-
Matteo Franciolini authored
The patch enables roundtrip to textual file when running `--verifyRoundtrip`. The verification is successful if both textual and bytecode formats can roundtrip successfully.
-
NAKAMURA Takumi authored
This is a preparation of incoming Clang changes (#82448) and just checks `TVIdx` is calculated correctly. NFC. `TVIdxBuilder` calculates deterministic Indices for each Condition Node. It is used for `clang` to emit `TestVector` indices (aka ID) and for `llvm-cov` to reconstruct `TestVectors`. This includes the unittest `CoverageMappingTest.TVIdxBuilder`. See also https://discourse.llvm.org/t/rfc-coverage-new-algorithm-and-file-format-for-mc-dc/76798
-
hev authored
This commit updates the pattern matching logic for the `AddLike` predicate in `LoongArchInstrInfo.td` to use the `isBaseWithConstantOffset` function provided by `CurDAG`. This optimization aims to improve the efficiency of pattern matching by identifying cases where the operation can be represented as a base address plus a constant offset, which can lead to more efficient code generation.
-
Kai Luo authored
This is useful when computing absdiff. Correctness prove: https://alive2.llvm.org/ce/z/eMbxps, https://alive2.llvm.org/ce/z/SNCWJe . --------- Co-authored-by:
Yingwei Zheng <dtcxzyw@qq.com>
-
Mehdi Amini authored
-
Mehdi Amini authored
-
Mehdi Amini authored
-
Mehdi Amini authored
-
tw-ilson authored
Since ODS generates getters functions for SPIRV operations' attribute names, we replace instances of these hardcoded strings in the SPIR-V dialect's op parser/printer with function calls for consistency. Fixes https://github.com/llvm/llvm-project/issues/77627 --------- Co-authored-by:
Lei Zhang <antiagainst@gmail.com>
-
Matteo Franciolini authored
This enables to correctly roundtrip the attribute to text or bytecode.
-
Matteo Franciolini authored
When roundtripping to bytecode an unregistered operation name that does not contain any '.' separator, the bytecode writer will emit an op encoding without a proper opName. In this case, the string just becomes a possibly unknown dialect name. At parsing, this dialect name is used as a proper operation name. However, when the unregistered operation name coincidentally matches that of a dialect, the parser would fail. That means we can't roundtrip an unregistered op with a name that matches one of the registered dialect names. For example, ``` "index"() : () -> () ``` can be emitted but cannot be parsed, because its name is coincidentally the same as that of the Index dialect. The patch removes such inconsistency. This patch specifically fixes the bytecode roundtrip of `mlir/test/IR/parser.mlir`.
-
Owen Pan authored
-
David CARLIER authored
This reverts commit 691b12a2.
-
Yingwei Zheng authored
This patch extends `reassociateMinMaxWithConstants` to fold the following patterns: ``` umax (smax X, nneg C0), nneg C1 --> smax X, (umax C0, C1) smin (umin X, nneg C0), nneg C1 --> umin X, (smin/umin C0, C1) ``` Alive2: https://alive2.llvm.org/ce/z/wfEj-e Address the comment https://github.com/llvm/llvm-project/pull/82472#pullrequestreview-1896922897.
-
Noah Goldstein authored
The false branch for `and` and true branch for `or` provide less information (intersection as opposed to union), but still can give some useful information. Closes #82818
-
Noah Goldstein authored
-
Yingwei Zheng authored
[ValueTracking][NFC] Early exit when enumerating guaranteed well-defined/non-poison operands. (#82812) According to the [coverage result](https://dtcxzyw.github.io/llvm-opt-benchmark/coverage/home/dtcxzyw/llvm-project/llvm/lib/Analysis/ValueTracking.cpp.html#L7193) on my benchmark, `llvm::mustTriggerUB` returns true with an average of 35.0M/12.3M=2.85 matches. I think we can stop enumerating when one of the matches succeeds to avoid filling the temporary buffer `NonPoisonOps`. This patch introduces two template functions `handleGuaranteedWellDefinedOps/handleGuaranteedNonPoisonOps`. They will pass well-defined/non-poison operands to inlinable callbacks `Handle`. If the callback returns true, stop processing and return true. Otherwise, return false. Compile-time improvement: https://llvm-compile-time-tracker.com/compare.php?from=13acb3af5ad48e850cf37dcf02270ede3f267bd4&to=2b55f513c1b6dd2732cb79a25f3eaf6c5e4d6619&stat=instructions:u |stage1-O3|stage1-ReleaseThinLTO|stage1-ReleaseLTO-g|stage1-O0-g|stage2-O3|stage2-O0-g|stage2-clang| |--|--|--|--|--|--|--| |-0.03%|-0.04%|-0.06%|-0.03%|-0.05%|+0.03%|-0.02%|
-
FruitClover authored
`__CLAUSE_NO_CLASS` was not undefined inside the `GEN_CLANG_CLAUSE_CLASS` block, resulting in macro redifinition warnings when several generated directives are used simultaneously.
-
SingleAccretion authored
We recently added `--initial-heap` - an option that allows one to up the initial memory size without the burden of having to know exactly how much is needed. However, in the process of implementing support for this in Emscripten (https://github.com/emscripten-core/emscripten/pull/21071), we have realized that `--initial-heap` cannot support the use-case of non-growable memories by itself, since with it we don't know what to set `--max-memory` to. We have thus agreed to move the above work forward by introducing another option to the linker (see https://github.com/emscripten-core/emscripten/pull/21071#discussion_r1491755616), one that would allow users to explicitly specify they want a non-growable memory. This change does this by introducing `--no-growable-memory`: an option that is mutally exclusive with `--max-memory` (for simplicity - we can also decide that it should override or be overridable by `--max-memory`. In Emscripten...
-
Alexander Scholz authored
I added the option -source-filter to the `run-clang-tidy.py` script in the clang-tools-extra. This option allows for handing over a regex, to filter out source files from the compilation database (not run `clang-tidy` on them).
-
Timm Bäder authored
We were instead asserting that they are non-null before.
-
David Green authored
This is a small part of #70452, attempting to take a small simpler part of it in isolation to simplify what remains. It changes the getSpillSize, getFoldedSpillSize, getRestoreSize and getFoldedRestoreSize methods to return optional<LocationSize> instead of unsigned. The code is intended to be the same, keeping the optional<> to specify when there was no size found, with some minor adjustments to make sure that unknown (~UINT64_C(0)) sizes are handled sensibly. Hopefully as more unsigned's are converted to LocationSize's the use of ~UINT64_C(0) can be cleaned up too.
-
- Feb 25, 2024
-
-
Owen Anderson authored
The expansion previously used, derived from Hacker's Delight, does not work correctly when the dividend is INT_MIN and the divisor is a power of two. We now use an alternate derivation of the A and Q constants specifically for the power-of-two divisor case to avoid this problem. Credit to Fabian Giesen for the new derivation. Fixes https://github.com/llvm/llvm-project/issues/77169
-
Dani authored
-
David CARLIER authored
implement internal __kmp_is_address_mapped.
-