summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix nodiscard failure tests on compilers w/o -verify.Eric Fiselier2018-01-172-2/+13
| | | | | | | | | | | | | Previously .fail.cpp tests for nodiscard were run with -Wunused-result being a warning, not an error, when the compiler didn't support -verify. When -verify isn't enabled this change judiciously adds -Werror=unused-result when to only the failure tests containing the // expected-error string for nodiscard. As a drive-by change, this patch also adds a missing // UNSUPPORTED: c++2a to a test which was only supposed to run in C++ <= 11. llvm-svn: 322776
* [analyzer] NFC: Forbid array elements of void type.Artem Dergachev2018-01-173-4/+23
| | | | | | | | | | | | | | | Represent the symbolic value for results of pointer arithmetic on void pointers in a different way: instead of making void-typed element regions, make char-typed element regions. Add an assertion that ensures that no void-typed regions are ever constructed. This is a refactoring of internals that should not immediately affect the analyzer's (default) behavior. Differential Revision: https://reviews.llvm.org/D40939 llvm-svn: 322775
* [analyzer] operator new: Use the correct region for the constructor.Artem Dergachev2018-01-179-49/+395
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -analyzer-config c++-allocator-inlining experimental option allows the analyzer to reason about C++ operator new() similarly to how it reasons about regular functions. In this mode, operator new() is correctly called before the construction of an object, with the help of a special CFG element. However, the subsequent construction of the object was still not performed into the region of memory returned by operator new(). The patch fixes it. Passing the value from operator new() to the constructor and then to the new-expression itself was tricky because operator new() has no call site of its own in the AST. The new expression itself is not a good call site because it has an incorrect type (operator new() returns 'void *', while the new expression is a pointer to the allocated object type). Additionally, lifetime of the new expression in the environment makes it unsuitable for passing the value. For that reason, an additional program state trait is introduced to keep track of the return value. Finally this patch relaxes restrictions on the memory region class that are required for inlining the constructor. This change affects the old mode as well (c++-allocator-inlining=false) and seems safe because these restrictions were an overkill compared to the actual problems observed. Differential Revision: https://reviews.llvm.org/D40560 rdar://problem/12180598 llvm-svn: 322774
* Add a TargetOption to enable/disable GlobalISelVolkan Keles2018-01-175-26/+23
| | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a new target option in order to control GlobalISel. This will allow the users to enable/disable GlobalISel prior to the backend by calling `TargetMachine::setGlobalISel(bool Enable)`. No test case as there is already a test to check GlobalISel command line options. See: CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll. Reviewers: qcolombet, aemerson, ab, dsanders Reviewed By: qcolombet Subscribers: rovka, javed.absar, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D42137 llvm-svn: 322773
* Add support for emitting libcalls for x86_fp80 -> fp128 and vice-versaBenjamin Kramer2018-01-174-0/+39
| | | | | | compiler_rt doesn't provide them (yet), but libgcc does. PR34076. llvm-svn: 322772
* Add a ProfileCount class to represent entry counts.Easwaran Raman2018-01-1711-44/+114
| | | | | | | | | | | | | | Summary: The class wraps a uint64_t and an enum to represent the type of profile count (real and synthetic) with some helper methods. Reviewers: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41883 llvm-svn: 322771
* [X86][MMX] Add PR35982 test casesSimon Pilgrim2018-01-171-0/+123
| | | | | | FEMMS has the same problem as EMMS llvm-svn: 322770
* [RISCV] Propagate -mabi and -march values to GNU assembler.Ana Pazos2018-01-173-0/+27
| | | | | | | | | | | | | | | When using -fno-integrated-as flag, the gnu assembler produces code with some default march/mabi which later causes linker failure due to incompatible mabi/march. In this patch we explicitly propagate -mabi and -march flags to the GNU assembler. In this patch we explicitly propagate -mabi and -march flags to the GNU assembler. Differential Revision: https://reviews.llvm.org/D41271 llvm-svn: 322769
* Fix standalone test-suite run.Eric Fiselier2018-01-172-11/+20
| | | | | | | | | This patch updates libc++abi's HandleOutOfTreeLLVM.cmake to match libc++'s -- and more importantly, to fix a bug where llvm-lit wasn't found/created when libc++abi was built out-of-tree. This prevented the test suite from running. llvm-svn: 322768
* [LegalizeDAG] Fix ATOMIC_CMP_SWAP_WITH_SUCCESS legalization.Eli Friedman2018-01-175-17/+47
| | | | | | | | | | | | | The code wasn't zero-extending correctly, so the comparison could spuriously fail. Adds some AArch64 tests to cover this case. Inspired by D41791. Differential Revision: https://reviews.llvm.org/D41798 llvm-svn: 322767
* [polly] [ScopInfo] Don't use isl_val_get_num_si.Eli Friedman2018-01-172-8/+42
| | | | | | | | | | | | | | | | | isl_val_get_num_si crashes on overflow, so don't use it on arbitrary integers. Testcase only crashes on platforms where long is 32 bits because of the signature of isl_val_get_num_si; not sure if it's possible to write a testcase which crashes if long is 64 bits. There are a few other places in polly which use isl_val_get_num_si; they probably need to be fixed as well. I don't think polly uses any of the other "long" isl APIs in an unsafe manner. Differential Revision: https://reviews.llvm.org/D42129 llvm-svn: 322766
* [SCEV] Fix typo. NFC.Javed Absar2018-01-171-1/+1
| | | | | | Fix confusing typo in comment. llvm-svn: 322765
* [scudo] Limit by default the TSD pool to 2 on AndroidKostya Kortchinsky2018-01-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: jemalloc on Android currently uses 2 arenas (https://android.googlesource.com/platform/external/jemalloc/+/master/Android.bp#64). Since the Android toolchain absorbs compiler-rt and compiles it as is, we have to enforce the same limit to somehow stay competitive in terms of memory usage. The changes could either go in: - `scudo_platform.h` with a default for Android of 2 (this is the solution implemented here); - in `CMakeLists.txt` adding -DSCUDO_SHARED_TSD_POOL_SIZE=2 for Android. - something else? I don't have a strong opinion on how to do it, but it has to be done upstream anyway. Reviewers: alekseyshl, eugenis Reviewed By: alekseyshl, eugenis Subscribers: srhines, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42194 llvm-svn: 322764
* rootn: Port from amd_builtinsJan Vesely2018-01-179-0/+399
| | | | | | | | | | | | Passes piglit on turks and carrizo fp64 passes ctx on carrizo v2: fix formatting check fp32 denormal support at runtime Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322763
* powr: Port from amd_builtinsJan Vesely2018-01-176-0/+411
| | | | | | | | | | | | Passes piglit on turks and carrizo fp64 passes cts on carrizo v2: fix formatting check fp32 denormal support at runtime Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322762
* pown: Port from amd_builtinsJan Vesely2018-01-178-31/+395
| | | | | | | | | | | | Passes piglit on turks and carrizo fp64 passes CTS on carrizo v2: fix formatting check fp32 denormal support at runtime Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322761
* pow: Port from amd_builtinsJan Vesely2018-01-178-6/+1096
| | | | | | | | | | | | Passes piglit on turks and carrizo fp64 passes CTS on carrizo v2: fix formatting check fp32 denormal support at runtime Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322760
* [clang-tidy] Adding Fuchsia checker for trailing returnsJulie Hockett2018-01-178-1/+164
| | | | | | | | | | | | Adds a check to the Fuchsia module to warn if a function has a trailing return. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference. Differential Revision: https://reviews.llvm.org/D42116 llvm-svn: 322759
* A third attempt to mark TestRdar12408181.py as skippedVedant Kumar2018-01-171-1/+3
| | | | | | | | | | | | | Due to an unfortunate difference between the open source test harness and our internal harness, applying two @skip... decorators to this test works in the internal build but not in the open source build. I've tried another approach to skipping this test and tested it out with the open source harness. Hopefully this sticks! rdar://36417163 llvm-svn: 322756
* Reland "[libFuzzer] Support using libc++"Petr Hosek2018-01-178-36/+126
| | | | | | | | | | | | This is needed in case the users of libFuzzer use libc++ in their code, which the fuzz target (libFuzzer) will be linked against. When libc++ source is available, we build a private version of it and link it against libFuzzer which allows using the same static library against codebases which use both libc++ and libstdc++. Differential Revision: https://reviews.llvm.org/D37631 llvm-svn: 322755
* [globalisel][tablegen] Honour priority order within nested instructions.Daniel Sanders2018-01-172-0/+53
| | | | | | | | | | | It appears that we haven't been prioritizing rules that contain nested instructions properly. InstructionOperandMatcher didn't override isHigherPriorityThan so it never compared the instructions/operands/predicates inside nested instructions. Fixes PR35926. Thanks to Diana Picus for the bug report. llvm-svn: 322754
* [analyzer] introduce getSVal(Stmt *) helper on ExplodedNode, make sure the ↵George Karpenkov2018-01-1739-164/+115
| | | | | | | | | | | | | | | | | | helper is used consistently In most cases using `N->getState()->getSVal(E, N->getLocationContext())` is ugly, verbose, and also opens up more surface area for bugs if an inconsistent location context is used. This patch introduces a helper on an exploded node, and ensures consistent usage of either `ExplodedNode::getSVal` or `CheckContext::getSVal` across the codebase. As a result, a large number of redundant lines is removed. Differential Revision: https://reviews.llvm.org/D42155 llvm-svn: 322753
* [analyzer] Make isSubRegionOf reflexiveGeorge Karpenkov2018-01-176-10/+8
| | | | | | | | | All usages of isSubRegionOf separately check for reflexive case, and in any case, set theory tells us that each set is a subset of itself. Differential Revision: https://reviews.llvm.org/D42140 llvm-svn: 322752
* [WebAssembly] Simplify generation of "names" sectionSam Clegg2018-01-176-57/+37
| | | | | | | | | | | | | | | | Simplify generation of "names" section by simply iterating over the DefinedFunctions array. This even fixes some bugs, judging by the test changes required. Some tests are asserting that functions are named multiple times, other tests are asserting that the "names" section contains the function's alias rather than its original name Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42076 llvm-svn: 322751
* [analyzer] Better UI in html reports for displaying shortcuts helpGeorge Karpenkov2018-01-172-3/+48
| | | | | | | Make the help window accessible, but don't show by default. Use a different CSS class from macro. llvm-svn: 322750
* [clang-format] Replace unordered_set with an arrayKrasimir Georgiev2018-01-171-14/+5
| | | | | | | | | | | | | | Summary: This replaces an unordered_set from r322690 with an array and binary search. Reviewers: bkramer, benhamilton Reviewed By: bkramer, benhamilton Subscribers: jolesiak, benhamilton, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42189 llvm-svn: 322749
* Revert [PowerPC] This reverts commit rL322721Zaara Syeda2018-01-1717-507/+13
| | | | | | Failing build bots. Revert the commit now. llvm-svn: 322748
* [MDA] Use common code instead of reimplementing same. [NFC]Philip Reames2018-01-171-10/+2
| | | | llvm-svn: 322747
* [ASTMatchers] Add isNoReturn() match narrower for FunctionDeclarationsRoman Lebedev2018-01-174-0/+111
| | | | | | | | | | | | | | Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: dblaikie, klimek, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D41455 llvm-svn: 322746
* [WebAssembly] Remove DEBUG_FUNCTION_NAME after llvm changeSam Clegg2018-01-172-6/+0
| | | | | | | | Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42193 llvm-svn: 322745
* libcxx: Disable CFI in function std::get_temporary_buffer.Peter Collingbourne2018-01-171-0/+1
| | | | | | | | | The specification of this function mandates a cast to uninitialized T*, which is forbidden under CFI. Differential Revision: https://reviews.llvm.org/D42146 llvm-svn: 322744
* [GISel] Make constrainSelectedInstRegOperands() available to the legalizer. NFCAditya Nandakumar2018-01-178-62/+71
| | | | | | https://reviews.llvm.org/D42149 llvm-svn: 322743
* [DeclPrinter] Fix two cases that crash clang -ast-print.Artem Belevich2018-01-173-4/+21
| | | | | | | | | | | | | Both are related to handling anonymous structures. * clang didn't handle () around an anonymous struct variable. * clang also crashed on syntax errors that could lead to other syntactic constructs following the declaration of an anonymous struct. While the code is invalid, that's not a good reason to panic compiler. Differential Revision: https://reviews.llvm.org/D41788 llvm-svn: 322742
* [WebAssembly] Remove debug names from symbol tableSam Clegg2018-01-1712-61/+90
| | | | | | | | | | | | | | | | | | | | | | | | | Get rid of DEBUG_FUNCTION_NAME symbols. When we actually debug data, maybe we'll want somewhere to put it... but having a symbol that just stores the name of another symbol seems odd. It means you have multiple Symbols with the same name, one containing the actual function and another containing the name! Store the names in a vector on the WasmObjectFile when reading them in. Also stash them on the WasmFunctions themselves. The names are //not// "symbol names" or aliases or anything, they're just the name that a debugger should show against the function body itself. NB. The WasmObjectFile stores them so that they can be exported in the YAML losslessly, and hence the tests can be precise. Enforce that the CODE section has been read in before reading the "names" section. Requires minor adjustment to some tests. Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42075 llvm-svn: 322741
* Try again to mark TestRdar12408181.py as skippedVedant Kumar2018-01-171-3/+7
| | | | | | rdar://36417163 llvm-svn: 322740
* Use a got to access a hidden weak undefined on MachO.Rafael Espindola2018-01-172-4/+2
| | | | | | | | | | | | | | | | | | | Trying to link __attribute__((weak, visibility("hidden"))) extern int foo; int *main(void) { return &foo; } on OS X fails with ld: 32-bit RIP relative reference out of range (-4294971318 max is +/-2GB): from _main (0x100000FAB) to _foo@0x00001000 (0x00000000) in '_main' from test.o for architecture x86_64 The problem being that 0 cannot be computed as a fixed difference from %rip. Exactly the same issue exists on ELF and we can use the same solution. llvm-svn: 322739
* [ARM] Optimize {s,u}mul.with.overflow.Joel Galenson2018-01-172-5/+72
| | | | | | | | This extends my previous patches to also optimize overflow-checked multiplies during SelectionDAG. Differential revision: https://reviews.llvm.org/D40922 llvm-svn: 322738
* [ARM] Optimize {s,u}{add,sub}.with.overflow.Joel Galenson2018-01-174-47/+130
| | | | | | | | The ARM backend contains code that tries to optimize compares by replacing them with an existing instruction that sets the flags the same way. This allows it to replace a "cmp" with a "adds", generalizing the code that replaces "cmp" with "sub". It also heuristically disables sinking of instructions that could potentially be used to replace compares (currently only if they're next to each other). Differential revision: https://reviews.llvm.org/D38378 llvm-svn: 322737
* [coff] Print detailed timing information with /TIME.Zachary Turner2018-01-1712-2/+195
| | | | | | | | | The classes used to print and update time information are in common, so other linkers could use this as well if desired. Differential Revision: https://reviews.llvm.org/D41915 llvm-svn: 322736
* [Attributes] Fix crash when attempting to remove alignment from an attribute ↵Daniel Neilson2018-01-172-24/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list/set Summary: Discovered while working on a patch to move alignment in @llvm.memcpy/move/set from an arg into parameter attributes. The current implementations of AttributeSet::removeAttribute() and AttributeList::removeAttribute crash when attempting to remove the alignment attribute. Currently, these implementations add the to-be-removed attributes to an AttrBuilder and then remove the builder from the list/set. Alignment is special in that it must be added to a builder with an integer value for the alignment; attempts to add alignment to a builder without a value is an error. This change fixes the removeAttribute implementations for AttributeSet and AttributeList to make them able to remove the alignment, and other similar, attributes. Reviewers: rnk, chandlerc, pete, javed.absar, reames Reviewed By: rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41951 llvm-svn: 322735
* [X86][BTVER2] Reduce instregex usage (PR35955)Simon Pilgrim2018-01-171-25/+29
| | | | | | Most are just replaced with instrs lists, but a few regexps have been further generalized to match more instructions with a single pattern. llvm-svn: 322734
* [InstCombine] add baseline tests for D39958; NFCSanjay Patel2018-01-171-0/+143
| | | | llvm-svn: 322733
* [WebAssembly] Remove non-existent method declaration. NFC.Sam Clegg2018-01-171-1/+0
| | | | | | Patch by Nicholas Wilson! llvm-svn: 322732
* [WebAssembly] Remove unused member variable. NFC.Sam Clegg2018-01-171-2/+1
| | | | | | Patch by Nicholas Wilson! llvm-svn: 322731
* [X86] Teach LowerBUILD_VECTOR to recognize pair-wise splats of 32-bit ↵Craig Topper2018-01-177-93/+87
| | | | | | | | | | | | | | elements and use a 64-bit broadcast If we are splatting pairs of 32-bit elements, we can use a 64-bit broadcast to get the job done. We could probably could probably do this with other sizes too, for example four 16-bit elements. Or we could broadcast pairs of 16-bit elements using a 32-bit element broadcast. But I've left that as a future improvement. I've also restricted this to AVX2 only because we can only broadcast loads under AVX. Differential Revision: https://reviews.llvm.org/D42086 llvm-svn: 322730
* [Parse] Forward brace locations to TypeConstructExprVedant Kumar2018-01-1712-90/+260
| | | | | | | | | | | | | | | | | | | | | | | | When parsing C++ type construction expressions with list initialization, forward the locations of the braces to Sema. Without these locations, the code coverage pass crashes on the given test case, because the pass relies on getLocEnd() returning a valid location. Here is what this patch does in more detail: - Forwards init-list brace locations to Sema (ParseExprCXX), - Builds an InitializationKind with these locations (SemaExprCXX), and - Uses these locations for constructor initialization (SemaInit). The remaining changes fall out of introducing a new overload for creating direct-list InitializationKinds. Testing: check-clang, and a stage2 coverage-enabled build of clang with asserts enabled. Differential Revision: https://reviews.llvm.org/D41921 llvm-svn: 322729
* Skip a flaky test (TestRdar12408181.py)Vedant Kumar2018-01-171-1/+3
| | | | | | | | | | This test frequently times out on our bots. While we're investigating the issue, mark the test as skipped so the builds aren't impacted as much. rdar://36417163 llvm-svn: 322728
* [WebAssembly] Fix typo in commentSam Clegg2018-01-171-1/+1
| | | | | | Patch by Nicholas Wilson! llvm-svn: 322727
* [WebAssembly] Refactor InputChunk.getSize(). NFCSam Clegg2018-01-171-8/+5
| | | | | | | | Also, remove trailing semicolons. Patch by Nicholas Wilson! llvm-svn: 322726
* [utils] Make .cfi_startproc optional for powerpcFangrui Song2018-01-171-1/+1
| | | | | | | | | | Summary: llc sometimes may not emit .cfi_startproc which makes func_dict to have less entries. Subscribers: nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D42144 llvm-svn: 322725
OpenPOWER on IntegriCloud