- May 13, 2020
-
-
Yevgeny Rouban authored
Hide the method that allows setting probability for particular edge and introduce a public method that sets probabilities for all outgoing edges at once. Setting individual edge probability is error prone. More over it is difficult to check that the total probability is 1.0 because there is no easy way to know when the user finished setting all the probabilities. Reviewers: yamauchi, ebrevnov Tags: #llvm Differential Revision: https://reviews.llvm.org/D79396
-
KAWASHIMA Takahiro authored
Fixes PR41696 The loop-reroll pass generates an invalid IR (or its assertion fails in debug build) if values of the base instruction and other root instructions (terms used in the loop-reroll pass) are used outside the loop block. See IRs written in PR41696 as examples. The current implementation of the loop-reroll pass can reroll only loops that don't have values that are used outside the loop, except reduced values (the last values of reduction chains). This is described in the comment of the `LoopReroll::reroll` function. https://github.com/llvm/llvm-project/blob/llvmorg-10.0.0/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp#L1600 This is checked in the `LoopReroll::DAGRootTracker::validate` function. https://github.com/llvm/llvm-project/blob/llvmorg-10.0.0/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp#L1393 However, the base instruction and other root instructions skip this check in the validation loop. https://github.com/llvm/llvm-project/blob/llvmorg-10.0.0/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp#L1229 Moving the check in front of the skip is the logically simplest fix. However, inserting the check in an earlier stage is better in terms of compilation time of unrerollable loops. This fix inserts the check for the base instruction into the function to validate possible base/root instructions. Check for other root instructions is unnecessary because they don't match any base instructions if they have uses outside the loop. Differential Revision: https://reviews.llvm.org/D79549
-
Johannes Doerfert authored
For AAReturnedValues we treated new and existing information differently in the updateImpl. Only the latter was properly analyzed and categorized. The former was thought to be analyzed in the subsequent update. Since the Attributor does not support "self-updates" we need to make sure the state is "stable" after each updateImpl invocation. That is, if the surrounding information does not change, the state is valid. Now we make sure all return values have been handled and properly categorized each iteration. We might not update again if we have not requested a non-fix attribute so we cannot "wait" for the next update to analyze a new return value. Bug reported by @sdmitriev.
-
Zequan Wu authored
We want to add a way to avoid merging identical calls so as to keep the separate debug-information for those calls. There is also an asan usecase where having this attribute would be beneficial to avoid alternative work-arounds. Here is the link to the feature request: https://bugs.llvm.org/show_bug.cgi?id=42783. `nomerge` is different from `noline`. `noinline` prevents function from inlining at callsites, but `nomerge` prevents multiple identical calls from being merged into one. This patch adds `nomerge` to disable the optimization in IR level. A followup patch will be needed to let backend understands `nomerge` and avoid tail merge at backend. Reviewed By: asbirlea, rnk Differential Revision: https://reviews.llvm.org/D78659
-
- May 12, 2020
-
-
Sergey Dmitriev authored
Reviewers: jdoerfert, sstefan1, uenoku Reviewed By: jdoerfert Subscribers: hiraditya, uenoku, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79801
-
Juneyoung Lee authored
Summary: This patch makes propagatesPoison be more accurate by returning true on more bin ops/unary ops/casts/etc. The changed test in ScalarEvolution/nsw.ll was introduced by https://github.com/llvm/llvm-project/commit/a19edc4d15b0dae0210b90615775edd76f021008 . IIUC, the goal of the tests is to show that iv.inc's SCEV expression still has no-overflow flags even if the loop isn't in the wanted form. It becomes more accurate with this patch, so think this is okay. Reviewers: spatel, lebedev.ri, jdoerfert, reames, nikic, sanjoy Reviewed By: spatel, nikic Subscribers: regehr, nlopes, efriedma, fhahn, javed.absar, llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D78615
-
Fangrui Song authored
gcov 4.8 (r189778) moved the exit block from the last to the second. The .gcda format is compatible with 4.7 but * decoding libgcov 4.7 produced .gcda with gcov [4.7,8) can mistake the exit block, emit bogus `%s:'%s' has arcs from exit block\n` warnings, and print wrong `" returned %s` for branch statistics (-b). * decoding libgcov 4.8 produced .gcda with gcov 4.7 has similar issues. Also, rename "return block" to "exit block" because the latter is the appropriate term.
-
Eric Christopher authored
-
- May 11, 2020
-
-
Johannes Doerfert authored
We will now ensure ensure the return type of called function is the type of all call sites we are going to rewrite. This avoids a problem partially fixed by D79680. The part that was not covered is a use of this "weird" casted call site (see `@func3` in `misc_crash.ll`). misc_crash.ll checks are auto-generated now.
-
Johannes Doerfert authored
We should never give up on AAIsDead as it guards other AAs from unreachable code (in which SSA properties are meaningless). We did however use required dependences on some queries in AAIsDead which caused us to invalidate AAIsDead if the queried AA got invalidated. We now use optional dependences instead. The bug that exposed this is added to the liveness.ll test and other test changes show the impact. Bug report by @sdmitriev.
-
Johannes Doerfert authored
During an update of AAIsDead, new instructions become live. If we query information from them, the result is often just the initial state, e.g., for call site `noreturn` and `nounwind`. We will now trigger an update for cached attributes during the AAIsDead update, though other AAs might later use the same API.
-
Sanjay Patel authored
Follow-up to D79452. Mimics the extra use cost formula for the inverse transform with extracts.
-
Mircea Trofin authored
Summary: Factoring out in preparation to https://reviews.llvm.org/D79042 Reviewers: dblaikie, davidxl Subscribers: mgorny, eraman, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79613
-
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
-