summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* IR: Add COMDATs to the IRDavid Majnemer2014-06-2756-105/+1512
| | | | | | | | | | | | | | | | This new IR facility allows us to represent the object-file semantic of a COMDAT group. COMDATs allow us to tie together sections and make the inclusion of one dependent on another. This is required to implement features like MS ABI VFTables and optimizing away certain kinds of initialization in C++. This functionality is only representable in COFF and ELF, Mach-O has no similar mechanism. Differential Revision: http://reviews.llvm.org/D4178 llvm-svn: 211920
* cmake: Don't do anything for LLVM_ENABLE_ASSERTIONS=OFFReid Kleckner2014-06-271-6/+0
| | | | | | | | | | | | | | | | | By default, CMake will set NDEBUG in Rel* builds and leave it off in debug builds, so we shouldn't need to do anything ourselves. Before this change, it was possible to a Debug build without assertions (aka Debug-Asserts in the autoconf system) by configuring with -DLLVM_ENABLE_ASSERTIONS=OFF, but this configuration isn't very useful. You can still get the same effect by explicitly adding -DNDEBUG to CFLAGS. Differential Revision: http://reviews.llvm.org/D4257 Patch by Janusz Sobczak! llvm-svn: 211919
* lldb can interrupt waitpid, so EINTR shouldn't be an error. This fixes the caseJulien Lerouge2014-06-271-1/+5
| | | | | | | | | | where there is no timeout. In the case where there is a timeout though, the code is still wrong since it doesn't check that the alarm really went off. Without this patch, I cannot debug a program that forks itself using sys::ExecuteAndWait with lldb. llvm-svn: 211918
* R600: Move trivial getters into header, use initializer listMatt Arsenault2014-06-272-95/+82
| | | | llvm-svn: 211917
* Fix test so it doesn't try to write out temporary files into the test tree.David Blaikie2014-06-271-1/+1
| | | | llvm-svn: 211916
* Remove 'const' from MemoryBuffers used through the SourceManagerDavid Blaikie2014-06-2712-76/+63
| | | | | | | | | | | | | | This removes a const_cast added in r211884 that occurred due to an inconsistency in how MemoryBuffers are handled between some parts of clang and LLVM. MemoryBuffers are immutable and the general convention in the LLVM project is to omit const from immutable types as it's simply redundant/verbose (see llvm::Type, for example). While this change doesn't remove "const" from /every/ MemoryBuffer, it at least makes this chain of ownership/usage consistent. llvm-svn: 211915
* Avoid non-ascii character in the source code.Logan Chien2014-06-271-1/+1
| | | | llvm-svn: 211914
* MC: Fix associative sections on COFFDavid Majnemer2014-06-274-9/+28
| | | | | | | | | COFF sections in MC were represented by a tuple of section-name and COMDAT-name. This is not sufficient to represent a .text section associated with another .text section; we need a way to distinguish between the key section and the one marked associative. llvm-svn: 211913
* Silence the implicit signed/unsigned conversion warning.Logan Chien2014-06-272-27/+29
| | | | llvm-svn: 211912
* [FastISel][X86] Fix typos.Juergen Ributzka2014-06-271-13/+13
| | | | llvm-svn: 211911
* Add reparse test for libclangBen Langmuir2014-06-271-0/+89
| | | | | | Adapted from a reproducer by Dan Schmidt, thanks! llvm-svn: 211910
* clang-cl: Map /EHs- to -fno-exceptionsReid Kleckner2014-06-274-6/+80
| | | | | | | | | | | | | | | This isn't 100% compatible with MSVC, but it's close enough. MSVC's /EH flag doesn't really control exceptions so much as how to clean up after an exception is thrown. The upshot is that cl.exe /EHs- will compile try, throw, and catch statements with a warning, but clang-cl will reject such constructs with a hard error. We can't compile such EH constructs anyway, but this may matter to consumers of the AST. Reviewers: hans Differential Revision: http://reviews.llvm.org/D4317 llvm-svn: 211909
* CodeGen: Fix a typo in getThreadLocalWrapperLinkageDavid Majnemer2014-06-271-1/+1
| | | | | | The description had a misspelling. No functionality change. llvm-svn: 211908
* Fix ObjectFileELF to determine architectures independent of host.Todd Fiala2014-06-275-37/+344
| | | | | | | | | | | | | | | | | | Previously ObjectFileELF was simplifying and assuming the object file it was looking at was the same as the host architecture/triple. This would break attempts to run, say, lldb on MacOSX against lldb-gdbserver on Linux since the MacOSX lldb would say that the linux elf file was really an Apple MacOSX architecture. Chaos would ensue. This change allows the elf file to parse ELF notes for Linux, FreeBSD and NetBSD, and determine the OS appropriately from them. It also initializes the OS type from the ELF header OSABI if it is set (which it is for FreeBSD but not for Linux). Added a test with freebsd and linux images that verify that '(lldb) image list -t -A' prints out the expected architecture for each. llvm-svn: 211907
* R600: Don't crash on unhandled instruction in promote allocaMatt Arsenault2014-06-274-2/+89
| | | | llvm-svn: 211906
* Fix a bug in my previous patch by restoring the behavior that the fatalChandler Carruth2014-06-271-1/+14
| | | | | | | | | | | | | | error handler is only registered once. To avoid the use of std::call_once (the obvious way to do this) I've wrapped everything up into a managed static and done the work in a constructor. Silly, but it should be effective. Some out-of-tree libclang users reported this to me, and I've asked them to put together a test case which exhibits this behavior, but I wanted to fix things ASAP since the nature of the fix is straight forward. llvm-svn: 211905
* llvm-objdump: don't assert if ELF file has no sectionsEd Maste2014-06-271-1/+1
| | | | | | | | | FreeBSD core files, for example, have no sections (only program headers). llvm.org/pr20139 Differential Revision: http://reviews.llvm.org/D4323 llvm-svn: 211904
* Revert the debugserver part of r211868. While formally a fine change, ↵Jim Ingham2014-06-278-42/+27
| | | | | | | | | debugserver doesn't depend on llvm (it really doesn't even depend on anything in lldb) and this nicety isn't worth adding that dependence. llvm-svn: 211903
* Clean up unused variable warning in release build.Alexander Kornienko2014-06-271-0/+1
| | | | llvm-svn: 211902
* This fixes libclang to cope with the now compile-time multithreadedChandler Carruth2014-06-271-13/+5
| | | | | | | | | selection re-enabled in r211900 in LLVM. The approach (unlike r211121) doesn't rely on std::mutex or std::call_once to avoid breaknig cygwin bots. llvm-svn: 211901
* Re-apply r211287: Remove support for LLVM runtime multi-threading.Chandler Carruth2014-06-277-99/+17
| | | | | | | I'll fix the problems in libclang and other projects in ways that don't require <mutex> until we sort out the cygwin situation. llvm-svn: 211900
* [cmake] When Python is disabled for LLDB, don't try to install theChandler Carruth2014-06-271-1/+1
| | | | | | | | | | python bindings. For example, this prevents errors on systems that disable python because the system python isn't available. Without this, we still try to install things and get install errors when that doesn't work. llvm-svn: 211899
* [ARM] Fix AAPCS non-compliance caused by very large structsOliver Stannard2014-06-272-3/+12
| | | | | | | | | | | | | | This is a fix to the code in clang which inserts padding arguments to ensure that the ARM backend can emit AAPCS-VFP compliant code. This code needs to track the number of registers which have been allocated in order to do this. When passing a very large struct (>64 bytes) by value, clang emits IR which takes a pointer to the struct, but the backend converts this back to passing the struct in registers and on the stack. The bug was that this was being considered by clang to only use one register, meaning that there were situations in which padding arguments were incorrectly emitted by clang. llvm-svn: 211898
* [PowerPC] Constrain base register in PPCRegisterInfo::resolveFrameIndexUlrich Weigand2014-06-272-0/+370
| | | | | | | | | | | | | | | | | | | | | | I've run into a bug where current LLVM at -O0 (with fast-isel) generated invalid code like: ld 0, 20936(1) # 8-byte Folded Reload stw 12, 10348(0) stw 12, 10344(0) The underlying vreg had been introduced as base register by the Local Stack Slot Allocation pass. That register was constrained to G8RC by PPCRegisterInfo::materializeFrameBaseRegister to match the ADDI instruction used to set it, but it was *not* constrained to G8RC_NOX0 to fit the *use* of the register in an address. That should have happened in PPCRegisterInfo::resolveFrameIndex. This patch adds an appropriate constrainRegClass call. Reviewed by Hal Finkel. llvm-svn: 211897
* [msan] Add store_context_size= flag.Evgeniy Stepanov2014-06-274-7/+12
| | | | | | | A new flag to control stack trace size for store event (in track-origins=2 mode) independently of malloc_context_size. llvm-svn: 211896
* Replace GetProgramPath("ld") with GetLinkerPath().Logan Chien2014-06-271-1/+1
| | | | llvm-svn: 211895
* [x86] Clean up some unused variables, especially in release builds.Chandler Carruth2014-06-271-9/+6
| | | | llvm-svn: 211894
* [ARM-BE] Generate correct NEON intrinsics for big endian systems.James Molloy2014-06-273-64/+192
| | | | | | | | | | | | | The NEON intrinsics in arm_neon.h are designed to work on vectors "as-if" loaded by (V)LDR. We load vectors "as-if" (V)LD1, so the intrinsics are currently incorrect. This patch adds big-endian versions of the intrinsics that does the "obvious but dumb" thing of reversing all vector inputs and all vector outputs. This will produce extra REVs, but we trust the optimizer to remove them. llvm-svn: 211893
* [x86] Teach the target combine step to aggressively fold pshufd insturcions.Chandler Carruth2014-06-273-13/+138
| | | | | | | | | | | | | Summary: This allows it to fold pshufd instructions across intervening half-shuffles and other noise. This pattern actually shows up in the generic lowering tests, but I've also added direct tests using intrinsics to make sure that the specific desired functionality is working even if the lowering stuff changes in the future. Differential Revision: http://reviews.llvm.org/D4292 llvm-svn: 211892
* [ELF][Mips] Fix recognition of MIPS 64-bit arch in the ↵Simon Atanasyan2014-06-273-5/+37
| | | | | | ELFObjectFile:getArch() method. llvm-svn: 211891
* [x86] Teach the target-specific combining how to aggressively foldChandler Carruth2014-06-272-0/+139
| | | | | | | | | | | | | | | | | | half-shuffles, even looking through intervening instructions in a chain. Summary: This doesn't happen to show up with any test cases I've found for the current shuffle lowering, but previous attempts would benefit from this and it seems generally useful. I've tested it directly using intrinsics, which also shows that it will work with hand vectorized code as well. Note that even though pshufd isn't directly used in these tests, it gets exercised because we combine some of the half shuffles into a pshufd first, and then merge them. Differential Revision: http://reviews.llvm.org/D4291 llvm-svn: 211890
* [x86] Teach the X86 backend to DAG-combine SSE2 shuffles that areChandler Carruth2014-06-273-43/+108
| | | | | | | | | | | | | | | | | trivially redundant. This fixes several cases in the new vector shuffle lowering algorithm which would generate redundant shuffle instructions for the sake of simplicity. I'm also deleting a testcase which was somewhat ridiculous. It was checking for a bug in 2007 about incorrectly transforming shuffles by looking for the string "-86" in the output of a pretty substantial function. This test case doesn't seem to have any value at this point. Differential Revision: http://reviews.llvm.org/D4240 llvm-svn: 211889
* [x86] Begin a significant overhaul of how vector lowering is done in theChandler Carruth2014-06-275-0/+2006
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | x86 backend. This sketches out a new code path for vector lowering, hidden behind an off-by-default flag while it is under development. The fundamental idea behind the new code path is to aggressively break down the problem space in ways that ease selecting the odd set of instructions available on x86, and carefully avoid scalarizing code even when forced to use older ISAs. Notably, this starts off restricting itself to SSE2 and implements the complete vector shuffle and blend space for 128-bit vectors in SSE2 without scalarizing. The plan is to layer on top of this ISA extensions where we can bail out of the complex SSE2 lowering and opt for a cheaper, specialized instruction (or set of instructions). It also needs to be generalized to AVX and AVX512 vector widths. Currently, this does a decent but not perfect job for SSE2. There are some specific shortcomings that I plan to address: - We need a peephole combine to fold together shuffles where possible. There are cases where a previous shuffle could be modified slightly to arrange for elements to be in the correct position and a later shuffle eliminated. Doing this eagerly added quite a bit of complexity, and so my plan is to combine away these redundancies afterward. - There are a lot more clever ways to use unpck and pack that need to be added. This is essential for real world shuffles as it turns out... Once SSE2 is polished a bit I should be able to get interesting numbers on performance improvements on benchmarks conducive to vectorization. All of this will be off by default until it is functionally equivalent of course. Differential Revision: http://reviews.llvm.org/D4225 llvm-svn: 211888
* Don't check clang binary name, as it can be different in some test setups.Alexander Kornienko2014-06-273-44/+44
| | | | | | | | | | | | | | Summary: This unbreaks our internal build after these tests were turned on in r211738. Reviewers: chandlerc Reviewed By: chandlerc Subscribers: benlangmuir, cfe-commits Differential Revision: http://reviews.llvm.org/D4311 llvm-svn: 211887
* [OPENMP] Parsing and sema analysis for 'copyprivate' clause.Alexey Bataev2014-06-2718-51/+525
| | | | llvm-svn: 211886
* [RuntimeDyld, PowerPC] Fix/improve handling of TOC relocationsUlrich Weigand2014-06-272-56/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current PPC64 RuntimeDyld code to handle TOC relocations has two problems: - With recent linkers, in addition to the relocations that implicitly refer to the TOC base (R_PPC64_TOC*), you can now also use the .TOC. magic symbol with any other relocation to refer to the TOC base explicitly. This isn't currently used much in ELFv1 code (although it could be), but it is essential in ELFv2 code. - In a complex JIT environment with multiple modules, each module may have its own .toc section, and TOC relocations in one module must refer to *its own* TOC section. The current findPPC64TOC implementation does not correctly implement this; in fact, it will always return the address of the first TOC section it finds anywhere. (Note that at the time findPPC64TOC is called, we don't even *know* which module the relocation originally resided in, so it is not even possible to fix this routine as-is.) This commit fixes both problems by handling TOC relocations earlier, in processRelocationRef. To do this, I've removed the findPPC64TOC routine and replaced it by a new routine findPPC64TOCSection, which works analogously to findOPDEntrySection in scanning the sections of the ObjImage provided by its caller, processRelocationRef. This solves the issue of finding the correct TOC section associated with the current module. This makes it straightforward to implement both R_PPC64_TOC relocations, and relocations explicitly refering to the .TOC. symbol, directly in processRelocationRef. There is now a new problem in implementing the R_PPC64_TOC16* relocations, because those can now in theory involve *three* different sections: the relocation may be applied in section A, refer explicitly to a symbol in section B, and refer implicitly to the TOC section C. The final processing of the relocation thus may only happen after all three of these sections have been assigned final addresses. There is currently no obvious means to implement this in its general form with the common-code RuntimeDyld infrastructure. Fortunately, ppc64 code usually makes no use of this most general form; in fact, TOC16 relocations are only ever generated by LLVM for symbols residing themselves in the TOC, which means "section B" == "section C" in the above terminology. This special case can easily be handled with the current infrastructure, and that is what this patch does. [ Unhandled cases result in an explicit error, unlike the current code which silently returns the wrong TOC base address ... ] This patch makes the JIT work on both BE and LE (ELFv2 requires additional patches, of course), and allowed me to successfully run complex JIT scenarios (via mesa/llvmpipe). Reviewed by Hal Finkel. llvm-svn: 211885
* const_cast the memory MemoryBuffer following LLVM r211883Alp Toker2014-06-271-1/+2
| | | | llvm-svn: 211884
* IRReader: don't mark MemoryBuffers constAlp Toker2014-06-274-7/+5
| | | | llvm-svn: 211883
* [tsan] Disable a failing test.Evgeniy Stepanov2014-06-271-1/+2
| | | | | | java_finalizer is failing on all sanitizer bots since it was added in r211829. llvm-svn: 211882
* Added instruction combine to transform few more negative values addition to ↵Dinesh Dwivedi2014-06-272-84/+127
| | | | | | | | | | | | subtraction (Part 3) This patch enables transforms for (x + (~(y | c) + 1) --> x - (y | c) if c is odd Differential Revision: http://reviews.llvm.org/D4210 llvm-svn: 211881
* Remove the caching of the target machine from SystemZTargetLowering.Eric Christopher2014-06-272-21/+33
| | | | | | Update all callers and uses accordingly. llvm-svn: 211880
* GlobalOpt: Fix constantfold-initializers.ll testDavid Majnemer2014-06-271-1/+1
| | | | | | | | | The test added in r211762 was sloppy, the correct initializer wasn't added to @llvm.global_ctors Spotted by Pasi Parviainen! llvm-svn: 211879
* [msan] Fix truncated stack trace in chained origin reports.Evgeniy Stepanov2014-06-272-1/+34
| | | | | | | This is a leftover from the times when the next (chained) origin id was stored as the last frame of a stack trace. llvm-svn: 211878
* Remove target machine caching from SystemZInstrInfo andEric Christopher2014-06-275-20/+18
| | | | | | | | SystemZRegisterInfo and replace it with the subtarget as that's all they needed in the first place. Update all uses and calls accordingly. llvm-svn: 211877
* Driver: Pass -ivfsoverlay to module crashdumpsJustin Bogner2014-06-272-1/+10
| | | | | | | | When we create a crashdump involving modules, we build a VFS to reproduce the problem with. This updates the reproduction script to use that VFS. llvm-svn: 211876
* Don't expand to invalid Scops with -polly-detect-keep-goingAndreas Simbuerger2014-06-273-6/+58
| | | | | | | | | | | | | | | | Enabling -keep-going in ScopDetection causes expansion to an invalid Scop candidate. Region A <- Valid candidate | Region B <- Invalid candidate If -keep-going is enabled, ScopDetection would expand A to A+B because the RejectLog is never checked for errors during expansion. With this patch only A becomes a valid Scop. llvm-svn: 211875
* Add a FIXME for an unfortunate issue in ConvertBackendLocation()Alp Toker2014-06-271-1/+3
| | | | | | | This function is copying the entire file contents into memory repeatedly and allocating new file IDs *each time* a source location is processed. llvm-svn: 211874
* Revert "Revert "Revert "PR20038: DebugInfo: Inlined call sites where the ↵David Blaikie2014-06-274-102/+50
| | | | | | | | | | | caller has debug info but the call itself has no debug location.""" Reverting this again, didn't mean to commit it - while r211872 fixes one of the issues here, there are still others to figure out and address. This reverts commit r211871. llvm-svn: 211873
* ArgumentPromotion: Propagate debug locations on calls for which arguments ↵David Blaikie2014-06-272-0/+18
| | | | | | are promoted. llvm-svn: 211872
* Revert "Revert "PR20038: DebugInfo: Inlined call sites where the caller has ↵David Blaikie2014-06-274-50/+102
| | | | | | | | debug info but the call itself has no debug location."" This reverts commit r211724. llvm-svn: 211871
OpenPOWER on IntegriCloud