summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization"Matthias Braun2015-07-143-157/+80
| | | | | | | | Accidental commit, needs review first. This reverts commit r242107. llvm-svn: 242108
* LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalizationMatthias Braun2015-07-143-80/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Factor out code to query and modify the sign bit of a floatingpoint value as an integer. This also works if none of the targets integer types is big enough to hold all bits of the floatingpoint value. - Legalize FABS(x) as FCOPYSIGN(x, 0.0) if FCOPYSIGN is available, otherwise perform bit manipulation on the sign bit. The previous code used "x >u 0 ? x : -x" which is incorrect for x being -0.0! It also takes 34 instructions on ARM Cortex-M4. With this patch we only require 5: vldr d0, LCPI0_0 vmov r2, r3, d0 lsrs r2, r3, #31 bfi r1, r2, #31, #1 bx lr (This could be further improved if the compiler would recognize that r2, r3 is zero). - Only lower FCOPYSIGN(x, y) = sign(x) ? -FABS(x) : FABS(x) if FABS is available otherwise perform bit manipulation on the sign bit. - Perform the sign(x) test by masking out the sign bit and comparing with 0 rather than shifting the sign bit to the highest position and testing for "<s 0". For x86 copysignl (on 80bit values) this gets us: testl $32768, %eax rather than: shlq $48, %rax sets %al testb %al, %al llvm-svn: 242107
* X86: Check output of x86 copysignl testcase.Matthias Braun2015-07-141-1/+16
| | | | | | This makes the changes in an upcoming patch visible. llvm-svn: 242106
* [modules] When diagnosing errors in module map files found by 'extern ↵Richard Smith2015-07-144-5/+15
| | | | | | module' declarations, show how we got to that module map file. llvm-svn: 242105
* Add capability to get and set the personalitty function from the C APIAndrew Wilkins2015-07-142-0/+22
| | | | | | | | | | | | | | | Summary: The capability was lost with D10429 where the personality function was set at function level rather than landing pad level. Now there is no way to get/set the personality function from the C API. That is a problem. Note that the whole thing could be avoided by improving the C API testing, as started by D10725 Reviewers: chandlerc, bogner, majnemer, andrew.w.kaylor, rafael, rnk, axw Subscribers: rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D10946 llvm-svn: 242104
* [CMake] Forgot to quote the first part of STREQUAL.Chris Bieneman2015-07-141-1/+1
| | | | llvm-svn: 242103
* [CMake] We shouldn't be storing values in the cache unless they actually ↵Chris Bieneman2015-07-141-4/+9
| | | | | | | | | | | | need CMake cache behavior. add_llvm_external_project puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache even if it is just the in-tree default path. This causes all sorts of oddness, and makes it so that I can't change the behavior of this variable. This patch never puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache. It will only end up in the cache if it is specified on the command line, which is the correct behavior. There is also a temporary change to remove non-default values from the cache if they are already present. This should have the impact of cleaning out unncecissary values from the caches on the buildbots and people's local build directories. This part of the change is marked with a TODO and can be removed in a few days. llvm-svn: 242102
* Refactor Unix signals.Chaoren Lin2015-07-1447-302/+505
| | | | | | | | | | | | | | | | | | Summary: - Consolidate Unix signals selection in UnixSignals. - Make Unix signals available from platform. - Add jSignalsInfo packet to retrieve Unix signals from remote platform. - Get a copy of the platform signal for each remote process. - Update SB API for signals. - Update signal utility in test suite. Reviewers: ovyalov, clayborg Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11094 llvm-svn: 242101
* Add a herper function. NFC.Rafael Espindola2015-07-142-8/+8
| | | | llvm-svn: 242100
* Remove a completely redundant initialization of llvm::TimePassesIsEnabled,Adrian Prantl2015-07-141-2/+0
| | | | | | | | which is actually the variable backing up the llvm -time-passes command line argument. llvm::TimePassesIsEnabled is actually being initialized in CodeGenAction. llvm-svn: 242099
* Fix warnings.Michael J. Spencer2015-07-142-6/+2
| | | | llvm-svn: 242098
* Basic code generation for MSan use-after-dtor.Evgeniy Stepanov2015-07-142-0/+40
| | | | | | | | | Under the -fsanitize-memory-use-after-dtor (disabled by default) insert an MSan runtime library call at the end of every destructor. Patch by Naomi Musgrave. llvm-svn: 242097
* [LinkerScript] Don't create unnecessarily large segmentsRafael Auler2015-07-142-29/+57
| | | | | | | | | | | | | When using a linker script expression to change the address of a section, even if the new address is more than a page of distance from the old address, lld may put everything in the same segment, forcing it to be unnecessarily large. This patch changes the logic in Segment::assignVirtualAddress() and Segment::assignFileOffsets() to allow the segment to be sliced into two or more if it detects a linker script expression that changes a section address. Differential Revision: http://reviews.llvm.org/D10952 llvm-svn: 242096
* MIR Serialization: Serialize the variable sized stack objects.Alex Lorenz2015-07-146-7/+101
| | | | llvm-svn: 242095
* Extend -ftime-report to give more information about time spent reading ↵Richard Smith2015-07-144-6/+45
| | | | | | module files. llvm-svn: 242094
* Put explicit template instantiations in the correct namespace.Michael J. Spencer2015-07-145-0/+20
| | | | llvm-svn: 242093
* Remove commented out code.Michael J. Spencer2015-07-141-11/+0
| | | | llvm-svn: 242092
* Update enforceKnownAlignment after the isWeakForLinker semantic changeReid Kleckner2015-07-142-14/+23
| | | | | | | | | | | | | Previously we would refrain from attempting to increase the linkage of available_externally globals because they were considered weak for the linker. Now they are treated more like a declaration instead of a weak definition. This was causing SSE alignment faults in Chromuim, when some code assumed it could increase the alignment of a dllimported global that it didn't control. http://crbug.com/509256 llvm-svn: 242091
* [OpenMP] Add REQUIRES pragma to threadprivate regression tests.Samuel Antao2015-07-142-1/+2
| | | | llvm-svn: 242090
* [LinkerScript] Fix bug in Segment::assignVirtualAddress()Rafael Auler2015-07-131-1/+1
| | | | | | | | | | | | | | When calculating the start address and size of a segment, lld mistakenly attributed the start address of the last segment slice to the whole segment when it should consider the start address of the first slice. In this case, in a multi-slice segment, Segment::assignVirtualAddress() will return a wrong segment start address to TargetLayout::assignVirtualAddress(). The effect of this miscalculation is to allocate some program headers in unnecessarily far away addresses. This commit fixes this. Differential Revision: http://reviews.llvm.org/D10951 llvm-svn: 242089
* Initial ELF port.Michael J. Spencer2015-07-1324-0/+2457
| | | | | | | | This is a direct port of the new PE/COFF linker to ELF. It can take a single object file and generate a valid executable that executes at the first byte in the text section. llvm-svn: 242088
* [Intrin.h] Use __ATOMIC_SEQ_CST instead of '5'David Majnemer2015-07-131-31/+37
| | | | | | No functionality change is intended. llvm-svn: 242087
* [Intrin.h] Make the variable names more consistentDavid Majnemer2015-07-131-34/+32
| | | | | | No functionality change intended. llvm-svn: 242086
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-1317-28/+516
| | | | | | | | | | | | | | | | | | | | | | | | | | CUDA code. NOTE: reverts r242077 to reinstate r242058, r242065, 242067 and includes fix for OS X test failures. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242085
* MIR Serialization: Serialize the sub register indices.Alex Lorenz2015-07-137-3/+146
| | | | | | | | This commit serializes the sub register indices from the register machine operands. Reviewers: Duncan P. N. Exon Smith llvm-svn: 242084
* Add missing file.Rafael Espindola2015-07-131-0/+0
| | | | | | Sorry about that. llvm-svn: 242083
* Fix reading archive members with / in the name.Rafael Espindola2015-07-132-3/+9
| | | | | | This is important for thin archives. llvm-svn: 242082
* [PPC64LE] More improvements to VSX swap optimizationBill Schmidt2015-07-133-23/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows VSX swap optimization to succeed more frequently. Specifically, it is concerned with common code sequences that occur when copying a scalar floating-point value to a vector register. This patch currently handles cases where the floating-point value is already in a register, but does not yet handle loads (such as via an LXSDX scalar floating-point VSX load). That will be dealt with later. A typical case is when a scalar value comes in as a floating-point parameter. The value is copied into a virtual VSFRC register, and then a sequence of SUBREG_TO_REG and/or COPY operations will convert it to a full vector register of the class required by the context. If this vector register is then used as part of a lane-permuted computation, the original scalar value will be in the wrong lane. We can fix this by adding a swap operation following any widening SUBREG_TO_REG operation. Additional COPY operations may be needed around the swap operation in order to keep register assignment happy, but these are pro forma operations that will be removed by coalescing. If a scalar value is otherwise directly referenced in a computation (such as by one of the many XS* vector-scalar operations), we currently disable swap optimization. These operations are lane-sensitive by definition. A MentionsPartialVR flag is added for use in each swap table entry that mentions a scalar floating-point register without having special handling defined. A common idiom for PPC64LE is to convert a double-precision scalar to a vector by performing a splat operation. This ensures that the value can be referenced as V[0], as it would be for big endian, whereas just converting the scalar to a vector with a SUBREG_TO_REG operation leaves this value only in V[1]. A doubleword splat operation is one form of an XXPERMDI instruction, which takes one doubleword from a first operand and another doubleword from a second operand, with a two-bit selector operand indicating which doublewords are chosen. In the general case, an XXPERMDI can be permitted in a lane-swapped region provided that it is properly transformed to select the corresponding swapped values. This transformation is to reverse the order of the two input operands, and to reverse and complement the bits of the selector operand (derivation left as an exercise to the reader ;). A new test case that exercises the scalar-to-vector and generalized XXPERMDI transformations is added as CodeGen/PowerPC/swaps-le-5.ll. The patch also requires a change to CodeGen/PowerPC/swaps-le-3.ll to use CHECK-DAG instead of CHECK for two independent instructions that now appear in reverse order. There are two small unrelated changes that are added with this patch. First, the XXSLDWI instruction was incorrectly omitted from the list of lane-sensitive instructions; this is now fixed. Second, I observed that the same webs were being rejected over and over again for different reasons. Since it's sufficient to reject a web only once, I added a check for this to speed up the compilation time slightly. llvm-svn: 242081
* [OpenMP] Add TLS-based implementation for threadprivate directive.Samuel Antao2015-07-1315-46/+350
| | | | llvm-svn: 242080
* Fix Windows build break related to MainLoop.Adrian McCarthy2015-07-131-0/+1
| | | | llvm-svn: 242079
* COFF: Fix x86 delay-load helper function name.Rui Ueyama2015-07-134-8/+27
| | | | | | | | If /delayload option is given, we have to resolve __delayLoadHelper2 since the function is the dynamic loader to delay-load DLLs. The function name is mangled in x86 as ___delayLoadHelper2@8. llvm-svn: 242078
* This reverts commit r242058, r242065, r242067.Rafael Espindola2015-07-1317-512/+28
| | | | | | | | | | The tests were failing on OS X. Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code." Revert "Fixed regex to properly match '64' in the test case." Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least." llvm-svn: 242077
* Don't crash if we are unable to get the member type.Greg Clayton2015-07-131-1/+1
| | | | | | <rdar://problem/21624447> llvm-svn: 242076
* COFF: Inline Defined::getRVA because it's very hot.Rui Ueyama2015-07-132-24/+23
| | | | llvm-svn: 242075
* Use std::make_tuple to reduce code duplication.Rafael Espindola2015-07-131-27/+8
| | | | | | Thanks to David Blaikie for the suggestion. llvm-svn: 242074
* Remove unnecessary lines from the test in r242068.Pete Cooper2015-07-131-3/+0
| | | | | | | | This test case was breaking the hexagon elf bot. The failing lines were actually unnecessary as checking that the store still reads the correct value demonstrates that everything is working fine now. llvm-svn: 242073
* Reduce memory usage of ComputeEditDistance() by (almost) 50%Nico Weber2015-07-131-22/+23
| | | | | | | | | | | | ComputeEditDistance() currently keeps two rows of the edit distance matrix in memory. That's unnecessary, one row plus one additional element are sufficient. With this change, strings up to 64 chars can be processed without going to the heap, compared to 32 chars previously. (But the main motivation is that the code gets a bit simpler.) No intended behavior change. llvm-svn: 242069
* Loop idiom recognizer was replacing too many uses of popcount.Pete Cooper2015-07-132-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | When spotting that a loop can use ctpop, we were incorrectly replacing all uses of a value with a value derived from ctpop. The bug here was exposed because we were replacing a use prior to the ctpop with the ctpop value and so we have a use before def, i.e., we changed %tobool.5 = icmp ne i32 %num, 0 store i1 %tobool.5, i1* %ptr br i1 %tobool.5, label %for.body.lr.ph, label %for.end to store i1 %1, i1* %ptr %0 = call i32 @llvm.ctpop.i32(i32 %num) %1 = icmp ne i32 %0, 0 br i1 %1, label %for.body.lr.ph, label %for.end Even if we inserted the ctpop so that it dominates the store here, that would still be incorrect. The store doesn’t want the result of ctpop. The fix is very simple, and involves replacing only the branch condition with the ctpop instead of all uses. Reviewed by Hal Finkel. llvm-svn: 242068
* clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least.NAKAMURA Takumi2015-07-131-0/+1
| | | | llvm-svn: 242067
* COFF: Split createSymbolAndSymbolTable to small functions. NFC.Rui Ueyama2015-07-132-34/+36
| | | | llvm-svn: 242066
* Fixed regex to properly match '64' in the test case.Artem Belevich2015-07-131-2/+2
| | | | llvm-svn: 242065
* Move class into an anonymous namespace. NFC.Benjamin Kramer2015-07-131-0/+2
| | | | llvm-svn: 242064
* [WinEH] Emit the LSDA even if no lpads remain but outlining occurredReid Kleckner2015-07-132-6/+49
| | | | | | | | | | | | | | | The outlined funclets call intrinsics which reference labels from the LSDA. This situation can easily arise in small functions with a single cleanup at -O0, where Clang marks a definition as nounwind, and then WinEHPrepare "discovers" that the landingpad is dead by accident and deletes it. We now need to ask the LLVM IR Function for it's personality directly, rather than going through MachineModuleInfo. Fixes PR23892. llvm-svn: 242063
* [Hexagon] Move BitTracker into the llvm namespace and remove redundant ↵Benjamin Kramer2015-07-134-64/+52
| | | | | | | | qualifications No functional change intended. llvm-svn: 242062
* Add support deterministic output in llvm-ar and make it the default.Rafael Espindola2015-07-138-41/+76
| | | | llvm-svn: 242061
* Revert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the ↵Chris Bieneman2015-07-132-85/+90
| | | | | | | | auto-registration that was already partially working." Reverting r242059 because it broke some bots. I'm attempting to reproduce the failures now. llvm-svn: 242060
* [CMake] Cleanup tools/CMakeLists.txt to take advantage of the ↵Chris Bieneman2015-07-132-90/+85
| | | | | | | | | | | | | | | | | | | auto-registration that was already partially working. Summary: This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*. Original Summary: The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are: * factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools * removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off * Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code. * Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt Differential Revision: http://reviews.llvm.org/D10665 llvm-svn: 242059
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-1317-28/+511
| | | | | | | | | | | | | | | | | | | | | | | CUDA code. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242058
* [lldb-mi] Add const qualifier to vMITextLine in InterpretCommandThisDriver.Dawn Perchik2015-07-131-1/+1
| | | | llvm-svn: 242057
* Implement the first part of N4258: 'Cleaning up noexcept in the Library'. ↵Marshall Clow2015-07-1326-297/+1311
| | | | | | This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates. llvm-svn: 242056
OpenPOWER on IntegriCloud