summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Remove MachineFrameInfo arg from checking functions (NFC)Heejin Ahn2018-08-222-13/+12
| | | | | | | | | | | | | | | | | | Summary: There are several functions in the form of `has***` or `needs***` in `WebAssemblyFrameLowering` and its `MachineFrameInfo` argument can be obtained from `MachineFunction` so it is not necessarily has to be passed from a caller. Also, it is more in line with other overriden fuctions like `hasBP` or `hasReservedCallFrame`, which also take only `MachineFunction` argument. Reviewers: dschuff Subscribers: sbc100, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D51116 llvm-svn: 340438
* [CMake] Remove unneeded and outdated policyChris Bieneman2018-08-221-7/+0
| | | | | | This was needed way back because we didn't properly handle that the SOURCES property of a target could have things that weren't source files to compile. Almost 2 years ago Takumi fixed that, and now CMake is throwing warnings that we should get off the old behavior. llvm-svn: 340436
* [CMake] Use LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPESChris Bieneman2018-08-224-10/+10
| | | | | | | | | | There are several places where we use CMAKE_CONFIGURATION_TYPES to determine if we are using an IDE generator and in turn decide not to generate some of the convenience targets (like all the install-* and check-llvm-* targets). This decision is made because IDEs don't always deal well with the thousands of targets LLVM can generate. This approach does not work for Visual Studio 15's new CMake integration. Because VS15 uses a Ninja generator, it isn't a multi-configuration build, and generating all these extra targets mucks up the UI and adds little value. With this change we still don't generate these targets by default for Visual Studio and Xcode generators, and LLVM_ENABLE_IDE becomes a switch that can be enabled on the VS15 CMake builds, to improve the IDE experience. llvm-svn: 340435
* [X86] In OptimizeLEAs pass, check that the key is in the LEAs map before ↵Craig Topper2018-08-221-2/+6
| | | | | | | | | | | | | | | | | | accessing When the key is not already in the map, the access operator[] creates an empty value and grows the map. Resizing a map is very slow, so this needs to be avoided. Found with csmith + asserts. May help with https://bugs.llvm.org/show_bug.cgi?id=25843 Patch by Tom Rix. Differential Revision: https://reviews.llvm.org/D50780 llvm-svn: 340434
* [WebAssembly] Add hasSideEffects flag to catch instructionsHeejin Ahn2018-08-221-1/+1
| | | | | | | | | | | | | | | Summary: `catch` instruction certainly has rather huge side effects and the flag was missing. At the moment this does not change any unit tests we currently have. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D50919 llvm-svn: 340433
* [CodeGenPrepare] Set debug locs when folding a comparison into a ↵Vedant Kumar2018-08-222-0/+8
| | | | | | | | | uadd.with.overflow CGP can replace a branch + select with a uadd.with.overflow. Teach it to set debug locations as it does this. llvm-svn: 340432
* [llvm-mca] Clean up a comment about the Context class. NFC.Matt Davis2018-08-222-2/+2
| | | | llvm-svn: 340431
* [MemorySSA] Move two simple getters; NFCGeorge Burgess IV2018-08-222-10/+7
| | | | | | | | We're calling these functions quite a bit from outside of MemorySSA.cpp now. Given that they're relatively simple one-liners, I think the style preference is to have them inline. llvm-svn: 340430
* [GISel]: Add legalization support for widening bit counting operationsAditya Nandakumar2018-08-222-0/+193
| | | | | | | | | | https://reviews.llvm.org/D51053 Added legalization for WidenScalar of various bitcounting opcodes. Reviewed by arsenm. llvm-svn: 340429
* [WebAssembly] Optimise relocation processing. NFC.Sam Clegg2018-08-223-37/+52
| | | | | | | | | | | | | | | | | This is a rebased version https://reviews.llvm.org/D42176 which is patch by Nicolas Wilson. Addresses issue: https://github.com/WebAssembly/tool-conventions/issues/32, and https://bugs.llvm.org/show_bug.cgi?id=38650 Previously, for each function/segment we iterated over every relocation to find the relevant ones, which is an n^2 operation. Now, we just make a single pass. Differential Revision: https://reviews.llvm.org/D51063 llvm-svn: 340428
* Disable the aligned allocation test on old mac versions instead of XFAILing itReid Kleckner2018-08-221-6/+6
| | | | | | | | | It looks like this test XPASSes when the deployment target is older than the OS of the system the test is running on. It looks like we run the tests with -mmacosx-version-min=10.12, and that makes the test expect to fail, but it passes. llvm-svn: 340427
* Add diagnostics for min/max algorithms when a InputIterator is used.Eric Fiselier2018-08-222-0/+43
| | | | | | | | | | These algorithms require a ForwardIterator or better. Ensure we diagnose the contract violation at compile time instead of of silently doing the wrong thing. Further algorithms will be audited in upcoming patches. llvm-svn: 340426
* [x86] add tests for load scalar + insertelement; NFCSanjay Patel2018-08-221-0/+814
| | | | llvm-svn: 340425
* [Android] Default to -fno-math-errnoPirama Arumuga Nainar2018-08-223-0/+9
| | | | | | | | | | | | Summary: Android's libm does not set errno. Reviewers: srhines, enh Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51068 llvm-svn: 340424
* [WebAssembly] Ensure relocation entries are ordered by offsetSam Clegg2018-08-222-5/+22
| | | | | | | | | | | | | wasm-lld expects relocation entries to be sorted by offset. In most cases llvm produces them in order, but the CODE section (which combines many MCSections) is an exception because we order the functions in Symbol order, not in section order. What is more, its not clear weather `recordRelocation` is guaranteed to be called in offset order so this sort of most likely needed in the general case too. Differential Revision: https://reviews.llvm.org/D51065 llvm-svn: 340423
* [llvm-mca] Remove unused decl. NFC.Matt Davis2018-08-221-2/+0
| | | | llvm-svn: 340422
* [Tooling] Allow -flto flags and filter out -Wa, flagsChih-Hung Hsieh2018-08-222-6/+17
| | | | | | | | | | | | | This change fixes the problem in https://bugs.llvm.org/show_bug.cgi?id=38332 by allowing driver::Action::BackendJobClass to run with the analyzer. Otherwise, such jobs will look up the non-existing compilation database and then run without flags. Also filter out the -Wa,* flags that could be passed to and ignored by the clang compiler. Clang-tidy gives warnings about unused -Wa,* flags. Differential Revision: http://reviews.llvm.org/D51002 llvm-svn: 340421
* lld-link: Emit warning if one each of {main,wmain} and {WinMain,wWinMain} ↵Nico Weber2018-08-222-2/+66
| | | | | | | | | exist and no /subsystem: flag is passed. Similar to link.exe's LNK4031. https://reviews.llvm.org/D51076 llvm-svn: 340420
* AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr spaceSamuel Pitoiset2018-08-224-32/+48
| | | | | | | | | | | | | | | | 32-bit constant address space is declared as 6, so the maximum number of address spaces is 6, not 5. Fixes "LLVM ERROR: Pointer address space out of range". v5: rename MAX_COMMON_ADDRESS to MAX_AMDGPU_ADDRESS v4: - fix compilation issues - fix out of bounds access v3: use static_assert() v2: add a very simple test for 32-bit addr space Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106630 llvm-svn: 340417
* AMDGPU: fix existing alias rules for constant and globalSamuel Pitoiset2018-08-222-5/+17
| | | | | | | | | | Constant and global may alias, also one rules table wasn't ordered correctly. Pinpointed by Matt. v2: add a test with swapped parameters llvm-svn: 340416
* [X86][SSE] LowerMULH vXi8 - use SSE shifts directly.Simon Pilgrim2018-08-223-175/+72
| | | | | | We know these vXi16 extended cases are legal constant splat shifts. llvm-svn: 340414
* [ELF][HEXAGON] Add R_HEX_16_X relocationSid Manning2018-08-222-0/+35
| | | | | | | | This relocation has only 6-bits the remaining are in the extender. Differential Revision: https://reviews.llvm.org/D50603 llvm-svn: 340413
* [clang-tidy] Add Abseil prefix to documentationHaojian Wu2018-08-221-0/+1
| | | | | | | | | | | | | | | | | | Summary: Adds the Abseil prefix to the list of prefixes in the documentation Patch by Deanna Garcia! Reviewers: aaron.ballman, hokein Reviewed By: hokein Subscribers: xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D51100 llvm-svn: 340412
* [clang-tidy] Abseil: faster strsplit delimiter checkHaojian Wu2018-08-228-0/+318
| | | | | | | | | | | This check is an abseil specific check that checks for code using single character string literals as delimiters and transforms the code into characters. The check was developed internally and has been running at google, this is just a move to open source the check. It was originally written by @sbenza. Patch by Deanna Garcia! llvm-svn: 340411
* [clangd] Get rid of regexes in CanonicalIncludesIlya Biryukov2018-08-222-679/+687
| | | | | | | | | | | | | | Summary: Replace them with suffix mappings. Reviewers: ioeric, kbobyrev Reviewed By: ioeric Subscribers: MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51088 llvm-svn: 340410
* [clangd] Implement BOOST iteratorKirill Bobyrev2018-08-224-40/+185
| | | | | | | | | | | | | | | This patch introduces BOOST iterator - a substantial block for efficient and high-quality symbol retrieval. The concept of boosting allows performing computationally inexpensive scoring on the query side so that the final (expensive) scoring can only be applied on the items with the highest preliminary score while eliminating the need to score too many items. Reviewed by: ilya-biryukov Differential Revision: https://reviews.llvm.org/D50970 llvm-svn: 340409
* [CodeGen] Look at the type of a block capture field rather than the typeAkira Hatanaka2018-08-223-39/+98
| | | | | | | | | | | | | | of the captured variable when determining whether the capture needs special handing when the block is copied or disposed. This fixes bugs in the handling of variables captured by a block that is nested inside a lambda that captures the variables by reference. rdar://problem/43540889 Differential Revision: https://reviews.llvm.org/D51025 llvm-svn: 340408
* [analyzer] Improve `CallDescription` to handle c++ method.Henry Wong2018-08-223-52/+85
| | | | | | | | | | | | | | | | | Summary: `CallDecription` can only handle function for the time being. If we want to match c++ method, we can only use method name to match and can't improve the matching accuracy through the qualifiers. This patch add the support for `QualifiedName` matching to improve the matching accuracy. Reviewers: xazax.hun, NoQ, george.karpenkov, rnkovacs Reviewed By: xazax.hun, NoQ, rnkovacs Subscribers: Szelethus, szepet, rnkovacs, a.sidorin, mikhail.ramalho, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D48027 llvm-svn: 340407
* Attempt to unbreak filesystem tests on certain linux distros.Eric Fiselier2018-08-221-1/+6
| | | | | | | | | | | | | | | On some platforms clock_gettime is in librt, which we don't link by default when building the tests. However it is required by the filesystem tests. This patch introduces a workaround which links librt whenever the filesystem tests are enabled. The workaround should later be replaced with a patch that selectively links both libc++fs and librt only when building filesystem specific tests. However, the way the test configuration is set up right now, this is non-trivial. llvm-svn: 340406
* [ARM] Rotated operand patterns for *xtb16Sam Parker2018-08-223-0/+159
| | | | | | | | | Add intrinsic isel patterns for sxtb16, sxtab16, uxtb16 and uxtab16 so that they can perform a ror. Differential Revision: https://reviews.llvm.org/D51034 llvm-svn: 340405
* [clangd] Make FileIndex aware of the main fileIlya Biryukov2018-08-224-33/+64
| | | | | | | | | | | | | | | | | | | | | Summary: It was previously only indexing the preamble decls. The new implementation will index both the preamble and the main AST and report both sets of symbols, preferring the ones from the main AST whenever the symbol is present in both. The symbols in the main AST slab always store all information available in the preamble symbols, possibly adding more, e.g. definition locations. Reviewers: hokein, ioeric Reviewed By: ioeric Subscribers: kadircet, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D50889 llvm-svn: 340404
* [Preamble] Fix an undefined behavior when checking an empty preamble can be ↵Haojian Wu2018-08-221-2/+2
| | | | | | | | | | | | | | | | reused. Summary: Passing nullptr to memcmp is UB. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50967 llvm-svn: 340403
* Fix import of class templates partial specializationGabor Marton2018-08-224-26/+355
| | | | | | | | | | | | | | | | | | | Summary: Currently there are several issues with the import of class template specializations. (1) Different TUs may have class template specializations with the same template arguments, but with different set of instantiated MethodDecls and FieldDecls. In this patch we provide a fix to merge these methods and fields. (2) Currently, we search the partial template specializations in the set of simple specializations and we add partial specializations as simple specializations. This is bad, this patch fixes it. Reviewers: a_sidorin, xazax.hun, r.stahl Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D50451 llvm-svn: 340402
* [clangd] Add callbacks on parsed AST in addition to parsed preamblesIlya Biryukov2018-08-225-41/+86
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Will be used for updating the dynamic index on updates to the open files. Currently we collect only information coming from the preamble AST. This has a bunch of limitations: - Dynamic index misses important information from the body of the file, e.g. locations of definitions. - XRefs cannot be collected at all, since we can only obtain full information for the current file (preamble is parsed with skipped function bodies, therefore not reliable). This patch only adds the new callback, actually updates to the index will be done in a follow-up patch. Reviewers: hokein Reviewed By: hokein Subscribers: kadircet, javed.absar, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D50847 llvm-svn: 340401
* [COFF] Move a comment close to the code it refers to. NFC.Martin Storsjo2018-08-221-3/+3
| | | | llvm-svn: 340400
* [COFF] Change fatal() into error() when writing chunks to the outputMartin Storsjo2018-08-221-15/+20
| | | | | | | | | | In most of these cases, it's easy to go on despite the error, printing as many valuable error messages as possible from one run as possible. Differential Revision: https://reviews.llvm.org/D51087 llvm-svn: 340399
* [AArch64] Add Tiny Code Model for AArch64David Green2018-08-224-2/+5
| | | | | | | | Adds a tiny code model to Clang along side rL340397. Differential Revision: https://reviews.llvm.org/D49674 llvm-svn: 340398
* [AArch64] Add Tiny Code Model for AArch64David Green2018-08-2234-51/+794
| | | | | | | | | | | | | | This adds the plumbing for the Tiny code model for the AArch64 backend. This, instead of loading addresses through the normal ADRP;ADD pair used in the Small model, uses a single ADR. The 21 bit range of an ADR means that the code and its statically defined symbols need to be within 1MB of each other. This makes it mostly interesting for embedded applications where we want to fit as much as we can in as small a space as possible. Differential Revision: https://reviews.llvm.org/D49673 llvm-svn: 340397
* AMDGPU: Fix not respecting byval alignment in call frame setupMatt Arsenault2018-08-226-41/+174
| | | | | | | | | This was hackily adding in the 4-bytes reserved for the callee's emergency stack slot. Treat it like a normal stack allocation so we get the correct alignment padding behavior. This fixes an inconsistency between the caller and callee. llvm-svn: 340396
* [llvm-mca] Improved code comments and moved some method definitions from ↵Andrea Di Biagio2018-08-222-81/+98
| | | | | | Scheduler.h to Scheduler.cpp. NFC llvm-svn: 340395
* Fix Wdocumentation warnings. NFCI.Simon Pilgrim2018-08-222-8/+7
| | | | llvm-svn: 340394
* [X86][SSE] Add sdiv test case from PR38658Simon Pilgrim2018-08-221-0/+202
| | | | llvm-svn: 340393
* [mips] Handle missing CondCodesStefan Maksimovic2018-08-222-0/+92
| | | | | | | | | | | | | | | | | | | | Add patterns for unhandled CondCode enumerables: SETEQ, SETGE, SETGT, SETLE, SETLT, SETNE. Stated at the ISD::CondCode enum declaration: `All of these (except for the 'always folded ops') should be handled for floating point.` Add patterns which use these nodes, same as corresponding 'ordered' CondCode nodes. Referring to 'Ordered means that neither operand is a QNAN' we assume it is safe to match ex. SETLT node to the same instruction as SETOLT. Differential Revision: https://reviews.llvm.org/D50757 llvm-svn: 340392
* [clang][mips] Set __mips_fpr correctly for -mfpxxStefan Maksimovic2018-08-224-19/+104
| | | | | | | | | | | | | | | | | | | | Set __mips_fpr to 0 if o32 ABI is used with either -mfpxx or none of -mfp32, -mfpxx, -mfp64 being specified. Introduce additional checks: -mfpxx is only to be used in conjunction with the o32 ABI. report an error when incompatible options are provided. Formerly no errors were raised when combining n32/n64 ABIs with -mfp32 and -mfpxx. There are other cases when __mips_fpr should be set to 0 that are not covered, ex. using o32 on a mips64 cpu which is valid but not supported in the backend as of yet. Differential Revision: https://reviews.llvm.org/D50557 llvm-svn: 340391
* [clang-tblgen] Add -print-records and -dump-json modes.Simon Tatham2018-08-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | Currently, if clang-tblgen is run without a mode option, it defaults to the first mode in its 'enum Action', which happens to be -gen-clang-attr-classes. I think it makes more sense for it to behave the same way as llvm-tblgen, i.e. print a diagnostic dump if it's not given any more specific instructions. I've also added the same -dump-json that llvm-tblgen supports. This means any tblgen command line (whether llvm- or clang-) can be mechanically turned into one that processes the same input into JSON. Reviewers: nhaehnle Reviewed By: nhaehnle Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50771 llvm-svn: 340390
* [XRay] Refactor file header reading (NFC)Dean Michael Berris2018-08-224-64/+119
| | | | | | | | | | | | | | | | Summary: This patch moves out the definition of the XRay log file header from binary logs into its own header and implementation file. This is one part of the refactoring being done in D50441. Reviewers: eizan Subscribers: mgorny, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D51086 llvm-svn: 340389
* [clangd] Cleanup after D50897Kirill Bobyrev2018-08-221-1/+1
| | | | | | | The wrong diff that was uploaded to Phabricator was building the wrong index. llvm-svn: 340388
* Change how we handle -wrap.Rui Ueyama2018-08-2210-131/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have an issue with -wrap that the option doesn't work well when renamed symbols get PLT entries. I'll explain what is the issue and how this patch solves it. For one -wrap option, we have three symbols: foo, wrap_foo and real_foo. Currently, we use memcpy to overwrite wrapped symbols so that they get the same contents. This works in most cases but doesn't when the relocation processor sets some flags in the symbol. memcpy'ed symbols are just aliases, so they always have to have the same contents, but the relocation processor breaks that assumption. r336609 is an attempt to fix the issue by memcpy'ing again after processing relocations, so that symbols that are out of sync get the same contents again. That works in most cases as well, but it breaks ASan build in a mysterious way. We could probably fix the issue by choosing symbol attributes that need to be copied after they are updated. But it feels too complicated to me. So, in this patch, I fixed it once and for all. With this patch, we no longer memcpy symbols. All references to renamed symbols point to new symbols after wrapSymbols() is done. Differential Revision: https://reviews.llvm.org/D50569 llvm-svn: 340387
* [AST] correct the behavior of -fvisibility-inlines-hidden option (don't make ↵Hiroshi Inoue2018-08-222-0/+75
| | | | | | | | | | | | | static local variables hidden) The command line option -fvisibility-inlines-hidden makes inlined method hidden, but it is expected not to affect the visibility of static local variables in the function. However, Clang makes the static local variables in the function also hidden as reported in PR37595. This problem causes LLVM bootstarp failure on Fedora 28 if configured with -DBUILD_SHARED_LIBS=ON. This patch makes the behavior of -fvisibility-inlines-hidden option to be consistent with that of gcc; the option does not change the visibility of the static local variables if the containing function does not associated with explicit visibility attribute and becomes hidden due to this option. Differential Revision: https://reviews.llvm.org/D50968 llvm-svn: 340386
* Fix Bug 38644: multimap::clear() missing exception specifier. Add noexcept ↵Marshall Clow2018-08-2213-12/+114
| | | | | | tests for all the containers that have clear(). llvm-svn: 340385
OpenPOWER on IntegriCloud