summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* [X86][SSE] Use multiplication scale factors for v8i16 SHL on pre-AVX2 targets.Simon Pilgrim2018-06-051-4/+4
| | | | | | | | | | | | Similar to v4i32 SHL, convert v8i16 shift amounts to scale factors instead to improve performance and reduce instruction count. We were already doing this for constant shifts, this adds variable shift support. Reduces the serial nature of the codegen, which relies on chains of plendvb/pand+pandn+por shifts. This is a step towards adding support for vXi16 vector rotates. Differential Revision: https://reviews.llvm.org/D47546 llvm-svn: 334023
* [ConstantFold] Disallow folding vector geps into bitcastsKarl-Johan Karlsson2018-06-011-3/+3
| | | | | | | | | | | | | | | | | | | Summary: Getelementptr returns a vector of pointers, instead of a single address, when one or more of its arguments is a vector. In such case it is not possible to simplify the expression by inserting a bitcast of operand(0) into the destination type, as it will create a bitcast between different sizes. Reviewers: majnemer, mkuper, mssimpso, spatel Reviewed By: spatel Subscribers: lebedev.ri, llvm-commits Differential Revision: https://reviews.llvm.org/D46379 llvm-svn: 333783
* [ConstantFold] Add lit testcase for bitcast problem. NFCKarl-Johan Karlsson2018-06-011-0/+29
| | | | llvm-svn: 333767
* [DA] Fix direction vectors for weakZeroSrcSIVDavid Green2018-05-313-3/+105
| | | | | | | | | | Both weakZeroSrcSIV and weakZeroDstSIV are currently giving the same direction vectors. Fix weakZeroSrcSIVtest by flipping the directions it gives. Differential Revision: https://reviews.llvm.org/D46678 llvm-svn: 333658
* [AliasSet] Teach the alias set how to handle atomic memcpy/memmove/memsetDaniel Neilson2018-05-301-0/+77
| | | | | | | | | Summary: The atomic variants of the memcpy/memmove/memset intrinsics can be treated the same was as the regular forms, with respect to aliasing. Update the AliasSetTracker to treat the atomic forms the same was as the regular forms. llvm-svn: 333551
* [BasicAA] Teach the analysis about atomic memcpyDaniel Neilson2018-05-291-0/+17
| | | | | | | | Summary: A simple change to derive mod/ref info from the atomic memcpy intrinsic in the same way as from the regular memcpy intrinsic. llvm-svn: 333454
* Fix aliasing of launder.invariant.groupPiotr Padlewski2018-05-231-0/+21
| | | | | | | | | | | | | | | | | | | Summary: Patch for capture tracking broke bootstrap of clang with -fstict-vtable-pointers which resulted in debbugging nightmare. It was fixed https://reviews.llvm.org/D46900 but as it turned out, there were other parts like inliner (computing of noalias metadata) that I found after bootstraping with enabled assertions. Reviewers: hfinkel, rsmith, chandlerc, amharc, kuhar Subscribers: JDevlieghere, eraman, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D47088 llvm-svn: 333070
* [TTI] Add uniform/non-uniform constant Pow2 detection to ↵Simon Pilgrim2018-05-221-158/+253
| | | | | | | | | | | | | | | | TargetTransformInfo::getInstructionThroughput This enables us to detect more fast path sdiv cases under cost analysis. This patch also enables us to handle non-uniform-constant pow2 cases for X86 SDIV costs. Found while working on D46276 Future patches can then extend the vectorizers to more fully support non-uniform pow2 cases. Differential Revision: https://reviews.llvm.org/D46637 llvm-svn: 332969
* Propagate nonnull and dereferenceable throught launderPiotr Padlewski2018-05-182-0/+44
| | | | | | | | | | | | | | | Summary: invariant.group.launder should not stop propagation of nonnull and dereferenceable, because e.g. we would not be able to hoist loads speculatively. Reviewers: rsmith, amharc, kuhar, xbolva00, hfinkel Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D46972 llvm-svn: 332788
* [MemDep] Fixed handling of invariant.groupPiotr Padlewski2018-05-181-0/+111
| | | | | | | | | | | | | | | | | | Summary: Memdep had funny bug related to invariant.groups - because it did not invalidated cache, in some very rare cases it was possible to show memory dependence of the instruction that was deleted, but because other instruction took it's place it resulted in call to vtable! Thanks @amharc for repro!. Reviewers: dberlin, kuhar, amharc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45320 Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com> llvm-svn: 332781
* [LICM] Extend the MustExecute scopeSerguei Katkov2018-05-181-0/+46
| | | | | | | | | | | | CanProveNotTakenFirstIteration utility does not handle the case when condition of the branch is a constant. Add its handling. Reviewers: reames, anna, mkazantsev Reviewed By: reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46996 llvm-svn: 332695
* Revert r332657: "[AA] cfl-anders-aa with field sensitivity"George Burgess IV2018-05-171-102/+0
| | | | | | | I don't believe the person who LGTMed this review has appropriate context on this code. I apologize if I'm wrong. llvm-svn: 332674
* [AA] cfl-anders-aa with field sensitivityDavid Bolvansky2018-05-171-0/+102
| | | | | | | | | | | | | | | | | | | Summary: There was some unfinished work started for offset tracking in CFLGraph by the author of implementation of Andersen algorithm. This work was completed and support for field sensitivity was added to the core of Andersen algorithm. The performance results seem promising. SPEC2006 int_base score was increased by 1.1 % (I compared clang 6.0 with clang 6.0 with this patch). The avergae compile time was increased by +- 1 % according my measures with small and medium C/C++ projects (I did not tested it on the large projects with milions of lines of code) Reviewers: chandlerc, george.burgess.iv, rja Reviewed By: rja Subscribers: rja, llvm-commits Differential Revision: https://reviews.llvm.org/D46282 llvm-svn: 332657
* [BasicAA] Fix handling of invariant group laundersKrzysztof Pszeniczny2018-05-161-0/+48
| | | | | | | | | | | | | | | | | Summary: A recent patch ([[ https://reviews.llvm.org/rL331587 | rL331587 ]]) to Capture Tracking taught it that the `launder_invariant_group` intrinsic captures its argument only by returning it. Unfortunately, BasicAA still considered every call instruction as a possible escape source and hence concluded that the result of a `launder_invariant_group` call cannot alias any local non-escaping value. This led to [[ https://bugs.llvm.org/show_bug.cgi?id=37458 | bug 37458 ]]. This patch updates the relevant check for escape sources in BasicAA. Reviewers: Prazek, kuhar, rsmith, hfinkel, sanjoy, xbolva00 Reviewed By: hfinkel, xbolva00 Subscribers: JDevlieghere, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D46900 llvm-svn: 332466
* [MemorySSA] Don't sort IDF blocks.Michael Zolotukhin2018-05-157-76/+76
| | | | | | | | | | | | | | | | Summary: After r332167 we started to sort the IDF blocks inside IDF calculation, so there is no need to re-sort them on the user site. The test changes are due to a slightly different order we're using now (originally we used DFSInNumber and now the blocks are sorted by a pair (LevelFromRoot, DFSInNumber)). Reviewers: dberlin, mgrang Subscribers: Prazek, hiraditya, george.burgess.iv, llvm-commits Differential Revision: https://reviews.llvm.org/D46899 llvm-svn: 332385
* Add regression test for r331976George Burgess IV2018-05-101-0/+30
| | | | | | | | | | | | | | | | | | | | In general, it's difficult to poke the ConstantExpr code in CFLAA, since LLVM is so great at eagerly reducing ConstantExprs. :) Sadly, this only shows a functional difference from before the patch because CFLAA has some special logic around taking loads of non-pointers into account. Namely, with the broken select behavior, CFLAA will completely fail to take note of @g3. Since CFLAA doesn't have any record about @g3 when we do an alias query for @g3 and %a, it conservatively answers MayAlias. When we properly take @g3 into account with the new select logic, we get NoAlias for this query. I suspect that the aforementioned "special logic" isn't completely correct, but this test-case should prevent future wonky aliasing results from appearing for these flavors of ConstantExprs, so I think it's still worth having. llvm-svn: 332017
* [SCEV] Add missed Test for rL331949.Serguei Katkov2018-05-101-0/+181
| | | | llvm-svn: 331950
* [AArch64] Improve cost of vector division by constantAdhemerval Zanella2018-05-091-0/+45
| | | | | | | | | | | | | With custom lowering for vector MULLH{S,U}, it is now profitable to vectorize a divide by constant loop for the custom types (v16i8, v8i16, and v4i32). The cost if based on TargetLowering::Build{S,U}DIV which uses a multiply by constant plus adjustment to express a divide by constant. Both {u,s}mull{2} are expressed as Instruction::Mul and shifts by Instruction::AShr. llvm-svn: 331873
* [CostModel][X86] Split off SLM checksSimon Pilgrim2018-05-091-1/+77
| | | | | | A future patch will require this and the diff is much better if we perform the split separately. llvm-svn: 331867
* [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.Shiva Chen2018-05-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to set breakpoints on labels and list source code around labels, we need collect debug information for labels, i.e., label name, the function label belong, line number in the file, and the address label located. In order to keep these information in LLVM IR and to allow backend to generate debug information correctly. We create a new kind of metadata for labels, DILabel. The format of DILabel is !DILabel(scope: !1, name: "foo", file: !2, line: 3) We hope to keep debug information as much as possible even the code is optimized. So, we create a new kind of intrinsic for label metadata to avoid the metadata is eliminated with basic block. The intrinsic will keep existing if we keep it from optimized out. The format of the intrinsic is llvm.dbg.label(metadata !1) It has only one argument, that is the DILabel metadata. The intrinsic will follow the label immediately. Backend could get the label metadata through the intrinsic's parameter. We also create DIBuilder API for labels to be used by Frontend. Frontend could use createLabel() to allocate DILabel objects, and use insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR. Differential Revision: https://reviews.llvm.org/D45024 Patch by Hsiangkai Wang. llvm-svn: 331841
* Rename invariant.group.barrier to launder.invariant.groupPiotr Padlewski2018-05-031-24/+24
| | | | | | | | | | | | | | Summary: This is one of the initial commit of "RFC: Devirtualization v2" proposal: https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing Reviewers: rsmith, amharc, kuhar, sanjoy Subscribers: arsenm, nhaehnle, javed.absar, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D45111 llvm-svn: 331448
* Re-enable "[SCEV] Make computeExitLimit more simple and more powerful"Max Kazantsev2018-05-031-0/+34
| | | | | | | | | | | This patch was temporarily reverted because it has exposed bug 37229 on PowerPC platform. The bug is unrelated to the patch and was just a general bug in the optimization done for PowerPC platform only. The bug was fixed by the patch rL331410. This patch returns the disabled commit since the bug was fixed. llvm-svn: 331427
* Mark invariant.group.barrier as inaccessiblememonlyPiotr Padlewski2018-05-021-40/+101
| | | | | | | | | | | | | | | | It turned out that readonly argmemonly is not enough. store 42, %p %b = barrier(%p) store 43, %b the first store is dead, but because barrier was marked as reading argument memory, it was considered alive. With inaccessiblememonly it doesn't read the argument, but it also can't be CSEd. based on: https://reviews.llvm.org/D32006 llvm-svn: 331338
* [IR] Do not assume that function pointers are alignedMikhail Maltsev2018-04-271-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The value tracking analysis uses function alignment to infer that the least significant bits of function pointers are known to be zero. Unfortunately, this is not correct for ARM targets: the least significant bit of a function pointer stores the ARM/Thumb state information (i.e., the LSB is set for Thumb functions and cleared for ARM functions). The original approach (https://reviews.llvm.org/D44781) introduced a new field for function pointer alignment in the DataLayout structure to address this. But it seems unlikely that optimizations based on function pointer alignment would bring much benefit in practice to justify the additional maintenance burden, so this patch simply assumes that function pointer alignment is always unknown. Reviewers: javed.absar, efriedma Reviewed By: efriedma Subscribers: kristof.beyls, llvm-commits, hfinkel, rogfer01 Differential Revision: https://reviews.llvm.org/D46110 llvm-svn: 331025
* [TTI, AArch64] Add transpose shuffle kindMatthew Simpson2018-04-261-20/+20
| | | | | | | | | | | | | | This patch adds a new shuffle kind useful for transposing a 2xn matrix. These transpose shuffle masks read corresponding even- or odd-numbered vector elements from two n-dimensional source vectors and write each result into consecutive elements of an n-dimensional destination vector. The transpose shuffle kind is meant to model the TRN1 and TRN2 AArch64 instructions. As such, this patch also considers transpose shuffles in the AArch64 implementation of getShuffleCost. Differential Revision: https://reviews.llvm.org/D45982 llvm-svn: 330941
* Revert "[SCEV] Make computeExitLimit more simple and more powerful"Max Kazantsev2018-04-261-34/+0
| | | | | | | | | | | This reverts commit 023c8be90980e0180766196cba86f81608b35d38. This patch triggers miscompile of zlib on PowerPC platform. Most likely it is caused by some pre-backend PPC-specific pass, but we don't clearly know the reason yet. So we temporally revert this patch with intention to return it once the problem is resolved. See bug 37229 for details. llvm-svn: 330893
* [CostModel][X86] Add div/rem tests for non-uniform constant divisorsSimon Pilgrim2018-04-252-0/+496
| | | | llvm-svn: 330852
* [AArch64] Add cost model test case for transposeMatthew Simpson2018-04-231-0/+182
| | | | | | | This patch adds a cost model test case for vector shuffles having transpose masks. The given costs are inaccurate and will be updated in a follow-on patch. llvm-svn: 330625
* [CostModel][X86] Add vector element insert/extract cost testsSimon Pilgrim2018-04-202-0/+718
| | | | llvm-svn: 330439
* [CostModel][X86] Add srem/urem constant cost testsSimon Pilgrim2018-04-201-0/+248
| | | | llvm-svn: 330436
* [CostModel][X86] Add SLM/GLM/BtVer2 compare + division/remainder cost testsSimon Pilgrim2018-04-203-0/+194
| | | | llvm-svn: 330435
* [CostModel][X86] Split off BtVer2 cost checksSimon Pilgrim2018-04-2015-101/+1454
| | | | llvm-svn: 330433
* [CostModel][X86] Add GoldmontPlus cost testsSimon Pilgrim2018-04-201-0/+1
| | | | | | Just reuses goldmont costs atm llvm-svn: 330432
* [BasicAA] Return MayAlias for the pointer plus variable offset toShiva Chen2018-04-161-5/+26
| | | | | | | | structure object member Differential Revision: https://reviews.llvm.org/D45510 llvm-svn: 330106
* [CostModel][X86] Add some specific cpu targets to the cost modelsSimon Pilgrim2018-04-1315-313/+371
| | | | | | We're mostly testing with generic isa attributes, but PR36550 will require testing of specific target's scheduler models as well. llvm-svn: 330056
* [CostModel][X86] Split fma arith costs tests from other fp testsSimon Pilgrim2018-04-132-10/+73
| | | | | | Was proving cumbersome to test with/without fma llvm-svn: 330054
* [CostModel][X86] Regenerate latency/codesize cost testsSimon Pilgrim2018-04-131-33/+27
| | | | llvm-svn: 330052
* [CostModel][X86] Regenerate cast conversion cost testsSimon Pilgrim2018-04-131-146/+378
| | | | llvm-svn: 330051
* [CostModel][X86] Regenerate masked intrinsic cost testsSimon Pilgrim2018-04-131-160/+429
| | | | llvm-svn: 330050
* [DA] Improve alias checking in dependence analysisDavid Green2018-04-101-0/+140
| | | | | | | | | | | | Improve the alias analysis to account for cases where we know that src/dst pairs cannot alias due to things like TBAA. As we know they are noalias, we know no dependency can occur. Also fixes issues around the size parameter to AA being incorrect. Differential Revision: https://reviews.llvm.org/D42381 llvm-svn: 329692
* [CostModel][X86] Regenerate vector reduction cost tests with ↵Simon Pilgrim2018-04-071-104/+987
| | | | | | | update_analyze_test_checks.py NOTE: We're only really interested in the extractelement cost (which represents the entire reduction). llvm-svn: 329504
* [CostModel][X86] Regenerate vector select cost tests with ↵Simon Pilgrim2018-04-071-59/+73
| | | | | | update_analyze_test_checks.py llvm-svn: 329502
* [CostModel][X86] Regenerate vector integer truncation cost tests with ↵Simon Pilgrim2018-04-071-118/+191
| | | | | | update_analyze_test_checks.py llvm-svn: 329500
* [CostModel][X86] Regenerate silvermont (and added goldmont) cost tests with ↵Simon Pilgrim2018-04-071-46/+357
| | | | | | update_analyze_test_checks.py llvm-svn: 329499
* [CostModel][X86] Fix v32i16/v64i8 SETCC costs on AVX512BW targetsSimon Pilgrim2018-04-071-4/+4
| | | | llvm-svn: 329498
* [CostModel][X86] Regenerate vector comparison cost tests with ↵Simon Pilgrim2018-04-071-137/+286
| | | | | | update_analyze_test_checks.py llvm-svn: 329497
* [CostModel][X86] Regenerate bit count cost tests with ↵Simon Pilgrim2018-04-063-447/+1415
| | | | | | update_analyze_test_checks.py llvm-svn: 329413
* [CostModel][X86] Regenerate vector shuffle cost tests with ↵Simon Pilgrim2018-04-065-856/+1288
| | | | | | update_analyze_test_checks.py llvm-svn: 329410
* [CostModel][X86] Regenerate bswap/bitreverse cost tests with ↵Simon Pilgrim2018-04-062-160/+442
| | | | | | update_analyze_test_checks.py llvm-svn: 329407
* [CostModel][X86] Regenerate integer extension/truncation cost tests with ↵Simon Pilgrim2018-04-061-167/+336
| | | | | | update_analyze_test_checks.py llvm-svn: 329402
OpenPOWER on IntegriCloud