summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[mips] Fix multiprecision arithmetic."Simon Dardis2017-06-2911-648/+463
| | | | | | | This reverts commit r305389. This broke chromium builds, so reverting while I investigate further. llvm-svn: 306741
* [AArch64] Silence an unused variable warning in Release builds. NFC.Chad Rosier2017-06-291-0/+1
| | | | llvm-svn: 306738
* [CodeGenPrepare] Don't create inttoptr for ni ptrsKeno Fischer2017-06-292-8/+91
| | | | | | | | | | | | | Summary: Arguably non-integral pointers probably shouldn't show up here at all, but since the backend doesn't complain and this takes valid (according to the Verifier) IR and makes it invalid, make sure not to introduce any inttoptr instructions if we're dealing with non-integral pointers. Reviewed By: sanjoy Differential Revision: https://reviews.llvm.org/D33110 llvm-svn: 306737
* Attempt to fix Orc JIT test timeoutsReid Kleckner2017-06-291-5/+5
| | | | | | | | | I think there are some destruction ordering issues here. The ShouldDelete map seems to be getting destroyed before the shared_ptr deleter lambda accesses it. In any case, this avoids inserting elements into the map during shutdown. llvm-svn: 306736
* [DWARF] Added verification checks for the .apple_names section.Spyridoula Gravani2017-06-2911-369/+336
| | | | | | | | This patch verifies the number of atoms, the validity of the form for each atom, as well as the validity of the hashdata. For hashdata, we're verifying that the hashdata offset is correct and that the offset in the .debug_info for each DIE in the hashdata is also valid. llvm-svn: 306735
* Remove `inline` keyword from inline `classof` methodsSam Clegg2017-06-2938-294/+292
| | | | | | | | | | | | | | | | | | | | | | The style guide states that the explicit `inline` should not be used with inline methods. classof is very common inline method with a fair amount on inconsistency: $ git grep classof ./include | grep inline | wc -l 230 $ git grep classof ./include | grep -v inline | wc -l 257 I chose to target this method rather the larger change since this method is easily cargo-culted (I did it at least once). I considered doing the larger change and removing all occurrences but that would be a much larger change. Differential Revision: https://reviews.llvm.org/D33906 llvm-svn: 306731
* [AliasSetTracker] Don't drop AA MD so eagerlyKeno Fischer2017-06-293-4/+112
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When we have patterns like loop: %la = load %ptr, !tbaa %lba = load %ptr, !tbaa !noalias AliasSetTracker would previously think that the two types of annotation for the pointer conflict, dropping both for the purpose of determining alias sets. That is clearly way too conservative, as the tbaa is still valid whether or not one of the memory accesses has additional AA metadata. We could go one step further and attempt to properly merge the AA metadata, but it's not clear that that would be worth it since that may introduce additional MD nodes, which may be undesirable since this is merely an Analysis. Reviewers: hfinkel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32139 llvm-svn: 306727
* [opt-viewer] Add progress indicators (PR33522)Brian Gesiak2017-06-295-44/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Provide feedback to users of opt-diff.py, opt-stats.py, and opt-viewer.py, on how many YAML files have finished being processed, and how many HTML files have been generated. This feedback is particularly helpful for opt-viewer.py, which may take a long time to complete when given many large YAML files as input. The progress indicators use simple output such as the following: ``` Reading YAML files... 9 of 1197 ``` Test plan: Run `utils/opt-viewer/opt-*.py` on a CentOS and macOS machine, using Python 3.4 and Python 2.7 respectively, and ensure the output is formatted well on both. Reviewers: anemet, davidxl Reviewed By: anemet Subscribers: simon.f.whittaker, llvm-commits Differential Revision: https://reviews.llvm.org/D34735 llvm-svn: 306726
* Reverting r306695 while investigating failing test case.Alexandre Isoard2017-06-294-64/+0
| | | | | | | Failing test case: Transforms/LoopVectorize.iv_outside_user.ll llvm-svn: 306723
* [opt-viewer] Python 3 support in opt-viewer.pyBrian Gesiak2017-06-292-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Minor changes that allow opt-stats.py to support both Python 2 and 3. In addition to the same dictionary iterator changes that were necessary in https://reviews.llvm.org/D34564, this diff also: * Explcitly converts strings to bytes when reading from and writing to stdin and stdout. * No longer uses dictionaries as a sort key for optimization remarks. Dictionary sort order in Python 2 is pretty esoteric anyway, so it's not clear that the additional sorting had a benefit for end users (for details, https://stackoverflow.com/a/3484456/679254 is a good resource on Python 2 dictionary sort order). Reviewers: anemet, davidxl Reviewed By: anemet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34647 llvm-svn: 306720
* llvm-nm: Add support for symbol demangling (-C/--demangle)Sam Clegg2017-06-294-10/+72
| | | | | | Differential Revision: https://reviews.llvm.org/D34668 llvm-svn: 306718
* [OrderedInst] Add const to constant parameter. NFCIXin Tong2017-06-291-1/+1
| | | | llvm-svn: 306717
* fix trivial typo, NFCHiroshi Inoue2017-06-291-1/+1
| | | | llvm-svn: 306716
* [Dominators] Rearrange access specifiers in DominatorTreeBaseJakub Kuderski2017-06-291-98/+94
| | | | | | | | | | | | | | | | | | Summary: This patch makes DominatorTreeBase more readable by putting most important members on top of the class. Before, the class looked like that: private -> protected (including data members) -> public -> protected. The patch changes it to: protected (data members only) -> public -> protected -> public. Reviewers: dberlin, sanjoy, chandlerc Reviewed By: dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34527 llvm-svn: 306714
* [Dominators] Remove DominatorBase classJakub Kuderski2017-06-291-42/+19
| | | | | | | | | | | | | | | | | | | Summary: DominatorBase class was only used by DominatorTreeBase. It didn't provide any useful abstractions, nor simplified anything, so I see no point keeping it. This commit removes the DominatorBase class and moves its content into DominatorTreeBase. This is the first patch in a series that tries to make all DomTrees have a single virtual root, which will allow to further simplify code (especially when it comes to incremental updates). Reviewers: dberlin, sanjoy, chandlerc Reviewed By: dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34493 llvm-svn: 306713
* Remove useless header. NFCXin Tong2017-06-291-1/+0
| | | | llvm-svn: 306712
* [Dominators] Add parent and sibling property verification (non-hacky)Jakub Kuderski2017-06-294-18/+173
| | | | | | | | | | | | | | | | | | | Summary: This patch adds an additional level of verification - it checks parent and sibling properties of a tree. By definition, every tree with these two properties is a dominator tree. It is possible to run those check by running llvm with `-verify-dom-info=1`. Bootstrapping clang and building the llvm test suite with this option enabled doesn't yield any errors. Reviewers: dberlin, sanjoy, chandlerc Reviewed By: dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34482 llvm-svn: 306711
* [ConstantHoisting] Avoid hoisting constants in GEPs that index into a struct ↵Leo Li2017-06-293-35/+99
| | | | | | | | | | | | | | | | | | | | | type. Summary: Indices for GEPs that index into a struct type should always be constants. This added more checks in `collectConstantCandidates:` which make sure constants for GEP pointer type are not hoisted. This fixed Bug https://bugs.llvm.org/show_bug.cgi?id=33538 Reviewers: ributzka, rnk Reviewed By: ributzka Subscribers: efriedma, llvm-commits, srhines, javed.absar, pirama Differential Revision: https://reviews.llvm.org/D34576 llvm-svn: 306704
* PredicateInfo: Use OrderedInstructions instead of our homemadeDaniel Berlin2017-06-292-55/+31
| | | | | | version. llvm-svn: 306703
* NewGVN: Remove useless test in addPhiOfOps.Daniel Berlin2017-06-291-2/+1
| | | | llvm-svn: 306702
* Remove unneeded else from OrderedInstructions::dominates.Daniel Berlin2017-06-291-2/+1
| | | | llvm-svn: 306701
* [DWARF] NFC: DWARFDataExtractor combines relocs with DataExtractor.Paul Robinson2017-06-2925-160/+194
| | | | | | | | | | | Requires callers to directly associate relocations with a DataExtractor used to read data from a DWARF section, which helps a callee not make assumptions about which section it is reading. This is the next step in reducing DWARFFormValue's dependence on DWARFUnit. Differential Revision: https://reviews.llvm.org/D34704 llvm-svn: 306699
* ScalarEvolution: Add URem supportAlexandre Isoard2017-06-294-0/+64
| | | | | | | | | | | | | | | | | | | | In LLVM IR the following code: %r = urem <ty> %t, %b is equivalent to: %q = udiv <ty> %t, %b %s = mul <ty> nuw %q, %b %r = sub <ty> nuw %t, %q ; (t / b) * b + (t % b) = t As UDiv, Mul and Sub are already supported by SCEV, URem can be implemented with minimal effort this way. Note: While SRem and SDiv are also related this way, SCEV does not provides SDiv yet. llvm-svn: 306695
* [opt-viewer] opt-viewer.py takes -o argumentBrian Gesiak2017-06-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Change how the output directory is specified when invoking opt-viewer.py, from `opt-viewer.py yaml_file_one yaml_file_two output_dir` to `opt-viewer.py -o output_dir yaml_file_one yaml_file_two`. This makes it easier to pipe the results of another command into opt-viewer.py. For example: ``` find . -name "*.yaml" -print | xargs /path/to/opt-viewer.py -o html ``` Reviewers: anemet, davidxl Reviewed By: anemet Subscribers: fhahn, llvm-commits Differential Revision: https://reviews.llvm.org/D34711 llvm-svn: 306694
* [Hexagon] Keep all phi nodes when building DFG in addr-mode-optKrzysztof Parzyszek2017-06-292-4/+36
| | | | | | | The dead phis are needed for finding correct would-be reaching defs in register propagation. llvm-svn: 306690
* [DAG] Fold FrameIndex offset into BaseIndexOffset analysis. NFCI.Nirav Dave2017-06-293-22/+36
| | | | | | | | | | | Relanding after restricting equalBaseIndex to not erroneuosly consider a FrameIndices stemming from alloca from being comparable as its offset is set post-selectionDAG. Pull FrameIndex comparision reasoning from DAGCombiner::isAlias to general BaseIndexOffset. llvm-svn: 306688
* [llvm-objdump] Handle invalid instruction gracefully on ARMEugene Leviant2017-06-292-1/+10
| | | | | | Differential revision: https://reviews.llvm.org/D34813 llvm-svn: 306687
* bpf: remove unnecessary truncate operationYonghong Song2017-06-293-77/+387
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For networking-type bpf program, it often needs to access packet data. A context data structure is provided to the bpf programs with two fields: u32 data; u32 data_end; User can access these two fields with ctx->data and ctx->data_end. During program verification process, the kernel verifier modifies the bpf program with loading of actual pointer value from kernel data structure. r = ctx->data ===> r = actual data start ptr r = ctx->data_end ===> r = actual data end ptr A typical program accessing ctx->data like char *data_ptr = (char *)(long)ctx->data will result in a 32-bit load followed by a zero extension. Such an operation is combined into a single LDW in DAG combiner as bpf LDW does zero extension automatically. In cases like the below (which can be a result of global value numbering and partial redundancy elimination before insn selection): B1: u32 a = load-32-bit &ctx->data u64 pa = zext a ... B2: u32 b = load-32-bit &ctx->data u64 pb = zext b ... B3: u32 m = PHI(a, b) u64 pm = zext m In B3, "pm = zext m" cannot be removed, which although is legal from compiler perspective, will generate incorrect code after kernel verification. This patch recognizes this pattern and traces through PHI node to see whether the operand of "zext m" is defined with LDWs or not. If it is, the "zext m" itself can be removed. The patch also recognizes the pattern where the load and use of the load value not in the same basic block, where truncate operation may be removed as well. The patch handles 1-byte, 2-byte and 4-byte truncation. Two test cases are added to verify the transformation happens properly for the above code pattern. Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 306685
* [NFC] Use stdin for some tests instead of positional argument.Nikolai Bozhenov2017-06-293-4/+4
| | | | | | | | | | | | | | | | Summary: Otherwise unexpected matches with the path to the tests might happen. Reviewers: rengolin, spatel, efriedma, RKSimon Reviewed By: spatel Subscribers: n.bozhenov, javed.absar, llvm-commits Patch by Andrei Elovikov <andrei.elovikov@intel.com> Differential Revision: https://reviews.llvm.org/D32994 llvm-svn: 306684
* Restore original intent of memset instcombine testDaniel Neilson2017-06-291-4/+13
| | | | | | | | | | | | | | | | | Summary: The original intent of test/Transforms/InstCombine/memset.ll was to test for lowering of llvm.memset into stores when the size of the memset is 1, 2, 4, or 8. Sometime between then and now the test has stopped testing for that, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memset calls's being eliminated due to their pointer args being undef; so it is not testing for conversion of llvm.memset into store instructions at all. This change alters the test to verify that store instructions are created, and moves the target of the memset to an arg of the proc to avoid it being eliminated as unused. Reviewers: anna, efriedma Reviewed By: efriedma Subscribers: efriedma, llvm-commits Differential Revision: https://reviews.llvm.org/D34642 llvm-svn: 306681
* Explicitly check for presence of correct results in instcombine memmove testDaniel Neilson2017-06-291-17/+31
| | | | | | | | | | | | | | | | | Summary: Rather than testing for expected results, test/Transforms/InstCombine/memmove.ll is testing for the absence of calls to llvm.memmove. In the case of test3, the test has stopped testing for materialization of loads/stores, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of load/store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memmove calls being eliminated due to a pointer arg being undef; so it is not testing for conversion of llvm.memmove into load/store instructions at all. Reviewers: eli.friedman, anna, efriedma Reviewed By: efriedma Subscribers: efriedma, llvm-commits Differential Revision: https://reviews.llvm.org/D34645 llvm-svn: 306679
* [PowerPC] fix potential verification error on __tls_get_addrHiroshi Inoue2017-06-295-4/+153
| | | | | | | | | | This patch fixes a verification error with -verify-machineinstrs while expanding __tls_get_addr by not creating ADJCALLSTACKUP and ADJCALLSTACKDOWN if there is another ADJCALLSTACKUP in this basic block since nesting ADJCALLSTACKUP/ADJCALLSTACKDOWN is not allowed. Here, ADJCALLSTACKUP and ADJCALLSTACKDOWN are created as a fence for instruction scheduling to avoid _tls_get_addr is scheduled before mflr in the prologue (https://bugs.llvm.org//show_bug.cgi?id=25839). So if another ADJCALLSTACKUP exists before _tls_get_addr, we do not need to create a new ADJCALLSTACKUP. Differential Revision: https://reviews.llvm.org/D34347 llvm-svn: 306678
* [DWARF] - Fix message reporting about broken relocation.George Rimar2017-06-291-1/+1
| | | | | | | | | | | | | Because of mistake introduced in r306517, wrong variable ("name" instead of "Name") was used in error message. As a result it reported section name instead of relocation name. This file still needs cleanup to match LLVM coding style and more tests I think. llvm-svn: 306677
* Revert "r306529 - [X86] Correct dwarf unwind information in function epilogue"Daniel Jasper2017-06-2974-1846/+266
| | | | | | | | | | I am 99% sure that this breaks the PPC ASAN build bot: http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/3112/steps/64-bit%20check-asan/logs/stdio If it doesn't go back to green, we can recommit (and fix the original commit message at the same time :) ). llvm-svn: 306676
* [TBAA] Remove metadata keyword from IR examples in comments (NFC).Florian Hahn2017-06-291-10/+10
| | | | | | The metadata keyword has been removed from the IR. llvm-svn: 306675
* [TargetTransformInfo, API] Add a list of operands to TTI::getUserCostEvgeny Astigeevich2017-06-295-13/+32
| | | | | | | | | | | | | | | | | | | | The changes are a result of discussion of https://reviews.llvm.org/D33685. It solves the following problem: 1. We can inform getGEPCost about simplified indices to help it with calculating the cost. But getGEPCost does not take into account the context which GEPs are used in. 2. We have getUserCost which can take the context into account but we cannot inform about simplified indices. With the changes getUserCost will have access to additional information as getGEPCost has. The one parameter getUserCost is also provided. Differential Revision: https://reviews.llvm.org/D34057 llvm-svn: 306674
* Recommit "[Support] Add RetryAfterSignal helper function"Pavel Labath2017-06-296-25/+60
| | | | | | | | | | | | | | | | | | | | | | | | | The difference from the previous version is the use of decltype, as the implementation of std::result_of in libc++ did not work correctly for variadic function like open(2). Original summary: This function retries an operation if it was interrupted by a signal (failed with EINTR). It's inspired by the TEMP_FAILURE_RETRY macro in glibc, but I've turned that into a template function. I've also added a fail-value argument, to enable the function to be used with e.g. fopen(3), which is documented to fail for any reason that open(2) can fail (which includes EINTR). The main user of this function will be lldb, but there were also a couple of uses within llvm that I could simplify using this function. Reviewers: zturner, silvas, joerg Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D33895 llvm-svn: 306671
* [GlobalISel][X86] Support vector type G_MERGE_VALUES selection.Igor Breger2017-06-293-0/+179
| | | | | | | | | | | | | | | | Summary: Support vector type G_MERGE_VALUES selection. For now G_MERGE_VALUES marked as legal for any type, so nothing to do in legalizer. Split from https://reviews.llvm.org/D33665 Reviewers: qcolombet, t.p.northover, zvi, guyblank Reviewed By: guyblank Subscribers: rovka, kristof.beyls, guyblank, llvm-commits Differential Revision: https://reviews.llvm.org/D33958 llvm-svn: 306665
* [X86][SSE] Dropped -mcpu from palignr testsSimon Pilgrim2017-06-291-112/+147
| | | | | | | | Use triple and attribute only for consistency Add AVX tests as well llvm-svn: 306664
* [X86][SSE] Regenerate shuffle test with update_llc_test_checks.pySimon Pilgrim2017-06-291-5/+6
| | | | llvm-svn: 306663
* [X86][SSE] Dropped -mcpu from vector shift testsSimon Pilgrim2017-06-291-4/+3
| | | | | | Use triple and attribute only for consistency llvm-svn: 306662
* [X86][SSE] Dropped -mcpu from zero insertion testsSimon Pilgrim2017-06-291-9/+6
| | | | | | Use triple and attribute only for consistency llvm-svn: 306661
* [LLVM][X86][Goldmont] Adding new target-cpu: GoldmontMichael Zuckerman2017-06-297-2/+47
| | | | | | | | | | | | | | | | [LLVM SIDE] Connecting the GoldMont processor to his feature. Reviewers: 1. igorb 2. zvi 3. delena 4. RKSimon 5. craig.topper Differential Revision: https://reviews.llvm.org/D34504 llvm-svn: 306658
* Test commitNAKAMURA Takumi2017-06-291-1/+1
| | | | llvm-svn: 306657
* [SLPVectorizer] Introducing getTreeEntry() helper function [NFC]Dinar Temirbulatov2017-06-291-34/+33
| | | | | | Differential Revision: https://reviews.llvm.org/D34756 llvm-svn: 306655
* [ARM] Add tGPRwithpc register class and use it for TBB/THHFlorian Hahn2017-06-293-6/+10
| | | | | | | | | | | | | | | | | | | | | | Summary: TBB and THH allow using a Thumb GPR or the PC as destination operand. A few machine verifier failures where due to those instructions not expecting PC as destination operand. Add -verify-machineinstrs to test/CodeGen/ARM/jump-table-tbh.ll to add test coverage even if expensive checks are disabled. Reviewers: MatzeB, t.p.northover, jmolloy Reviewed By: MatzeB Subscribers: aemerson, javed.absar, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D34610 llvm-svn: 306654
* [BinaryFormat] Identify AArch64 COFF filesMartin Storsjo2017-06-291-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D34742 llvm-svn: 306647
* [X86] Adding shuffle tests demonstrating missed vcompress opportunities. NFCZvi Rackover2017-06-292-0/+145
| | | | llvm-svn: 306646
* [lit] Re-apply: Fix some convoluted logic around Unicode encoding, and ↵David L. Jones2017-06-292-51/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | de-duplicate across modules that used it. (Take 2: this patch re-applies r306625, which was reverted in r306629. This patch includes only trivial fixes.) In Python2 and Python3, the various (non-)?Unicode string types are sort of spaghetti. Python2 has unicode support tacked on via the 'unicode' type, which is distinct from 'str' (which are bytes). Python3 takes the "unicode-everywhere" approach, with 'str' representing a Unicode string. Both have a 'bytes' type. In Python3, it is the only way to represent raw bytes. However, in Python2, 'bytes' is an alias for 'str'. This leads to interesting problems when an interface requires a precise type, but has to run under both Python2 and Python3. The previous logic appeared to be correct in all cases, but went through more layers of indirection than necessary. This change does the necessary conversions in one shot, with documentation about which paths might be taken in Python2 or Python3. Changes from r306625: some tests just print binary outputs, so in those cases, fall back to str() in Python3. For googletests, add one missing call to to_string(). (Tested by verifying the visible breakage with Python3. Verified that everything works in py2 and py3.) llvm-svn: 306643
* llvm-profdata: Indirect infrequently used fields to reduce memory usageDavid Blaikie2017-06-292-30/+66
| | | | | | | | | | | | | | | | | | | | | | | | | Examining a large profile example, it seems relatively few records have non-empty IndirectCall and MemOP data, so indirecting these through a unique_ptr (non-null only when they are non-empty) Reduces memory usage on this particular example from 14GB to 10GB according to valgrind's massif. I suspect it'd still be worth moving InstrProfWriter to its own data structure that had Counts and the indirected IndirectCall+MemOP, and did not include the Name, Hash, or Error fields. This would reduce the size of this dominant data structure by half of this new, lower amount. (Name(2), Hash(1), Error(1) ~= Counts(vector, 3), ValueProfData (unique_ptr, 1)) -> From code review feedback, might actually refactor InstrProfRecord itself to have a sub-struct with all the counts, and use that from InstrProfWriter, rather than InstrProfWriter owning its own data structure for this. Reviewers: davidxl Differential Revision: https://reviews.llvm.org/D34694 llvm-svn: 306631
OpenPOWER on IntegriCloud