summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [Sema] Emit -Wincomplete-implementation for partial methods.Erik Pilkington2018-07-072-10/+9
| | | | | | Fixes rdar://40634455 llvm-svn: 336478
* [PM/LoopUnswitch] Fix PR37889, producing the correct loop nest structureChandler Carruth2018-07-073-3/+1243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after trivial unswitching. This PR illustrates that a fundamental analysis update was not performed with the new loop unswitch. This update is also somewhat fundamental to the core idea of the new loop unswitch -- we actually *update* the CFG based on the unswitching. In order to do that, we need to update the loop nest in addition to the domtree. For some reason, when writing trivial unswitching, I thought that the loop nest structure cannot be changed by the transformation. But the PR helps illustrate that it clearly can. I've expanded this to a number of different test cases that try to cover the different cases of this. When we unswitch, we move an exit edge of a loop out of the loop. If this exit edge changes which loop reached by an exit is the innermost loop, it changes the parent of the loop. Essentially, this transformation may hoist the inner loop up the nest. I've added the simple logic to handle this reliably in the trivial unswitching case. This just requires updating LoopInfo and rebuilding LCSSA on the impacted loops. In the trivial case, we don't even need to handle dedicated exits because we're only hoisting the one loop and we just split its preheader. I've also ported all of these tests to non-trivial unswitching and verified that the logic already there correctly handles the loop nest updates necessary. Differential Revision: https://reviews.llvm.org/D48851 llvm-svn: 336477
* [X86] Merge INTR_TYPE_3OP_RM with INTR_TYPE_3OP. Remove unused INTR_TYPE_1OP_RM.Craig Topper2018-07-072-40/+21
| | | | llvm-svn: 336476
* Check returned type is valid before using it.Richard Trieu2018-07-072-0/+11
| | | | | | Add a .isNull() check to returned QualType. Fixes PR38077 llvm-svn: 336475
* Revert "Make __gcov_flush flush counters for all shared libraries"Michael Zolotukhin2018-07-0720-678/+85
| | | | | | | This reverts r336365: the added tests are failing on various configurations (e.g. on green-dragon). llvm-svn: 336474
* Revert "[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)."Tim Shen2018-07-0618-70/+55
| | | | | | This reverts commit r336140. Our tests shows that LSR assert fails with it. llvm-svn: 336473
* [X86] When creating a select for scalar masked sqrt and div builtins make ↵Craig Topper2018-07-062-106/+109
| | | | | | | | | | sure we optimize the all ones mask case. This case occurs in the intrinsic headers so we should avoid emitting the mask in those cases. Factor the code into a helper function to make this easy. llvm-svn: 336472
* [MachineOutliner] Properly pass -moutline along to the toolchainJessica Paquette2018-07-064-13/+19
| | | | | | | | | | This moves the LTO-specific code for outlining from ToolChains/Clang.cpp to ToolChains/Darwin.cpp. Passing -mllvm flags isn't sufficient for making sure that the specified pass will actually run in LTO. This makes sure that when -moutline is passed, the MachineOutliner will actually be added to the LTO pass pipeline as expected. llvm-svn: 336471
* [X86] Add missing scalar fma intrinsics with rounding, but no mask.Craig Topper2018-07-062-24/+120
| | | | | | | | We had the mask versions of the rounding intrinsics, but not one without masking. Also change the rounding tests to not use the CUR_DIRECTION rounding mode. llvm-svn: 336470
* [PDB] memicmp only exists on Windows, use StringRef::compare_lower insteadBenjamin Kramer2018-07-061-2/+2
| | | | llvm-svn: 336469
* [ASTMatchers] A matcher for Objective-C @autoreleasepoolGeorge Karpenkov2018-07-065-8/+94
| | | | | | Differential Revision: https://reviews.llvm.org/D48910 llvm-svn: 336468
* [OPENMP] Fix PR38026: Link -latomic when -fopenmp is used.Alexey Bataev2018-07-062-9/+13
| | | | | | | On Linux atomic constructs in OpenMP require libatomic library. Patch links libatomic when -fopenmp is used. llvm-svn: 336467
* Fix DIExpression::ExprOperand::appendToVectorVedant Kumar2018-07-062-7/+3
| | | | | | | | | | | | appendToVector used the wrong overload of SmallVector::append, resulting in it appending the same element to a vector `getSize()` times. This did not cause a problem when initially committed because appendToVector was only used to append 1-element operands. This changes appendToVector to use the correct overload of append(). Testing: ./unittests/IR/IRTests --gtest_filter='*DIExpressionTest*' llvm-svn: 336466
* Remove a redundant null-check in DIExpression::prepend, NFCVedant Kumar2018-07-061-13/+14
| | | | | | | Code outside of an `if (Expr)` block dereferenced `Expr`, so the null check was redundant. llvm-svn: 336465
* [PDB] One more fix for hasing GSI records.Zachary Turner2018-07-066-9/+199
| | | | | | | | | | | | | | | | The reference implementation uses a case-insensitive string comparison for strings of equal length. This will cause the string "tEo" to compare less than "VUo". However we were using a case sensitive comparison, which would generate the opposite outcome. Switch to a case insensitive comparison. Also, when one of the strings contains non-ascii characters, fallback to a straight memcmp. The only way to really test this is with a DIA test. Before this patch, the test will fail (but succeed if link.exe is used instead of lld-link). After the patch, it succeeds even with lld-link. llvm-svn: 336464
* [test-suite] Add a decorator for the lack of libstdcxx on the system.Davide Italiano2018-07-0610-26/+21
| | | | | | | | | This generalizes a bunch of target-specific tests. MacOS has no libstdcxx anymore, and neither does FreeBSD (or Windows). <rdar://problem/41896105> llvm-svn: 336463
* Use Type::isIntOrPtrTy where possible, NFCVedant Kumar2018-07-068-37/+22
| | | | | | | | | | | It's a bit neater to write T.isIntOrPtrTy() over `T.isIntegerTy() || T.isPointerTy()`. I used Python's re.sub with this regex to update users: r'([\w.\->()]+)isIntegerTy\(\)\s*\|\|\s*\1isPointerTy\(\)' llvm-svn: 336462
* libFuzzer: always print line-break for NEW_FUNC/PC outputKostya Serebryany2018-07-061-3/+6
| | | | | | | | | | | | | | Summary: This is a minor cosmetic change. When function/path exceed ~1000 characters, the output is truncated before the line-break. I noticed this for NEW_FUNC. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48799 llvm-svn: 336461
* [OPENMP] Make clauses closing loc point to right bracket.Alexey Bataev2018-07-063-16/+24
| | | | | | | | For some of the clauses the closing location erroneously points to the beginning of the next clause rather than on the location of the closing bracket of the clause. llvm-svn: 336460
* [IR] Fix inconsistent declaration parameter nameFangrui Song2018-07-063-6/+6
| | | | llvm-svn: 336459
* [X86] Remove patterns for MOVLPD/MOVLPS nodes with integer types.Craig Topper2018-07-061-8/+0
| | | | | | Lowering shouldn't generate these. If we need to use them for integer types, it should use a bitcast. llvm-svn: 336458
* [X86] Add more FMA3 memory folding patterns. Remove patterns that are no ↵Craig Topper2018-07-062-53/+49
| | | | | | | | longer needed. We've removed the legacy FMA3 intrinsics and are now using llvm.fma and extractelement/insertelement. So we don't need patterns for the nodes that could only be created by the old intrinscis. Those ISD opcodes still exist because we haven't dropped the AVX512 intrinsics yet, but those should go to EVEX instructions. llvm-svn: 336457
* [llvm-mca] Add HardwareUnit and Context classes.Matt Davis2018-07-069-25/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the construction of the default backend from llvm-mca.cpp and into mca::Context. The Context class is responsible for holding ownership of the simulated hardware components. These components are subclasses of HardwareUnit. Right now the HardwareUnit is pretty bare-bones, but eventually we might want to add some common functionality across all hardware components, such as isReady() or something similar. I have a feeling this patch will probably need some updates, but it's a start. One thing I am not particularly fond of is the rather large interface for createDefaultPipeline. That convenience routine takes a rather large set of inputs from the llvm-mca driver, where many of those inputs are generated via command line options. One item I think we might want to change is the separating of ownership of hardware components (owned by the context) and the pipeline (which owns Stages). In short, a Pipeline owns Stages, a Context (currently) owns hardware. The Pipeline's Stages make use of the components, and thus there is a lifetime dependency generated. The components must outlive the pipeline. We could solve this by having the Context also own the Pipeline, and not return a unique_ptr<Pipeline>. Now that I think about it, I like that idea more. Differential Revision: https://reviews.llvm.org/D48691 llvm-svn: 336456
* [llvm-objcopy] Add support for static librariesAlexander Shaposhnikov2018-07-067-87/+372
| | | | | | | | | | | This diff adds support for handling static libraries to llvm-objcopy and llvm-strip. Test plan: make check-all Differential revision: https://reviews.llvm.org/D48413 llvm-svn: 336455
* [InstCombine] add more tests for potentially poisonous shifts; NFCSanjay Patel2018-07-061-0/+43
| | | | llvm-svn: 336454
* Revert 336426 (and follow-ups 428, 440), it very likely caused PR38084.Nico Weber2018-07-064-318/+20
| | | | llvm-svn: 336453
* [Debugify] Allow unsigned values narrower than their variablesVedant Kumar2018-07-062-5/+19
| | | | | | | | Suppress the diagnostic for mis-sized dbg.values when a value operand is narrower than the unsigned variable it describes. Assume that a debugger would implicitly zero-extend these values. llvm-svn: 336452
* [Local] replaceAllDbgUsesWith: Update debug values before RAUWVedant Kumar2018-07-0612-69/+544
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The replaceAllDbgUsesWith utility helps passes preserve debug info when replacing one value with another. This improves upon the existing insertReplacementDbgValues API by: - Updating debug intrinsics in-place, while preventing use-before-def of the replacement value. - Falling back to salvageDebugInfo when a replacement can't be made. - Moving the responsibiliy for rewriting llvm.dbg.* DIExpressions into common utility code. Along with the API change, this teaches replaceAllDbgUsesWith how to create DIExpressions for three basic integer and pointer conversions: - The no-op conversion. Applies when the values have the same width, or have bit-for-bit compatible pointer representations. - Truncation. Applies when the new value is wider than the old one. - Zero/sign extension. Applies when the new value is narrower than the old one. Testing: - check-llvm, check-clang, a stage2 `-g -O3` build of clang, regression/unit testing. - This resolves a number of mis-sized dbg.value diagnostics from Debugify. Differential Revision: https://reviews.llvm.org/D48676 llvm-svn: 336451
* [InstCombine] add more tests with poison and undef; NFCSanjay Patel2018-07-061-5/+540
| | | | | | | | As discussed in D48987 and D48893, there are many different ways to go wrong depending on the binop (and as shown here we already do go wrong in some cases). llvm-svn: 336450
* Recommit "[CMake] Run libFuzzer tests with check-all."Yvan Roux2018-07-061-2/+0
| | | | | | Since problematic tests on AArch64 were disabled at r336446. llvm-svn: 336449
* AMDGPU: Fix UBSan error caused by r335942Tom Stellard2018-07-063-24/+21
| | | | | | | | | | | | | | Summary: Fixes PR38071. Reviewers: arsenm, dstenb Reviewed By: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D48979 llvm-svn: 336448
* [MSan] Add functions to enable/disable interceptor checks.Matt Morehouse2018-07-064-0/+69
| | | | | | | | | | | | | | | | | | Summary: The motivation for this change is to make libFuzzer+MSan possible without instrumenting libFuzzer. See https://github.com/google/sanitizers/issues/958. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D48890 llvm-svn: 336447
* [libFuzzer] Disable hanging tests on AArch64Yvan Roux2018-07-063-0/+3
| | | | | | | | | Disable problematic tests which broke AArch64 bots. Details available in Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=38034 Differential Revision: https://reviews.llvm.org/D49011 llvm-svn: 336446
* [scudo] Add some logs for AndroidKostya Kortchinsky2018-07-061-0/+3
| | | | | | | | | | | | | | | | Summary: Namely, set the abort message, and allow to write the message to syslog if the option is enabled. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48902 llvm-svn: 336445
* [Constants] extend getBinOpIdentity(); NFCSanjay Patel2018-07-062-28/+50
| | | | | | | | The enhanced version will be used in D48893 and related patches and an almost identical (fadd is different) version is proposed in D28907, so adding this as a preliminary step. llvm-svn: 336444
* [ELF] - Add test for empty version in a symbol name. George Rimar2018-07-061-0/+20
| | | | | | | This covers the following line which was untested: https://github.com/llvm-mirror/lld/blob/master/ELF/Symbols.cpp#L170 llvm-svn: 336443
* [Constant] add undef element query for vector constants; NFCSanjay Patel2018-07-062-0/+14
| | | | | | | This is likely to be used in D48987 and similar patches, so adding it as an NFC preliminary step. llvm-svn: 336442
* [ARM] ParallelDSP: added statistics, NFC.Sjoerd Meijer2018-07-0614-20/+25
| | | | | | | | | Added statistics for the number of SMLAD instructions created, and als renamed the pass name to -arm-parallel-dsp. Differential Revision: https://reviews.llvm.org/D48971 llvm-svn: 336441
* Commit rL336426 cause buildbot failuresDiogo N. Sampaio2018-07-062-6/+6
| | | | | | | | http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/50537/testReport/junit/LLVM/CodeGen_AArch64/FoldRedundantShiftedMasking_ll/ This removes the comments of the function label causing this error. llvm-svn: 336440
* [LoopSink] Make the enforcement of determinism deterministic.Benjamin Kramer2018-07-061-4/+6
| | | | | | | | | | | | | | LoopBlockNumber is a DenseMap<BasicBlock*, int>, comparing the result of find() will compare a pair<BasicBlock*, int>. That's of course depending on pointer ordering which varies from run to run. Reverse iteration doesn't find this because we're copying to a vector first. This bug has been there since 2016 but only recently showed up on clang selfhost with FDO and ThinLTO, which is also why I didn't manage to get a reasonable test case for this. Add an assert that would've caught this. llvm-svn: 336439
* Define the __STDC_FORMAT_MACROS to avoid test failure on some platforms.Kelvin Li2018-07-061-0/+5
| | | | | | | | | ompt/misc/api_calls_from_other_thread.cpp ompt/misc/interoperability.cpp Differential Revision: https://reviews.llvm.org/D48984 llvm-svn: 336438
* [llvm-mca] A write latency cannot be a negative value. NFCAndrea Di Biagio2018-07-063-10/+10
| | | | llvm-svn: 336437
* [ELF] - Remove dead code #2.George Rimar2018-07-061-4/+1
| | | | | | 'Pos' is never can be 0 here. llvm-svn: 336436
* [ELF] - Remove dead code. NFC.George Rimar2018-07-061-2/+0
| | | | | | 'Pos' can never be 0. llvm-svn: 336435
* [AArch64] Armv8.4-A: TLB supportSjoerd Meijer2018-07-064-0/+470
| | | | | | | | This adds: - outer shareable TLB Maintenance instructions, and - TLB range maintenance instructions. llvm-svn: 336434
* [dsymutil] Emit label at the begin of a CUJonas Devlieghere2018-07-062-0/+9
| | | | | | | | When emitting a CU, store the MCSymbol pointing to the beginning of the CU. We'll need this information later when emitting the .debug_names section (DWARF5 accelerator table). llvm-svn: 336433
* Recommit: [AArch64] Armv8.4-A: Flag manipulation instructionsSjoerd Meijer2018-07-066-0/+143
| | | | | | Now with the asm operand definition included. llvm-svn: 336432
* [clangd] Make SymbolOrigin an enum class, rather than a plain enum.Sam McCall2018-07-065-16/+24
| | | | | | | I never intended to define namespace pollution like clangd::AST, clangd::Unknown etc. Oops! llvm-svn: 336431
* Add a file that was missing in r336425Philip Pfaffe2018-07-061-0/+513
| | | | llvm-svn: 336430
* [Driver,AArch64] Add support for -mcpu=native.Florian Hahn2018-07-062-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This patches adds support for passing -mcpu=native for AArch64. It will get turned into the host CPU name, before we get the target features. CPU = native is handled in a similar fashion in getAArch64MicroArchFetauresFromMtune and getAArch64TargetCPU already. Having a good test case for this is hard, as it depends on the host CPU of the machine running the test. But we can check that native has been replaced with something else. When cross-compiling, we will get a CPU name from the host architecture and get ` the clang compiler does not support '-mcpu=native'` as error message, which seems reasonable to me. Reviewers: rengolin, peter.smith, dlj, javed.absar, t.p.northover Reviewed By: peter.smith Tags: #clang Differential Revision: https://reviews.llvm.org/D48931 llvm-svn: 336429
OpenPOWER on IntegriCloud