summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [CUDA] add support for the new kernel launch API in CUDA-9.2+.Artem Belevich2019-01-3114-46/+250
| | | | | | | | | | | | | Instead of calling CUDA runtime to arrange function arguments, the new API constructs arguments in a local array and the kernels are launched with __cudaLaunchKernel(). The old API has been deprecated and is expected to go away in the next CUDA release. Differential Revision: https://reviews.llvm.org/D57488 llvm-svn: 352799
* [CUDA] Propagate detected version of CUDA to cc1Artem Belevich2019-01-316-6/+104
| | | | | | | | | | | | | ..and use it to control that parts of CUDA compilation that depend on the specific version of CUDA SDK. This patch has a placeholder for a 'new launch API' support which is in a separate patch. The list will be further extended in the upcoming patch to support CUDA-10.1. Differential Revision: https://reviews.llvm.org/D57487 llvm-svn: 352798
* [clangd] A code action to swap branches of an if statementIlya Biryukov2019-01-317-13/+401
| | | | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: llvm-commits, mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D56611 llvm-svn: 352796
* Fix compilation error with GCC after r352791.James Y Knight2019-01-311-1/+1
| | | | llvm-svn: 352795
* [EarlyCSE & MSSA] Cleanup special handling for removing MemoryAccesses.Alina Sbirlea2019-01-311-30/+5
| | | | | | | | | | | | Summary: Moving special handling to MemorySSAUpdater in D57199. Reviewers: gberry, george.burgess.iv Subscribers: sanjoy, jlebar, Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D57200 llvm-svn: 352794
* [WebAssembly] Add bulk memory target featureThomas Lively2019-01-318-27/+113
| | | | | | | | | | | | Summary: Also clean up some preexisting target feature code. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, jfb Differential Revision: https://reviews.llvm.org/D57495 llvm-svn: 352793
* [DAGCombine] Avoid CombineZExtLogicopShiftLoad if there is free ZEXTGuozhi Wei2019-01-312-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes pr39098. For the attached test case, CombineZExtLogicopShiftLoad can optimize it to t25: i64 = Constant<1099511627775> t35: i64 = Constant<0> t0: ch = EntryToken t57: i64,ch = load<(load 4 from `i40* undef`, align 8), zext from i32> t0, undef:i64, undef:i64 t58: i64 = srl t57, Constant:i8<1> t60: i64 = and t58, Constant:i64<524287> t29: ch = store<(store 5 into `i40* undef`, align 8), trunc to i40> t57:1, t60, undef:i64, undef:i64 But later visitANDLike transforms it to t25: i64 = Constant<1099511627775> t35: i64 = Constant<0> t0: ch = EntryToken t57: i64,ch = load<(load 4 from `i40* undef`, align 8), zext from i32> t0, undef:i64, undef:i64 t61: i32 = truncate t57 t63: i32 = srl t61, Constant:i8<1> t64: i32 = and t63, Constant:i32<524287> t65: i64 = zero_extend t64 t58: i64 = srl t57, Constant:i8<1> t60: i64 = and t58, Constant:i64<524287> t29: ch = store<(store 5 into `i40* undef`, align 8), trunc to i40> t57:1, t60, undef:i64, undef:i64 And it triggers CombineZExtLogicopShiftLoad again, causes a dead loop. Both forms should generate same instructions, CombineZExtLogicopShiftLoad generated IR looks cleaner. But it looks more difficult to prevent visitANDLike to do the transform, so I prevent CombineZExtLogicopShiftLoad to do the transform if the ZExt is free. Differential Revision: https://reviews.llvm.org/D57491 llvm-svn: 352792
* [opaque pointer types] Add a FunctionCallee wrapper type, and use it.James Y Knight2019-01-3170-897/+865
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FunctionCallee type is effectively a {FunctionType*,Value*} pair, and is a useful convenience to enable code to continue passing the result of getOrInsertFunction() through to EmitCall, even once pointer types lose their pointee-type. Then: - update the CallInst/InvokeInst instruction creation functions to take a Callee, - modify getOrInsertFunction to return FunctionCallee, and - update all callers appropriately. One area of particular note is the change to the sanitizer code. Previously, they had been casting the result of `getOrInsertFunction` to a `Function*` via `checkSanitizerInterfaceFunction`, and storing that. That would report an error if someone had already inserted a function declaraction with a mismatching signature. However, in general, LLVM allows for such mismatches, as `getOrInsertFunction` will automatically insert a bitcast if needed. As part of this cleanup, cause the sanitizer code to do the same. (It will call its functions using the expected signature, however they may have been declared.) Finally, in a small number of locations, callers of `getOrInsertFunction` actually were expecting/requiring that a brand new function was being created. In such cases, I've switched them to Function::Create instead. Differential Revision: https://reviews.llvm.org/D57315 llvm-svn: 352791
* [cmake] Note future cleanup in comment. NFCShoaib Meenai2019-01-311-1/+3
| | | | | | | | CMake 3.6 introduced CMAKE_TRY_COMPILE_PLATFORM_VARIABLES, which solves precisely the problem that necessitated init_user_prop, so we can switch over whenever we bump our minimum CMake requirement. llvm-svn: 352790
* [fuzzer] Use RawPrint instead of Printf for instrumentation warningJonathan Metzman2019-01-313-8/+12
| | | | | | | | | | | | | | | Summary: Use RawPrint instead of Printf for instrumentation warning because Printf doesn't work on Win when instrumentation is being initialized (since OutputFile is not yet initialized). Reviewers: kcc Reviewed By: kcc Differential Revision: https://reviews.llvm.org/D57531 llvm-svn: 352789
* [CodeComplete] Propagate preferred types through parser in more casesIlya Biryukov2019-01-319-136/+393
| | | | | | | | | | | | | | Preferred types are used by code completion for ranking. This commit considerably increases the number of points in code where those types are propagated. In order to avoid complicating signatures of Parser's methods, a preferred type is kept as a member variable in the parser and updated during parsing. Differential revision: https://reviews.llvm.org/D56723 llvm-svn: 352788
* [MemorySSA] Extend removeMemoryAccess API to optimize MemoryPhis.Alina Sbirlea2019-01-312-4/+24
| | | | | | | | | | | | | | | | Summary: EarlyCSE needs to optimize MemoryPhis after an access is removed and has special handling for it. This should be handled by MemorySSA instead. The default remains that MemoryPhis are *not* optimized after an access is removed. Reviewers: george.burgess.iv Subscribers: sanjoy, jlebar, llvm-commits, Prazek Differential Revision: https://reviews.llvm.org/D57199 llvm-svn: 352787
* [DAG][SystemZ] Define unwrapAddress for PCREL_WRAPPER.Nirav Dave2019-01-312-0/+8
| | | | | | | | | | | | | | | | Summary: Like with X86, this allows better DAG-level alias analysis and alignment inference for wrapped addresses. Reviewers: jonpa, uweigand Reviewed By: uweigand Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D57407 llvm-svn: 352786
* [ELF] Return the section name when calling getSymbolName on a section symbol.Matt Davis2019-01-313-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, llvm-nm would report symbols for .debug and .note sections as: '?' with an empty section name: ``` 00000000 ? 00000000 ? ... ``` With this patch the output more closely resembles GNU nm: ``` 00000000 N .debug_abbrev 00000000 n .note.GNU-stack ... ``` This patch calls `getSectionName` for sections that belong to symbols of type `ELF::STT_SECTION`, which returns the name of the section from the section string table. Reviewers: Bigcheese, davide, jhenderson Reviewed By: davide, jhenderson Subscribers: rupprecht, jhenderson, llvm-commits Differential Revision: https://reviews.llvm.org/D57105 llvm-svn: 352785
* [DAG] Aggressively cleanup dangling node in CombineZExtLogicopShiftLoad.Nirav Dave2019-01-311-0/+4
| | | | | | | | | | | | | While dangling nodes will eventually be pruned when they are considered, leaving them disables combines requiring single-use. Reviewers: Carrot, spatel, craig.topper, RKSimon, efriedma Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D57520 llvm-svn: 352784
* [Intrinsic] Expand SMULFIX to MUL, MULH[US], or [US]MUL_LOHI on vector argumentsLeonard Chan2019-01-313-86/+49
| | | | | | | | | | | r zero scale SMULFIX, expand into MUL which produces better code for X86. For vector arguments, expand into MUL if SMULFIX is provided with a zero scale. Otherwise, expand into MULH[US] or [US]MUL_LOHI. Differential Revision: https://reviews.llvm.org/D56987 llvm-svn: 352783
* Revert "[X86] Mark EMMS and FEMMS as clobbering MM0-7 and ST0-7."Craig Topper2019-01-313-48/+88
| | | | | | This is causing a failure in chromium llvm-svn: 352782
* Fix a bit of libc++-specific behavior in the regex tests; add a missing ↵Marshall Clow2019-01-313-4/+46
| | | | | | test. Reviewed as https://reviews.llvm.org/D57391 Thanks to Andrey Maksimov for the patch llvm-svn: 352781
* [unittest] Fix scalar unit test.Jonas Devlieghere2019-01-311-4/+4
| | | | | | | | The test was using ASSERT_EQ instead of ASSERT_STREQ which meant we were comparing string addresses instead of the actual string. This caused the test to fail with with the sanitizers enabled. llvm-svn: 352780
* Lower widenable_conditions in CGPPhilip Reames2019-01-312-0/+107
| | | | | | | | This ensures that if we make it to the backend w/o lowering widenable_conditions first, that we generate correct code. Doing it in CGP - instead of isel - let's us fold control flow before hitting block local instruction selection. Differential Revision: https://reviews.llvm.org/D57473 llvm-svn: 352779
* [libFuzzer] relax a flaky testKostya Serebryany2019-01-311-1/+0
| | | | llvm-svn: 352778
* GlobalISel: Fix handling of vectors of pointers in clamp{Min,Max}NumElementsMatt Arsenault2019-01-311-5/+3
| | | | | | This avoids hitting the assert added in r352636 in a future commit. llvm-svn: 352777
* [ADT] Fix a typo in isOSVersionLT that breaks the Micro version checkBob Wilson2019-01-311-1/+1
| | | | | | | | The original commit of this function (r129800 in 2011) had a typo where part of the "Micro" version check was actually comparing against the "Minor" version number. llvm-svn: 352776
* Trim trailing whitespace. NFCI.Simon Pilgrim2019-01-311-1/+1
| | | | llvm-svn: 352775
* [X86][AVX] Fold concat(broadcast(x),broadcast(x)) -> broadcast(x)Simon Pilgrim2019-01-313-82/+30
| | | | | | Differential Revision: https://reviews.llvm.org/D57514 llvm-svn: 352774
* [X86][AVX] insert_subvector(bitcast(v), bitcast(s), c1) -> ↵Simon Pilgrim2019-01-315-98/+103
| | | | | | | | | | bitcast(insert_subvector(v,s,c2)) Similar to what we already do in DAGCombiner, but this version also handles bitcasts from types with different scalar sizes, which x86 is better at handling. Differential Revision: https://reviews.llvm.org/D57514 llvm-svn: 352773
* Fix use of non-existing variable in crashlog.pyShafik Yaghmour2019-01-311-1/+1
| | | | | | | | | Summary: The method find_matching_slice(self) uses uuid_str on one of the paths but the variable does not exist and so this results in a NameError exception if we take that path. Differential Revision: https://reviews.llvm.org/D57467 llvm-svn: 352772
* [CallSite removal] Remove CallSite uses from InstCombine.Craig Topper2019-01-316-101/+130
| | | | | | | | | | | | Reviewers: chandlerc Reviewed By: chandlerc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D57494 llvm-svn: 352771
* Recommit "[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT ↵Teresa Johnson2019-01-314-0/+65
| | | | | | | | leader" Recommit of r352763 with fix for use after free. llvm-svn: 352770
* revert r352766: [PatternMatch] add special-case uaddo matching for ↵Sanjay Patel2019-01-313-40/+23
| | | | | | | | increment-by-one Missed some regression test updates when testing this. llvm-svn: 352769
* Revert "[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader"Teresa Johnson2019-01-314-64/+0
| | | | | | | | | | | | This reverts commit r352763. Causing a couple bot failures, root cause pointed to by sanitizer bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/28909/steps/annotate/logs/stdio Use after free. I understand the issue but will revert and test with fix before recommitting. llvm-svn: 352768
* [llvm-objcopy] Skip --localize-symbol for undefined symbolsJordan Rupprecht2019-01-312-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Include the symbol being defined in the list of requirements for using --localize-symbol. This is used, for example, when someone is depending on two different projects that have the same (or close enough) method defined in each library, and using "-L sym" for a conflicting symbol in one of the libraries so that the definition from the other one is used. However, the library may have internal references to the symbol, which cause program crashes when those are used, i.e.: ``` $ cat foo.c int foo() { return 5; } $ cat bar.c int foo(); int bar() { return 2 * foo(); } $ cat foo2.c int foo() { /* Safer implementation */ return 42; } $ cat main.c int bar(); int main() { __builtin_printf("bar = %d\n", bar()); return 0; } $ ar rcs libfoo.a foo.o bar.o $ ar rcs libfoo2.a foo2.o # Picks the wrong foo() impl $ clang main.o -lfoo -lfoo2 -L. -o main # Picks the right foo() impl $ objcopy -L foo libfoo.a && clang main.o -lfoo -lfoo2 -L. -o main # Links somehow, but crashes at runtime $ llvm-objcopy -L foo libfoo.a && clang main.o -lfoo -lfoo2 -L. -o main ``` Reviewers: jhenderson, alexshap, jakehehrlich, espindola Subscribers: emaste, arichardson Differential Revision: https://reviews.llvm.org/D57417 llvm-svn: 352767
* [PatternMatch] add special-case uaddo matching for increment-by-oneSanjay Patel2019-01-313-23/+40
| | | | | | | | | | | | | | | | | This is the most important uaddo problem mentioned in PR31754: https://bugs.llvm.org/show_bug.cgi?id=31754 We were failing to match the canonicalized pattern when it's an 'add 1' operation. Pattern matching, however, shouldn't assume that we have canonicalized IR, so we match 4 commuted variants of uaddo. There's also a test with a crazy type to show that the existing CGP transform based on this matcher is not limited by target legality checks, but that's a different problem. Differential Revision: https://reviews.llvm.org/D57516 llvm-svn: 352766
* lld-link: Allow mixing 'discard' and 'largest' comdat selectionsNico Weber2019-01-312-11/+30
| | | | | | | | | | | | | | | | | | | cl.exe and clang-cl.exe put vftables in a 'discard' comdat when building with RTTI disabled (/GR-) but in a 'largest' comdat when building with RTTI enabled. To be able to link /GR- code with /GR code, lld-link needs to accept comdats that have this type of comdat selection conflict. For example, static libraries in the Visual Studio standard library are built with /GR, and without this it's impossible to build client code with /GR- and still link to the standard library. link.exe also accepts merging 'discard' with 'largest', and it accepts merging 'largest' with any other selection type. lld-link is still a bit stricter since it only allows merging 'largest' with 'discard' for symmetry. Differential Revision: https://reviews.llvm.org/D57515 llvm-svn: 352765
* [clangd] Append "(fix available)" to diagnostic message when fixes are present.Eric Liu2019-01-319-13/+16
| | | | | | | | | | | | | | | | Summary: This would make diagnostic fixits more discoverable, especially for plugins like YCM. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57509 llvm-svn: 352764
* [ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leaderTeresa Johnson2019-01-314-0/+64
| | | | | | | | | | | | | | | | | | Summary: COFF requires that COMDAT name match that of the leader. When we promote and rename an internal leader in ThinLTO due to an import, ensure we subsequently rename the associated COMDAT. Similar to D31963 which did this during ThinLTO module splitting. Fixes PR40414. Reviewers: pcc, inglorion Subscribers: mehdi_amini, dexonsmith, dmajor, llvm-commits Differential Revision: https://reviews.llvm.org/D57395 llvm-svn: 352763
* [CGP] add more tests for uaddo; NFCSanjay Patel2019-01-311-0/+71
| | | | llvm-svn: 352762
* Accomodate gcc 7.3.0's -Wdangling-elseNico Weber2019-01-311-1/+2
| | | | llvm-svn: 352761
* [OpenCL] Fixed addr space manging test.Anastasia Stulova2019-01-311-5/+5
| | | | | | | | | Fixed typo in the Filecheck directive and changed the test to verify output correctly. Fixes PR40029! llvm-svn: 352760
* gn build: Merge r352483Nico Weber2019-01-311-0/+7
| | | | llvm-svn: 352759
* gn build: Merge r352681, r352739Nico Weber2019-01-312-1/+1
| | | | llvm-svn: 352758
* Update monorepo .arcconfig with new project callsign.Ben Hamilton2019-01-311-0/+1
| | | | llvm-svn: 352757
* [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify ↵James Henderson2019-01-318-69/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | (#3) This is the fourth (and final for now) of a series of patches simplifying llvm-symbolizer tests. See r352752, r352753 and 352754 for the previous ones. This patch splits out several more distinct test cases from llvm-symbolizer.test into separate tests, and simplifies them in various ways including: 1) Building a test case for spaces in path from source, rather than using a pre-canned binary. This allows deleting of said binary and the source it was built from. 2) Switching to specifying addresses and objects directly on the command-line rather than via stdin. This also adds an explict test for the ability to specify a file and address as a line in stdin, since the majority of the tests have been migrated away from this approach, leaving this largely untested. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57446 llvm-svn: 352756
* Revert "[Sanitizers] UBSan unreachable incompatible with ASan in the ↵Eric Liu2019-01-314-57/+21
| | | | | | | | | presence of `noreturn` calls" This reverts commit r352690. This causes clang to crash. Sent reproducer to the author in the orginal commit. llvm-svn: 352755
* [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify ↵James Henderson2019-01-316-73/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#2) This is the third of a series of patches simplifying llvm-symbolizer tests. See r352752 and r352753 for the previous two. This patch splits out a number of distinct test cases from llvm-symbolizer.test into separate tests, and simplifies them in various ways including: 1) using --obj/positional arguments for the input file and addresses instead of stdin, 2) using runtime-generated inputs rather than a pre-canned binary, and 3) testing more specifically (i.e. checking only what is interesting to the behaviour changed in the original commit for that test case). This patch also removes the test case for using --obj. The tools/llvm-symbolizer/basic.s test already tests this case. Finally, this patch adds a simple test case to the demangle switch test case to show that demangling happens by default. See https://bugs.llvm.org/show_bug.cgi?id=40070#c1 for the motivation. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57446 llvm-svn: 352754
* [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify ↵James Henderson2019-01-316-33/+31
| | | | | | | | | | | | | | | | | | (#1) This is the second of a series of patches simplifying llvm-symbolizer tests. See r352752 for the first. This one splits out 5 distinct test cases from llvm-symbolizer.test into separate tests, and simplifies them slightly by using --obj/positional arguments for the input file and addresses instead of stdin. See https://bugs.llvm.org/show_bug.cgi?id=40070#c1 for the motivation. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57443 llvm-svn: 352753
* [llvm-symbolizer][test] Simplify test input readingJames Henderson2019-01-3111-67/+37
| | | | | | | | | | | | | | | | | | This change migrates most llvm-symbolizer tests away from reading input via stdin and instead using --obj + positional arguments for the file and addresses respectively, which makes the tests easier to read. One exception is the test test/tools/llvm-symbolizer/pdb/pdb.test, which was doing some manipulation on the input addresses. This patch simplifies this somewhat, but it still reads from stdin. More changes to follow to simplify/break-up other tests. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57441 llvm-svn: 352752
* [X86][AVX] Fold broadcast(bitcast(src)) -> bitcast(broadcast(src))Simon Pilgrim2019-01-314-12/+16
| | | | llvm-svn: 352751
* [CommandLine] Improve help text for cl::values style optionsJames Henderson2019-01-313-6/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make an option value truly optional, both the ValueOptional and an empty-named value are required. This empty-named value appears in the command-line help text, which is not ideal. This change improves the help text for these sort of options in a number of ways: 1) ValueOptional options with an empty-named value now print their help text twice: both without and then with '=<value>' after the name. The latter version then lists the allowed values after it. 2) Empty-named values with no help text in ValueOptional options are not listed in the permitted values. 3) Otherwise empty-named options are printed as =<empty> rather than simply '='. 4) Option values without help text do not have the '-' separator printed. It also tweaks the llvm-symbolizer -functions help text to not print a trailing ':' as that looks bad combined with 1) above. Reviewed by: thopre, ruiu Differential Revision: https://reviews.llvm.org/D57030 llvm-svn: 352750
* [X86][AVX] Add PR34394 subvector broadcast test casesSimon Pilgrim2019-01-311-10/+131
| | | | | | Tidyup check-prefixes at the same time llvm-svn: 352749
OpenPOWER on IntegriCloud