summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* AMDGPU: Use wider scalar spills for SGPR spillingMatt Arsenault2016-12-024-53/+259
| | | | | | | | | | | | | | | | Since the spill is for the whole wave, these don't have the swizzling problems that vector stores do and a single 4-byte allocation is enough to spill a 64 element register. This should reduce the number of spill instructions and put all the spills for a register in the same cacheline. This should save allocated private size, but for now it doesn't. The extra slots are allocated for each component, but never used because the frame layout is essentially finalized before frame indices are replaced. For always using the scalar store path, this should probably be moved into processFunctionBeforeFrameFinalized. llvm-svn: 288445
* Delete tautological assertion.Jonathan Roelofs2016-12-021-1/+0
| | | | | | | | After r256463, both the LHS and RHS now refer to the same variable. Before, they referred to the member, the parameter respectively. Now GCC6's -Wtautological-compare complains. llvm-svn: 288444
* Fix undefined behavior.Rui Ueyama2016-12-021-7/+9
| | | | | | | New items can be added to Ranges here, and that invalidates an iterater that previously pointed the end of the vector. llvm-svn: 288443
* When instructions are hoisted out of loops by MachineLICM, remove their ↵Wolfgang Pieb2016-12-023-4/+151
| | | | | | | | | | | | | | | debug loc. This prevents erratic stepping behavior as well as incorrect source attribution for sample profiling. Reviewers: dblakie Subscribers: llvm-commit Differential Revision: https://reviews.llvm.org/D27290 llvm-svn: 288442
* SDAG: Avoid a large, usually empty SmallVector in a recursive functionJustin Bogner2016-12-021-2/+2
| | | | | | | | | | | | | | | This SmallVector is using up 128 bytes on the stack every time despite almost always being empty[1], and since this function can recurse quite deeply that adds up to a lot of overhead. We've seen this run afoul of ulimits in some cases with ASAN on. Replacing the SmallVector with a std::vector trades an occasional heap allocation for vastly less stack usage. [1]: I gathered some stats on an internal test suite and the vector was non-empty in only 45,000 of 10,000,000 calls to this function. llvm-svn: 288441
* Struct GEPs must use i32, not whatever size_t is. It should be safeJohn McCall2016-12-011-2/+4
| | | | | | | to do this unconditionally, given that the indices will always be small constant integers anyway. llvm-svn: 288440
* [AArch64] Fold more spilled/refilled COPYs.Geoff Berry2016-12-013-64/+114
| | | | | | | | | | | | | | | Summary: Make AArch64InstrInfo::foldMemoryOperandImpl more general by folding all full COPYs between register classes of the same size that are either spilled or refilled. Reviewers: MatzeB, qcolombet Subscribers: aemerson, rengolin, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D27271 llvm-svn: 288439
* [libclang] Add APIs to check the result of an integer expression in ↵Argyrios Kyrtzidis2016-12-015-6/+81
| | | | | | | | | CXEvalResult without overflow Patch by Emilio Cobos Álvarez! See https://reviews.llvm.org/D26788 llvm-svn: 288438
* [MC] Refactor emitELFSize to make usage more consistent. NFC.Dan Gohman2016-12-017-14/+11
| | | | | | | | | | | | | Move the cast<MCSymbolELF> inside emitELFSize, so that: - it's done in one place instead of at each call - it's more consistent with similar functions like EmitCOFFSafeSEH - ambiguity between cast<> and dyn_cast<> is avoided (which also eliminates an unnecessary dyn_cast call) This also makes it easier to experiment with using ".size" directives on non-ELF targets. llvm-svn: 288437
* Extend CompilationDatabase by a field for the output filenameJoerg Sonnenberger2016-12-016-9/+31
| | | | | | | | | | | | | | In bigger projects like an Operating System, the same source code is often compiled in slightly different ways. This could be the difference between PIC and non-PIC code for static vs dynamic libraries, it could also be the difference between size optimised versions of tools for ramdisk images. At the moment, the compilation database has no way to distinguish such cases. As first step, add a field in the JSON format for it and process it accordingly. Differential Revision: https://reviews.llvm.org/D27138 llvm-svn: 288436
* llvm-modextract: Call keep() on the output stream before exiting.Peter Collingbourne2016-12-012-0/+7
| | | | llvm-svn: 288435
* [ARM] Fix for 64-bit CAS expansion on ARM32 with -O0Oleg Ranevskyy2016-12-012-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes comparison of 64-bit atomic with its expected value in CMP_SWAP_64 expansion. Currently, the low words are compared with CMP, while the high words are compared with SBC. SBC expects the carry flag to be set if CMP detects a difference. CMP might leave the carry unset for unequal arguments though if the first one is >= than the second. This might cause the comparison logic to detect false equality. Example of the broken C++ code: ``` std::atomic<long long> at(2); long long ll = 1; std::atomic_compare_exchange_strong(&at, &ll, 3); ``` Even though the atomic `at` and the expected value `ll` are not equal and `atomic_compare_exchange_strong` returns `false`, `at` is changed to 3. The patch replaces SBC with CMPEQ. Reviewers: t.p.northover Subscribers: aemerson, rengolin, llvm-commits, asl Differential Revision: https://reviews.llvm.org/D27315 llvm-svn: 288433
* Revert "[SLP] Fix for PR6246: vectorization for scalar ops on vector elements."Artem Belevich2016-12-012-134/+180
| | | | | | This reverts r288412 which causes severe compile-time regression. llvm-svn: 288431
* RegisterCoalscer: Only coalesce complete reserved registers.Matthias Braun2016-12-014-62/+105
| | | | | | | | | | | | The coalescer eliminates copies from reserved registers of the form: %vregX = COPY %rY in the case where %rY is a reserved register. However this turns out to be invalid if only some of the subregisters are reserved (see also https://reviews.llvm.org/D26648). Differential Revision: https://reviews.llvm.org/D26687 llvm-svn: 288428
* Fix broken buildbots because of r288424 (NFC).Eugene Zelenko2016-12-011-0/+1
| | | | llvm-svn: 288426
* [ADT, Support, TableGen] Fix some Clang-tidy modernize-use-default and ↵Eugene Zelenko2016-12-0112-161/+318
| | | | | | Include What You Use warnings; other minor fixes (NFC). llvm-svn: 288424
* [dsymutil] Simplify a lazy-init condition/expressionDavid Blaikie2016-12-011-4/+3
| | | | llvm-svn: 288423
* build: fix building for Windows after SVN r287465Saleem Abdulrasool2016-12-011-1/+1
| | | | | | | | The previous change for enabling MinGW did not preserve the Win32 check and added the EABI specific routines to a Windows build which does not use the EABI routines. Correct the conditional check for that. llvm-svn: 288422
* [debug info] Minor cleanup from D27170/r288399David Blaikie2016-12-014-8/+3
| | | | llvm-svn: 288421
* [SelectionDAG] getRawSubclassData should not return HasDebugValue.Chih-Hung Hsieh2016-12-012-1/+187
| | | | | | | | | | | This change fixes a regression in r279537 and makes getRawSubclassData behave like r279536. Without this change, the fp128-g.ll test case will have an infinite loop involving SoftenFloatRes_LOAD. Differential Revision: http://reviews.llvm.org/D26942 llvm-svn: 288420
* Add an assert instead of ignoring an impossible condition.Rui Ueyama2016-12-011-2/+5
| | | | llvm-svn: 288419
* AArch64: fix 128-bit cmpxchg at -O0 (again, again).Tim Northover2016-12-012-10/+22
| | | | | | | | | | | | | | | This time the issue is fortunately just a simple mistake rather than a horrible design spectre. I thought SUBS/SBCS provided sufficient NZCV flags for comparing two 64-bit values, but they don't. The fix is slightly clunkier in AArch64 because we can't use conditional execution to emit a pair of CMPs. Traditionally an "icmp ne i128" would map to an EOR/EOR/ORR/CBNZ, but that uses more registers so it's easier to go with a CSET/CINC/CBNZ combination. Slightly less efficient, but this is -O0 anyway. Thanks to Anton Korobeynikov for pointing out the issue. llvm-svn: 288418
* Improve documentation on MSVC workaround for AlignedCharArray (NFC)Mehdi Amini2016-12-011-1/+1
| | | | | | | | The comment only mentioned "old version of MSVC". Differential Revision: https://reviews.llvm.org/D27312 llvm-svn: 288417
* Fix unused variable warning in Release builds. NFC.Benjamin Kramer2016-12-011-1/+1
| | | | llvm-svn: 288416
* [PR29121] Don't fold if it would produce atomic vector loads or storesPhilip Reames2016-12-012-14/+48
| | | | | | | | The instcombine code which folds loads and stores into their use types can trip up if the use is a bitcast to a type which we can't directly load or store in the IR. In principle, such types shouldn't exist, but in practice they do today. This is a workaround to avoid a bug while we work towards the long term goal. Differential Revision: https://reviews.llvm.org/D24365 llvm-svn: 288415
* Add a space in a run line. NFC.George Burgess IV2016-12-011-1/+1
| | | | llvm-svn: 288414
* Factor out common parts of LVI and Float2Int into ConstantRange [NFCI]Philip Reames2016-12-014-80/+113
| | | | | | | | | | This just extracts out the transfer rules for constant ranges into a single shared point. As it happens, neither bit of code actually overlaps in terms of the handled operators, but with this change that could easily be tweaked in the future. I also want to have this separated out to make experimenting with a eager value info implementation and possibly a ValueTracking-like fixed depth recursion peephole version. There's no reason all four of these can't share a common implementation which reduces the chances of bugs. Differential Revision: https://reviews.llvm.org/D27294 llvm-svn: 288413
* [SLP] Fix for PR6246: vectorization for scalar ops on vector elements.Alexey Bataev2016-12-012-180/+134
| | | | | | | | | | | | | | | When trying to vectorize trees that start at insertelement instructions function tryToVectorizeList() uses vectorization factor calculated as MinVecRegSize/ScalarTypeSize. But sometimes it does not work as tree cost for this fixed vectorization factor is too high. Patch tries to improve the situation. It tries different vectorization factors from max(PowerOf2Floor(NumberOfVectorizedValues), MinVecRegSize/ScalarTypeSize) to MinVecRegSize/ScalarTypeSize and tries to choose the best one. Differential Revision: https://reviews.llvm.org/D27215 llvm-svn: 288412
* [WebAssembly] Define more wasm binary encoding constants.Dan Gohman2016-12-011-0/+29
| | | | llvm-svn: 288411
* Refactored X86InterleavedAccess into a class. NFCI.David L Kreitzer2016-12-011-67/+171
| | | | | | | | Patch by Farhana Aleen Differential Revision: https://reviews.llvm.org/D25986 llvm-svn: 288410
* Updates file comments and variable names.Rui Ueyama2016-12-012-76/+85
| | | | | | Use "color" instead of "group id" to describe the ICF algorithm. llvm-svn: 288409
* [tablegen] Delete duplicates from a vector without skipping elementsVedant Kumar2016-12-012-0/+85
| | | | | | | | | | | | | | Tablegen's -gen-instr-info pass has a bug in its emitEnums() routine. The function intends for values in a vector to be deduplicated, but it accidentally skips over elements after performing a deletion. I think there are smarter ways of doing this deduplication, but we can do that in a follow-up commit if there's interest. See the thread: [PATCH] TableGen InstrMapping Bug fix. Patch by Tyler Kenney! llvm-svn: 288408
* Remove unused header, NFC.Vedant Kumar2016-12-011-1/+0
| | | | llvm-svn: 288407
* Send compiler output to /dev/null in defsym.s test.Artem Belevich2016-12-011-2/+2
| | | | | | Fixes test failures if tests are run in a read-only source tree. llvm-svn: 288406
* Move most EH from MachineModuleInfo to MachineFunctionMatthias Braun2016-12-0122-433/+435
| | | | | | | | | | | | | | | | | | | | | | | Recommitting r288293 with some extra fixes for GlobalISel code. Most of the exception handling members in MachineModuleInfo is actually per function data (talks about the "current function") so it is better to keep it at the function instead of the module. This is a necessary step to have machine module passes work properly. Also: - Rename TidyLandingPads() to tidyLandingPads() - Use doxygen member groups instead of "//===- EH ---"... so it is clear where a group ends. - I had to add an ugly const_cast at two places in the AsmPrinter because the available MachineFunction pointers are const, but the code wants to call tidyLandingPads() in between (markFunctionEnd()/endFunction()). Differential Revision: https://reviews.llvm.org/D27227 llvm-svn: 288405
* [CodeGen][ARM] Make sure the value and type used to create a bitcastAkira Hatanaka2016-12-012-10/+44
| | | | | | | | | | | have the same size. This fixes an asset that is triggered when an address of a boolean variable is passed to __builtin_arm_ldrex or __builtin_arm_strex. rdar://problem/29269006 llvm-svn: 288404
* Handle empty strings when looking for a CFString's encoding.Sean Callanan2016-12-011-1/+1
| | | | | | Should fix the bots. llvm-svn: 288403
* Fix a bug with llvm-size and the -m option with multiple files not printing ↵Kevin Enderby2016-12-013-1/+7
| | | | | | the file names. llvm-svn: 288402
* Fix unused variable warning in Release builds. NFC.Benjamin Kramer2016-12-011-1/+1
| | | | llvm-svn: 288401
* Fix module map to create a module for the configured header ↵Mehdi Amini2016-12-011-0/+4
| | | | | | | | | | | | | | | | | | | | | Config/abi-breaking.h A client of a header that relies on ABI breaking should get the macro exported there. Before this, the unittest for Support/Error including Support/Error.h didn't get the macro exported by the Support module, because the latter only re-export its submodules and included module, not textual headers. Hopefully, it'll also fix the build with local submodule visibility, since the LLVM_Utils contains two submodules: ADT and Support. They both include abi-breaking.h that defines a symbol. The textual inclusion lead to a double definition of the symbol which broke the parent module. Differential Revision: https://reviews.llvm.org/D27273 llvm-svn: 288400
* This change removes the dependency on DwarfDebug that was used for ↵Greg Clayton2016-12-0112-157/+221
| | | | | | | | | | | | | DW_FORM_ref_addr by making a new DIEUnit class in DIE.cpp. The DIEUnit class represents a compile or type unit and it owns the unit DIE as an instance variable. This allows anyone with a DIE, to get the unit DIE, and then get back to its DIEUnit without adding any new ivars to the DIE class. Why was this needed? The DIE class has an Offset that is always the CU relative DIE offset, not the "offset in debug info section" as was commented in the header file (the comment has been corrected). This is great for performance because most DIE references are compile unit relative and this means most code that accessed the DIE's offset didn't need to make it into a compile unit relative offset because it already was. When we needed to emit a DW_FORM_ref_addr though, we needed to find the absolute offset of the DIE by finding the DIE's compile/type unit. This class did have the absolute debug info/type offset and could be added to the CU relative offset to compute the absolute offset. With this change we can easily get back to a DIE's DIEUnit which will have this needed offset. Prior to this is required having a DwarfDebug and required calling: DwarfCompileUnit *DwarfDebug::lookupUnit(const DIE *CU) const; Now we can use the DIEUnit class to do so without needing DwarfDebug. All clients now use DIEUnit objects (the DwarfDebug stack and the DwarfLinker). A follow on patch for the DWARF generator will also take advantage of this. Differential Revision: https://reviews.llvm.org/D27170 llvm-svn: 288399
* [SLP] Fixed cost model for horizontal reduction.Alexey Bataev2016-12-014-14/+70
| | | | | | | | | | | | | | Currently when cost of scalar operations is evaluated the vector type is used for scalar operations. Patch fixes this issue and fixes evaluation of the vector operations cost. Several test showed that vector cost model is too optimistic. It allowed vectorization of 8 or less add/fadd operations, though scalar code is faster. Actually, only for 16 or more operations vector code provides better performance. Differential Revision: https://reviews.llvm.org/D26277 llvm-svn: 288398
* [clang] Implement support for -defsym assembler optionMandeep Singh Grang2016-12-014-0/+39
| | | | | | | | | | | | | | | | | Summary: Adds support for -Wa,-defsym,abc=1 option. Related llvm patch: https://reviews.llvm.org/D26214 Reviewers: rafael, t.p.northover, colinl, echristo, compnerd, rengolin Subscribers: mehdi_amini Tags: #clang-c Differential Revision: https://reviews.llvm.org/D26213 llvm-svn: 288397
* [llvm] Implement support for -defsym assembler optionMandeep Singh Grang2016-12-013-16/+22
| | | | | | | | | | | | | | | Summary: Changes to llvm-mc to move common logic to separate function. Related clang patch: https://reviews.llvm.org/D26213 Reviewers: rafael, t.p.northover, colinl, echristo, rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26214 llvm-svn: 288396
* [X86][SSE] Moved shuffle mask widening/narrowing helper functions earlier in ↵Simon Pilgrim2016-12-011-78/+84
| | | | | | | | the file. Will be necessary for a future patch. llvm-svn: 288395
* swiftcc: Add an api to query whether a target ABI stores swifterror in a ↵Arnold Schwaighofer2016-12-014-0/+31
| | | | | | register llvm-svn: 288394
* Fix VS2015 build of clang-format-vsix by using NuGet to pull in required ↵Hans Wennborg2016-12-015-24/+138
| | | | | | | | | | assemblies Also added a gitignore to help track the right items to commit. Patch by Antonio Maiorano <amaiorano@gmail.com>! llvm-svn: 288393
* [libFuzzer] add a test for r288389 (-rss_limit_mb=0 means no limit).Kostya Serebryany2016-12-011-0/+3
| | | | llvm-svn: 288392
* [SystemZ] Fix fallout from r288374Ulrich Weigand2016-12-011-1/+2
| | | | | | Avoid undefined behavior due to too-large shift count. llvm-svn: 288391
* [AsmParser] Diagnose empty symbol for .set directiveWeiming Zhao2016-12-012-1/+5
| | | | | | | | | | | | Summary: Diagnose empty symbol to avoid hitting assertion in MCContext::getOrCreateSymbol Reviewers: eli.friedman, rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26728 llvm-svn: 288390
OpenPOWER on IntegriCloud