summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Triple: refactor redundant code.Tim Northover2015-02-121-19/+5
| | | | | | | | | | Should be no functional change, since most of the logic removed was completely pointless (after some previous refactoring) and the rest duplicated elsewhere. Patch by Kamil Rytarowski. llvm-svn: 228926
* Re-add makefiles of inline testsPavel Labath2015-02-123-0/+11
| | | | llvm-svn: 228925
* [X86] Call frame optimization - allow stack-relative movs to be folded into ↵Michael Kuperstein2015-02-122-17/+11
| | | | | | | | a push Since we track esp precisely, there's no reason not to allow this. llvm-svn: 228924
* [TTI] Teach the cost heuristic how to query TLI to check if a zext/trunc is ↵Andrea Di Biagio2015-02-123-2/+209
| | | | | | | | | | | | | | | | | | | | | | | | 'free' for the target. Now that SimplifyCFG uses TTI for the cost heuristic, we can teach BasicTTIImpl how to query TLI in order to get a more accurate cost for truncates and zero-extends. Before this patch, the basic cost heuristic in TargetTransformInfoImplCRTPBase would have conservatively returned a 'default' TCC_Basic for all zero-extends, and TCC_Free for truncates on native types. This patch improves the heuristic so that we query TLI (if available) to get more accurate answers. If TLI is available, then methods 'isZExtFree' and 'isTruncateFree' can be used to check if a zext/trunc is free for the target. Added more test cases to SimplifyCFG/X86/speculate-cttz-ctlz.ll. With this change, SimplifyCFG is now able to speculate a 'cheap' cttz/ctlz immediately followed by a free zext/trunc. Differential Revision: http://reviews.llvm.org/D7585 llvm-svn: 228923
* BitVector: Remove manual bit width dispatch, this is handled by templatesBenjamin Kramer2015-02-122-33/+15
| | | | | | NFC. llvm-svn: 228922
* MathExtras: Parametrize count(Trailing|Leading)Zeros on the type size.Benjamin Kramer2015-02-121-117/+105
| | | | | | | | Otherwise we will always select the generic version for e.g. unsigned long if uint64_t is typedef'd to 'unsigned long long'. Also remove enable_if hacks in favor of static_assert. llvm-svn: 228921
* ARM: Fix another regression introduced in r223113Asiri Rathnayake2015-02-122-5/+2
| | | | | | | | | | | | | | | | | | | | | The changes in r223113 (ARM modified-immediate syntax) have broken instructions like: mov r0, #~0xffffff00 The problem is that I've added a spurious range check on the immediate operand to ensure that it lies between INT32_MIN and UINT32_MAX. While this range check is correct in theory, it causes problems because the operand is stored in an int64_t (by MC). So valid 32-bit constants like \#~0xffffff00 become out of range. The solution is to simply remove this range check. It is not possible to validate the range of the immediate operand with the current setup because: 1) The operand is stored in an int64_t by MC, 2) The immediate can be of the forms #imm, #-imm, #~imm or even #((~imm)) etc. So we just chop the value to 32 bits and use it. Also noted that the original range check was note tested by any of the unit tests. I've added a new test to cover #~imm kind of operands. Change-Id: I411e90d84312a2eff01b732bb238af536c4a7599 llvm-svn: 228920
* Fix dependency generation crash test to run clang and clean up after itself.Greg Bedwell2015-02-121-1/+5
| | | | | | | | | | Previously the test did not have a RUN: prefix for the clang command. In addition it was leaving behind a tmp file with no permissions causing issues when deleting the build directory on Windows. Differential Revision: http://reviews.llvm.org/D7534 llvm-svn: 228919
* [mips] Partially revert r223927: Removing __SIZEOF_INT128__ macro for MIPS64Vasileios Kalintiris2015-02-122-8/+3
| | | | | | | | Partially revert r223927 because LLVM gained support for 128-bit integers in r227089. Modify and keep the tests that verify the definition of the macro __SIZEOF_INT128__ for MIPS64 BE & LE in the preprocessor. llvm-svn: 228918
* tsan: do not instrument not captured valuesDmitry Vyukov2015-02-122-0/+106
| | | | | | | | | | | | | | | | I've built some tests in WebRTC with and without this change. With this change number of __tsan_read/write calls is reduced by 20-40%, binary size decreases by 5-10% and execution time drops by ~5%. For example: $ ls -l old/modules_unittests new/modules_unittests -rwxr-x--- 1 dvyukov 41708976 Jan 20 18:35 old/modules_unittests -rwxr-x--- 1 dvyukov 38294008 Jan 20 18:29 new/modules_unittests $ objdump -d old/modules_unittests | egrep "callq.*__tsan_(read|write|unaligned)" | wc -l 239871 $ objdump -d new/modules_unittests | egrep "callq.*__tsan_(read|write|unaligned)" | wc -l 148365 http://reviews.llvm.org/D7069 llvm-svn: 228917
* AVX-512: Fixed the "test" operation for i1 typeElena Demikhovsky2015-02-125-41/+14
| | | | | | | | | | | | Using KORTESTW for comparison i1 value with zero was wrong since the instruction tests 16 bits. KORTESTW may be used with KSHIFTL+KSHIFTR that clean the 15 upper bits. I removed (X86cmp i1, 0) pattern and zero-extend i1 to i8 and then use TESTB. There are some cases where i1 is in the mask register and the upper bits are already zeroed. Then KORTESTW is the better solution, but it is subject for optimization. Meanwhile, I'm fixing the correctness issue. llvm-svn: 228916
* [X86] A heuristic to estimate the size impact for converting stack-relative ↵Michael Kuperstein2015-02-122-25/+159
| | | | | | | | | | | | | parameter movs to pushes This gives a rough estimate of whether using pushes instead of movs is profitable, in terms of size. We go over all calls in the MachineFunction and compute: a) For each callsite that can not use pushes, the penalty of not having a reserved call frame. b) For each callsite that can use pushes, the gain of actually replacing the movs with pushes (and the potential penalty of having to readjust the stack). Differential Revision: http://reviews.llvm.org/D7561 llvm-svn: 228915
* Link LLVM libraries into libLLVMPolly if BUILD_SHARED_LIBS=ON is setTobias Grosser2015-02-121-1/+12
| | | | | | | | | | | | | | | | Without this change we get linker errors such as: undefined reference to `llvm::dbgs()' We only conditionally link in these libraries, as in BUILD_SHARED_LIBS=OFF mode, linking in these libraries causes such functions (and especially global options) to be defined twice. The "solution" I choose is most likely not ideal, but seems to work. If any cmake specialist can suggest a better approach, this would be appreciated. We also drop a .c file that is not needed as it caused linker errors as well. llvm-svn: 228914
* [CodeGen] Don't blindly combine (fp_round (fp_round x)) to (fp_round x).Ahmed Bougacha2015-02-123-10/+51
| | | | | | | | | | | | We used to do this DAG combine, but it's not always correct: If the first fp_round isn't a value preserving truncation, it might introduce a tie in the second fp_round, that wouldn't occur in the single-step fp_round we want to fold to. In other words, double rounding isn't the same as rounding. Differential Revision: http://reviews.llvm.org/D7571 llvm-svn: 228911
* Search through all memory regions of the core file forJason Molenda2015-02-121-3/+7
| | | | | | | | | | | | | | both a user process dyld and for a kernel binary -- we will decide which to prefer after one or both have been located. It would be faster to stop the search thorugh the core segments one we've found a dyld/kernel binary - but that may trick us into missing the one we would prefer. <rdar://problem/19806413> llvm-svn: 228910
* Cast EOF to get a proper comparison.Justin Hibbits2015-02-121-1/+1
| | | | | | | | On PowerPC, and maybe some other architectures, 'char' is unsigned. Comparing an unsigned char with a signed int (-1) is always false. To fix this, down-cast EOF to a char. llvm-svn: 228909
* Quiet CoverityJustin Hibbits2015-02-121-1/+2
| | | | | | | | | | | | | | Summary: Coverity warns that unsigned >= 0 is always true, and k_first_gpr_powerpc happens to be 0. Quiet Coverity by changing that comparison instead to a static_assert(), in case things change in the future. Reviewers: emaste Reviewed By: emaste Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7576 llvm-svn: 228908
* [ELF][Cleanup] Remove unused functionShankar Easwaran2015-02-121-4/+0
| | | | | | We can add this function when we really have a need. llvm-svn: 228907
* [ELF] Support --wrap optionShankar Easwaran2015-02-126-3/+360
| | | | | | | | | | | | | | | | | | | | | | | | Use a wrapper function for symbol. Any undefined reference to symbol will be resolved to "__wrap_symbol". Any undefined reference to "__real_symbol" will be resolved to symbol. This can be used to provide a wrapper for a system function. The wrapper function should be called "__wrap_symbol". If it wishes to call the system function, it should call "__real_symbol". Here is a trivial example: void * __wrap_malloc (size_t c) { printf ("malloc called with %zu\n", c); return __real_malloc (c); } If you link other code with this file using --wrap malloc, then all calls to "malloc" will call the function "__wrap_malloc" instead. The call to "__real_malloc" in "__wrap_malloc" will call the real "malloc" function. llvm-svn: 228906
* [ELF] Add LinkingContext to the ELFReader.Shankar Easwaran2015-02-1230-180/+186
| | | | | | | | | | | | | | | This adds the LinkingContext parameter to the ELFReader. Previously the flags in that were needed in the Context was passed to the ELFReader, this made it very hard to access data structures in the LinkingContext when reading an ELF file. This change makes the ELFReader more flexible so that required parameters can be grabbed directly from the LinkingContext. Future patches make use of the changes. There is no change in functionality though. llvm-svn: 228905
* unwind: use explicit memcpy for register savingSaleem Abdulrasool2015-02-121-6/+19
| | | | | | | | | | Convert the register saving code to use an explicit memcpy rather than the implicit memcpy from the assignment. This avoids warnings from -Wcast-qual on GCC and makes the code more explicit. Furthermore, use sizeof to calculate the offsets rather than adding magic numbers, improving legibility of the code. NFC. llvm-svn: 228904
* unwind: move exported APIs out of headerSaleem Abdulrasool2015-02-122-66/+73
| | | | | | | | | | | | | | | Ideally, we would do something like inline __declspec(dllexport) to ensure that the symbol was inlined within libunwind as well as emitted into the final DSO. This simply moves the definition out of the header to ensure that the *public* interfaces are defined and exported into the final DSO. This change also has "gratuitous" code movement so that the EHABI and generic implementations are co-located making it easier to find them. The movement from the header has one minor change introduced into the code: additional tracing to mirror the behaviour of the non-EHABI interfaces. llvm-svn: 228903
* Fix tests so they work when the linker is gccFilipe Cabecinhas2015-02-123-8/+25
| | | | | | | | | | | If the linker is gcc (the default for Generic_ELF toolchains), we end up passing most of the arguments to the linker. Some tests were failing to account for this in their usage of *-NOT: lines and would fail if compiled with -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-unknown llvm-svn: 228902
* Fixed a bug where CFLAA would crash the compiler.George Burgess IV2015-02-122-6/+29
| | | | | | | | We would crash if we couldn't locate a Function that either Location's Value belonged to. Now we just print out a debug message and return conservatively. llvm-svn: 228901
* PECOFF: make dumpbin tool happy.Rui Ueyama2015-02-121-8/+17
| | | | | | | | | | | | | | | | | | | | | The dumpbin tool in the MSVC toolchain cannot handle an executable created by LLD if the executable contains a long section name. In PE/COFF, a section name is stored to a section table entry. Because the section name field in the table is only 8 byte long, a name longer than that is stored to the string table and the offset in the string table is stored to the section table entry instead. In order to look up a string from the string table, tools need to handle the symbol table, because the string table is defined as it immediately follows the symbol table. And seems the dumpbin doesn't like zero-length symbol table. This patch teaches LLD how to emit a dummy symbol table. The dummy table has one dummy entry in it. llvm-svn: 228900
* [slp] Fix a nasty bug in the SLP vectorizer that Joerg pointed out.Chandler Carruth2015-02-123-7/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently some code finally started to tickle this after my canonicalization changes to instcombine. The bug stems from trying to form a vector type out of scalars that aren't compatible at all. In this example, from x86_mmx values. The code in the vectorizer that checks for reasonable types whas checking for aggregates or vectors, but there are lots of other types that should just never reach the vectorizer. Debugging this was made more confusing by the lie in an assert in VectorType::get() -- it isn't that the types are *primitive*. The types must be integer, pointer, or floating point types. No other types are allowed. I've improved the assert and added a helper to the vectorizer to handle the element type validity checks. It now re-uses the VectorType static function and then further excludes weird target-specific types that we probably shouldn't be touching here (x86_fp80 and ppc_fp128). Neither of these are really reachable anyways (neither 80-bit nor 128-bit things will get vectorized) but it seems better to just eagerly exclude such nonesense. I've added a test case, but while it definitely covers two of the paths through this code there may be more paths that would benefit from test coverage. I'm not familiar enough with the SLP vectorizer to synthesize test cases for all of these, but was able to update the code itself by inspection. llvm-svn: 228899
* Add InlineAsmDiagnosticHandler for bitcode inputSteven Wu2015-02-122-0/+14
| | | | | | | | | | | | | | | | | | | | Summary: This patch installs an InlineAsmDiagnosticsHandler to avoid the crash report when the input is bitcode and the bitcode contains invalid inline assembly. The handler will simply print the same error message that will print from the backend. Add CHECK in test-case Reviewers: echristo, rafael Reviewed By: rafael Subscribers: rafael, cfe-commits Differential Revision: http://reviews.llvm.org/D7568 llvm-svn: 228898
* More for DR1467: In C++, when initializing an element of an aggregate,Richard Smith2015-02-123-41/+52
| | | | | | | | | always use the normal copy-initialization rules. Remove a special case that tries to stay within the list initialization checker here; that makes us do the wrong thing when list-initialization of an aggregate would not perform aggregate initialization. llvm-svn: 228897
* Improve the "braces around scalar init" warning to determine whether to warnRichard Smith2015-02-1210-22/+81
| | | | | | | | based on whether "redundant" braces are ever reasonable as part of the initialization of the entity, rather than whether the initialization is "top-level". In passing, add a warning flag for it. llvm-svn: 228896
* [PowerPC] Mark jumps as expensive (using using CR bits)Hal Finkel2015-02-122-1/+39
| | | | | | | | | | | | | | | On PowerPC, which has a full set of logical operations on (its multiple sets of) condition-register bits, it is not profitable to break of complex conditions feeding a jump into multiple jumps. We can turn off this feature of CGP/SDAGBuilder by marking jumps as "expensive". P7 test-suite speedups (no regressions): MultiSource/Benchmarks/FreeBench/pcompress2/pcompress2 -0.626647% +/- 0.323583% MultiSource/Benchmarks/Olden/power/power -18.2821% +/- 8.06481% llvm-svn: 228895
* [Sanitizer] Change InitializeFlags() signatures. NFC.Alexey Samsonov2015-02-126-23/+23
| | | | | | | These functions are always used to initialize singleton flags(), as well as other global data (common_flags()). llvm-svn: 228894
* [Sanitizer] Add "final" specifier to FlagHandlerBase::Parse overrides. NFC.Alexey Samsonov2015-02-123-3/+3
| | | | llvm-svn: 228893
* Make a more complete fix for always supplying an execution context when ↵Greg Clayton2015-02-1216-65/+103
| | | | | | | | | | getting byte sizes from types. There was a test in the test suite that was triggering the backtrace logging output that requested that the client pass an execution context. Sometimes we need the process for Objective C types because our static notion of the type might not align with the reality when being run in a live runtime. Switched from an "ExecutionContext *" to an "ExecutionContextScope *" for greater ease of use. llvm-svn: 228892
* Revert "Change Path::filename_pos() to skip the drive letter."Zachary Turner2015-02-121-5/+2
| | | | | | | | This reverts commit 228874. For some reason users reported seeing Clang taking up 25+GB of memory and bringing down machines with this change. Reverting until we figure it out. llvm-svn: 228890
* Invert the section relocation map.Rafael Espindola2015-02-111-31/+26
| | | | | | | It now points from rel section to section. Use it to set sh_info, avoiding a brittle name lookup. llvm-svn: 228889
* Use the existing SymbolTableIndex instead of doing a lookup. NFC.Rafael Espindola2015-02-111-7/+3
| | | | llvm-svn: 228888
* Remove unused parameter.Rui Ueyama2015-02-113-6/+4
| | | | llvm-svn: 228887
* Create the Seciton -> Rel Section map when it is first needed. NFC.Rafael Espindola2015-02-111-47/+45
| | | | | | Saves a walk over every section. llvm-svn: 228886
* DeadArgElim: aggregate Return assessment properly.Tim Northover2015-02-112-4/+37
| | | | | | | | | I mistakenly thought the liveness of each "RetVal(F, i)" depended only on F. It actually depends on the index too, which means we need to be careful about how the results are combined before return. In particular if a single Use returns Live, that counts for the entire object, at the granularity we're considering. llvm-svn: 228885
* Remove unused argument. NFC.Rafael Espindola2015-02-111-8/+4
| | | | llvm-svn: 228884
* Unbreak buildbotsDavid Majnemer2015-02-111-1/+2
| | | | | | The next offset should be updated as well. llvm-svn: 228883
* Don't recompute the entire section map just to add 3 entries. NFC.Rafael Espindola2015-02-111-6/+6
| | | | llvm-svn: 228881
* Wrap to 80 columns. No behavior change.Nico Weber2015-02-112-4/+7
| | | | llvm-svn: 228880
* MC, COFF: Align section contents to a four byte boundaryDavid Majnemer2015-02-112-2/+15
| | | | llvm-svn: 228879
* On second thought, a const ValueObject& has too many limitations on what it ↵Enrico Granata2015-02-111-1/+1
| | | | | | can do. Strip the constness away llvm-svn: 228878
* Except only EIO errors of OSError exception in Base.deletePexpectChild() in ↵Ilia K2015-02-111-1/+8
| | | | | | lldbtest.py after r227086 llvm-svn: 228877
* Add the 'noinline' attribute to call sites within __try bodiesReid Kleckner2015-02-116-6/+25
| | | | | | | LLVM doesn't support non-call exceptions, so inlining makes it harder to catch such asynchronous exceptions. llvm-svn: 228876
* Add clang-tidy check google-global-names-in-headers.Samuel Benzaquen2015-02-115-0/+137
| | | | | | | | | | | | | | Summary: google-global-names-in-headers flags global namespace pollution in header files. Right now it only triggers on using declarations and directives. Reviewers: alexfh Subscribers: curdeius Differential Revision: http://reviews.llvm.org/D7563 llvm-svn: 228875
* Change Path::filename_pos() to skip the drive letter.Zachary Turner2015-02-111-2/+5
| | | | | | | | | For Windows, filename_pos() tries to find the filename by searching for separators after the last :. Instead, it should really check for the only location that a : is valid, which is in the second character, and search for separators after that. llvm-svn: 228874
* Remove unused argument. NFC.Rafael Espindola2015-02-111-4/+2
| | | | llvm-svn: 228873
OpenPOWER on IntegriCloud