summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* ADT: Tidy up ilist_traits static asserts, NFCDuncan P. N. Exon Smith2016-08-172-19/+33
| | | | | | | | | | | | Change the ilist traits to use decltype instead of sizeof, and add HasObsoleteCustomization so that additions to this list don't need to be added in two places. I suspect this will now work with MSVC, since the trait tested in r278991 seems to work. If for some reason it continues to fail on Windows I'll follow up by adding back the #ifndef _MSC_VER. llvm-svn: 279012
* [WebAssembly] Handle debug information and virtual registers without ↵Dominic Chen2016-08-175-3/+82
| | | | | | | | | | | | | | crashing (reland r278967) Summary: Currently, enabling debug information when compiling for WebAssembly crashes the backend. This commit fixes these by skipping debug values in backend passes. Reviewers: jfb, aprantl, dschuff, echristo Subscribers: llvm-commits, dschuff, jfb, MatzeB, dexonsmith, yurydelendik, mehdi_amini Differential Revision: https://reviews.llvm.org/D23635 llvm-svn: 279011
* [Docs] Update MemorySSA doc to address more feedback.George Burgess IV2016-08-171-34/+38
| | | | | | | | | Primarily, this clarifies wording in a few places, and adds "\ "s to make the formatting of things like "``Foo`` s" better. Thanks to Michael Kuperstein for the comments. llvm-svn: 279007
* [libFuzzer] force proper popcnt instructionKostya Serebryany2016-08-172-1/+3
| | | | llvm-svn: 279002
* Make llvm-pdbdump print column info when availableAdrian McCarthy2016-08-171-0/+9
| | | | | | | | | | llvm-pdbdump already had code to retrieve column information in the line tables, but it wasn't using it. Most Microsoft PDBs don't seem to have column info, so this wasn't missed. But Clang includes column info by default (at least for now), and being able to see that is useful for ensuring we get the column info correct. Differential Revision: https://reviews.llvm.org/D23629 llvm-svn: 279001
* Actually enable new test for const RangeAdapter. Missing from r278991Pete Cooper2016-08-171-1/+2
| | | | llvm-svn: 279000
* SCEV: Don't assert about non-SCEV-able value in isSCEVExprNeverPoison() ↵Hans Wennborg2016-08-172-0/+53
| | | | | | | | (PR28932) Differential Revision: https://reviews.llvm.org/D23594 llvm-svn: 278999
* [LoopUnroll] Move a simple check earlier. NFC.Haicheng Wu2016-08-171-5/+5
| | | | | | | | Move the check of CallInst earlier to skip expensive recursive operations. Differential Revision: https://reviews.llvm.org/D23611 llvm-svn: 278998
* [LV] Move LoopBodyTraits to a better place, and add comment for simplifying ↵Tim Shen2016-08-172-57/+60
| | | | | | | | | | | | | | LoopBlocksTraversal. NFC. Summary: I later (after r278573) found that LoopIterator.h has some overlapping with LoopBodyTraits. It's good to use LoopBodyTraits because a *Traits struct is algorithm independent. Reviewers: anemet, nadav, mkuper Subscribers: mzolotukhin, llvm-commits Differential Revision: https://reviews.llvm.org/D23529 llvm-svn: 278996
* [InstCombine] add test for missing vector icmp foldSanjay Patel2016-08-171-12/+36
| | | | | | | | Also, add a scalar test to demonstrate one of the intermediate folds that is necessary to accomplish the existing, multi-step test. And simplify the vector tests to only check the final piece of that multi-step transform. llvm-svn: 278995
* wordsmith the "new targets" section a bit.Chris Lattner2016-08-171-10/+10
| | | | llvm-svn: 278994
* [RegionIterator] clang-format some pieces. NFC.Tim Shen2016-08-171-44/+43
| | | | llvm-svn: 278992
* Fix reverse to work on const rbegin()/rend().Pete Cooper2016-08-172-4/+43
| | | | | | | | | | | | Duncan found that reverse worked on mutable rbegin(), but the has_rbegin trait didn't work with a const method. See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160815/382890.html for more details. Turns out this was already solved in clang with has_getDecl. Copied that and made it work for rbegin. This includes the tests Duncan attached to that thread, including the traits test. llvm-svn: 278991
* [libFuzzer] given 0 and 255 more preference when inserting repeated bytesKostya Serebryany2016-08-171-1/+2
| | | | llvm-svn: 278986
* [macho2yaml] Don't write empty linkedit dataChris Bieneman2016-08-173-1/+9
| | | | | | | | Since I stopped writing empty export tries it causes LinkEdit to potentially be completely empty which results in invalid yaml being generated. To prevent this we skip linkedit data if it is empty. llvm-svn: 278985
* [libFuzzer] one more mutation: ChangeBinaryInteger; also fix the breakage ↵Kostya Serebryany2016-08-173-2/+77
| | | | | | from r278970 llvm-svn: 278982
* Tail Duplication: Accept explicit threshold for duplicating.Kyle Butt2016-08-172-5/+13
| | | | | | | | This will allow tail duplication and tail merging during layout to have a shared threshold to make sure that they don't overlap. No observable change intended. llvm-svn: 278981
* TailDuplicator: Use optForSize instead of hasFnAttribute.Kyle Butt2016-08-171-1/+1
| | | | | | | This will cause minsize functions to have the same threshold as optsize functions, but otherwise should have no effects. llvm-svn: 278980
* [libFuzzer] when printing the reproducer input, also print the base input ↵Kostya Serebryany2016-08-173-4/+13
| | | | | | and the mutation sequence llvm-svn: 278975
* ADT: Remove UB in ilist (and use a circular linked list)Duncan P. N. Exon Smith2016-08-173-287/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the undefined behaviour (UB) in ilist/ilist_node/etc., mainly by removing (gutting) the ilist_sentinel_traits customization point and canonicalizing on a single, efficient memory layout. This fixes PR26753. The new ilist is a doubly-linked circular list. - ilist_node_base has two ilist_node_base*: Next and Prev. Size-of: two pointers. - ilist_node<T> (size-of: two pointers) is a type-safe wrapper around ilist_node_base. - ilist_iterator<T> (size-of: two pointers) operates on an ilist_node<T>*, and downcasts to T* on dereference. - ilist_sentinel<T> (size-of: two pointers) is a wrapper around ilist_node<T> that has some extra API for list management. - ilist<T> (size-of: two pointers) has an ilist_sentinel<T>, whose address is returned for end(). The new memory layout matches ilist_half_embedded_sentinel_traits<T> exactly. The Head pointer that previously lived in ilist<T> is effectively glued to the ilist_half_node<T> that lived in ilist_half_embedded_sentinel_traits<T>, becoming the Next and Prev in the ilist_sentinel_node<T>, respectively. sizeof(ilist<T>) is now the size of two pointers, and there is never any additional storage for a sentinel. This is a much simpler design for a doubly-linked list, removing most of the corner cases of list manipulation (add, remove, etc.). In follow-up commits, I intend to move as many algorithms as possible into a non-templated base class (ilist_base) to reduce code size. Moreover, this fixes the UB in ilist_iterator/getNext/getPrev operations. Previously, ilist_iterator<T> operated on a T*, even when the sentinel was not of type T (i.e., ilist_embedded_sentinel_traits and ilist_half_embedded_sentinel_traits). This added UB to all operations involving end(). Now, ilist_iterator<T> operates on an ilist_node<T>*, and only downcasts when the full type is guaranteed to be T*. What did we lose? There used to be a crash (in some configurations) on ++end(). Curiously (via UB), ++end() would return begin() for users of ilist_half_embedded_sentinel_traits<T>, but otherwise ++end() would cause a nice dependable nullptr dereference, crashing instead of a possible infinite loop. Options: 1. Lose that behaviour. 2. Keep it, by stealing a bit from Prev in asserts builds. 3. Crash on dereference instead, using the same technique. Hans convinced me (because of the number of problems this and r278532 exposed on Windows) that we really need some assertion here, at least in the short term. I've opted for #3 since I think it catches more bugs. I added only a couple of unit tests to root out specific bugs I hit during bring-up, but otherwise this is tested implicitly via the extensive usage throughout LLVM. Planned follow-ups: - Remove ilist_*sentinel_traits<T>. Here I've just gutted them to prevent build failures in sub-projects. Once I stop referring to them in sub-projects, I'll come back and delete them. - Add ilist_base and move algorithms there. - Check and fix move construction and assignment. Eventually, there are other interesting directions: - Rewrite reverse iterators, so that rbegin().getNodePtr()==&*rbegin(). This allows much simpler logic when erasing elements during a reverse traversal. - Remove ilist_traits::createNode, by deleting the remaining API that creates nodes. Intrusive lists shouldn't be creating nodes themselves. - Remove ilist_traits::deleteNode, by (1) asserting that lists are empty on destruction and (2) changing API that calls it to take a Deleter functor (intrusive lists shouldn't be in the memory management business). - Reconfigure the remaining callback traits (addNodeToList, etc.) to be higher-level, pulling out a simple_ilist<T> that is much easier to read and understand. - Allow tags (e.g., ilist_node<T,tag1> and ilist_node<T,tag2>) so that T can be a member of multiple intrusive lists. llvm-svn: 278974
* Revert "[WebAssembly] Handle debug information and virtual registers without ↵Duncan P. N. Exon Smith2016-08-174-80/+3
| | | | | | | | | | crashing" This reverts commit r278967, since the new test is failing when you don't build the WebAssembly target (most people, since it's off-by-default). llvm-svn: 278973
* [docs] Adding "new target" rules to dev policyRenato Golin2016-08-171-0/+83
| | | | | | | | Making explicit our current policy to accept new targets as experimental and later official. Every new target should follow these rules to be added, and kept relevant in the upstream tree. llvm-svn: 278971
* Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-1752-161/+209
| | | | | | Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
* GlobalISel: support irtranslation of icmp instructions.Tim Northover2016-08-1718-38/+198
| | | | llvm-svn: 278969
* [WebAssembly] Handle debug information and virtual registers without crashingDominic Chen2016-08-174-3/+80
| | | | | | | | | | | | Summary: Currently, enabling debug information when compiling for WebAssembly crashes the backend. This commit fixes these by skipping debug values in backend passes. Reviewers: jfb, aprantl, dschuff, echristo Subscribers: mehdi_amini, yurydelendik, dexonsmith, MatzeB, jfb, dschuff, llvm-commits Differential Revision: https://reviews.llvm.org/D21808 llvm-svn: 278967
* [GraphWriter] Change GraphWriter to use NodeRef in GraphTraitsTim Shen2016-08-175-18/+19
| | | | | | | | | | | | | | | Summary: This is part of the "NodeType* -> NodeRef" migration. Notice that since GraphWriter prints object address as identity, I added a static_assert on NodeRef to be a pointer type. Reviewers: dblaikie Subscribers: llvm-commits, MatzeB Differential Revision: https://reviews.llvm.org/D23580 llvm-svn: 278966
* AMDGPU: Remove dead optionMatt Arsenault2016-08-171-6/+0
| | | | llvm-svn: 278965
* [GenericDomTree] Change GenericDomTree to use NodeRef in GraphTraits. NFC.Tim Shen2016-08-175-87/+91
| | | | | | | | | | | | | | | | | | Summary: Looking at the implementation, GenericDomTree has more specific requirements on NodeRef, e.g. NodeRefObject->getParent() should compile, and NodeRef should be a pointer. We can remove the pointer requirement, but it seems to have little gain, given the limited use cases. Also changed GraphTraits<Inverse<Inverse<T>> to be more accurate. Reviewers: dblaikie, chandlerc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23593 llvm-svn: 278961
* [InstCombine] minimize tests and autogenerate checksSanjay Patel2016-08-171-32/+34
| | | | llvm-svn: 278960
* [InstCombine] more clean up of foldICmpXorConstant(); NFCISanjay Patel2016-08-171-27/+21
| | | | | | | Use m_APInt for the xor constant, but this is all still guarded by the initial ConstantInt check, so no vector types should make it in here. llvm-svn: 278957
* [InstCombine] clean up foldICmpXorConstant(); NFCISanjay Patel2016-08-171-55/+60
| | | | | | | | 1. Change variable names 2. Use local variables to reduce code 3. Early exit to reduce indent llvm-svn: 278955
* Fix for PR29010Marina Yatsina2016-08-172-1/+17
| | | | | | | | | | | This is a fix for https://llvm.org/bugs/show_bug.cgi?id=29010 Root cause of the bug is that the register class of the machine instruction operand does not fully reflect if this registers that can be allocated. Both for i386 and x86_64 the operand's register class is VR128RegClass and thus contains xmm0-xmm15, though in i386 we can only use xmm0-xmm8. In order to get the actual allocable registers of the class we need to use RegisterClassInfo. Differential Revision: https://reviews.llvm.org/D23613 llvm-svn: 278954
* [libFuzzer] more mutationsKostya Serebryany2016-08-173-18/+124
| | | | llvm-svn: 278950
* Move tests to the appropriate subdirectory.Adrian Prantl2016-08-173-0/+0
| | | | llvm-svn: 278948
* [InstCombine] use m_APInt to allow icmp (or X, Y), C folds for splat ↵Sanjay Patel2016-08-173-19/+7
| | | | | | | | | | constant vectors This is a sibling of: https://reviews.llvm.org/rL278859 https://reviews.llvm.org/rL278935 llvm-svn: 278945
* [InstCombine] clean up foldICmpOrConstant(); NFCISanjay Patel2016-08-171-18/+16
| | | | | | | | | 1. Change variable names 2. Use local variables to reduce code 3. Use ? instead of if/else 4. Use the APInt variable instead of 'RHS' so the removal of the FIXME code will be direct llvm-svn: 278944
* [InstCombine] add tests for missing vector icmp foldsSanjay Patel2016-08-171-0/+30
| | | | llvm-svn: 278943
* Support the DW_AT_noreturn DWARF flag.Adrian Prantl2016-08-1710-4/+177
| | | | | | | | | | | This is used to mark functions with the C++11 [[ noreturn ]] or C11 _Noreturn attributes. Patch by Victor Leschuk! https://reviews.llvm.org/D23167 llvm-svn: 278940
* Revert "Reassociate: Reprocess RedoInsts after each inst".Chad Rosier2016-08-175-100/+33
| | | | | | | | This reverts commit r258830, which introduced a bug described in PR28367. PR28367 llvm-svn: 278938
* [InstCombine] use m_APInt to allow icmp (add X, Y), C folds for splat ↵Sanjay Patel2016-08-173-49/+37
| | | | | | | | | constant vectors This is a sibling of: https://reviews.llvm.org/rL278859 llvm-svn: 278935
* Clarify the statement on using #if 0 ... #endif in CodingStandards.Andrey Bokhanko2016-08-171-2/+4
| | | | | | | | | The statement on using #if 0 ... #endif is not very clear (for people like me :-)). This patch clarifies it a bit to avoid confusion. Differential Revision: https://reviews.llvm.org/D23404 llvm-svn: 278932
* [mips] Add l.[sd] and s.[sd] instruction aliasesSimon Dardis2016-08-1715-0/+75
| | | | | | | | Reviewers: dsanders, vkalintiris Differential Review: https://reviews.llvm.org/D23121 llvm-svn: 278930
* Revert "[Reassociate] Avoid iterator invalidation when negating value."Chad Rosier2016-08-172-39/+0
| | | | | | This reverts commit r278928 due to lit test failures. llvm-svn: 278929
* [Reassociate] Avoid iterator invalidation when negating value.Chad Rosier2016-08-172-0/+39
| | | | | | | Differential Revision: https://reviews.llvm.org/D23464 PR28367 llvm-svn: 278928
* [LoopStrenghtReduce] Refactoring and addition of a new target cost function.Jonas Paulsson2016-08-179-225/+375
| | | | | | | | | | | | | | | | | | | | | | | Refactored so that a LSRUse owns its fixups, as oppsed to letting the LSRInstance own them. This makes it easier to rate formulas for LSRUses, since the fixups are available directly. The Offsets vector has been removed since it was no longer necessary. New target hook isFoldableMemAccessOffset(), which is used during formula rating. For SystemZ, this is useful to express that loads and stores with float or vector types with a big/negative offset should be avoided in loops. Without this, LSR will generate a lot of negative offsets that would require extra instructions for loading the address. Updated tests: test/CodeGen/SystemZ/loop-01.ll Reviewed by: Quentin Colombet and Ulrich Weigand. https://reviews.llvm.org/D19152 llvm-svn: 278927
* Fixing bug committed in rev. 278321Marina Yatsina2016-08-172-3/+12
| | | | | | | | | | In theory the indices of RC (and thus the index used for LiveRegs) may differ from the indices of OpRC. Fixed the code to extract the correct RC index. OpRC contains the first X consecutive elements of RC, and thus their indices are currently de facto the same, therefore a test cannot be added at this point. Differential Revision: https://reviews.llvm.org/D23491 llvm-svn: 278923
* [AMDGPU] llvm-objdump: Skip amd_kernel_code_t only at the begining of kernel ↵Sam Kolton2016-08-172-20/+55
| | | | | | | | | | | | | | symbol. Summary: This change fix bug in AMDGPU disassembly. Previously, presence of symbols other than kernel symbols caused objdump to skip begining of those symbols. Reviewers: tstellarAMD, vpykhtin, Bigcheese, ruiu Subscribers: kzhuravl, arsenm Differential Revision: http://reviews.llvm.org/D21966 llvm-svn: 278921
* LiveIntervals: add removeRegUnitNicolai Haehnle2016-08-171-0/+7
| | | | | | | | | | | | | | | | | | | | | | Summary: See D22198 for the motivation: We have a pass that uses LiveIntervals anyway, and there is now a requirement to track a physical register that is not usually tracked at this point of the compilation. The pass also introduces instructions that affect this physical register, but we want to preserve LiveIntervals. Rather than add brittle and rarely exercised code to keep the tracking of the physical register intact, we want to just remove the corresponding LiveRange -- it didn't exist before anyway, and subsequent passes don't expect it to be there. Reviewers: MatzeB, arsenm Subscribers: llvm-commits, MatzeB Differential Revision: https://reviews.llvm.org/D22801 llvm-svn: 278920
* Fix bug in DAGBuilder for getelementptr with expanded vector.Ayman Musa2016-08-172-1/+26
| | | | | | | Replacing the usage of MVT with EVT in case the vector type is expanded. Differential Revision: https://reviews.llvm.org/D23306 llvm-svn: 278913
* [LTO] Fix a use-after-free introduced in r278907 and caught by ASan.Chandler Carruth2016-08-171-3/+3
| | | | | | | | | The ASan build bot caught this right away: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15580/steps/check-llvm%20asan/logs/stdio This was also breaking a Windows build bot I'm pretty sure. llvm-svn: 278912
OpenPOWER on IntegriCloud