summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Update ExpressionSourceCode::GetText() to match theJason Molenda2015-01-221-1/+1
| | | | | | | | name of the iOS simulator platform which was changed in r181631. <rdar://problem/19200084> llvm-svn: 226789
* [OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.Alexey Bataev2015-01-223-74/+603
| | | | | | | | | | | | | "omp atomic read [seq_cst]" accepts expressions "v=x;". In this patch we perform an atomic load of "x" (using builtin atomic loading instructions or a call to "atomic_load()" for simple lvalues and "kmpc_atomic_start();load <x>;kmpc_atomic_end();" for other lvalues), convert the result of loading to type of "v" (using EmitScalarConversion() for simple types and EmitComplexToScalarConversion() for conversions from complex to scalar) and then store the result in "v".) Differential Revision: http://reviews.llvm.org/D6431 llvm-svn: 226788
* Revert commit revision 226786Alexey Bataev2015-01-223-602/+74
| | | | | | Need to add initialization of AtomicInfo::EvaluationKind field llvm-svn: 226787
* [OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.Alexey Bataev2015-01-223-74/+602
| | | | | | | | | | | | | "omp atomic read [seq_cst]" accepts expressions "v=x;". In this patch we perform an atomic load of "x" (using builtin atomic loading instructions or a call to "atomic_load()" for simple lvalues and "kmpc_atomic_start();load <x>;kmpc_atomic_end();" for other lvalues), convert the result of loading to type of "v" (using EmitScalarConversion() for simple types and EmitComplexToScalarConversion() for conversions from complex to scalar) and then store the result in "v".) Differential Revision: http://reviews.llvm.org/D6431 llvm-svn: 226786
* Revert commit r226784.Alexey Bataev2015-01-224-603/+75
| | | | | | Accidentally modified file SemaType.cpp must be restored to its original state. llvm-svn: 226785
* [OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.Alexey Bataev2015-01-224-75/+603
| | | | | | | | | | | | | "omp atomic read [seq_cst]" accepts expressions "v=x;". In this patch we perform an atomic load of "x" (using builtin atomic loading instructions or a call to "atomic_load()" for simple lvalues and "kmpc_atomic_start();load <x>;kmpc_atomic_end();" for other lvalues), convert the result of loading to type of "v" (using EmitScalarConversion() for simple types and EmitComplexToScalarConversion() for conversions from complex to scalar) and then store the result in "v". Differential Revision: http://reviews.llvm.org/D6431 llvm-svn: 226784
* [PM] Rename InstCombine.h to InstCombineInternal.h in preparation forChandler Carruth2015-01-2214-16/+21
| | | | | | | | | | | | | | | | creating a non-internal header file for the InstCombine pass. I thought about calling this InstCombiner.h or in some way more clearly associating it with the InstCombiner clas that it is primarily defining, but there are several other utility interfaces defined within this for InstCombine. If, in the course of refactoring, those end up moving elsewhere or going away, it might make more sense to make this the combiner's header alone. Naturally, this is a bikeshed to a certain degree, so feel free to lobby for a different shade of paint if this name just doesn't suit you. llvm-svn: 226783
* Add ARM backend to the autotools buildGreg Fitzgerald2015-01-223-2/+5
| | | | | From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226782
* [canonicalize] Teach InstCombine to canonicalize loads which are onlyChandler Carruth2015-01-223-3/+82
| | | | | | | | | | | | | | | | | | | | | | | ever stored to always use a legal integer type if one is available. Regardless of whether this particular type is good or bad, it ensures we don't get weird differences in generated code (and resulting performance) from "equivalent" patterns that happen to end up using a slightly different type. After some discussion on llvmdev it seems everyone generally likes this canonicalization. However, there may be some parts of LLVM that handle it poorly and need to be fixed. I have at least verified that this doesn't impede GVN and instcombine's store-to-load forwarding powers in any obvious cases. Subtle cases are exactly what we need te flush out if they remain. Also note that this IR pattern should already be hitting LLVM from Clang at least because it is exactly the IR which would be produced if you used memcpy to copy a pointer or floating point between memory instead of a variable. llvm-svn: 226781
* Makes a simple member function static.Francisco Lopes da Silva2015-01-221-2/+2
| | | | | | | This function has been just included with the initial support for C++ parameter completion and it's trivial enough to be a static member. llvm-svn: 226780
* ARM: fail less catastrophically on invalid Windows inputSaleem Abdulrasool2015-01-225-14/+40
| | | | | | | | | | | | Windows supports a restricted set of relocations (compared to ARM ELF). In some cases, we may end up generating an unsupported relocation. This can occur with bad input to the assembler in particular (the frontend should never generate code that cannot be compiled). Generate an error rather than just aborting. The change in the API is driven by the desire to provide a slightly more helpful message for debugging purposes. llvm-svn: 226779
* [modules] If we add an implicit special member to a class through an updateRichard Smith2015-01-226-1/+26
| | | | | | | | record, and that class declaration is not the canonical definition of the class, be sure to add the class to the list of classes that are consulted when we look up a special member in the canonical definition. llvm-svn: 226778
* [canonicalize] Move a helper function further up the file so it can beChandler Carruth2015-01-221-47/+47
| | | | | | used earlier. NFC. llvm-svn: 226777
* Fix test file names so they're picked up by lit.Richard Smith2015-01-222-0/+0
| | | | llvm-svn: 226776
* DIBuilder: Make header iterator constructor explicit, NFCDuncan P. N. Exon Smith2015-01-221-3/+5
| | | | llvm-svn: 226775
* DIBuilder: Extract header_begin() and header_end(), NFCDuncan P. N. Exon Smith2015-01-221-4/+6
| | | | | | | Use begin/end functions so that users don't need to know how these weird things work. llvm-svn: 226774
* DIBuilder: Stop abusing DIExpressionIterator::operator*(), NFCDuncan P. N. Exon Smith2015-01-221-1/+1
| | | | | | | | | This code was confusing, since it created a `DIExpressionIterator` from an invalid start point (although it wasn't wrong: it never actually iterated). Now that the underlying iterator has `getNumber()`, just use it directly. llvm-svn: 226773
* DIBuilder: Extract DIHeaderFieldIterator::getNumber(), NFCDuncan P. N. Exon Smith2015-01-221-10/+12
| | | | | | | Reduce code duplication between `DIBuilder` and `DIExpressionIterator` by implementing a `getNumber()` directly in the iterator. llvm-svn: 226772
* Add an API to ValueObject that iterates over the entire parent chain via a ↵Enrico Granata2015-01-222-9/+20
| | | | | | callback, and rewrite GetRoot() in terms of this general iteration API. NFC llvm-svn: 226771
* DIBuilder: Create a getHeaderIterator() helper, NFCDuncan P. N. Exon Smith2015-01-221-2/+6
| | | | | | Extract this so it can be reused. llvm-svn: 226770
* Making deleted copy constructors and operators to be private for better ↵Chris Bieneman2015-01-221-16/+16
| | | | | | diagnostics when deleted is not available. llvm-svn: 226769
* SEH: Finish writing the catch-all test caseReid Kleckner2015-01-221-1/+5
| | | | llvm-svn: 226768
* Win64 SEH: Emit the constant 1 for catch-all into xdataReid Kleckner2015-01-222-2/+31
| | | | llvm-svn: 226767
* SEH: Emit the constant filter 1 as a catch-allReid Kleckner2015-01-222-7/+17
| | | | | | Minor optimization of code like __try { ... } __except(1) { ... }. llvm-svn: 226766
* [modules] If we load two declarations with typedef names for linkage purposesRichard Smith2015-01-225-4/+22
| | | | | | | on top of a local declaration of the same entity, we still need to remember that we loaded the first one or we may fail to merge the second one properly. llvm-svn: 226765
* InstrProf: Avoid creating profile names for symbols in system headersJustin Bogner2015-01-222-2/+22
| | | | | | | | | | We don't emit any coverage mapping for uncovered functions that come from system headers, but we were creating a GlobalVariable with each of their names. This is wasteful since the linker will need to dead strip the unused symbols, and it can lead to issues when merging coverage with others TUs that do have coverage for those functions. llvm-svn: 226764
* Assigning and copying command line option objects shouldn't be allowed.Chris Bieneman2015-01-224-4/+22
| | | | | | | | | | | | | | | Summary: The default copy and assignment operators for these objects probably don't actually do what the clients intend, so they should be deleted. Places using the assignment operator to set the value of an option should cast to the option's data type first to call into the override for operator=. Places using the copy constructor just need to be changed to not copy (i.e. passing by const reference instead of value). Reviewers: dexonsmith, chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7114 llvm-svn: 226762
* [modules] It's possible to merge into the pattern of a class template before weRichard Smith2015-01-226-3/+28
| | | | | | | load the definition data from the declaration itself. In that case, merge properly; don't assume the prior definition is the same as our own. llvm-svn: 226761
* Initial support for Win64 SEH IR emissionReid Kleckner2015-01-2221-49/+667
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lowering looks a lot like normal EH lowering, with the exception that the exceptions are caught by executing filter expression code instead of matching typeinfo globals. The filter expressions are outlined into functions which are used in landingpad clauses where typeinfo would normally go. Major aspects that still need work: - Non-call exceptions in __try bodies won't work yet. The plan is to outline the __try block in the frontend to keep things simple. - Filter expressions cannot use local variables until capturing is implemented. - __finally blocks will not run after exceptions. Fixing this requires work in the LLVM SEH preparation pass. The IR lowering looks like this: // C code: bool safe_div(int n, int d, int *r) { __try { *r = normal_div(n, d); } __except(_exception_code() == EXCEPTION_INT_DIVIDE_BY_ZERO) { return false; } return true; } ; LLVM IR: define i32 @filter(i8* %e, i8* %fp) { %ehptrs = bitcast i8* %e to i32** %ehrec = load i32** %ehptrs %code = load i32* %ehrec %matches = icmp eq i32 %code, i32 u0xC0000094 %matches.i32 = zext i1 %matches to i32 ret i32 %matches.i32 } define i1 zeroext @safe_div(i32 %n, i32 %d, i32* %r) { %rr = invoke i32 @normal_div(i32 %n, i32 %d) to label %normal unwind to label %lpad normal: store i32 %rr, i32* %r ret i1 1 lpad: %ehvals = landingpad {i8*, i32} personality i32 (...)* @__C_specific_handler catch i8* bitcast (i32 (i8*, i8*)* @filter to i8*) %ehptr = extractvalue {i8*, i32} %ehvals, i32 0 %sel = extractvalue {i8*, i32} %ehvals, i32 1 %filter_sel = call i32 @llvm.eh.seh.typeid.for(i8* bitcast (i32 (i8*, i8*)* @filter to i8*)) %matches = icmp eq i32 %sel, %filter_sel br i1 %matches, label %eh.except, label %eh.resume eh.except: ret i1 false eh.resume: resume } Reviewers: rjmccall, rsmith, majnemer Differential Revision: http://reviews.llvm.org/D5607 llvm-svn: 226760
* Revert "Try to fix -Asserts build bots."Rafael Espindola2015-01-221-2/+2
| | | | | | | | | This reverts commit r226758. Looks like rnk's 226757 fixed the real issue. Sorry for the noise. llvm-svn: 226759
* Try to fix -Asserts build bots.Rafael Espindola2015-01-221-2/+2
| | | | llvm-svn: 226758
* Give the block inlining test a triple to determinise outputReid Kleckner2015-01-221-1/+1
| | | | | | | | It fails on Windows due to another temporary being emitted first, so the LLVM internal renaming scheme gives out the name __block_descriptor_tmp1. llvm-svn: 226757
* Remove an out-of-date and incorrect comment.Richard Smith2015-01-221-10/+0
| | | | llvm-svn: 226756
* Make ScalarEvolution less aggressive with respect to no-wrap flags.Sanjoy Das2015-01-222-8/+48
| | | | | | | | | | | | ScalarEvolution currently lowers a subtraction recurrence to an add recurrence with the same no-wrap flags as the subtraction. This is incorrect because `sub nsw X, Y` is not the same as `add nsw X, -Y` and `sub nuw X, Y` is not the same as `add nuw X, -Y`. This patch fixes the issue, and adds two test cases demonstrating the bug. Differential Revision: http://reviews.llvm.org/D7081 llvm-svn: 226755
* Fix compiler_builtins.m test to not rely on including system stdlib.h and ↵Hans Wennborg2015-01-223-2/+3
| | | | | | | | | | | | | | malloc.h Importing _Builtin_intrinsics.sse and avx would transitively pull in those headers, and the test would fail when building in an environment where they were not available on the include path. This fixes PR20995 for me. Differential Revision: http://reviews.llvm.org/D7112 llvm-svn: 226754
* File::Read(), when asked to read the contents of a file into a heapJason Molenda2015-01-221-3/+4
| | | | | | | | | | | | buffer and to add a nul terminator byte, was incorrectly resizing its buffer so the nul terminator was not included. Problem found by clang ASAN instrumentation when using an expression prefix file which was read via this mechanism. <rdar://problem/19556459> llvm-svn: 226753
* Add Utility/UriParser.cpp to the lldb-core target so xcode buildsJason Molenda2015-01-221-2/+2
| | | | | | work again. llvm-svn: 226752
* Emit DeferredDeclsToEmit in a DFS order.Rafael Espindola2015-01-2246-334/+357
| | | | | | | | | | | | | | Currently we emit DeferredDeclsToEmit in reverse order. This patch changes that. The advantages of the change are that * The output order is a bit closer to the source order. The change to test/CodeGenCXX/pod-member-memcpys.cpp is a good example. * If we decide to deffer more, it will not cause as large changes in the estcases as it would without this patch. llvm-svn: 226751
* Explicitly describe '///' versus '//' comment delimiters.Paul Robinson2015-01-221-2/+4
| | | | llvm-svn: 226750
* Fix lit config typoJonathan Roelofs2015-01-221-1/+1
| | | | llvm-svn: 226749
* Make DwarfExpression use the new DIExpressionIterator. NFC.Adrian Prantl2015-01-222-30/+36
| | | | llvm-svn: 226748
* Rewrite DIExpression::Verify() using an iterator. NFC.Adrian Prantl2015-01-222-16/+82
| | | | | | Addresses review comments for r226627. llvm-svn: 226747
* [canonicalization] Refactor how we create new stores into a helperChandler Carruth2015-01-211-38/+48
| | | | | | | function. This is a bit tidier anyways and will make a subsquent patch simpler as I want to add another case to this combine. llvm-svn: 226746
* [X86][SSE] Missing SSE/AVX1 memory folding integer instructionsSimon Pilgrim2015-01-215-220/+704
| | | | | | | | | | Added most of the missing integer vector folding patterns for SSE (to SSE42) and AVX1. The most useful of these are probably the i32/i64 extraction, i8/i16/i32/i64 insertions, zero/sign extension, unsigned saturation subtractions, i64 subtractions and the variable mask blends (pblendvb) - others include CLMUL, SSE42 string comparisons and bit tests. Differential Revision: http://reviews.llvm.org/D7094 llvm-svn: 226745
* Expression evaluation for functions with unknown signatures on works byKate Stone2015-01-211-0/+4
| | | | | | | | | | | | | | | inferring the function signature. This works well where the ABI doesn't distinguish between variadic and fixed argument lists, but on arm64 the calling conventions differ. The default assumption works for fixed argument lists, but variadic functions require explicit prototypes to be called. By far the most common case where this is an issue is when attempting to use printf(). This change augments the default expression prefix to include a working variadic prototype for the function. <rdar://problem/19024779> llvm-svn: 226744
* Use CHECK-LABEL when possible. NFC.Rafael Espindola2015-01-211-6/+6
| | | | llvm-svn: 226743
* Implement ProcessWindows::GetMemoryRegionInfo.Zachary Turner2015-01-212-0/+39
| | | | llvm-svn: 226742
* Adopt new cl::HideUnrelatedOptions API added r226729.Chris Bieneman2015-01-212-18/+2
| | | | | | | | | | | | Summary: cl::HideUnrelatedOptions allows tools to hide all options not part of a specific OptionCategory. This is the common use case for cl::getRegisteredOptions, which should be deprecated in the future because it exposes implementation details of command line parsing. Reviewers: dexonsmith Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D7109 llvm-svn: 226741
* DAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))Tim Northover2015-01-214-16/+68
| | | | | | | It can help with argument juggling on some targets, and is generally a good idea. llvm-svn: 226740
* Drop an unused parameterTobias Grosser2015-01-211-5/+3
| | | | llvm-svn: 226739
OpenPOWER on IntegriCloud