summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [InstSimplify] fix folds for (0.0 - X) + X --> 0 (PR27151)Sanjay Patel2018-03-142-32/+22
| | | | | | | | | | | | | | | | As shown in: https://bugs.llvm.org/show_bug.cgi?id=27151 ...the existing fold could miscompile when X is NaN. The fold was also dependent on 'ninf' but that's not necessary. From IEEE-754 (with default rounding which we can assume for these opcodes): "When the sum of two operands with opposite signs (or the difference of two operands with like signs) is exactly zero, the sign of that sum (or difference) shall be +0...However, x + x = x − (−x) retains the same sign as x even when x is zero." llvm-svn: 327575
* [ELF] Add .eh_frame pieces to map fileRui Ueyama2018-03-144-3/+52
| | | | | | | | | This patch is a simplified version of https://reviews.llvm.org/D42960 written by Andrew Ng. Differential Revision: https://reviews.llvm.org/D44168 llvm-svn: 327574
* [Tooling] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-1414-231/+346
| | | | | | other minor fixes (NFC). llvm-svn: 327573
* [X86] Add haswell testing for PR35635 as well.Simon Pilgrim2018-03-141-16/+34
| | | | | | To improve complete model testing for schedulers for instructions with multiple results. llvm-svn: 327572
* [COFF] Fix LLD COFF tests as a follow-up to r327563Reid Kleckner2018-03-145-8/+11
| | | | | | | | | | | | I definitely didn't run the tests before committing :( Most of these tests failed because the LLD map file output changed, moving the functions from the main text section to a new per-function section. ICF also started to fire in a few cases, leading to new layouts. llvm-svn: 327571
* Reduce AST depth for test deep-ast-tree.cpp for atomYaxun Liu2018-03-141-2/+4
| | | | llvm-svn: 327570
* [AArch64] Emit CSR loads in the same order as storesFrancis Visoiu Mistrih2018-03-142-14/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optionally allow the order of restoring the callee-saved registers in the epilogue to be reversed. The flag -reverse-csr-restore-seq generates the following code: ``` stp x26, x25, [sp, #-64]! stp x24, x23, [sp, #16] stp x22, x21, [sp, #32] stp x20, x19, [sp, #48] ; [..] ldp x24, x23, [sp, #16] ldp x22, x21, [sp, #32] ldp x20, x19, [sp, #48] ldp x26, x25, [sp], #64 ret ``` Note how the CSRs are restored in the same order as they are saved. One exception to this rule is the last `ldp`, which allows us to merge the stack adjustment and the ldp into a post-index ldp. This is done by first generating: ldp x26, x27, [sp] add sp, sp, #64 which gets merged by the arm64 load store optimizer into ldp x26, x25, [sp], #64 The flag is disabled by default. llvm-svn: 327569
* [test] Skip some lldb-mi tests which time out on DarwinVedant Kumar2018-03-142-0/+11
| | | | | | These don't always timeout, but it's inconvenient when they do. llvm-svn: 327568
* [test] Fix a temp filename in a test from SVN r327561. NFC.Martin Storsjo2018-03-141-1/+1
| | | | | | | An earlier file name accidentally slipped through into the committed version. llvm-svn: 327567
* [ORC] Switch from shared_ptr to unique_ptr for addModule methods.Lang Hames2018-03-1417-112/+83
| | | | | | | Layer implementations typically mutate module state, and this is better reflected by having layers own the Module they are operating on. llvm-svn: 327566
* Implement --cref.Rui Ueyama2018-03-148-3/+84
| | | | | | | | | | | | | | This is an option to print out a table of symbols and filenames. The output format of this option is the same as GNU, so that it can be processed by the same scripts as before after migrating from GNU to lld. This option is mildly useful; we can live without it. But it is pretty convenient sometimes, and it can be implemented in 50 lines of code, so I think lld should support this option. Differential Revision: https://reviews.llvm.org/D44336 llvm-svn: 327565
* [UpdateTestChecks] Handle IR variables with a '-' in the nameAlexander Richardson2018-03-141-1/+2
| | | | | | | | | | | | | | | | | Summary: I noticed that clang will emit variables such as %indirect-arg-temp when running update_cc1_test_checks.py and therefore update_cc1_test_checks.py wasn't adding FileCheck captures for those variables. Reviewers: MaskRay Reviewed By: MaskRay Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44459 llvm-svn: 327564
* [COFF] Enable per-function and data sections in LTOReid Kleckner2018-03-142-0/+32
| | | | | | | | | | | | Summary: This allows post-LTO symbol reordering and ICF. Reviewers: inglorion Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D44492 llvm-svn: 327563
* [MinGW] Add support for the GNU ld flag --kill-atMartin Storsjo2018-03-143-0/+7
| | | | llvm-svn: 327562
* [COFF] Add support for the GNU ld flag --kill-atMartin Storsjo2018-03-145-1/+67
| | | | | | | | | | | | | | | | | | | GNU ld has got a number of different flags for adjusting how to behave around stdcall functions. The --kill-at flag strips the trailing sdcall suffix from exported functions (which otherwise is included by default in MinGW setups). This also strips it from the corresponding import library though. That makes it hard to link to such an import library from code that calls the functions - but this matches what GNU ld does with this flag. Therefore, this flag is probably not sensibly used together with import libraries, but probably mostly when creating some sort of plugin, or if creating the import library separately with dlltool. Differential Revision: https://reviews.llvm.org/D44292 llvm-svn: 327561
* [wasm] Fix wasm lld test on Windows, where the executable name ends in .exeReid Kleckner2018-03-141-1/+1
| | | | llvm-svn: 327560
* [COFF] Add integration test for LTO + /guard:cfReid Kleckner2018-03-142-0/+50
| | | | | | | | | This tests that LLVM emits the relocations that /guard:cf needs to identify address taken. This was PR36624, which was fixed in r327557. llvm-svn: 327559
* [Parser] (C++) Make -Wextra-semi slightly more usefulRoman Lebedev2018-03-144-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Let's suppose the `-Weverything` is passed. Given code like ``` void F() {} ; ``` If the code is compiled with `-std=c++03`, it would diagnose that extra sema: ``` <source>:2:1: warning: extra ';' outside of a function is a C++11 extension [-Wc++11-extra-semi] ; ^~ ``` If the code is compiled with `-std=c++11`, it also would diagnose that extra sema: ``` <source>:2:1: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-pedantic] ; ^~ ``` But, let's suppose the C++11 or higher is used, and the used does not care about `-Wc++98-compat-pedantic`, so he disables that diagnostic. And that silences the complaint about extra `;` too. And there is no way to re-enable that particular diagnostic, passing `-Wextra-semi` does nothing... Now, there is also a related `no newline at end of file` diagnostic, which is also emitted by `-Wc++98-compat-pedantic` ``` <source>:2:2: warning: C++98 requires newline at end of file [-Wc++98-compat-pedantic] ; ^ ``` But unlike the previous case, if `-Wno-c++98-compat-pedantic` is passed, that diagnostic stays displayed: ``` <source>:2:2: warning: no newline at end of file [-Wnewline-eof] ; ^ ``` This diff refactors the code so `-Wc++98-compat-extra-semi` can be re-enabled, after the `-Wc++98-compat-pedantic` was disabled. This seems ugly, but there does not seem to be any saner way. Testing: `$ ninja check-clang` Reviewers: rsmith, rtrieu, aaron.ballman Reviewed By: aaron.ballman Subscribers: jordan_rose, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D43162 llvm-svn: 327558
* [MC] Always emit relocations for same-section function referencesReid Kleckner2018-03-142-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We already emit relocations in this case when the "incremental linker compatible" flag is set, but it turns out these relocations are also required for /guard:cf. Now that we have two use cases for this behavior, let's make it unconditional to try to keep things simple. We never hit this problem in Clang because it always sets the "incremental linker compatible" flag when targeting MSVC. However, LLD LTO doesn't set this flag, so we'd get CFG failures at runtime when using ThinLTO and /guard:cf. We probably don't want LLD LTO to set the "incremental linker compatible" assembler flag, since this has nothing to do with incremental linking, and we don't need to timestamp LTO temporary objects. Fixes PR36624. Reviewers: inglorion, espindola, majnemer Subscribers: mehdi_amini, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D44485 llvm-svn: 327557
* [libomptarget][nvptx] Bug fix: Correctly identify the warp master active thread.George Rokos2018-03-141-1/+2
| | | | llvm-svn: 327556
* Separate sentences to clarify a comment.Rui Ueyama2018-03-141-7/+9
| | | | llvm-svn: 327555
* [InstSimplify] add tests to show missing/broken fadd folds (PR27151, ↵Sanjay Patel2018-03-141-27/+77
| | | | | | PR26958); NFC llvm-svn: 327554
* [InstSimplify] regenerate checks; NFCSanjay Patel2018-03-141-24/+24
| | | | llvm-svn: 327553
* [test] Delete some xfailed lldb-mi testsVedant Kumar2018-03-147-638/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first pass at removing some lldb-mi tests which have been xfailed and unmaintained for a while. We have open PRs for most of these tests already. I've opened up the following additional PRs: llvm.org/PR36739 - lldb-mi driver exits properly llvm.org/PR36740 - lldb-mi -gdb-set and -gdb-show llvm.org/PR36741 - lldb-mi -symbol-xxx The motivation here is to address timeout and pexpect-related issues in the test suite. This was discussed on lldb-dev in the thread: "increase timeout for tests?". After this change, the lldb-mi tests seem to be in better health (on Darwin at least). I consistently get: $ ./bin/llvm-dotest -p TestMi =================== Test Result Summary =================== Test Methods: 101 Reruns: 0 Success: 88 Expected Failure: 0 Failure: 0 Error: 0 Exceptional Exit: 0 Unexpected Success: 0 Skip: 13 Timeout: 0 Expected Timeout: 0 llvm-svn: 327552
* [LLVM-C] [bindings/go] Add C and Golang bindings for COMDATReid Kleckner2018-03-145-10/+186
| | | | | | | | Patch by Ben Clayton Differential Revision: https://reviews.llvm.org/D44086 llvm-svn: 327551
* [clangd] Use Contents from inputs in codeComplete and signatureHelpSimon Marchi2018-03-141-13/+10
| | | | | | | | | | | | | | | Summary: ClangdServer::{codeComplete,signatureHelp} both use the Contents from the draft manager. Since we want to move the draft manager from ClangdServer to ClangdLSPServer, this patch changes those methods to find the file contents from InputsAndPreamble, which contains the source passed in previously. Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D44484 llvm-svn: 327550
* Use GetItemAtIndexAsString overload for ConstString and move set rather than ↵Tatyana Krasnukha2018-03-141-6/+3
| | | | | | copy. llvm-svn: 327549
* Reuse IsEmpty for ConstString::operator bool().Tatyana Krasnukha2018-03-141-1/+1
| | | | llvm-svn: 327548
* Attempt to fix failure of deep-ast-tree.cpp on atom and s390Yaxun Liu2018-03-141-1/+1
| | | | llvm-svn: 327547
* Update DR script to mark Clang 6 as 'done' not 'svn'.Richard Smith2018-03-141-3/+0
| | | | llvm-svn: 327546
* [www] Update C++ DR status to match latest issues list.Richard Smith2018-03-141-309/+783
| | | | llvm-svn: 327545
* Set dso_local for NSConcreteStackBlock.Rafael Espindola2018-03-142-5/+5
| | | | llvm-svn: 327544
* Set dso_local on external rtti GVs.Rafael Espindola2018-03-143-7/+6
| | | | | | | | | | | In this particular case it would be possible to just add an else with CGM.setDSOLocal(GV), but it seems better to have as many callers as possible just call setGVProperties so that we can centralize the logic there. This patch then makes setGVProperties able to handle null Decls. llvm-svn: 327543
* Error instead of producing broken binary.Rafael Espindola2018-03-143-0/+27
| | | | | | | | This "fixes" PR36678 by just producing an error when we find a case where we would produce an plt entry that used ebx but ebx would not be set. llvm-svn: 327542
* [InstSimplify] [NFC] cast-unsigned-icmp-cmp-0.ll - don't run instcombineRoman Lebedev2018-03-141-4/+1
| | | | | | | As disscussed in post-commit review of D44421, there is simply no reason to run instcombine on this testcase. llvm-svn: 327541
* [X86] Add back fast-isel code for handling i8 shifts.Craig Topper2018-03-142-7/+26
| | | | | | | | | | I removed this in r316797 because the coverage report showed no coverage and I thought it should have been handled by the auto generated table. I now see that there is code that bypasses the table if the shift amount is out of bounds. This adds back the code. We'll codegen out of bounds i8 shifts to effectively (amount & 0x1f). The 0x1f is a strange quirk of x86 that shift amounts are always masked to 5-bits(except 64-bits). So if the masked value is still out bounds the result will be 0. Fixes PR36731. llvm-svn: 327540
* [clangd] Fix indentation in the comment. NFCIlya Biryukov2018-03-141-2/+3
| | | | llvm-svn: 327539
* Fix LLVM IR check lines in utils/update_cc_test_checks.pyFangrui Song2018-03-143-9/+11
| | | | | | | | | | Reviewers: arichardson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44400 llvm-svn: 327538
* [clangd] Don't expose vfs in TUScheduler::runWithPreamble.Ilya Biryukov2018-03-144-21/+27
| | | | | | | | | | | | | | | | Summary: It was previously an easy way to concurrently access a mutable vfs, which is a recipe for disaster. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, jkorous-apple, cfe-commits, ioeric Differential Revision: https://reviews.llvm.org/D44463 llvm-svn: 327537
* Reduce code duplication a bit.Rafael Espindola2018-03-145-14/+18
| | | | | | | The code for computing the offset of an entry in the plt is simple, but it was duplicated in quite a few places. llvm-svn: 327536
* [InstSimplify] [NFC] Add tests for peeking through unsigned FP casts for ↵Roman Lebedev2018-03-141-0/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sign compares (PR36682) Summary: This pattern came up in PR36682 / D44390 https://bugs.llvm.org/show_bug.cgi?id=36682 https://reviews.llvm.org/D44390 https://godbolt.org/g/oKvT5H Looking at the IR pattern in question, as per [[ https://github.com/rutgers-apl/alive-nj | alive-nj ]], for all the type combinations i checked (input: `i16`, `i32`, `i64`; intermediate: `half`/`i16`, `float`/`i32`, `double`/`i64`) for the following `icmp` comparisons the `uitofp`+`bitcast`+`icmp` can be evaluated to a boolean: * `slt 0` * `sgt -1` I did not check vectors, but i'm guessing it's the same there. {F5889242} Thus all these cases are in the testcase (along with the vector variant with additional `undef` element in the middle). There are no negative patterns here (unless alive-nj lied/is broken), all of these should be optimized. Reviewers: spatel, majnemer, efriedma, arsenm Reviewed By: spatel Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D44421 llvm-svn: 327535
* [InstCombine] [NFC] Add tests for peeking through unsigned FP casts for ↵Roman Lebedev2018-03-141-0/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | zero-equality compares (PR36682) Summary: This pattern came up in PR36682 / D44390 https://bugs.llvm.org/show_bug.cgi?id=36682 https://reviews.llvm.org/D44390 https://godbolt.org/g/oKvT5H Looking at the IR pattern in question, as per [[ https://github.com/rutgers-apl/alive-nj | alive-nj ]], for all the type combinations i checked (input: `i16`, `i32`, `i64`; intermediate: `half`/`i16`, `float`/`i32`, `double`/`i64`) for the following `icmp` comparisons the `uitofp`+`bitcast` can be dropped: * `eq 0` * `ne 0` I did not check vectors, but i'm guessing it's the same there. {F5889189} Thus all these cases are in the testcase (along with the vector variant with additional `undef` element in the middle). There are no negative patterns here (unless alive-nj lied/is broken), all of these should be optimized. Generated with {F5889196} Reviewers: spatel, majnemer, efriedma, arsenm Reviewed By: spatel Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D44416 llvm-svn: 327534
* [AArch64] Keep track of MIFlags in the LoadStoreOptimizerFrancis Visoiu Mistrih2018-03-144-7/+124
| | | | | | | | | | | | | | | | Merging: * $x26, $x25 = frame-setup LDPXi $sp, 0 * $sp = frame-destroy ADDXri $sp, 64, 0 into an LDPXpost should preserve the flags from both instructions as following: * frame-setup frame-destroy LDPXpost Differential Revision: https://reviews.llvm.org/D44446 llvm-svn: 327533
* [clangd] Remove forceReparse, add a flag to addDocument insteadIlya Biryukov2018-03-145-90/+65
| | | | | | | | | | | | | | Summary: To make the removal of DraftMgr from ClangdServer easier (D44408). Reviewers: sammccall, simark Reviewed By: sammccall, simark Subscribers: simark, klimek, jkorous-apple, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D44462 llvm-svn: 327532
* [CMake] Properly quote string arguments to quiet errors from r327528 when builtFrederich Munch2018-03-141-7/+7
| | | | | | with LLVM_ENABLE_EH and LLVM_ENABLE_RTTI. llvm-svn: 327531
* [X86] Teach X86TargetLowering::targetShrinkDemandedConstant to set ↵Craig Topper2018-03-145-16/+37
| | | | | | | | | | | | non-demanded bits if it helps created an and mask that can be matched as a zero extend. I had to modify the bswap recognition to allow unshrunk masks to make this work. Fixes PR36689. Differential Revision: https://reviews.llvm.org/D44442 llvm-svn: 327530
* Attempt to fix failure of deep-ast-tree.cpp on ppc64 and atomYaxun Liu2018-03-141-0/+3
| | | | llvm-svn: 327529
* Expand clang-interpreter with example of throwing in and from the JIT for ↵Frederich Munch2018-03-148-49/+621
| | | | | | | | | | | | | | | | | | Windows64. Summary: Getting this to work is not particularly obvious, and having it as an example should be helpful. Portions of this could be placed into LLVM, but as a whole it seems necessary to do this a higher level. Reviewers: lhames, mehdi_amini Reviewed By: lhames Subscribers: mgrang, martell, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D35103 llvm-svn: 327528
* [WebAssembly] Use DenseMapInfo traits from LLVM repo. NFCNicholas Wilson2018-03-142-47/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D44150 llvm-svn: 327527
* [WebAssembly] Add DenseMap traits and operator== for Wasm type structsNicholas Wilson2018-03-142-0/+80
| | | | | | Differential Revision: https://reviews.llvm.org/D44303 llvm-svn: 327526
OpenPOWER on IntegriCloud