- May 11, 2020
-
-
Sergey Dmitriev authored
Reviewers: jdoerfert, sstefan1, uenoku Reviewed By: uenoku Subscribers: hiraditya, uenoku, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79680
-
Tyker authored
Summary: this patch fixe crash/asserts found in the test-suite. the AssumeptionCache cannot be assumed to have all assumes contrary to what i tought. prevent generation of information for terminators, because this can create broken IR in transfromation where we insert the new terminator before removing the old one. Reviewers: jdoerfert Reviewed By: jdoerfert Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79458
-
OCHyams authored
don't span their entire scope. The previous commit (6d1c40c1) is an older version of the test. Reviewed By: aprantl, vsk Differential Revision: https://reviews.llvm.org/D79573
-
Xun Li authored
Summary: In D65848 the function getFuncNameInModule was refactored to no longer use module. This diff removes the parameter and rename the function name to avoid confusion. Reviewers: wenlei, wmi, davidxl Reviewed By: wenlei Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79310
-
Johannes Doerfert authored
The old QuerriedAAs contained two vectors, one for required one for optional dependences (=queries). We now use a single vector and encode the kind directly in the pointer. This reduces memory consumption and makes the connection between abstract attributes and their dependences clearer. No functional change is intended, changes in the test are due to different order in the query map. Neither the order before nor now is in any way special. --- Single run of the Attributor module and then CGSCC pass (oldPM) for SPASS/clause.c (~10k LLVM-IR loc): Before: ``` calls to allocation functions: 543734 (329735/s) temporary memory allocations: 105895 (64217/s) peak heap memory consumption: 19.19MB peak RSS (including heaptrack overhead): 102.26MB total memory leaked: 269.10KB ``` After: ``` calls to allocation functions: 513292 (341511/s) temporary memory allocations: 106028 (70544/s) peak heap memory consumption: 13.35MB peak RSS (including heaptrack overhead): 95.64MB total memory leaked: 269.10KB ``` Difference: ``` calls to allocation functions: -30442 (208506/s) temporary memory allocations: 133 (-910/s) peak heap memory consumption: -5.84MB peak RSS (including heaptrack overhead): 0B total memory leaked: 0B ``` --- Reviewed By: uenoku Differential Revision: https://reviews.llvm.org/D78729
-
Johannes Doerfert authored
When we have an existing `argmemonly` or `inaccessiblememorargmemonly` we used to "know" that information. However, interprocedural constant propagation can invalidate these attributes. We now ignore and remove these attributes for internal functions (which may be affected by IP constant propagation), if we are deriving new attributes for the function.
-
Johannes Doerfert authored
As we replace values with constants interprocedurally, we also need to do this "look-through" step during the generic value traversal or we would derive properties from replaced values. While this is often not problematic, it is when we use the "kind" of a value for reasoning, e.g., accesses to arguments allow `argmemonly`.
-
Johannes Doerfert authored
When we categorize a pointer value we bailed at `null` before. If we know `null` is not a valid memory location we can ignore it as there won't be an access at all.
-
Johannes Doerfert authored
We now use getPointerDereferenceableBytes to determine `nonnull` and `dereferenceable` facts from the IR. We also use getPointerAlignment in AAAlign for the same reason. The latter can interfere with callbacks so we do restrict it to non-function-pointers for now.
-
Johannes Doerfert authored
-
Fangrui Song authored
Defaulting to -Xclang -coverage-version='407*' makes .gcno/.gcda compatible with gcov [4.7,8) In addition, delete clang::CodeGenOptionsBase::CoverageExtraChecksum and GCOVOptions::UseCfgChecksum. We can infer the information from the version. With this change, .gcda files produced by `clang --coverage a.o` linked executable can be read by gcov 4.7~7. We don't need other -Xclang -coverage* options. There may be a mismatching version warning, though. (Note, GCC r173147 "split checksum into cfg checksum and line checksum" made gcov 4.7 incompatible with previous versions.)
-
- May 10, 2020
-
-
Fangrui Song authored
rL144865 incorrectly wrote function names for GCOV_TAG_FUNCTION (this might be part of the reasons the header says "We emit files in a corrupt version of GCOV's "gcda" file format"). rL176173 and rL177475 realized the problem and introduced -coverage-no-function-names-in-data to work around the issue. (However, the description is wrong. libgcov never writes function names, even before GCC 4.2). In reality, the linker command line has to look like: clang --coverage -Xclang -coverage-version='407*' -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data Failing to pass -coverage-no-function-names-in-data can make gcov 4.7~7 either produce wrong results (for one gcov-4.9 program, I see "No executable lines") or segfault (gcov-7). (gcov-8 uses an incompatible format.) This patch deletes -coverage-no-function-names-in-data and the related function names support from libclang_rt.profile
-
Tyker authored
Summary: The assume builder was non-deterministic when working on unamed values. this patch fixes this. Reviewers: jdoerfert Reviewed By: jdoerfert Subscribers: hiraditya, mgrang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78616
-
Tyker authored
Summary: with this patch the assume salvageKnowledge will not generate assume if all knowledge is already available in an assume with valid context. assume bulider can also in some cases update an existing assume with better information. Reviewers: jdoerfert Reviewed By: jdoerfert Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78014
-
Florian Hahn authored
Currently LAA's uses of ScalarEvolutionExpander blocks moving the expander from Analysis to Transforms. Conceptually the expander does not fit into Analysis (it is only used for code generation) and runtime-check generation also seems to be better suited as a transformation utility. Reviewers: Ayal, anemet Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D78460
-
Sanjay Patel authored
We have a transform in the opposite direction only for the x86 MMX type, Other types are not handled either way before this patch. The motivating case from PR45748: https://bugs.llvm.org/show_bug.cgi?id=45748 ...is the last test diff. In that example, we are triggering an existing bitcast transform, so we reduce the number of casts, and that should give us the ideal x86 codegen. Differential Revision: https://reviews.llvm.org/D79171
-
Simon Pilgrim authored
Fold or(zext(bitreverse(x)),shl(zext(bitreverse(y)),bw/2) -> bitreverse(or(zext(x),shl(zext(y),bw/2)) Practically this is the same as the BSWAP pattern so we might as well handle it.
-
Florian Hahn authored
The failing assertion has been fixed and the problematic test case has been added. This reverts the revert commit fc44617f.
-
Florian Hahn authored
This reverts commit c28114c8. This causes some bots to fail: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/30596/steps/build%20android%2Faarch64/logs/stdio
-
Florian Hahn authored
In order to reduce the API surface area (preparation for D78460), remove a addRuntimeChecks() function and do the additional check in the single caller. Reviewers: Ayal, anemet Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D79679
-
Sanjay Patel authored
We can combine a floating-point extension cast with a conversion from integer if we know the earlier cast is exact. This is an optimization suggested in PR36617: https://bugs.llvm.org/show_bug.cgi?id=36617#c19 However, this patch does not change the example suggested there. This patch only uses the existing analysis to handle cases where the integer source value magnitude is narrower than the intermediate FP mantissa (guarantees that the conversion to FP is exact). Follow-up patches to the analysis function can enable more cases. Differential Revision: https://reviews.llvm.org/D79116
-
Arthur Eubanks authored
Summary: This was preventing MemorySanitizerLegacyPass from appearing in --print-after-all. Reviewers: vitalybuka Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79661
-
Jinsong Ji authored
https://reviews.llvm.org/D63616 added `-fsanitize-coverage-whitelist` and `-fsanitize-coverage-blacklist` for clang. However, it was done only for legacy pass manager. This patch enable it for new pass manager as well. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D79653
-
- May 09, 2020
-
-
Matt Arsenault authored
Consider any constant memory type, not just global constants. AMDGPU kernel parameters are effectively global constants, but appear as either reads from an intrinsic derived pointer or function argument.
-
Evgenii Stepanov authored
-
- May 08, 2020
-
-
Layton Kifer authored
Separate functions that require shared state into a class to avoid needing to pass them though multiple functions just to be available where needed. The main motivation for this is that we would like to remove the limitation that accumulator values be dynamic constant, which would require additional shared state between call eliminations in the same function, compounding this issue. Differential Revision: https://reviews.llvm.org/D79299
-
Sanjay Patel authored
As with the extractelement patterns that are currently in vector-combine, there are going to be several possible variations on this theme. This should be the clearest, simplest example. Scalarization is the right direction for target-independent canonicalization, and InstCombine has some of those folds already, but it doesn't do this. I proposed a similar transform in D50992. Here in vector-combine, we can check the cost model to be sure it's profitable, so there should be less risk. Differential Revision: https://reviews.llvm.org/D79452
-
Sanjay Patel authored
-
zoecarver authored
Summary: If the only use of a value is a start or end lifetime intrinsic then mark the intrinsic as trivially dead. This should allow for that value to then be removed as well. Currently, this only works for allocas, globals, and arguments. Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79355
-
Sanjay Patel authored
As suggested in D79116 - there's shared logic between the existing code and potential new folds. This could go in ValueTracking if it seems generally useful.
-
Ricky Zhou authored
FoldBranchToCommonDest clones instructions to a different basic block, but handles debug intrinsics in a separate path. Previously, when cloning debug intrinsics, their operands were not updated to reference the correct cloned values. As a result, we would emit debug.value intrinsics with broken operand references which are discarded in later passes. This leads to incorrect debuginfo that reports incorrect values for variables. Fix this by remapping debug intrinsic operands when cloning them. Fixes https://bugs.llvm.org/show_bug.cgi?id=45667. Differential Revision: https://reviews.llvm.org/D79602
-
Sanjay Patel authored
Mostly cosmetic improvements to variable names and logic to ease refactoring suggested in D79116.
-
Sanjay Patel authored
FoldIToFPtoI() returns immediately if the operand is not an opposite cast instruction, so the extra checks in the callers are redundant.
-
Benjamin Kramer authored
This reverts commit ae45b4db. It causes miscompilations, test case on the mailing list.
-
Diego Caballero authored
This patch removes FC0.ExitBlock and FC1GuardBlock from DT and LI after fusion of guarded loops. They become unreachable and LI verification failed when they happened to be inside another loop. Reviewed By: kbarton Differential Revision: https://reviews.llvm.org/D78679
-
Johannes Doerfert authored
In a recent patch we introduced a problem with abstract attributes that were assumed dead at some point. Since `Attributor::updateAA` was introduced in 95e0d28b, we did not remember the dependence on the liveness AA when an abstract attribute was assumed dead and therefore not updated. Explicit reproducer added in liveness.ll. --- Single run of the Attributor module and then CGSCC pass (oldPM) for SPASS/clause.c (~10k LLVM-IR loc): Before: ``` calls to allocation functions: 509242 (345483/s) temporary memory allocations: 98666 (66937/s) peak heap memory consumption: 18.60MB peak RSS (including heaptrack overhead): 103.29MB total memory leaked: 269.10KB ``` After: ``` calls to allocation functions: 529332 (355494/s) temporary memory allocations: 102107 (68574/s) peak heap memory consumption: 19.40MB peak RSS (including heaptrack overhead): 102.79MB total memory leaked: 269.10KB ``` Difference: ``` calls to allocation functions: 20090 (1339333/s) temporary memory allocations: 3441 (229400/s) peak heap memory consumption: 801.45KB peak RSS (including heaptrack overhead): 0B total memory leaked: 0B ```
-
Johannes Doerfert authored
-
- May 07, 2020
-
-
Alina Sbirlea authored
Summary: Update the check for the default exit block to not only check that the terminator is not unreachable, but also check that unreachable block has *only* the unreachable instruction. Reviewers: chandlerc Subscribers: hiraditya, uabelho, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78277
-
Huihui Zhang authored
Summary: This patch fix the following issues with visitExtractElementInst: 1. Restrict VectorUtils::findScalarElement to fixed-length vector. For scalable type, the number of elements in shuffle mask is unknown at compile-time. 2. Fix out-of-range calculation for fixed-length vector. 3. Skip scalable type when analysis rely on fixed number of elements. 4. Add unit tests to check functionality of extractelement for scalable type. Reviewers: sdesmalen, efriedma, spatel, nikic Reviewed By: efriedma Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78267
-
Huihui Zhang authored
Summary: This patch fixes the following issues in visitInsertElementInst: 1. Bail out for scalable type when analysis requires fixed size number of vector elements. 2. Use cast<FixedVectorType> to get vector number of elements. This ensure assertion on scalable vector type. 3. For scalable type, avoid folding a chain of insertelement into splat: insertelt(insertelt(insertelt(insertelt X, %k, 0), %k, 1), %k, 2) ... -> shufflevector(insertelt(X, %k, 0), undef, zero) The length of scalable vector is unknown at compile-time, therefore we don't know if given insertelement sequence is valid for splat. Reviewers: sdesmalen, efriedma, spatel, nikic Reviewed By: sdesmalen, efriedma Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78895
-