summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Initial support for the align_value attributeHal Finkel2014-10-0211-2/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the align_value attribute. This attribute is supported by Intel's compiler (versions 14.0+), and several of my HPC users have requested support in Clang. It specifies an alignment assumption on the values to which a pointer points, and is used by numerical libraries to encourage efficient generation of vector code. Of course, we already have an aligned attribute that can specify enhanced alignment for a type, so why is this additional attribute important? The problem is that if you want to specify that an input array of T is, say, 64-byte aligned, you could try this: typedef double aligned_double attribute((aligned(64))); void foo(aligned_double *P) { double x = P[0]; // This is fine. double y = P[1]; // What alignment did those doubles have again? } the access here to P[1] causes problems. P was specified as a pointer to type aligned_double, and any object of type aligned_double must be 64-byte aligned. But if P[0] is 64-byte aligned, then P[1] cannot be, and this access causes undefined behavior. Getting round this problem requires a lot of awkward casting and hand-unrolling of loops, all of which is bad. With the align_value attribute, we can accomplish what we'd like in a well defined way: typedef double *aligned_double_ptr attribute((align_value(64))); void foo(aligned_double_ptr P) { double x = P[0]; // This is fine. double y = P[1]; // This is fine too. } This attribute does not create a new type (and so it not part of the type system), and so will only "propagate" through templates, auto, etc. by optimizer deduction after inlining. This seems consistent with Intel's implementation (thanks to Alexey for confirming the various Intel-compiler behaviors). As a final note, I would have chosen to call this aligned_value, not align_value, for better naming consistency with the aligned attribute, but I think it would be more useful to users to adopt Intel's name. llvm-svn: 218910
* Remove unused function attribute params.Sanjay Patel2014-10-021-2/+2
| | | | llvm-svn: 218909
* Add FreeBSD test failure decoratorsEd Maste2014-10-023-0/+3
| | | | llvm-svn: 218908
* LTO: Document the Boolean argument from r218784Duncan P. N. Exon Smith2014-10-021-1/+2
| | | | llvm-svn: 218907
* Optimize square root squared (PR21126).Sanjay Patel2014-10-022-0/+34
| | | | | | | | | | | When unsafe-fp-math is enabled, we can turn sqrt(X) * sqrt(X) into X. This can happen in the real world when calculating x ** 3/2. This occurs in test-suite/SingleSource/Benchmarks/BenchmarkGame/n-body.c. Differential Revision: http://reviews.llvm.org/D5584 llvm-svn: 218906
* Add __sync_fetch_and_nand (again)Hal Finkel2014-10-027-13/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to GCC 4.4, __sync_fetch_and_nand was implemented as: { tmp = *ptr; *ptr = ~tmp & value; return tmp; } but this was changed in GCC 4.4 to be: { tmp = *ptr; *ptr = ~(tmp & value); return tmp; } in response to this change, support for sync_fetch_and_nand (and sync_nand_and_fetch) was removed in r99522 in order to avoid miscompiling code depending on the old semantics. However, at this point: 1. Many years have passed, and the amount of code relying on the old semantics is likely smaller. 2. Through the work of many contributors, all LLVM backends have been updated such that "atomicrmw nand" provides the newer GCC 4.4+ semantics (this process was complete July of 2014 (added to the release notes in r212635). 3. The lack of this intrinsic is now a needless impediment to porting codes from GCC to Clang (I've now seen several examples of this). It is true, however, that we still set GNUC_MINOR to 2 (corresponding to GCC 4.2). To compensate for this, and to address the original concern regarding code relying on the old semantics, I've added a warning that specifically details the fact that the semantics have changed and that we provide the newer semantics. Fixes PR8842. llvm-svn: 218905
* Limit test to DarwinEd Maste2014-10-021-0/+1
| | | | | | Test requres <Foundation/Foundation.h> llvm-svn: 218904
* [x86] Move the vperm2f128 test to be vperm2x128 and test both theChandler Carruth2014-10-023-116/+217
| | | | | | | | | floating point and integer domains. Merge the AVX2 test into it and add an extra RUN line. Generate clean FileCheck statements with my script. Remove the now merged AVX2 tests. llvm-svn: 218903
* Fix stale comments in new tests.Todd Fiala2014-10-021-2/+6
| | | | | | Dang. llvm-svn: 218901
* thread state coordinator: add tests and impl to error on creation/death issues.Todd Fiala2014-10-023-7/+49
| | | | | | | | Added tests and impl to make sure the following errors are reported: * Notifying a created thread that we are already tracking. * Notifying a thread death for a thread we don't know about. llvm-svn: 218900
* Add ENABLE_THREADS for these threaded testsEd Maste2014-10-022-0/+2
| | | | | | On at least FreeBSD linking with -lpthread is needed for std::thread. llvm-svn: 218899
* [clang-tidy] Add check misc-braces-around-statements.Alexander Kornienko2014-10-026-0/+787
| | | | | | | | | | | | | | | | | | | | | | | | | | | This check looks for if statements and loops: for, range-for, while and do-while, and verifies that the inside statements are inside braces '{}'. If not, proposes to add braces around them. Example: if (condition) action(); becomes if (condition) { action(); } This check ought to be used with the -format option, so that the braces be well-formatted. Patch by Marek Kurdej! http://reviews.llvm.org/D5395 llvm-svn: 218898
* thread state coordinator: added simpler deferred stop notification method.Todd Fiala2014-10-023-33/+214
| | | | | | | | | | | | | | | Now that ThreadStateCoordinator errors out on threads in unexpected states, it has enough information to know which threads need stop requests fired when we want to do a deferred callback on a thread's behalf. This change adds a new method, CallAfterRunningThreadsStop(...), which no longer takes a set of thread ids that require stop requests. It's much harder to misuse this method and (with newer error logic) it's harder to correctly use the original method. Expect the original method that takes the set of thread ids to stop to disappear in the near future. Adds several tests for CallAfterRunningThreadsStop(). llvm-svn: 218897
* Make this test case a little more resilient to class name changesEnrico Granata2014-10-021-1/+1
| | | | llvm-svn: 218896
* Diagnose mixed use of '_' and '.' as versionFariborz Jahanian2014-10-023-2/+15
| | | | | | separators in my previous patch. llvm-svn: 218895
* [mach-o] preserve custom section names on coalesable stringsNick Kledzik2014-10-022-5/+114
| | | | llvm-svn: 218894
* Preserve custom section names when coalescing.Nick Kledzik2014-10-022-0/+84
| | | | | | | | | | | | The mergeByContent attribute on DefinedAtoms triggers the symbol table to coalesce atoms with the exact same content. The problem is that atoms can also have a required custom section. The coalescing should never change the custom section of an atom. The fix is to only consider to atoms to have the same content if their sectionChoice() and customSectionName() attributes match. llvm-svn: 218893
* InstrProf: Avoid linear search in a hot loopJustin Bogner2014-10-022-10/+41
| | | | | | | | | | Every time we were adding or removing an expression when generating a coverage mapping we were doing a linear search to try and deduplicate the list. The indices in the list are important, so we can't just replace it by a DenseMap entirely, but an auxilliary DenseMap for fast lookup massively improves the performance issues I was seeing here. llvm-svn: 218892
* This patch adds a new flag "-coff-imports" to llvm-readobj.Rui Ueyama2014-10-028-5/+68
| | | | | | | | | | | | | | When the flag is given, the command prints out the COFF import table. Currently only the import table directory will be printed. I'm going to make another patch to print out the imported symbols. The implementation of import directory entry iterator in COFFObjectFile.cpp was buggy. This patch fixes that too. http://reviews.llvm.org/D5569 llvm-svn: 218891
* Fix codesigning of MacOSX debugserver when built with cmake.Todd Fiala2014-10-022-2/+4
| | | | | | | | | | | | | | | | This patch fixes the codesigning of debugserver on OSX when built with cmake. Without this you get this error when debugging: error: process launch failed: unable to locate debugserver Note: you also need to set LLDB_DEBUGSERVER_PATH to point to your built debugserver. e.g. export LLDB_DEBUGSERVER_PATH=`pwd`/bin/debugserver Change by dawn@burble.org. Tested on MacOSX 10.9.5 and Xcode 6.1 Beta using cmake/ninja. Verified no build break on Linux Ubuntu cmake/ninja and Xcode 6.1 canonical build. llvm-svn: 218890
* [x32/NaCl] Check if method pointers straddle an eightbyte to classify HiJan Wen Voung2014-10-023-3/+77
| | | | | | | | | | | | | | | | | | | | Summary: Currently, with struct my_struct { int x; method_ptr y; }; a call to foo(my_struct s) may end up dropping the last 4 bytes of the method pointer for x86_64 NaCl and x32. When checking Has64BitPointers, also check if the method pointer straddles an eightbyte boundary and classify Hi as well as Lo if needed. Test Plan: test/CodeGenCXX/x86_64-arguments-nacl-x32.cpp Reviewers: dschuff, pavel.v.chupin Subscribers: jfb Differential Revision: http://reviews.llvm.org/D5555 llvm-svn: 218889
* Reapply "InstrProf: Update for the LLVM API change in r218879"Justin Bogner2014-10-023-15/+7
| | | | | | | | Reapplying now that r218887 is in. This reverts commit r218882, reapplying r218880. llvm-svn: 218888
* Reapply "InstrProf: Don't keep a large sparse list around just to zero it"Justin Bogner2014-10-022-32/+50
| | | | | | | | | | When I was preparing r218879 for commit, I removed an early return that I decided was just noise. It wasn't. This is r218879 no-crash edition. This reverts commit r218881, reapplying r218879. llvm-svn: 218887
* Remove an extra whitespace.Adrian Prantl2014-10-021-1/+1
| | | | llvm-svn: 218886
* Pretty-printer: Paper over an ambiguity between line table entriesAdrian Prantl2014-10-021-1/+3
| | | | | | | | and tagged mdnodes. fixes http://llvm.org/bugs/show_bug.cgi?id=21131 llvm-svn: 218885
* Patch to accept '_' in addition to '.' as versionFariborz Jahanian2014-10-022-3/+100
| | | | | | | number separator in "availability" attribute. rdar://18490958 llvm-svn: 218884
* Align copied load/store instructions as the original.Johannes Doerfert2014-10-026-6/+112
| | | | | | | | | | This also forbids the json importer to access other memory locations than the original instruction as we to reuse the alignment of the original load/store. Differential Revision: http://reviews.llvm.org/D5560 llvm-svn: 218883
* Revert "InstrProf: Update for the LLVM API change in r218879"Justin Bogner2014-10-023-7/+15
| | | | | | | | r218879 has been reverted for now, this needs to go to match. This reverts commit r218880. llvm-svn: 218882
* Revert "InstrProf: Don't keep a large sparse list around just to zero it"Justin Bogner2014-10-022-45/+32
| | | | | | | | This seems to be crashing on some buildbots. Reverting to investigate. This reverts commit r218879. llvm-svn: 218881
* InstrProf: Update for the LLVM API change in r218879Justin Bogner2014-10-023-15/+7
| | | | llvm-svn: 218880
* InstrProf: Don't keep a large sparse list around just to zero itJustin Bogner2014-10-022-32/+45
| | | | | | | | | | | | | | | | | | | | The Terms vector here represented a polynomial of of all possible counters, and is used to simplify expressions when generating coverage mapping. There are a few problems with this: 1. Keeping the vector as a member is wasteful, since we clear it every time we use it. 2. Most expressions refer to a subset of the counters, so we end up iterating over a large number of zeros doing nothing a lot of the time. This updates the user of the vector to store the terms locally, and uses a sort and combine approach so that we only operate on counters that are actually used in a given expression. For small cases this makes very little difference, but in cases with a very large number of counted regions this is a significant performance fix. llvm-svn: 218879
* [Refactor] Rename LoopAnnotator to ScopAnnotatorJohannes Doerfert2014-10-025-19/+19
| | | | | | | | | The LoopAnnotator doesn't annotate only loops any more, thus it is called ScopAnnotator from now on. This also removes unnecessary polly:: namespace tags. llvm-svn: 218878
* Allow to annotate alias scopes in the new SCoP.Johannes Doerfert2014-10-028-34/+225
| | | | | | | | | The command line flag -polly-annotate-alias-scopes controls whether or not Polly annotates alias scopes in the new SCoP (default ON). This can improve later optimizations as the new SCoP is basically an alias free environment for them. llvm-svn: 218877
* Use the local variable that other clauses around here are already using.Sanjay Patel2014-10-021-1/+1
| | | | llvm-svn: 218876
* Remove duplicate function names from comments. NFC.Sanjay Patel2014-10-021-43/+35
| | | | llvm-svn: 218875
* [NVPTX] Remove dead code.Tilmann Scheller2014-10-021-9/+3
| | | | | | Found by the Clang static analyzer. llvm-svn: 218874
* Fix up stale comments from last change.Todd Fiala2014-10-021-2/+2
| | | | llvm-svn: 218873
* thread state coordinator: requesting resume now signals error appropriately.Todd Fiala2014-10-022-8/+37
| | | | | | | | | | Added tests to verify that the coordinator signals an error if the given thread to resume is unknown, and if the thread is through to be running already. Modified resume handling code to match tests. llvm-svn: 218872
* gtest runner: now always does a clean step after running.Todd Fiala2014-10-021-13/+25
| | | | | | | | | | * Checks for any 'clean' arg, setting clean-only mode. * If clean-only mode, skip the make. * Adds the equivalent of os.devnull in a way that supports the file-like 'write' operation. * Uses a null sysout/syserr for the clean step so we don't see noise from cleaning. * Now always runs the clean step after a real test run so we don't have cruft left over after a test run. llvm-svn: 218871
* Support padding unaligned data in .text.Joerg Sonnenberger2014-10-022-1/+10
| | | | llvm-svn: 218870
* Support Cortex-m0Jonathan Roelofs2014-10-023-21/+70
| | | | | | | | | As the title says... also, fix all the ARM asm return sequences so that they work on processors without the BX instruction. http://reviews.llvm.org/D5314 llvm-svn: 218869
* Silence a -Wsign-compare warning. NFC.Aaron Ballman2014-10-021-2/+2
| | | | llvm-svn: 218868
* [BUG][INDVAR] Fix for PR21014: wrong SCEV operands commuting for ↵Zinovy Nis2014-10-022-5/+18
| | | | | | | | | | | | non-commutative instructions My commit rL216160 introduced a bug PR21014: IndVars widens code 'for (i = ; i < ...; i++) arr[ CONST - i]' into 'for (i = ; i < ...; i++) arr[ i - CONST]' thus inverting index expression. This patch fixes it. Thanks to Jörg Sonnenberger for pointing. Differential Revision: http://reviews.llvm.org/D5576 llvm-svn: 218867
* [Compiler-rt][MIPS][Profile] Adding support for MIPS32/64Daniel Sanders2014-10-021-3/+10
| | | | | | | | | | | | | | | | | | Summary: Changed cmake/config-ix.cmake to add support for different MIPS architectures: mips, mipsel, mips64, mips64el In profile code there is no target based dependencies, so just enabling mips flag does the work. Patch by Mohit Bhakkad Reviewers: dsanders, void, petarj, kcc, samsonov Reviewed By: samsonov Subscribers: llvm-commits, farazs, kumarsukhani Differential Revision: http://reviews.llvm.org/D4880 llvm-svn: 218866
* Emit lifetime.start / lifetime.end markers for unnamed temporary objects.Arnaud A. de Grandmaison2014-10-026-32/+414
| | | | | | | This will give more information to the optimizers so that they can reuse stack slots and reduce stack usage. llvm-svn: 218865
* Fix a broken test case.Asiri Rathnayake2014-10-021-2/+2
| | | | | | | | | | Summary: Commit r218863 broke this test case. This patch fixes it by updating the expected output line. Should've been updated with the original patch but for some reason it didn't fail during my local make check. Change-Id: I89ed28b37f67c34d1a5d28a3e47ae33d9a82a98f llvm-svn: 218864
* [ARM] Handle conflicts between -mfpu and -mfloat-abi options.Asiri Rathnayake2014-10-024-10/+172
| | | | | | | | | Summary: This patch implements warnings/downgradable errors for invalid -mfpu, -mfloat-abi option combinations (e.g. -mfpu=none -mfloat-abi=hard). Change-Id: I94fa664e1bc0b5855ad835abd7a50a3e0395632d llvm-svn: 218863
* [x86] Just delete the last combine test file.Chandler Carruth2014-10-021-448/+0
| | | | | | | | | | This file isn't really doing anything useful. Many of the tests that seem to be combined are also repeats from other test files. Many of the other tests, despite the comment that they should be combined into a single shuffle... well... aren't combined into a single shuffle. =/ llvm-svn: 218862
* [x86] Merge still more combine tests into the common file. These atChandler Carruth2014-10-022-237/+382
| | | | | | | least seem *slightly* more interesting test wise, although given how spotily we actually combine anything, I remain somewhat suspicious. llvm-svn: 218861
* [x86] Merge the third combining test into the generic one and add properChandler Carruth2014-10-022-380/+1001
| | | | | | | | | | | | | | | | checks for all the ISA variants. If the SSE2 checks here terrify you, good. This is (in large part) the kind of amazingly bad code that is holding LLVM back when vectorizing on older ISAs. At the same time, these tests seem increasingly dubious to me. There are a very large number of tests and it isn't clear that they are systematically covering a specific set of functionality. Anyways, I don't want to reduce testing during the transition, I just want to consolidate it to where it is easier to manage. llvm-svn: 218860
OpenPOWER on IntegriCloud