summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve C API support for atomicrmw and cmpxchg.Nick Lewycky2019-09-264-22/+125
| | | | | | | | | | | | | | atomicrmw and cmpxchg have a volatile flag, so allow them to be get and set with LLVM{Get,Set}Volatile. atomicrmw and fence have orderings, so allow them to be get and set with LLVM{Get,Set}Ordering. Add missing LLVMAtomicRMWBinOpFAdd and LLVMAtomicRMWBinOpFSub enum constants. AtomicCmpXchg also has a weak flag, add a getter/setter for that too. Add a getter/setter for the binary-op of an atomicrmw. atomicrmw and cmpxchg have a volatile flag, so allow it to be set/get with LLVMGetVolatile and LLVMSetVolatile. Add missing LLVMAtomicRMWBinOpFAdd and LLVMAtomicRMWBinOpFSub enum constants. AtomicCmpXchg also has a weak flag, add a getter/setter for that too. Add a getter/setter for the binary-op of an atomicrmw. Add LLVMIsA## for CatchSwitchInst, CallBrInst and FenceInst, as well as AtomicCmpXchgInst and AtomicRMWInst. Update llvm-c-test to include atomicrmw and fence, and to copy volatile for the four applicable instructions. Differential Revision: https://reviews.llvm.org/D67132 llvm-svn: 372938
* [libFuzzer] [NFC] Fix grammar error with "it's"Mitch Phillips2019-09-262-2/+2
| | | | llvm-svn: 372937
* [libTooling] Add `run` combinator to Stencils.Yitzhak Mandelbaum2019-09-263-0/+45
| | | | | | | | | | | | | | | | Summary: This revision adds `run`, a StencilPart that runs a user-defined function that computes a result over `MatchFinder::MatchResult`. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67969 llvm-svn: 372936
* [TargetLowering] Make allowsMemoryAccess methode virtual.Thomas Raoux2019-09-269-32/+67
| | | | | | | | | | | Rename old function to explicitly show that it cares only about alignment. The new allowsMemoryAccess call the function related to alignment by default and can be overridden by target to inform whether the memory access is legal or not. Differential Revision: https://reviews.llvm.org/D67121 llvm-svn: 372935
* [MC][WebAssembly] Error on data symbols in the text section.Sam Clegg2019-09-252-1/+16
| | | | | | | | | Previously we had an assert but this can actually occur in valid user code so we need to handle this in release builds too. Differential Revision: https://reviews.llvm.org/D67997 llvm-svn: 372934
* [X86] Use VR512_0_15RegClass intead of VR512RegClass in X86VZeroUpper.Craig Topper2019-09-251-4/+2
| | | | | | | | | | | | | | This pass is only concerned with ZMM0-15 and YMM0-15. For YMM we use VR256 which only contains YMM0-15, but for ZMM we were using VR512 which contains ZMM0-31. Using VR512_0_15 is more correct. Given that the ABI and register allocator will use registers in order, its unlikely that register from 16-31 would be used without also using 0-15. So this probably doesn't functionally matter. llvm-svn: 372933
* [MemorySSA] Avoid adding Phis in the presence of unreachable blocks.Alina Sbirlea2019-09-257-77/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If a block has all incoming values with the same MemoryAccess (ignoring incoming values from unreachable blocks), then use that incoming MemoryAccess and do not create a Phi in the first place. Revert IDF work-around added in rL372673; it should not be required unless the Def inserted is the first in its block. The patch also cleans up a series of tests, added during the many iterations on insertDef. The patch also fixes PR43438. The same issue that occurs in insertDef with "adding phis, hence the IDF of Phis is needed", can also occur in fixupDefs: the `getPreviousRecursive` call only adds Phis walking on the predecessor edges, which means there may be the case of a Phi added walking the CFG "backwards" which triggers the needs for an additional Phi in successor blocks. Such Phis are added during fixupDefs only in the presence of unreachable blocks. Hence this highlights the need to avoid adding Phis in blocks with unreachable predecessors in the first place. Reviewers: george.burgess.iv Subscribers: Prazek, sanjoy.google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67995 llvm-svn: 372932
* [InstCombine] foldUnsignedUnderflowCheck(): one last pattern with 'sub' ↵Roman Lebedev2019-09-252-8/+14
| | | | | | | | (PR43251) https://rise4fun.com/Alive/0j9 llvm-svn: 372930
* [NFC][InstCombine] Tests for 'base u<= offset && (base - offset) != 0' ↵Roman Lebedev2019-09-251-0/+33
| | | | | | pattern (PR43251) llvm-svn: 372929
* [InstSimplify] Handle more 'A </>/>=/<= B &&/|| (A - B) !=/== 0' patterns ↵Roman Lebedev2019-09-253-28/+22
| | | | | | | | | | | (PR43251) https://rise4fun.com/Alive/sl9s https://rise4fun.com/Alive/2plN https://bugs.llvm.org/show_bug.cgi?id=43251 llvm-svn: 372928
* [NFC][InstSimplify] More exaustive test coverage for 'A </>/>=/<= B &&/|| (A ↵Roman Lebedev2019-09-251-68/+245
| | | | | | - B) !=/== 0' pattern (PR43251) llvm-svn: 372927
* Simplify -fms-compatibility include lookup logic, NFCReid Kleckner2019-09-252-11/+12
| | | | | | | | | | | This include search logic has an extra parameter to deal with Windows includes with backslashes, which get normalized to forward slashes on non-Windows under -fms-compatibility. Hoist the conditional operator out of LookupHeaderIncludeOrImport and pass the result in instead of repeating the ?: expression everywhere. llvm-svn: 372926
* Fix memory leak in DeclTest.Evgeniy Stepanov2019-09-251-1/+2
| | | | | | | | | | | | Fixes a leak introduced in r372903, detected on the ASan bot. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/35430/steps/check-clang%20asan/logs/stdio Direct leak of 192 byte(s) in 1 object(s) allocated from: #0 0x561d88 in operator new(unsigned long) /b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:105 #1 0x1a48779 in clang::ItaniumMangleContext::create(clang::ASTContext&, clang::DiagnosticsEngine&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/AST/ItaniumMangle.cpp:5134:10 #2 0xdff000 in Decl_AsmLabelAttr_Test::TestBody() /b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/unittests/AST/DeclTest.cpp:97:23 llvm-svn: 372925
* [LICM] Don't verify domtree/loopinfo unless EXPENSIVE_CHECKS is enabled.Eli Friedman2019-09-251-1/+1
| | | | | | | | | For large functions, verifying the whole function after each loop takes non-linear time. Differential Revision: https://reviews.llvm.org/D67571 llvm-svn: 372924
* [Verifier] add invariant check for callbrNick Desaulniers2019-09-254-17/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The list of indirect labels should ALWAYS have their blockaddresses as argument operands to the callbr (but not necessarily the other way around). Add an invariant that checks this. The verifier catches a bad test case that was added recently in r368478. I think that was a simple mistake, and the test was made less strict in regards to the precise addresses (as those weren't specifically the point of the test). This invariant will be used to find a reported bug. Link: https://www.spinics.net/lists/arm-kernel/msg753473.html Link: https://github.com/ClangBuiltLinux/linux/issues/649 Reviewers: craig.topper, void, chandlerc Reviewed By: void Subscribers: ychen, lebedev.ri, javed.absar, kristof.beyls, hiraditya, llvm-commits, srhines Tags: #llvm Differential Revision: https://reviews.llvm.org/D67196 llvm-svn: 372923
* [libcxxabi] Fix arm build failer with libgccAdhemerval Zanella2019-09-252-2/+12
| | | | | | | | | | | | | | | | | | | | Both arm32 armv7/armv8 bots which do not use compiler-rt are failing to a linking issue: [100%] Built target cxxabi_static CMakeFiles/cxxabi_shared.dir/cxa_demangle.cpp.o: In function `(anonymous namespace)::itanium_demangle::OutputStream::writeUnsigned(unsigned long long, bool)': /home/buildslave/buildslave/libcxx-libcxxabi-libunwind-armv7-linux-noexceptions/llvm/projects/libcxxabi/src/demangle/Utility.h:55: undefined reference to `__aeabi_uldivmod' /home/buildslave/buildslave/libcxx-libcxxabi-libunwind-armv7-linux-noexceptions/llvm/projects/libcxxabi/src/demangle/Utility.h:56: undefined reference to `__aeabi_uldivmod' clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) It seems after r371273 OutputStream is used more extensively and is pulling OutputStream::writeUnsigned (which thus requires unsigned integer module). The straightfoward fix is to explicit link against libgcc if compiler-rt is not used. llvm-svn: 372921
* [Dwarf] Fix switch cases that take an dw_tag_t.Jonas Devlieghere2019-09-253-0/+10
| | | | | | Now that dw_tag_t is an enum, a default case is required. llvm-svn: 372920
* [clang-format] Modified SortIncludes and IncludeCategories to priority for ↵Paul Hoad2019-09-257-4/+108
| | | | | | | | | | | | | | | | | | | | | | | | | sorting #includes within the Group Category. Summary: This new Style rule is made as a part of adding support for NetBSD KNF in clang-format. NetBSD have it's own priority of includes which should be followed while formatting NetBSD code. This style sorts the Cpp Includes according to the priorities of NetBSD, as mentioned in the [Style Guide](http://cvsweb.netbsd.org/bsdweb.cgi/src/share/misc/style?rev=HEAD&content-type=text/x-cvsweb-markup) The working of this Style rule shown below: **Configuration:** This revision introduces a new field under IncludeCategories named `SortPriority` which defines the priority of ordering the `#includes` and the `Priority` will define the categories for grouping the `#include blocks`. Reviewers: cfe-commits, mgorny, christos, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: lebedev.ri, rdwampler, christos, mgorny, krytarowski Patch By: Manikishan Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D64695 llvm-svn: 372919
* [libTooling][NFC] Switch StencilTest.cpp to use EXPECT_THAT_EXPECTEDYitzhak Mandelbaum2019-09-251-21/+4
| | | | | | | | | | | | | | | | Summary: Currently, some tests use homegrown matchers to handle `llvm::Expected` values. This revision standardizes on EXPECT_THAT_EXPECTED and `HasValue`. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67973 llvm-svn: 372918
* [OPENMP50]Parsing/sema support for 'implementation/vendor' contextAlexey Bataev2019-09-2512-57/+237
| | | | | | | | | selector. Added basic parsing/semantic support for 'implementation={vendor(<vendor>)}' context selector. llvm-svn: 372917
* [libc++] Purge mentions of GCC 4 from the test suiteLouis Dionne2019-09-2525-59/+6
| | | | | | | | | We don't support GCC 4 and older according to the documentation, so we should pretend it doesn't exist. This is a re-application of r372787. llvm-svn: 372916
* [InstSimplify] Match 1.0 and 0.0 for both operands in SimplifyFMAMulFlorian Hahn2019-09-252-3/+10
| | | | | | | | | | | | | | | | | | Because we do not constant fold multiplications in SimplifyFMAMul, we match 1.0 and 0.0 for both operands, as multiplying by them is guaranteed to produce an exact result (if it is allowed to do so). Note that it is not enough to just swap the operands to ensure a constant is on the RHS, as we want to also cover the case with 2 constants. Reviewers: lebedev.ri, spatel, reames, scanon Reviewed By: lebedev.ri, reames Differential Revision: https://reviews.llvm.org/D67553 llvm-svn: 372915
* [lit] Do a better job at parsing unsupported tests.Jonas Devlieghere2019-09-251-0/+5
| | | | | | | | | | | | | When all the tests run by dotest are unsupported, it still reports RESULT: PASSED which we translate to success for lit. We can better report the status as unsupported when we see that there are unsupported tests but no passing tests. This will not affect the situation where there are failures or unexpected passes, because those report a non-zero exit code. Differential revision: https://reviews.llvm.org/D68039 llvm-svn: 372914
* [InstCombine] Fold (A - B) u>=/u< A --> B u>/u<= A iff B != 0Roman Lebedev2019-09-255-28/+22
| | | | | | | | | | | | | https://rise4fun.com/Alive/KtL This also shows that the fold added in D67412 / r372257 was too specific, and the new fold allows those test cases to be handled more generically, therefore i delete now-dead code. This is yet again motivated by D67122 "[UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour" llvm-svn: 372912
* [NFC][InstCombine] Add tests for (X - Y) < X --> Y <= X iff Y != 0Roman Lebedev2019-09-251-0/+111
| | | | | | | | https://rise4fun.com/Alive/KtL This should go to InstCombiner::foldICmpBinO(), next to "Convert sub-with-unsigned-overflow comparisons into a comparison of args." llvm-svn: 372911
* [MSP430] Allow msp430_intrcc functions to not have interrupt attribute.Vadzim Dambrouski2019-09-252-3/+14
| | | | | | | | | | | | | | | | | | Summary: Useful in case you want to have control over interrupt vector generation. For example in Rust language we have an arrangement where all unhandled ISR vectors gets mapped to a single default handler function. Which is hard to implement when LLVM tries to generate vectors on its own. Reviewers: asl, krisb Subscribers: hiraditya, JDevlieghere, awygle, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67313 llvm-svn: 372910
* Add forward declaration of operator<< in <string_view> as required.Eric Fiselier2019-09-253-1/+34
| | | | | | | | This declaration was previously missing despite appearing in the synopsis. Users are still required to include <ostream> to get the definition of the streaming operator. llvm-svn: 372909
* [AMDGPU] Improve fma.f64 test. NFC.Stanislav Mekhanoshin2019-09-251-1/+154
| | | | llvm-svn: 372908
* add tests that debug mode catches nullptr->string_view conversions in ↵Eric Fiselier2019-09-251-0/+5
| | | | | | comparison operators llvm-svn: 372907
* [AMDGPU] gfx10 v_fmac_f16 operand foldingStanislav Mekhanoshin2019-09-252-13/+20
| | | | | | | | Fold immediates into v_fmac_f16. Differential Revision: https://reviews.llvm.org/D68037 llvm-svn: 372906
* [lldb] Excludes private headers from SWIG dependency.Haibo Huang2019-09-251-0/+6
| | | | | | | | | | | | Reviewers: xiaobai Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68040 llvm-svn: 372905
* [emacs] simplify and improve keyword highlighting in tablegen-mode.elBob Haarman2019-09-251-3/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: The keyword and type keyword matchers in tablegen-mode.el checked for space, newline, tab, or open paren after the regular expression that matches keywords (or type keywords, respectively). This is unnecessary, because those regular expressions already include word boundaries. This change removes the extra check. This also causes "def" in "def:" to be highlighted as a keyword, which was missed before. Reviewers: lattner, MaskRay Reviewed By: MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68002 llvm-svn: 372904
* [Mangle] Add flag to asm labels to disable '\01' prefixingVedant Kumar2019-09-256-14/+110
| | | | | | | | | | | | | | LLDB synthesizes decls using asm labels. These decls cannot have a mangle different than the one specified in the label name. I.e., the '\01' prefix should not be added. Fixes an expression evaluation failure in lldb's TestVirtual.py on iOS. rdar://45827323 Differential Revision: https://reviews.llvm.org/D67774 llvm-svn: 372903
* [NFC] Add { } to silence compiler warning [-Wmissing-braces].Huihui Zhang2019-09-251-1/+1
| | | | | | | | | llvm-project/llvm/unittests/ADT/ArrayRefTest.cpp:254:25: warning: suggest braces around initialization of subobject [-Wmissing-braces] std::array<int, 5> A1{42, -5, 0, 1000000, -1000000}; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ { } llvm-svn: 372902
* [CMake] Add the system debugserver to lldb-test-deps.Jonas Devlieghere2019-09-251-0/+1
| | | | | | | When using the system debugserver we create a target to copy it over. This target has to be added to lldb-test-deps. llvm-svn: 372901
* [CMake] Run the lldb-server tests with system debugserver.Jonas Devlieghere2019-09-251-1/+1
| | | | | | | Now that we no longer build debugserver when LLDB_USE_SYSTEM_DEBUGSERVER is set, we have to change the logic for testing lldb-server. llvm-svn: 372900
* [InstCombine] Limit FMul constant folding for fma simplifications.Florian Hahn2019-09-254-22/+112
| | | | | | | | | | | | | | | | | As @reames pointed out post-commit, rL371518 adds additional rounding in some cases, when doing constant folding of the multiplication. This breaks a guarantee llvm.fma makes and must be avoided. This patch reapplies rL371518, but splits off the simplifications not requiring rounding from SimplifFMulInst as SimplifyFMAFMul. Reviewers: spatel, lebedev.ri, reames, scanon Reviewed By: reames Differential Revision: https://reviews.llvm.org/D67434 llvm-svn: 372899
* [CUDA][HIP] Enable kernel function return type deduction.Michael Liao2019-09-255-2/+65
| | | | | | | | | | | | | | | | | Summary: - Even though only `void` is still accepted as the deduced return type, enabling deduction/instantiation on the return type allows more consistent coding. Reviewers: tra, jlebar Subscribers: cfe-commits, yaxunl Tags: #clang Differential Revision: https://reviews.llvm.org/D68031 llvm-svn: 372898
* [AArch64][GlobalISel] Choose CCAssignFns per-argument for tail call loweringJessica Paquette2019-09-254-44/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | When checking for tail call eligibility, we should use the correct CCAssignFn for each argument, rather than just checking if the caller/callee is varargs or not. This is important for tail call lowering with varargs. If we don't check it, then basically any varargs callee with parameters cannot be tail called on Darwin, for one thing. If the parameters are all guaranteed to be in registers, this should be entirely safe. On top of that, not checking for this could potentially make it so that we have the wrong stack offsets when checking for tail call eligibility. Also refactor some of the stuff for CCAssignFnForCall and pull it out into a helper function. Update call-translator-tail-call.ll to show that we can now correctly tail call on Darwin. Also add two extra tail call checks. The first verifies that we still respect the caller's stack size, and the second verifies that we still don't tail call when a varargs function has a memory argument. Differential Revision: https://reviews.llvm.org/D67939 llvm-svn: 372897
* Add a missing default parameter to regex::assign. This is LWG3296; reviewed ↵Marshall Clow2019-09-252-6/+16
| | | | | | as https://reviews.llvm.org/D67944 llvm-svn: 372896
* [lldb] Move swig call from python code to cmakeHaibo Huang2019-09-253-629/+24
| | | | | | | | | | | | | | Summary: Elimiates lots of unused code. Reviewers: labath, mgorny Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68007 llvm-svn: 372895
* [Docs] Document forwarding arguments with litJonas Devlieghere2019-09-251-0/+8
| | | | | | Explain how to forward arguments to dotest.py from lit. llvm-svn: 372894
* [CodeGen] Replace -max-jump-table-size with -max-jump-table-targetsEvandro Menezes2019-09-259-107/+104
| | | | | | | | | | | | | | | | | | | | | | | Modern processors predict the targets of an indirect branch regardless of the size of any jump table used to glean its target address. Moreover, branch predictors typically use resources limited by the number of actual targets that occur at run time. This patch changes the semantics of the option `-max-jump-table-size` to limit the number of different targets instead of the number of entries in a jump table. Thus, it is now renamed to `-max-jump-table-targets`. Before, when `-max-jump-table-size` was specified, it could happen that cluster jump tables could have targets used repeatedly, but each one was counted and typically resulted in tables with the same number of entries. With this patch, when specifying `-max-jump-table-targets`, tables may have different lengths, since the number of unique targets is counted towards the limit, but the number of unique targets in tables is the same, but for the last one containing the balance of targets. Differential revision: https://reviews.llvm.org/D60295 llvm-svn: 372893
* [LangRef] Clarify absence of rounding guarantees for fmuladd.Florian Hahn2019-09-251-6/+6
| | | | | | | | | | | | | During the review of D67434, it was recommended to make fmuladd's behavior more explicit. D67434 depends on this interpretation. Reviewers: efriedma, jfb, reames, scanon, lebedev.ri, spatel Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D67552 llvm-svn: 372892
* [Dwarf] Make dw_tag_t a typedef for llvm::dwarf::Tag instead of uint16_t.Jonas Devlieghere2019-09-257-11/+13
| | | | | | | | | | | | Currently dw_tag_t is a typedef for uint16_t. This patch changes makes dw_tag_t a typedef for llvm::dwarf::Tag. This enables us to use the full power of the DWARF utilities in LLVM without having to do the cast every time. With this approach, we only have to do the cast when reading the ULEB value. Differential revision: https://reviews.llvm.org/D68005 llvm-svn: 372891
* Modernize Makefile.Adrian Prantl2019-09-251-1/+1
| | | | llvm-svn: 372890
* Re-land r372863: [AST] Extract Decl::printNestedNameSpecifier helper from ↵Ilya Biryukov2019-09-253-20/+85
| | | | | | | | | | Decl::printQualifiedName Reverted in r372880 due to the test failure. Also contains a fix that adjusts printQualifiedName to return the same results as before in case of anonymous function locals and parameters. llvm-svn: 372889
* [clangd] Change constness of parameters to findExplicitRefsKadir Cetinkaya2019-09-252-6/+6
| | | | | | | | | | | | | | | | | | Summary: Recursive AST requires non-const ast nodes, but it doesn't really mutate them. In addition to that, in clangd we mostly have const ast nodes. So it makes sense to move the const_cast into callee rather than having it at every caller in the future. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68027 llvm-svn: 372888
* fixed test: eliminated race condition which might cause deadlockAndrey Churbanov2019-09-251-1/+1
| | | | llvm-svn: 372887
* [DAGCombiner] add one-use restriction to vector transform with cheap extractSanjay Patel2019-09-252-11/+8
| | | | | | | | | | We might be able to do better on the example in the test, but in general, we should not scalarize a splatted vector binop if there are other uses of the binop. Otherwise, we can end up with code as we had - a scalar op that is redundant with a vector op. llvm-svn: 372886
OpenPOWER on IntegriCloud