summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Move unittests/Support/IteratorTest.cpp to unittests/ADT/Duncan P. N. Exon Smith2016-08-203-1/+1
| | | | | | This testing stuff from ADT, not Support. Fix the file location. llvm-svn: 279372
* Reapply "[SLP] Initialize VectorizedValue when gathering"Matthew Simpson2016-08-202-8/+153
| | | | | | | | | | | The test case included in r279125 exposed existing undefined behavior in the SLP vectorizer that it did not introduce. This patch reapplies the original patch, but modifies the test case to avoid hitting the undefined behavior. This allows us to close PR28330 while keeping the UBSan bot happy. The undefined behavior the original test uncovered will be addressed in a follow-on patch. Reference: https://llvm.org/bugs/show_bug.cgi?id=28330 llvm-svn: 279370
* [SLP] Add command line option for minimum tree size (NFC)Matthew Simpson2016-08-201-1/+5
| | | | llvm-svn: 279369
* Revert "[SLP] Initialize VectorizedValue when gathering" to fix ubsan bot.Vitaly Buka2016-08-202-161/+8
| | | | | | | | This reverts commit r279125. https://reviews.llvm.org/D23410 llvm-svn: 279363
* [CMake/ASan] Skip using libedit if ASan is enabled -- it leaks memory.Chandler Carruth2016-08-201-1/+2
| | | | | | | Note that you'll have to clear this variable from your CMake cache for it to take effect. llvm-svn: 279362
* [Profile] add test with large countsXinliang David Li2016-08-202-0/+15
| | | | llvm-svn: 279361
* [PM] Introduce an abstraction for all the analyses over a particular IRChandler Carruth2016-08-203-13/+35
| | | | | | | | | | | | | | | | | | unit for use in the PreservedAnalyses set. This doesn't have any important functional change yet but it cleans things up and makes the analysis substantially more efficient by avoiding querying through the type erasure for every analysis. I also think it makes it much easier to reason about how analyses are preserved when walking across pass managers and across IR unit abstractions. Thanks to Sean and Mehdi both for the comments and suggestions. Differential Revision: https://reviews.llvm.org/D23691 llvm-svn: 279360
* [gold/ThinLTO] Restore ThinLTO file management in gold pluginTeresa Johnson2016-08-202-1/+20
| | | | | | | | | | | | | | | | | | Summary: The gold-plugin changes added along with the new LTO API in r278338 had the effect of removing the management of the PluginInputFile that ensured the files weren't released back to gold until the backend threads were complete. Add back the old file handling. Fixes PR29020. Reviewers: mehdi_amini Subscribers: mehdi_amini, llvm-commits, hjl.tools Differential Revision: https://reviews.llvm.org/D23721 llvm-svn: 279356
* [gold] Fix new gold test to specify emulation modeTeresa Johnson2016-08-201-0/+1
| | | | | | Add emulation mode option for new test added in r279023. llvm-svn: 279355
* [LTO] Add the ability to test -thinlto-emit-imports-files through llvm-lto2Mehdi Amini2016-08-192-1/+28
| | | | | | | | | | | | | | Summary: Start bringing llvm-lto2 to a level where we can test the LTO API a bit deeper. Reviewers: tejohnson Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23681 llvm-svn: 279349
* MachineFunction: Add llvm_unreachable for missing propertiesMatthias Braun2016-08-191-0/+1
| | | | | | Most compilers should give you a warning anyway though. llvm-svn: 279346
* Reset "undef" flag when coalescing subregister into whole registerKrzysztof Parzyszek2016-08-191-0/+1
| | | | llvm-svn: 279344
* GlobalISel: support legalization of G_FCONSTANTsTim Northover2016-08-195-0/+26
| | | | llvm-svn: 279341
* GlobalISel: teach legalizer how to handle integer constants.Tim Northover2016-08-194-3/+80
| | | | llvm-svn: 279340
* [InstCombine] use m_APInt to allow icmp (shl X, Y), C folds for splat ↵Sanjay Patel2016-08-193-33/+36
| | | | | | | | | constant vectors, part 1 This is a partial enablement (move the ConstantInt guard down) because there are many different folds here and one of the later ones will require reworking 'isSignBitCheck'. llvm-svn: 279339
* MachineFunction: Cleanup/simplify MachineFunctionProperties::print()Matthias Braun2016-08-194-40/+22
| | | | | | | | | | - Always compile print() regardless of LLVM_ENABLE_DUMP. (We usually only gard dump() functions with that). - Only show the set properties to reduce output clutter. - Remove the unused variant that even shows the unset properties. - Fix comments llvm-svn: 279338
* MachineFunction: Make LastProperty an alias of the last propertyMatthias Braun2016-08-192-4/+2
| | | | | | | This avoids unnecessary cases in switch statements covering all properties. llvm-svn: 279337
* Partially revert 279331, as we modify this instruction in the loopDaniel Berlin2016-08-191-3/+7
| | | | llvm-svn: 279335
* Revert "[asan] Add support of lifetime poisoning into ↵Vitaly Buka2016-08-194-48/+33
| | | | | | | | | | ComputeASanStackFrameLayout" This reverts commit r279020. Speculative revert in hope to fix asan test on arm. llvm-svn: 279332
* Convert some depth first traversals to depth_firstDaniel Berlin2016-08-193-17/+10
| | | | llvm-svn: 279331
* [CallGraph] Use decltype instead of pointer_to_unary_function. NFC.Tim Shen2016-08-191-30/+25
| | | | | | | | | | Reviewers: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23725 llvm-svn: 279328
* [GraphTraits] Make nodes_iterator dereference to NodeType*/NodeRefTim Shen2016-08-1916-54/+59
| | | | | | | | | Currently nodes_iterator may dereference to a NodeType* or a NodeType&. Make them all dereference to NodeType*, which is NodeRef later. Differential Revision: https://reviews.llvm.org/D23704 Differential Revision: https://reviews.llvm.org/D23705 llvm-svn: 279326
* [Packetizer] Add debugging code to stop packetization after N instructionsKrzysztof Parzyszek2016-08-191-0/+21
| | | | llvm-svn: 279325
* [Hexagon] Avoid register dependencies on indirect branches in packetizerKrzysztof Parzyszek2016-08-191-7/+8
| | | | | | | Do not packetize the instruction setting the branch address with the indirect branch itself. llvm-svn: 279324
* [ADT] add pointer_iterator, the opposite of pointee_iteratorTim Shen2016-08-192-0/+41
| | | | | | Differential Revision: https://reviews.llvm.org/D23703 llvm-svn: 279323
* [libFuzzer] fix the non-debug build warningsKostya Serebryany2016-08-191-1/+2
| | | | llvm-svn: 279321
* GlobalISel: translate floating-point round/extendTim Northover2016-08-194-2/+42
| | | | llvm-svn: 279320
* GlobalISel: translate floating-point comparisonsTim Northover2016-08-197-14/+76
| | | | llvm-svn: 279319
* [NVPTX] Switch nvptx-use-infer-addrspace to true.Justin Lebar2016-08-194-7/+7
| | | | | | | | | | | | | | | Summary: This switches us to use a different, more powerful algorithm for address space inference. I've tested this locally and it seems to work great. Once we're more confident in it, we can remove the old pass altogether. Reviewers: jingyue Subscribers: llvm-commits, tra, jholewinski Differential Revision: https://reviews.llvm.org/D23694 llvm-svn: 279317
* Reapply "ADT: Remove UB in ilist (and use a circular linked list)"Duncan P. N. Exon Smith2016-08-193-289/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit r279053, reapplying r278974 after fixing PR29035 with r279104. Note that r279312 has been committed in the meantime, and this has been rebased on top of that. Otherwise it's identical to r278974. Note for maintainers of out-of-tree code (that I missed in the original message): if the new isKnownSentinel() assertion is firing from ilist_iterator<>::operator*(), this patch has identified a bug in your code. There are a few common patterns: - Some IR-related APIs htake an IRUnit* that might be nullptr, and pass in an incremented iterator as an insertion point. Some old code was using "&*++I", which in the case of end() only worked by fluke. If the IRUnit in question inherits from ilist_node_with_parent<>, you can use "I->getNextNode()". Otherwise, use "List.getNextNode(*I)". - In most other cases, crashes on &*I just need to check for I==end() before dereferencing. - There's also occasional code that sends iterators into a function, and then starts calling I->getOperand() (or other API). Either check for end() before the entering the function, or early exit. Note for if the static_assert with HasObsoleteCustomization is firing for you: - r278513 has examples of how to stop using custom sentinel traits. - r278532 removed ilist_nextprev_traits since no one was using it. See lld's r278469 for the only migration I needed to do. Original commit message follows. ---- 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: 279314
* Revert "[SimplifyCFG] Rewrite SinkThenElseCodeToEnd"Reid Kleckner2016-08-195-416/+153
| | | | | | | This reverts commit r279229. It breaks intrinsic function calls in diamonds. llvm-svn: 279313
* Reapply "ADT: Tidy up ilist_traits static asserts, NFC"Duncan P. N. Exon Smith2016-08-192-11/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This spiritually reapplies r279012 (reverted in r279052) without the r278974 parts. The differences: - Only the HasGetNext trait exists here, so I've only cleaned up (and tested) it. I still added HasObsoleteCustomization since I know this will be expanding when r278974 is reapplied. - I changed the unit tests to use static_assert to catch problems earlier in the build. - I added negative tests for the type traits. Original commit message follows. ---- 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: 279312
* GlobalISel: translate floating-point constantsTim Northover2016-08-196-0/+36
| | | | llvm-svn: 279311
* GlobalISel: translate float/int conversion instructions.Tim Northover2016-08-194-4/+96
| | | | llvm-svn: 279310
* GlobalISel: support translating select instructions.Tim Northover2016-08-197-2/+49
| | | | llvm-svn: 279309
* GlobalISel: fix insert/extract to work on ConstantExprs too.Tim Northover2016-08-191-18/+27
| | | | | | | No tests yet unfortunately (ConstantFolding reduces all supported constants to ConstantInts before we get to translation). Soon. llvm-svn: 279308
* GlobalISel: fix stale commentTim Northover2016-08-191-2/+3
| | | | llvm-svn: 279307
* GlobalISel: translate insertvalue instructions.Tim Northover2016-08-196-1/+73
| | | | | | | | | | This adds a G_INSERT instruction, which technically makes G_SEQUENCE redundant (it's equivalent to a G_INSERT into an IMPLICIT_DEF). We'll leave G_SEQUENCE for now though: it's likely to be far more common as it's a fundamental part of legalization, so avoiding the mess and bloat of the extra IMPLICIT_DEFs is probably worthwhile. llvm-svn: 279306
* MachineScheduler: Add constructor functions for the DAGMutationsTom Stellard2016-08-192-4/+56
| | | | | | | | | | | | Summary: This way they can be re-used by target-specific schedulers. Reviewers: atrick, MatzeB, kparzysz Subscribers: kparzysz, llvm-commits, MatzeB Differential Revision: https://reviews.llvm.org/D23678 llvm-svn: 279305
* [Hexagon] Add RUN line to testKrzysztof Parzyszek2016-08-191-0/+4
| | | | llvm-svn: 279304
* [Hexagon] Fix subesthetic indentationKrzysztof Parzyszek2016-08-193-51/+50
| | | | llvm-svn: 279303
* [Hexagon] Allow i1 values for 'r' constraint in inline-asmKrzysztof Parzyszek2016-08-192-2/+13
| | | | llvm-svn: 279302
* [CostModel][X86] Added sub, or, and, fadd and fsub costs and missing 512-bit ↵Simon Pilgrim2016-08-191-0/+227
| | | | | | mul costs llvm-svn: 279301
* [InstCombine] remove an icmp fold that is already handled by InstSimplifySanjay Patel2016-08-191-10/+0
| | | | | | | | | | | | Specifically, this is done near the end of "SimplifyICmpInst" using computeKnownBits() as the broader solution. There are even vector tests (yay!) for this in test/Transforms/InstSimplify/compare.ll. I considered putting an assert here instead of just deleting, but then we could assert every possible fold in InstSimplify in InstCombine, so...less is more? llvm-svn: 279300
* Add missing #include found by modules build.Richard Smith2016-08-191-0/+1
| | | | llvm-svn: 279298
* [Hexagon] Do not cache alloca instructions during iselKrzysztof Parzyszek2016-08-195-29/+6
| | | | | | | | They can be deleted or replicated, so the cache may become outdated. They only need to be visited once during frame lowering, so just scan the function instead. llvm-svn: 279297
* [PM] Re-instate r279227 and r279228 with a fix to the way the templatingChandler Carruth2016-08-195-60/+154
| | | | | | | | | | | was done to hopefully appease MSVC. As an upside, this also implements the suggestion Sanjoy made in code review, so two for one! =] I'll be watching the bots to see if there are still issues. llvm-svn: 279295
* GlobalISel: improve representation of G_SEQUENCE and G_EXTRACTTim Northover2016-08-196-53/+83
| | | | | | | | | | | | First, make sure all types involved are represented, rather than being implicit from the register width. Second, canonicalize all types to scalar. These operations just act in bits and don't care about vectors. Also standardize spelling of Indices in the MachineIRBuilder (NFC here). llvm-svn: 279294
* [CostModel][X86] Added some AVX512 and 512-bit vector cost testsSimon Pilgrim2016-08-191-0/+129
| | | | llvm-svn: 279291
* Revert "IfConversion: Rescan diamonds."Kyle Butt2016-08-191-115/+34
| | | | | | This reverts commit bfd62a4b4465dd21811bf615c3b04c30ddb09f7b. llvm-svn: 279289
OpenPOWER on IntegriCloud