summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix ASan test cases after r263177Alexey Samsonov2016-03-113-7/+7
| | | | llvm-svn: 263195
* Removing the friend declaration was not a good idea.John McCall2016-03-111-0/+1
| | | | llvm-svn: 263194
* Speculatively attempt to fix the MSVC build by making someJohn McCall2016-03-111-8/+9
| | | | | | methods non-private. llvm-svn: 263193
* Add a coerce-and-expand ABIArgInfo as a generalization of someJohn McCall2016-03-114-19/+243
| | | | | | | | of the things we do with Expand / Direct. NFC for now, but this will be used by swiftcall expansion. llvm-svn: 263192
* Preserve ExtParameterInfos into CGFunctionInfo.John McCall2016-03-1118-196/+337
| | | | | | | | | As part of this, make the function-arrangement interfaces a little simpler and more semantic. NFC. llvm-svn: 263191
* ELF: Add --thread option and partially parallelize writeTo().Rui Ueyama2016-03-114-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds --thread option and use parallel_for_each to write sections in regular OutputSections. This is the first patch to use more than one threads. Note that --thread is off by default because it is experimental. At this moment I still want to focus on single thread performance because multi-threading is not a magic wand to fix performance problems after all. It is generally very hard to make a slow program faster by threads. Therefore, I want to make the linker as efficient as possible first and then look for opportunity to make it even faster using more than one core. Here are some numbers to link programs with and without --threads and using GNU gold. Numbers are in seconds. Clang w/o --threads 0.697 w --threads 0.528 gold 1.643 Scylla w/o --threads 5.032 w --threads 4.935 gold 6.791 GNU gold w/o --threads 0.550 w --threads 0.551 gold 0.737 I limited the number of cores these processes can use to 4 using perf command, so although my machine has 20 physical cores, the performance gain I observed should be reproducible with a machine which is not as beefy as mine. llvm-svn: 263190
* Remove llvm::getDISubprogram in favor of Function::getSubprogramPete Cooper2016-03-118-36/+9
| | | | | | | | | | | | | | | | | llvm::getDISubprogram walks the instructions in a function, looking for one in the scope of the current function, so that it can find the !dbg entry for the subprogram itself. Now that !dbg is attached to functions, this should not be necessary. This patch changes all uses to just query the subprogram directly on the function. Ideally this should be NFC, but in reality its possible that a function: has no !dbg (in which case there's likely a bug somewhere in an opt pass), or that none of the instructions had a scope referencing the function, so we used to not find the !dbg on the function but now we will Reviewed by Duncan Exon Smith. Differential Revision: http://reviews.llvm.org/D18074 llvm-svn: 263184
* Fix SBDebugger.GetOutputFileHandle() on OS X.Jim Ingham2016-03-114-3/+10
| | | | | | | | | | | | | | | | | | | | | | | The swig typemaps had some magic for output File *'s on OS X that made: SBDebugger.GetOutputFileHandle() actually work. That was protected by a "#ifdef __MACOSX__", but the corresponding define got lost going from the Darwin shell scripts to the python scripts for running swig, so the code was elided. I need to pass the define to SWIG, but only when targetting Darwin. So I added a target-platform argument to prepare_bindings, and if that is Darwin, I pass -D__APPLE__ to swig, and that activates this code again, and GetOutputFileHandle works again. Note, I only pass that argument for the Xcode build. I'm sure it is possible to do that for cmake, but my cmake-foo is weak. I should have been able to write a test for this by creating a debugger, setting the output file handle to something file, writing to it, getting the output file handle and reading it. But SetOutputFileHandle doesn't seem to work from Python, so I'd have to write a pexpect test to test this, which I'd rather not do. llvm-svn: 263183
* [lto] Add a useful test case.Sean Silva2016-03-111-0/+3
| | | | | | | | | | | This is reduced from an issue found in practice. The original version of D18012 needed another patch to handle this, but it now works since we are using a more correct GV->hasAppendingLinkage() check that Rafael suggested. This is what remains of that other patch. llvm-svn: 263181
* [gold] Fix common symbols handling.Evgeniy Stepanov2016-03-113-20/+63
| | | | | | | | | | | | LLVM Gold plugin decides which instance of a common symbol it wants based on the symbol size in claim_file_hook. If the file that contains the chosen instance is later dropped from the link, we end up with an undefined reference. This change delays this decision until the set of the included files is known. llvm-svn: 263180
* [lto] Make sure that ctors are added to the combined module.Sean Silva2016-03-114-1/+31
| | | | | | | | | | | | | | Summary: More generally, appending linkage is a special case that we don't want to create a SymbolBody for. Reviewers: rafael, ruiu Subscribers: Bigcheese, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D18012 llvm-svn: 263179
* Tighten up this test a bit.Sean Silva2016-03-111-0/+1
| | | | | | Thanks to Rafael to spotting this in the post-commit review of r263070. llvm-svn: 263178
* [sanitizer] Add strlen to the common interceptorsAlexey Samsonov2016-03-117-37/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds strlen to the common interceptors, under a new common flag intercept_strlen. This provides better sharing of interception code among sanitizers and cleans up the inconsistent type declarations of the previously duplicated interceptors. Removes the now-duplicate strlen interceptor from asan, msan, and tsan. The entry check semantics are normalized now for msan and asan, whose private strlen interceptors contained multiple layers of checks that included impossible-to-reach code. The new semantics are identical to the old: bypass interception if in the middle of init or if both on Mac and not initialized; else, call the init routine and proceed. Patch by Derek Bruening! Reviewers: samsonov, vitalybuka Subscribers: llvm-commits, kcc, zhaoqin Differential Revision: http://reviews.llvm.org/D18020 llvm-svn: 263177
* [UBSan] Improve bufferization of UBSan error reports.Alexey Samsonov2016-03-111-93/+90
| | | | | | | | | | | | | | | Summary: Use InternalScopedString more extensively. This reduces the number of write() syscalls, and reduces the chance that UBSan output will be mixed with program output. Reviewers: vitalybuka Subscribers: kcc, llvm-commits Differential Revision: http://reviews.llvm.org/D18068 llvm-svn: 263176
* Add doxygen comments to avxintrin.h's intrinsics.Ekaterina Romanova2016-03-111-0/+902
| | | | | | | | | | Only around 25% of the intrinsics in this file are documented here. The patches for the other half will be sent out later. The doxygen comments are automatically generated based on Sony's intrinsics document. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. llvm-svn: 263175
* Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; ↵Eugene Zelenko2016-03-106-273/+184
| | | | | | other minor fixes. llvm-svn: 263174
* [LLE] Add missed LoopSimplify dependenceAdam Nemet2016-03-102-0/+36
| | | | | | | | | The code assumed that we always had a preheader without making the pass dependent on LoopSimplify. Thanks to Mattias Eriksson V for reporting this. llvm-svn: 263173
* Print strict in Availability attribute when it is on.Manman Ren2016-03-102-0/+4
| | | | llvm-svn: 263172
* Add has_feature objc_class_property.Manman Ren2016-03-102-0/+5
| | | | | | rdar://23891898 llvm-svn: 263171
* libclang python bindings: Fix for bug 26394Jonathan Coe2016-03-101-1/+1
| | | | | | | | | | | Summary: https://llvm.org/bugs/show_bug.cgi?id=26394 reports that clang's python bindings tests are failing. I can confirm that the bug exists and that the proposed fix is good. Differential Revision: http://reviews.llvm.org/D17226 llvm-svn: 263170
* AArch64: only try to use scaled fcvt ops on legal vector types.Tim Northover2016-03-102-1/+10
| | | | | | | Before we ended up calling getSimpleVectorType on a <3 x float>, which asserted. llvm-svn: 263169
* Reenable asm-errors.cNico Weber2016-03-101-3/+2
| | | | | | | r134811 made the test pass and reenabled it, but r134831 accidentally disabled it again due to a bad merge. llvm-svn: 263168
* [x86] don't use a shuffle when a vselect will do; NFCISanjay Patel2016-03-101-16/+5
| | | | | | | | Looking at the IR definition of a masked load made me realize there was no reason to use a shuffle here, so we don't need to convert the format of the mask at all. llvm-svn: 263167
* Fixed ValueObject::GetExpressionPath() for paths including anonymous ↵Marianne Mailhot-Sarrasin2016-03-102-1/+12
| | | | | | | | | | struct/union When the parent of an expression is anonymous, skip adding '.' or '->' before the expression name. Differential Revision: http://reviews.llvm.org/D18005 llvm-svn: 263166
* Test commit accessMarianne Mailhot-Sarrasin2016-03-101-1/+1
| | | | llvm-svn: 263165
* Strip trailing whitespace.Simon Pilgrim2016-03-101-66/+66
| | | | llvm-svn: 263162
* Fixed the python interpreter so that it correctly inherits the top ↵Greg Clayton2016-03-104-96/+41
| | | | | | | | | | IOHandler's files instead of always using stdin/out/err. Removed lldb_private::File::Duplicate() and the copy constructor and the assignment operator that used to duplicate the file handles and made them private so no one uses them. Previously the lldb_private::File::Duplicate() function duplicated files that used file descriptors, (int) but not file streams (FILE *), so the lldb_private::File::Duplicate() function only worked some of the time. No one else excep thee ScriptInterpreterPython was using these functions, so that aren't needed nor desired. Previously every time you would drop into the python interpreter we would duplicate files, and now we avoid this file churn. <rdar://problem/24877720> llvm-svn: 263161
* [Windows] Fix UnmapOrDie and MmapAlignedOrDieReid Kleckner2016-03-104-24/+95
| | | | | | | | | | | | | | | | | | | | | | | | | Now ASan can return virtual memory to the underlying OS. Portable sanitizer runtime code needs to be aware that UnmapOrDie cannot unmap part of previous mapping. In particular, this required changing how we implement MmapAlignedOrDie on Windows, which is what Allocator32 uses. The new code first attempts to allocate memory of the given size, and if it is appropriately aligned, returns early. If not, it frees the memory and attempts to reserve size + alignment bytes. In this region there must be an aligned address. We then free the oversized mapping and request a new mapping at the aligned address immediately after. However, a thread could allocate that virtual address in between our free and allocation, so we have to retry if that allocation fails. The existing thread creation stress test managed to trigger this condition, so the code isn't totally untested. Reviewers: samsonov Differential Revision: http://reviews.llvm.org/D17431 llvm-svn: 263160
* [X86][SSE] Reapplied: Improve vector ZERO_EXTEND by combining to ↵Simon Pilgrim2016-03-106-44/+98
| | | | | | | | | | | | ZERO_EXTEND_VECTOR_INREG Generalise the existing SIGN_EXTEND to SIGN_EXTEND_VECTOR_INREG combine to support zero extension as well and get rid of a lot of unnecessary ANY_EXTEND + mask patterns. Reapplied with a fix for PR26870 (avoid premature use of TargetConstant in ZERO_EXTEND_VECTOR_INREG expansion). Differential Revision: http://reviews.llvm.org/D17691 llvm-svn: 263159
* Support arbitrary addrspace pointers in masked load/store intrinsicsArtur Pilipenko2016-03-1012-207/+338
| | | | | | | | | | | | This patch fixes the problem which occurs when loop-vectorize tries to use @llvm.masked.load/store intrinsic for a non-default addrspace pointer. It fails with "Calling a function with a bad signature!" assertion in CallInst constructor because it tries to pass a non-default addrspace pointer to the pointer argument which has default addrspace. The fix is to add pointer type as another overloaded type to @llvm.masked.load/store intrinsics. Reviewed By: reames Differential Revision: http://reviews.llvm.org/D17270 llvm-svn: 263158
* Retrieve command line arguments and environment correctly on FreeBSDDimitry Andric2016-03-101-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Recently I saw the test `TestCases/Posix/print_cmdline.cc` failing on FreeBSD, with "expected string not found in input". This is because asan could not retrieve the command line arguments properly. In `lib/sanitizer_common/sanitizer_linux.cc`, this is taken care of by the `GetArgsAndEnv()` function, but it uses `__libc_stack_end` to get at the required data. This variable does not exist on BSDs; the regular way to retrieve the arguments and environment information is via the `kern.ps_strings` sysctl. I added this functionality in sanitizer_linux.cc, as a separate #ifdef block in `GetArgsAndEnv()`. Also, `ReadNullSepFileToArray()` becomes unused due to this change. (It won't work on FreeBSD anyway, since `/proc` is not mounted by default.) Reviewers: kcc, emaste, joerg, davide Subscribers: llvm-commits, emaste Differential Revision: http://reviews.llvm.org/D17832 llvm-svn: 263157
* ARM: Support relative references using the PREL31 symbol variant.Peter Collingbourne2016-03-102-4/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D17937 llvm-svn: 263156
* Add test for r263138.Richard Smith2016-03-101-0/+13
| | | | llvm-svn: 263155
* Fix testicase to turn buildbot green. NFC.Balaram Makam2016-03-102-3/+3
| | | | llvm-svn: 263154
* Move getLocalRelTarget to the file where it is used.Rafael Espindola2016-03-103-73/+42
| | | | llvm-svn: 263152
* Rename MaxAlignment -> Alignment.Rui Ueyama2016-03-103-10/+7
| | | | | | | | We can argue about a maximum alignment of a group of symbols, but for each symbol, there is only one alignment. So it is a bit weird that each symbol has a "maximum alignment". llvm-svn: 263151
* [ELF] - Fixed handling R_X86_64_DTPOFF64 relocation relaxationGeorge Rimar2016-03-102-0/+17
| | | | | | | | | | | | | | | | | | | R_X86_64_DTPOFF64 was not handled properly. Next sample app was impossible to link before this patch: ~/pg/release/bin/clang -target x86_64-pc-linux testthread.cpp -c -g ~/pg/d+a/bin/ld.lld testthread.o "Unknown TLS optimization" (value was 17) __thread int x = 0; void _start() { } It works fine now. Differential revision: http://reviews.llvm.org/D18039 llvm-svn: 263150
* Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker.Manman Ren2016-03-107-36/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the following test case: typedef struct { const char *name; id field; } Test9; extern void doSomething(Test9 arg); void test9() { Test9 foo2 = {0, 0}; doSomething(foo2); } With a release compiler, we don't emit any message and silently ignore the variable "foo2". With an assert compiler, we get an assertion failure. The root cause ————————————— Back in r140457 we gave InitListChecker a verification-only mode, and will use CanUseDecl instead of DiagnoseUseOfDecl for verification-only mode. These two functions handle unavailable issues differently: In Sema::CanUseDecl, we say the decl is invalid when the Decl is unavailable and the current context is available. In Sema::DiagnoseUseOfDecl, we say the decl is usable by ignoring the return code of DiagnoseAvailabilityOfDecl So with an assert build, we will hit an assertion in diagnoseListInit assert(DiagnoseInitList.HadError() && "Inconsistent init list check result."); The fix ------------------- If we follow what is implemented in CanUseDecl and treat Decls with unavailable issues as invalid, the variable decl of “foo2” will be marked as invalid. Since unavailable checking is processed in delayed diagnostics (r197627), we will silently ignore the diagnostics when we find out that the variable decl is invalid. We add a flag "TreatUnavailableAsInvalid" for the verification-only mode. For overload resolution, we want to say decls with unavailable issues are invalid; but for everything else, we should say they are valid and emit diagnostics. Depending on the value of the flag, CanUseDecl can return different values for unavailable issues. rdar://23557300 Differential Revision: http://reviews.llvm.org/D15314 llvm-svn: 263149
* [TableGen] more helpful error message in MapTableEmitterNicolai Haehnle2016-03-101-2/+12
| | | | | | Differential Revision: http://reviews.llvm.org/D17275 llvm-svn: 263148
* [ELF] - Refactor of SymbolBody::compare()George Rimar2016-03-101-18/+15
| | | | | | | | That makes it a bit shorter. Differential revision: http://reviews.llvm.org/D18004 llvm-svn: 263144
* Materialize metadata in IRLinker before value mappingTeresa Johnson2016-03-101-5/+6
| | | | | | | | | | | | | | | | | | | Summary: Unless we plan to do later postpass metadata linking (ThinLTO special mode), always invoke metadata materialization at the start of IRLinker::run(). This avoids the need for clients who use lazy metadata loading to explicitly invoke materializeMetadata before the IRMover, which in turn invokes IRLinker::run and needs materialized metadata for mapping. Came up in the context of an LLD issue (D17982). Reviewers: rafael Subscribers: silvas, llvm-commits Differential Revision: http://reviews.llvm.org/D17992 llvm-svn: 263143
* [sanitizer_common tests] Make Darwin a Posix system and bring the ↵Filipe Cabecinhas2016-03-104-1/+7
| | | | | | | | | | | | | | | | | | | stable-runtime definition from ASan tests. Summary: This is an initial setup in order to move some additional tests from Linux onto Posix. I also moved decorate_proc_maps onto the Linux directory Finally added msan's definition for "stable-runtime". Only a test requires it, and its commit message (r248014) seems to imply that AArch64 is problematic with MSan. Reviewers: samsonov, rengolin, t.p.northover, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17928 llvm-svn: 263142
* AArch64: remove pseudo-instructions used only for their patterns.Tim Northover2016-03-101-15/+42
| | | | | | | There's no real reason for these pseudos to exist, we should be writing real patterns even if it is slightly less convenient. NFC. llvm-svn: 263141
* AMDGPU/SI: add llvm.amdgcn.buffer.load/store.format intrinsicsNicolai Haehnle2016-03-105-15/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: They correspond to BUFFER_LOAD/STORE_FORMAT_XYZW and will be used by Mesa to implement the GL_ARB_shader_image_load_store extension. The intention is that for llvm.amdgcn.buffer.load.format, LLVM will decide whether one of the _X/_XY/_XYZ opcodes can be used (similar to image sampling and loads). However, this is not currently implemented. For llvm.amdgcn.buffer.store, LLVM cannot decide to use one of the "smaller" opcodes and therefore the intrinsic is overloaded. Currently, only the v4f32 is actually implemented since GLSL also only has a vec4 variant of the store instructions, although it's conceivable that Mesa will want to be smarter about this in the future. BUFFER_LOAD_FORMAT_XYZW is already exposed via llvm.SI.vs.load.input, which has a legacy name, pretends not to access memory, and does not capture the full flexibility of the instruction. Reviewers: arsenm, tstellarAMD, mareko Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D17277 llvm-svn: 263140
* [X86] Correctly select registers to pop into for x86_64Michael Kuperstein2016-03-102-1/+13
| | | | | | | | | | | | | | When trying to replace an add to esp with pops, we need to choose dead registers to pop into. Registers clobbered by the call and not imp-def'd by it should be safe. Except that it's not enough to check the register itself isn't defined, we also need to make sure no overlapping registers are defined either. This fixes PR26711. Differential Revision: http://reviews.llvm.org/D18029 llvm-svn: 263139
* Make remaining ImplicitFallthrough warning DefaultIgnore.Nico Weber2016-03-101-1/+1
| | | | | | Follow-up to r262881, which caused this to fire more often. llvm-svn: 263138
* Follow-up fix for r263126. Apparently `printf("%p", NULL)` can output 0x0, ↵Kuba Brecka2016-03-101-2/+2
| | | | | | (nil) or (null) on different platforms. llvm-svn: 263137
* [AArch64] Optimize compare and branch sequence when the compare's constant ↵Balaram Makam2016-03-103-26/+134
| | | | | | | | | | | | | | | | | | | | | | | operand is power of 2 Summary: Peephole optimization that generates a single TBZ/TBNZ instruction for test and branch sequences like in the example below. This handles the cases that miss folding of AND into TBZ/TBNZ during ISelLowering of BR_CC Examples: and w8, w8, #0x400 cbnz w8, L1 to tbnz w8, #10, L1 Reviewers: MatzeB, jmolloy, mcrosier, t.p.northover Subscribers: aemerson, rengolin, mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D17942 llvm-svn: 263136
* give regression test a meaningful nameSanjay Patel2016-03-101-4/+4
| | | | llvm-svn: 263135
* [Renderscript] Add stack argument reading code for Mipsel 3Aidan Dodds2016-03-101-7/+7
| | | | | | | | Fix a problem raised with the previous patches being applied in the wrong order. Committed on behalf of: Dean De Leo <dean@codeplay.com> llvm-svn: 263134
OpenPOWER on IntegriCloud