summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [NewPM] Second attempt at porting ASanLeonard Chan2019-02-1311-200/+489
| | | | | | | | | | | | | | | | | | | | This is the second attempt to port ASan to new PM after D52739. This takes the initialization requried by ASan from the Module by moving it into a separate class with it's own analysis that the new PM ASan can use. Changes: - Split AddressSanitizer into 2 passes: 1 for the instrumentation on the function, and 1 for the pass itself which creates an instance of the first during it's run. The same is done for AddressSanitizerModule. - Add new PM AddressSanitizer and AddressSanitizerModule. - Add legacy and new PM analyses for reading data needed to initialize ASan with. - Removed DominatorTree dependency from ASan since it was unused. - Move GlobalsMetadata and ShadowMapping out of anonymous namespace since the new PM analysis holds these 2 classes and will need to expose them. Differential Revision: https://reviews.llvm.org/D56470 llvm-svn: 353985
* Restore Check for Unreachable Exit Block in -Winfinite-recursionRobert Widmann2019-02-132-2/+15
| | | | | | | | | | | | | | | | | | | Summary: When this was rewritten in D43737, the logic changed to better explore infinite loops. The check for a reachable exit block was deleted which accidentally introduced false positives in case the exit node was unreachable. We were testing for cases like this, but @steven_wu provided an additional test case that I've included in the regression tests for this patch. Reviewers: steven_wu, rtrieu Reviewed By: steven_wu, rtrieu Subscribers: cfe-commits, steven_wu Tags: #clang Differential Revision: https://reviews.llvm.org/D58122 llvm-svn: 353984
* [WebAssembly] Bulk memory intrinsics and builtinsThomas Lively2019-02-138-36/+145
| | | | | | | | | | | | | | | | Summary: implements llvm intrinsics and clang intrinsics for memory.init and data.drop. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57736 llvm-svn: 353983
* Revert r353962Serge Guelton2019-02-132-85/+28
| | | | | | | Specialization of Optional for trivially copyable types yields failure on the buildbots I fail to reproduce locally. Better safe than sorry, reverting. llvm-svn: 353982
* ELF: Allow GOT relocs pointing to non-preemptable ifunc to resolve to an ↵Peter Collingbourne2019-02-1316-117/+345
| | | | | | | | | | | | | | | | IRELATIVE where possible. Non-GOT non-PLT relocations to non-preemptible ifuncs result in the creation of a canonical PLT, which now takes the identity of the IFUNC in the symbol table. This (a) ensures address consistency inside and outside the module, and (b) fixes a bug where some of these relocations end up pointing to the resolver. Fixes (at least) PR40474 and PR40501. Differential Revision: https://reviews.llvm.org/D57371 llvm-svn: 353981
* gn build: Merge r353957.Peter Collingbourne2019-02-131-0/+7
| | | | llvm-svn: 353980
* Add missing includeAdrian Prantl2019-02-131-0/+1
| | | | llvm-svn: 353979
* [CMake] Make lldb-test-deps a dependency of check-lldbJonas Devlieghere2019-02-132-1/+4
| | | | | | | We have a custom target for lldb's test dependencies but it must have gotten lost in one of the recent CMake refactorings. llvm-svn: 353978
* [SelectionDAG] Kill last uses of getAtomic w/o a MMO operand [NFC]Philip Reames2019-02-133-48/+36
| | | | | | The helper function was used by only two callers, and largely ended up providing distinct functionality based on optional arguments and opcode. Inline and simply to make the functionality much more clear. llvm-svn: 353977
* [Sema] Delay checking whether objc_designated_initializer is being applied ↵Erik Pilkington2019-02-135-11/+43
| | | | | | | | | | | | | | | | to an init method This fixes a regression that was caused by r335084, which reversed the order that attributes are applied. objc_method_family can change whether a method is an init method, so the order that these attributes are applied matters. The commit fixes this by delaying the init check until after all attributes have been applied. rdar://47829358 Differential revision: https://reviews.llvm.org/D58152 llvm-svn: 353976
* [PowerPC] Stop defining _ARCH_PWR6X on POWER7 and upHubert Tong2019-02-132-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The predefined macro `_ARCH_PWR6X` is associated with GCC's `-mcpu=power6x` option, which enables generation of P6 "raw mode" instructions such as `mftgpr`. Later POWER processors build upon the "architected mode", not the raw one. `_ARCH_PWR6X` should not be defined for these later processors. Fixes PR#40236. Reviewers: echristo, hfinkel, kbarton, nemanjai, wschmidt Reviewed By: hfinkel Subscribers: jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58128 llvm-svn: 353975
* [X86] Add 'mpx' to getHostCPUFeatures.Craig Topper2019-02-131-0/+1
| | | | llvm-svn: 353974
* [CodeExtractor] Only lift lifetime markers present in the extraction regionVedant Kumar2019-02-133-37/+194
| | | | | | | | | | | | | | | When CodeExtractor finds liftime markers referencing inputs to the extraction region, it lifts these markers out of the region and inserts them around the call to the extracted function (see r350420, PR39671). However, it should *only* lift lifetime markers that are actually present in the extraction region. I.e., if a start marker is present in the extraction region but a corresponding end marker isn't (or vice versa), only the start marker (or end marker, resp.) should be lifted. Differential Revision: https://reviews.llvm.org/D57834 llvm-svn: 353973
* [Tests] More unordered atomic lowering testsPhilip Reames2019-02-131-1/+324
| | | | | | This time, focused around narrowing and widening transformations. Also, include a few simple memory optimization tests to highlight missed oppurtunities. This is part of building up the test base for D57601. llvm-svn: 353972
* Add missing includeAdrian Prantl2019-02-131-0/+1
| | | | llvm-svn: 353971
* [clang] Make sure C99/C11 features in <float.h> are provided in C++11Louis Dionne2019-02-132-9/+12
| | | | | | | | | | | | | | | | Summary: Previously, those #defines were only provided in C or when GNU extensions were enabled. We need those #defines in C++11 and above, too. Reviewers: jfb, eli.friedman Subscribers: jkorous, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58149 llvm-svn: 353970
* Re-enable the test disabled in r353836 and hopefully make it pass in gcc buildsNico Weber2019-02-132-20/+17
| | | | | | | | | Argument evaluation order is different between gcc and clang, so pull out the Builder calls to make the generated IR independent of the host compiler's argument evaluation order. Thanks to rnk for reminding me of this clang/gcc difference. llvm-svn: 353969
* Recover elf32-bigmips and elf32-powerpc support in LLDRui Ueyama2019-02-134-2/+43
| | | | | | | | | | | | | This fixes a 7.0 -> 8.0 regression when parsing OUTPUT_FORMAT("elf32-powerpc"); or elf32-bigmips directive in ldscripts as well as an unknown emulation error when lld is invoked by clang due to missed elf32ppclinux case. Patch by vit9696 Differential Revision: https://reviews.llvm.org/D58005 llvm-svn: 353968
* Show "Unknown -z option" error message even if --version or --help are given.Rui Ueyama2019-02-132-1/+2
| | | | | | | | | | Previously, we validated -z options after we process --version or --help flags. So, if one of these flags is given, we wouldn't show an "unknown -z option" error. This patch fixes that behavior. Differential Revision: https://reviews.llvm.org/D55446 llvm-svn: 353967
* [Tests] RMW folding tests w/unordered atomic operationsPhilip Reames2019-02-131-0/+618
| | | | | | We get a suprising number of these today actually, but some are missed. The main point of this is strengthen the test set for D57601. llvm-svn: 353966
* [Headers][mips] Add `__attribute__((__mode__(__unwind_word__)))` to the ↵Simon Atanasyan2019-02-134-3/+28
| | | | | | | | | | | | | | | | | | _Unwind_Word / _Unwind_SWord definitions The rationale of this change is to fix _Unwind_Word / _Unwind_SWord definitions for MIPS N32 ABI. This ABI uses 32-bit pointers, but _Unwind_Word and _Unwind_SWord types are eight bytes long. # The __attribute__((__mode__(__unwind_word__))) is added to the type definitions. It makes them equal to the corresponding definitions used by GCC and allows to override types using `getUnwindWordWidth` function. # The `getUnwindWordWidth` virtual function override in the `MipsTargetInfo` class and provides correct type size values. Differential revision: https://reviews.llvm.org/D58165 llvm-svn: 353965
* [Tests] Add a bunch of tests for load folding w/unordered atomicsPhilip Reames2019-02-131-0/+904
| | | | llvm-svn: 353964
* [X86] Add 'fxsr' to the getHostCPUFeatures detection code.Craig Topper2019-02-131-0/+1
| | | | | | We implicitly mark this feature as enabled when the target is 64-bits, but our detection code for -march=native didn't support it so you can't detect it on 32-bit targets. llvm-svn: 353963
* Re-commit rL353927, patch includedSerge Guelton2019-02-132-28/+85
| | | | | | | | | | | | | | | Make llvm::Optional<T> trivially copyable when T is trivially copyable This is an ever-recurring issue (see https://bugs.llvm.org/show_bug.cgi?id=39427 and https://bugs.llvm.org/show_bug.cgi?id=35978) but I believe that thanks to https://reviews.llvm.org/D54472 we can now ship a decent implementation of this. Basically the fact that llvm::is_trivially_copyable has a consistent behavior across compilers should prevent any ABI issue, and using in-place new instead of memcpy should keep compiler bugs away. This patch is slightly different from the original revision https://reviews.llvm.org/rL353927 but achieves the same goal. It just avoids going through std::conditional which may the code more explicit. llvm-svn: 353962
* Deserialize Clang module search path from DWARFAdrian Prantl2019-02-1326-108/+219
| | | | | | | | | | | | This patch properly extracts the full submodule path as well as its search paths from DWARF import decls and passes it on to the ClangModulesDeclVendor. rdar://problem/47970144 Differential Revision: https://reviews.llvm.org/D58090 llvm-svn: 353961
* [Driver] Pass +reserve-x25 to backend if -ffixed-x25 is specifiedPetr Hosek2019-02-131-0/+3
| | | | | | This was accidentally omitted in r353957 breaking the Clang test. llvm-svn: 353960
* [Tests] First batch of cornercase tests for unordered atomicsPhilip Reames2019-02-131-0/+175
| | | | | | Mixture of things we legally can't do, and things we're missing. Once D57601 is in, the later will serve as a punch list. llvm-svn: 353959
* [Tests] Auto update a testPhilip Reames2019-02-131-57/+213
| | | | llvm-svn: 353958
* [AArch64] Support reserving arbitrary general purpose registersPetr Hosek2019-02-1310-62/+290
| | | | | | | | | | | | This is a follow up to D48580 and D48581 which allows reserving arbitrary general purpose registers with the exception of registers with special purpose (X8, X16-X18, X29, X30) and registers used by LLVM (X0, X19). This change also generalizes some of the existing logic to rely entirely on values generated from tablegen. Differential Revision: https://reviews.llvm.org/D56305 llvm-svn: 353957
* [Tests] Rename some test files for consistencyPhilip Reames2019-02-134-0/+0
| | | | | | Most are named "atomic-something" so rename the few which were "atomic_something". I keep typing the wrong name due to the inconsistency. :) llvm-svn: 353956
* [libcxx] Do not assume the number of elements in a moved-from associative ↵Louis Dionne2019-02-134-12/+24
| | | | | | | | | container Reviewed as https://reviews.llvm.org/D57903. Thanks to Andrey Maksimov for the patch. llvm-svn: 353955
* [DebugInfo][DAG] Either salvage dangling debug info or emit Undef DBG_VALUEsJeremy Morse2019-02-135-19/+154
| | | | | | | | | | | | | | | | | | | | | | | | | In this patch SelectionDAG tries to salvage any dbg.values that are going to be dropped, in case they can be recovered from Values in the current BB. It also strengthens SelectionDAGs handling of dangling debug data, so that dbg.values are *always* emitted (as Undef or otherwise) instead of dangling forever. The motivation behind this patch exists in the new test case: a memory address (here a bitcast and GEP) exist in one basic block, and a dbg.value referring to the address is left in the 'next' block. The base pointer is live across all basic blocks. In current llvm trunk the dbg.value cannot be encoded, and it isn't even emitted as an Undef DBG_VALUE. The change is simply: if we're definitely going to drop a dbg.value, repeatedly apply salvageDebugInfo to its operand until either we find something that can be encoded, or we can't salvage any further in which case we produce an Undef DBG_VALUE. To know when we're "definitely going to drop a dbg.value", SelectionDAG signals SelectionDAGBuilder when all IR instructions have been encoded to force salvaging. This ensures that any dbg.value that's dangling after DAG creation will have a corresponding DBG_VALUE encoded. Differential Revision: https://reviews.llvm.org/D57694 llvm-svn: 353954
* [X86][AVX] Add shuffle_v8i32_0dcd3f14 shuffle test caseSimon Pilgrim2019-02-131-0/+30
| | | | llvm-svn: 353953
* [HIP] Handle compile -m options and propagate into LLCAaron Enye Shi2019-02-132-2/+68
| | | | | | | | | | | Allow the compile options for -m such as -mxnack/-mno-xnack, -msram-ecc/-mno-sram-ecc, -mcode-object-v3/-mno-code-object-v3 to propagate into LLC args. Fix an issue where -mattr was pushed even when it was empty. Also add lit tests to verify features are properly passed. Differential Revision: https://reviews.llvm.org/D57977 Reviewers: yaxunl, kzhuravl llvm-svn: 353952
* [llvm-readobj] Rename pr_data to PrDataFangrui Song2019-02-131-12/+12
| | | | | | As requested by grimar in D58112. llvm-svn: 353951
* [DebugInfo][DAG] Refactor dbg.value lowering into its own methodJeremy Morse2019-02-132-84/+100
| | | | | | | | | | This is a pure copy-and-paste job, moving the logic for lowering dbg.value intrinsics to SDDbgValues into its own function. This is ahead of adding some more users of this logic. Differential Revision: https://reviews.llvm.org/D57697 llvm-svn: 353950
* [MCA] Store a bitmask of used groups in the instruction descriptor.Andrea Di Biagio2019-02-134-9/+29
| | | | | | | This is to speedup 'checkAvailability' queries in class ResourceManager. No functional change intended. llvm-svn: 353949
* [DebugInfo][DAG] Limit special-casing of dbg.values for ArgumentsJeremy Morse2019-02-132-4/+114
| | | | | | | | | | | | | | | | | | | | | SelectionDAGBuilder has special handling for dbg.value intrinsics that are understood to define the location of function parameters on entry to the function. To enable this, we avoid recording a dbg.value as a virtual register reference if it might be such a parameter, so that it later hits EmitFuncArgumentDbgValue. This patch reduces the set of circumstances where we avoid recording a dbg.value as a virtual register reference, to allow more "normal" variables to be recorded that way. We now only bypass for potential parameters if: * The dbg.value operand is an Argument, * The Variable is a parameter, and * The Variable is not inlined. meaning it's very likely that the dbg.value is a function-entry parameter location. Differential Revision: https://reviews.llvm.org/D57584 llvm-svn: 353948
* Dmitry Vyukov2019-02-1314-10/+466
| | | | | | | | | | | | | | | | | | | | | | | tsan: add fiber support This patch adds functions for managing fibers: __tsan_get_current_fiber() __tsan_create_fiber() __tsan_destroy_fiber() __tsan_switch_to_fiber() __tsan_set_fiber_name() See the added tests for use examples. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D54889 [The previous commit of this change was reverted, this is a resubmit with a squashed fix for check_analyze.sh and COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED] llvm-svn: 353947
* [test] Tweak driver test from r353917 and r353922 to pass with a nondefault ↵Martin Storsjo2019-02-131-2/+2
| | | | | | | | | | | CLANG_DEFAULT_LINKER Force -fuse-ld=ld, as some other tests in the same file do. Loosen the regex matching the linker tool name as well, as this can end up being <triple>-ld in case such a named tool exists. llvm-svn: 353946
* Revert "Fix one more string/bytes issue in lldb-server tests"Pavel Labath2019-02-131-1/+1
| | | | | | | | | | | | | It looks like I was too hasty to submit the previous patch. It does fix some tests on python3, but it also breaks one tests with python2. This happens because the gdb-remote protocol can sometimes (but not very often) contain binary data, and attempting to parse this as utf8 characters fails. This reverts commit r353944. llvm-svn: 353945
* Fix one more string/bytes issue in lldb-server testsPavel Labath2019-02-131-1/+1
| | | | | | This fixes about a dozen tests with python3. llvm-svn: 353944
* [Analyzer] Crash fix for FindLastStoreBRVisitorAdam Balogh2019-02-133-5/+48
| | | | | | | | | | | | | | | | | | | | | | | FindLastStoreBRVisitor tries to find the first node in the exploded graph where the current value was assigned to a region. This node is called the "store site". It is identified by a pair of Pred and Succ nodes where Succ already has the binding for the value while Pred does not have it. However the visitor mistakenly identifies a node pair as the store site where the value is a `LazyCompoundVal` and `Pred` does not have a store yet but `Succ` has it. In this case the `LazyCompoundVal` is different in the `Pred` node because it also contains the store which is different in the two nodes. This error may lead to crashes (a declaration is cast to a parameter declaration without check) or misleading bug path notes. In this patch we fix this problem by checking for unequal `LazyCompoundVals`: if their region is equal, and their store is the same as the store of their nodes we consider them as equal when looking for the "store site". This is an approximation because we do not check for differences of the subvalues (structure members or array elements) in the stores. Differential Revision: https://reviews.llvm.org/D58067 llvm-svn: 353943
* Revert "tsan: update check_analyze.sh"Diana Picus2019-02-131-1/+7
| | | | | | This reverts commit r353820, to go with the revert of r353817. llvm-svn: 353942
* [NFC] Add const qualifiers where possibleMax Kazantsev2019-02-131-28/+29
| | | | llvm-svn: 353941
* Revert r353927Serge Guelton2019-02-132-84/+31
| | | | llvm-svn: 353940
* Revert "tsan: add fiber support"Diana Picus2019-02-1313-464/+2
| | | | | | | This reverts commit r353817 because we think it broke AARch64 and PowerPC buildbots. llvm-svn: 353939
* [ARM GlobalISel] Support G_SELECT for Thumb2Diana Picus2019-02-135-60/+150
| | | | | | Same as arm mode, but slightly different opcodes. llvm-svn: 353938
* [MCA][Scheduler] Use latency information to further classify busy instructions.Andrea Di Biagio2019-02-134-42/+139
| | | | | | | | | | | | | | | | | | This patch introduces a new instruction stage named 'IS_PENDING'. An instruction transitions from the IS_DISPATCHED to the IS_PENDING stage if input registers are not available, but their latency is known. This patch also adds a new set of instructions named 'PendingSet' to class Scheduler. The idea is that the PendingSet will only contain instructions that have reached the IS_PENDING stage. By construction, an instruction in the PendingSet is only dependent on instructions that have already reached the execution stage. The plan is to use this knowledge to identify bottlenecks caused by data dependencies (see PR37494). Differential Revision: https://reviews.llvm.org/D58066 llvm-svn: 353937
* [DebugInfo][InstCombine] Prefer to salvage debuginfo over sinking itJeremy Morse2019-02-132-5/+105
| | | | | | | | | | | | | | | | | | When instcombine sinks an instruction between two basic blocks, it sinks any dbg.value users in the source block with it, to prevent debug use-before-free. However we can do better by attempting to salvage the debug users, which would avoid moving where the variable location changes. If we successfully salvage, still sink a (cloned) dbg.value with the sunk instruction, as the sunk instruction is more likely to be "live" later in the compilation process. If we can't salvage dbg.value users of a sunk instruction, mark the dbg.values in the original block as being undef. This terminates any earlier variable location range, and represents the fact that we've optimized out the variable location for a portion of the program. Differential Revision: https://reviews.llvm.org/D56788 llvm-svn: 353936
OpenPOWER on IntegriCloud