summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ARM & AArch64: make use of common cmpxchg idioms after expansionTim Northover2014-05-3059-87/+347
| | | | | | | | | | | | | | | | | | | | | | | | The C and C++ semantics for compare_exchange require it to return a bool indicating success. This gets mapped to LLVM IR which follows each cmpxchg with an icmp of the value loaded against the desired value. When lowered to ldxr/stxr loops, this extra comparison is redundant: its results are implicit in the control-flow of the function. This commit makes two changes: it replaces that icmp with appropriate PHI nodes, and then makes sure earlyCSE is called after expansion to actually make use of the opportunities revealed. I've also added -{arm,aarch64}-enable-atomic-tidy options, so that existing fragile tests aren't perturbed too much by the change. Many of them either rely on undef/unreachable too pervasively to be restored to something well-defined (particularly while making sure they test the same obscure assert from many years ago), or depend on a particular CFG shape, which is disrupted by SimplifyCFG. rdar://problem/16227836 llvm-svn: 209883
* Remove redundant check discovered in post-commit review of r209505.Daniel Jasper2014-05-301-3/+1
| | | | llvm-svn: 209882
* [ASan Win] DLL thunk: make each INTERFACE_FUNCTION unique to prevent ICF ↵Timur Iskhodzhanov2014-05-303-1/+12
| | | | | | linker optimizations llvm-svn: 209881
* AArch64 & ARM: remove undefined behaviour from some tests.Tim Northover2014-05-3013-62/+66
| | | | llvm-svn: 209880
* [asan] Enable ASan on PowerPC.Evgeniy Stepanov2014-05-304-4/+20
| | | | | | Patch by Peter Bergner. llvm-svn: 209879
* clang/test/Frontend/Weverything-and-remarks.cpp: Add explicit -target.NAKAMURA Takumi2014-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | You could see unexpected result (*.tmp.err) with "-target x86_64-win32". Weverything-and-remarks.cpp:11:9: warning: 'char32_t' type specifier is incompatible with C++98 [-Wc++98-compat] typedef __char32_t char32_t; ^ Weverything-and-remarks.cpp:12:27: error: typedef redefinition with different types ('unsigned long' vs 'unsigned long long') typedef long unsigned int size_t; ^ Weverything-and-remarks.cpp:19:62: warning: dynamic exception specifications are deprecated [-Wdeprecated] static void assign(char_type& __c1, const char_type& __c2) throw() { ^~~~~~~ Weverything-and-remarks.cpp:19:62: note: use 'noexcept' instead static void assign(char_type& __c1, const char_type& __c2) throw() { ^~~~~~~ noexcept Weverything-and-remarks.cpp:25:46: warning: unused parameter '__n' [-Wunused-parameter] size_t __n) { ^ 3 warnings and 1 error generated. llvm-svn: 209878
* Test cases named with dates is a legacy rule not used now. Rename several ↵Hao Liu2014-05-304-0/+0
| | | | | | test cases. llvm-svn: 209877
* [OPENMP] Improve debug location codegen for OpenMP runtime library.Alexey Bataev2014-05-302-14/+23
| | | | llvm-svn: 209876
* [ELF] Fix incorrect sorting of .init_array / .fini_array sections.Simon Atanasyan2014-05-302-15/+65
| | | | | | | | | | | | | | | | | | | | | | The main problem is in the predicate passed to the `std::stable_sort()`. This predicate always returns false if **both** section's names do not start with `.init_array` or `.fini_array` prefixes. In short, it does not define a strict weak orderng. Suppose we have the following sections: .A .init_array.1 .init_array.2 The predicate states that: not .init_array.1 < .A not .A < .init_array.2 but .init_array.1 < .init_array.2 !!! The second problem is that `.init_array` section without number should go last in the list. Not it has the lowest priority '0' and goes first. The patch fixes both of the problems. llvm-svn: 209875
* Fix 'this' capturing Generic lambdas used within default initializers (PR19876) Faisal Vali2014-05-302-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=19876 The following C++1y code results in a crash: struct X { int m = 10; int n = [this](auto) { return m; }(20); }; When implicitly instantiating the generic lambda's call operator specialization body, Sema is unable to determine the current 'this' type when transforming the MemberExpr 'm' - since it looks for the nearest enclosing FunctionDeclDC - which is obviously null. I considered two ways to fix this: 1) In InstantiateFunctionDefinition, when the context is saved after the lambda scope info is created, retain the 'this' pointer. 2) Teach getCurrentThisType() to recognize it is within a generic lambda within an NSDMI/default-initializer and return the appropriate this type. I chose to implement #2 (though I confess I do not have a compelling reason for choosing it over #1). Richard Smith accepted the patch: http://reviews.llvm.org/D3935 Thank you! llvm-svn: 209874
* Allow vectorization of intrinsics such as powi,cttz and ctlz in Loop and SLP ↵Karthik Bhat2014-05-305-2/+426
| | | | | | | | | | Vectorizer. This patch adds support to vectorize intrinsics such as powi, cttz and ctlz in Vectorizer. These intrinsics are different from other intrinsics as second argument to these function must be same in order to vectorize them and it should be represented as a scalar. Review: http://reviews.llvm.org/D3851#inline-32769 and http://reviews.llvm.org/D3937#inline-32857 llvm-svn: 209873
* Add a trivial ArrayRef helper overload to the SelectionDAG interface.Chandler Carruth2014-05-301-0/+6
| | | | | | | I'm using this pretty frequently in a patch I'm working on and it seems generally useful. llvm-svn: 209872
* Remove use of comma operator.Richard Trieu2014-05-301-2/+5
| | | | llvm-svn: 209871
* When analyzing params/args for readnone/readonly, don't forget to consider ↵Nick Lewycky2014-05-303-2/+33
| | | | | | that a pointer argument may be passed through a callsite to the return, and that we may need to analyze it. Fixes a bug reported on llvm-dev: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073098.html llvm-svn: 209870
* PR11410 - Confusing diagnostic when trailing array element tries to call ↵Nikola Smiljanic2014-05-303-3/+22
| | | | | | deleted default constructor llvm-svn: 209869
* [mach-o] Wire up mach-o binary reader to reader registryNick Kledzik2014-05-301-0/+48
| | | | llvm-svn: 209868
* PR12214 - Warn on suspicious self-compound-assignments.Nikola Smiljanic2014-05-303-2/+6
| | | | llvm-svn: 209867
* [X86] Move test from r209863 to CodeGen/X86Adam Nemet2014-05-291-0/+0
| | | | | | We should only run this if X86 is in the targets. llvm-svn: 209866
* [mach-0] Add support for parsing compact unwind info sectionNick Kledzik2014-05-294-0/+176
| | | | llvm-svn: 209865
* [X86] Remove AVX1 vbroadcast intrinsicsAdam Nemet2014-05-293-48/+17
| | | | | | | | | | | | | | | | | | | | | The corresponding CFE patch replaces these intrinsics with vector initializers in avxintrin.h. This patch removes the LLVM intrinsics from the backend. We now stop lowering at X86ISD::VBROADCAST custom node rather than lowering that further to the intrinsics. The patch only changes VBROADCASTS* and leaves VBROADCAST[FI]128 to continue to use intrinsics. As explained in the CFE patch, the reason is that we currently don't generate as good code for them without the intrinsics. CodeGen/X86/avx-vbroadcast.ll already provides coverage for this change. It checks that for a series of insertelements we generate the appropriate vbroadcast instruction. Also verified that there was no assembly change in the test-suite before and after this patch. llvm-svn: 209864
* [X86] Auto-upgrade AVX1 vbroadcast intrinsicsAdam Nemet2014-05-292-0/+57
| | | | | | | | | | | | | They are replaced with the same IR that is generated for the vector-initializers in avxintrin.h. The test verifies that we get back the original instruction. I haven't seen this approach to be used in other auto-upgrade tests (i.e. llc + FileCheck) but I think it's the most direct way to test this case. I believe this should work because llc upgrades calls during parsing. (Other tests mostly check that assembling and disassembling yields the upgraded IR.) llvm-svn: 209863
* Mark currently failing ARM tests with XFAIL.Greg Fitzgerald2014-05-2920-0/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D3857 llvm-svn: 209862
* Mark unstable tests as Unsupported on ARMGreg Fitzgerald2014-05-294-0/+8
| | | | | | | | This is half the patch from: http://reviews.llvm.org/D3857 It lets us get deterministic results from the rest of the test suite. llvm-svn: 209861
* And fix my fix to sink down through the type at the right time. MyChandler Carruth2014-05-291-8/+9
| | | | | | | | | original fix would actually trigger the *exact* same crasher as the original bug for a different reason. Awesomesauce. Working on test cases now, but wanted to get bots healthier. llvm-svn: 209860
* Permit the "if" literal suffix with Microsoft extensions enabled.Peter Collingbourne2014-05-292-2/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D3963 llvm-svn: 209859
* [mach-o] Add support for parsing __eh_frame section. Generalize support for ↵Nick Kledzik2014-05-293-21/+180
| | | | | | whether symbols in a section are ignored or illegal llvm-svn: 209858
* Fix one bug in the latest incarnation of r209843 -- combining GEPsChandler Carruth2014-05-291-8/+13
| | | | | | | | | | across PHI nodes. The code was computing the Idxs from the 'GEP' variable's indices when what it wanted was Op1's indices. This caused an ASan heap-overflow for me that pin pointed the issue when Op1 had more indices than GEP did. =] I'll let Louis add a specific test case for this if he wants. llvm-svn: 209857
* light up sanitizers for ARM, take 2Greg Fitzgerald2014-05-294-13/+35
| | | | | | Differential Revision: http://reviews.llvm.org/D3794 llvm-svn: 209856
* Sync list of targets with configure's realityJeroen Ketema2014-05-291-8/+6
| | | | llvm-svn: 209855
* LoopVectorizer: Add a check that the backedge taken count + 1 does not overflowArnold Schwaighofer2014-05-293-34/+123
| | | | | | | | | | | The loop vectorizer instantiates be-taken-count + 1 as the loop iteration count. If this expression overflows the generated code was invalid. In case of overflow the code now jumps to the scalar loop. Fixes PR17288. llvm-svn: 209854
* Added tests for shufflevector lowering to blend instrs.Filipe Cabecinhas2014-05-293-0/+69
| | | | | | | | | | | | | | | | | | | | These tests ensure that a change I will propose in clang works as expected. Summary: Added tests for the generation of blend+immediate instructions from a shufflevector. These tests were proposed along with a patch that was dropped. I'm committing the tests anyway to protect against possible regressions in codegen. Reviewers: nadav, bkramer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D3600 llvm-svn: 209853
* iOS simulator cleanup to make sure we use "*-apple-ios" for iOS simulator ↵Greg Clayton2014-05-298-81/+302
| | | | | | | | | | | | | | | | | | apps and binaries. Changes include: - ObjectFileMachO can now determine if a binary is "*-apple-ios" or "*-apple-macosx" by checking the min OS and SDK load commands - ArchSpec now says "<arch>-apple-macosx" is equivalent to "<arch>-apple-ios" since the simulator mixes and matches binaries (some from the system and most from the iOS SDK). - Getting process inforamtion on MacOSX now correctly classifies iOS simulator processes so they have "*-apple-ios" architectures in the ProcessInstanceInfo - PlatformiOSSimulator can now list iOS simulator processes correctly instead of showing nothing by using: (lldb) platform select ios-simulator (lldb) platform process list - debugserver can now properly return "*-apple-ios" for the triple in the process info packets for iOS simulator executables - GDBRemoteCommunicationClient now correctly passes along the triples it gets for process info by setting the OS in the llvm::Triple correctly <rdar://problem/17060217> llvm-svn: 209852
* Revert "light up sanitizers for ARM"Greg Fitzgerald2014-05-294-31/+13
| | | | | | | | This commit broke the Windows build, where CMAKE_C_COMPILER can compile and link with -march=armv7-a but the just-built-clang cannot. llvm-svn: 209851
* Add more log related float constantsJeroen Ketema2014-05-291-0/+3
| | | | llvm-svn: 209850
* Fix _F definitionsJeroen Ketema2014-05-291-2/+2
| | | | | | | | | The 'f' was missing and, hence, the values were considered to be doubles instead of floats. Reviewed by: Tom Stellard llvm-svn: 209849
* Add definition for M_PIJeroen Ketema2014-05-291-0/+1
| | | | | | Reviewed by: Tom Stellard llvm-svn: 209848
* Thread Safety Analysis: implement review suggestions from Aaron Ballman.DeLesley Hutchins2014-05-294-27/+38
| | | | llvm-svn: 209847
* Implement AVX1 vbroadcast intrinsics with vector initializersAdam Nemet2014-05-294-9/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These intrinsics are special because they directly take a memory operand (AVX2 adds the register counterparts). Typically, other non-memop intrinsics take registers and then it's left to isel to fold memory operands. In order to LICM intrinsics directly reading memory, we require that no stores are in the loop (LICM) or that the folded load accesses constant memory (MachineLICM). When neither is the case we fail to hoist a loop-invariant broadcast. We can work around this limitation if we expose the load as a regular load and then just implement the broadcast using the vector initializer syntax. This exposes the load to LICM and other optimizations. At the IR level this is translated into a series of insertelements. The sequence is already recognized as a broadcast so there is no impact on the quality of codegen. _mm256_broadcast_pd and _mm256_broadcast_ps are not updated by this patch because right now we lack the DAG-combiner smartness to recover the broadcast instructions. This will be tackled in a follow-on. There will be completing changes on the LLVM side to remove the LLVM intrinsics and to auto-upgrade bitcode files. Fixes <rdar://problem/16494520> llvm-svn: 209846
* gdb-remote testing: new test, cleaned up socket reading.Todd Fiala2014-05-295-129/+521
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new SocketPacketPump class to decouple gdb remote packet reading from packet expectations code. This allowed for cleaner implementation of the separate $O output streams (non-deterministic packaging of inferior stdout/stderr) from all the rest of the packets. Added a packet expectation matcher that can match expected accumulated output with a timeout. Use a dictionary with "type":"output_match". See lldbgdbserverutils.MatchRemoteOutputEntry for details. Added a gdb remote test to verify that $Hc (continue thread selection) plus signal delivery ($C{signo}) works. Having trouble getting this to pass with debugserver on MacOSX 10.9. Tried different variants, including $vCont;C{signo}:{thread-id};c. In some cases, I get the test exe's signal handler to run ($vCont variant first time), in others I don't ($vCont second and further times). $C{signo} doesn't hit the signal handler code at all in the test exe but delivers a stop. Further $Hc and $C{signo} deliver the stop marking the wrong thread. For now I'm marking the test as XFAIL on dsym/debugserver. Will revisit this on lldb-dev. Updated the text exe for these tests to support thread:print-ids (each thread announces its thread id) and provide a SIGUSR1 thread handler that prints out the thread id on which it was signaled. llvm-svn: 209845
* [mach-o] Add support for parsing CFString sectionsNick Kledzik2014-05-294-25/+236
| | | | llvm-svn: 209844
* Add support for combining GEPs across PHI nodesLouis Gerbarg2014-05-292-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | Currently LLVM will generally merge GEPs. This allows backends to use more complex addressing modes. In some cases this is not happening because there is PHI inbetween the two GEPs: GEP1--\ |-->PHI1-->GEP3 GEP2--/ This patch checks to see if GEP1 and GEP2 are similiar enough that they can be cloned (GEP12) in GEP3's BB, allowing GEP->GEP merging (GEP123): GEP1--\ --\ --\ |-->PHI1-->GEP3 ==> |-->PHI2->GEP12->GEP3 == > |-->PHI2->GEP123 GEP2--/ --/ --/ This also breaks certain use chains that are preventing GEP->GEP merges that the the existing instcombine would merge otherwise. Tests included. llvm-svn: 209843
* Thread Safety Analysis: minor changes to TIL pretty-printing.DeLesley Hutchins2014-05-292-21/+23
| | | | llvm-svn: 209842
* Add documentation for -Rpass*Diego Novillo2014-05-292-0/+71
| | | | | | | | | | | | | | Summary: This adds documentation for -Rpass, -Rpass-missed and -Rpass-analysis. It also adds release notes for 3.5. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3730 llvm-svn: 209841
* Update Credits.Chad Rosier2014-05-291-2/+12
| | | | llvm-svn: 209840
* Add flags -Rpass-missed and -Rpass-analysis.Diego Novillo2014-05-298-50/+161
| | | | | | | | | | | | | | | | | | | | | | Summary: These two flags are in the same family as -Rpass, but are used in different situations. -Rpass-missed is used by optimizers to inform the user when they tried to apply an optimization but couldn't (or wouldn't). -Rpass-analysis is used by optimizers to report analysis results back to the user (e.g., why the transformation could not be applied). Depends on D3682. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3683 llvm-svn: 209839
* implement missing SCEVDivision caseSebastian Pop2014-05-291-0/+9
| | | | | | | | without this case we would end on an infinite recursion: the remainder is zero, so Numerator - Remainder is equal to Numerator and so we would recursively ask for the division of Numerator by Denominator. llvm-svn: 209838
* fail to find dimensions when ElementSize is nullptrSebastian Pop2014-05-291-1/+1
| | | | | | | | when ScalarEvolution::getElementSize returns nullptr it is safe to early return in ScalarEvolution::findArrayDimensions such that we avoid later problems when we try to divide the terms by ElementSize. llvm-svn: 209837
* Make the -mno-global-merge option work for arm64/aarch64. rdar://17024719Bob Wilson2014-05-292-0/+16
| | | | llvm-svn: 209836
* light up sanitizers for ARMGreg Fitzgerald2014-05-294-13/+31
| | | | | | | | | | | | You can expect the sanitizers to be built under any of the following conditions: 1) CMAKE_C_COMPILER is GCC built to cross-compile to ARM 2) CMAKE_C_COMPILER is Clang built to cross-compile to ARM (ARM is default target) 3) CMAKE_C_COMPILER is Clang and CMAKE_C_FLAGS contains -target and --sysroot Differential Revision: http://reviews.llvm.org/D3794 llvm-svn: 209835
* Use range-based for loops in ASan, TSan and MSanAlexey Samsonov2014-05-293-97/+81
| | | | llvm-svn: 209834
OpenPOWER on IntegriCloud