summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [CFG] Allow CallExpr's to be looked up in CFG'sRichard Trieu2018-03-152-0/+27
| | | | | | | | r327343 changed the handling for CallExpr in a CFG, which prevented lookups for CallExpr while other Stmt kinds still worked. This change carries over the necessary bits from Stmt function to CallExpr function. llvm-svn: 327593
* [Dictionary] Rewrite the test added in r327587 as an inline test.Davide Italiano2018-03-156-20/+13
| | | | | | | | | | | | | | | Until we have a better story for putting commands and check lines in the same file (they're currently ignored), it seems that inline tests are actually more concise and easier to understand. Too bad we have still some python boilerplate, but that's not really substantial so we can live with it. Thanks to Fred for pointing out and Jim for explaining me how to use the inline test format. <rdar://problem/34806516> llvm-svn: 327592
* [analyzer] Explicitly set an -std level for the analyzer test.George Karpenkov2018-03-141-1/+1
| | | | llvm-svn: 327591
* [clang-tidy] Add Zircon module to clang-tidyJulie Hockett2018-03-1412-0/+334
| | | | | | | | | | Adding a Zircon module to clang-tidy for checks specific to the Zircon kernel, and adding a checker to fuchsia-zx (for zircon) to flag instances where specific objects are temporarily created. Differential Revision: https://reviews.llvm.org/D44346 llvm-svn: 327590
* [CleanUp] Remove NumInstructions field from LoopVectorizer's RegisterUsage ↵Matt Davis2018-03-141-7/+0
| | | | | | | | | | | | | | | | | | | | | struct. Summary: This variable is largely going unused; aside from reporting number of instructions for in DEBUG builds. The only use of NumInstructions is in debug output to represent the LoopSize. That value can be can be misleading as it also includes metadata instructions (e.g., DBG_VALUE) which have no real impact. If we do choose to keep this around, we probably should guard it by a DEBUG macro, as it's not used in production builds. Reviewers: majnemer, congh, rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: https://reviews.llvm.org/D44495 llvm-svn: 327589
* [X86][Btver2] Add support for multiple pipelines stages for fpu schedules. NFCI.Simon Pilgrim2018-03-141-98/+41
| | | | | | This allows us to use JWriteResFpuPair for complex schedule classes as well as single pipe instructions. llvm-svn: 327588
* [DataFormatters] Implement summary for __NSDictionary0.Davide Italiano2018-03-145-0/+24
| | | | | | | | | | | | | | | | | | | Before the patch: (lldb) frame var emptyDictionary (__NSDictionary0 *) emptyDictionary = 0x0000000100304420 After: (lldb) frame var emptyDictionary (__NSDictionary0 *) emptyDictionary = 0x0000000100304420 0 key/value pairs There's nothing much else we can do, as this is always empty by definition. <rdar://problem/34806516> llvm-svn: 327587
* [test] Skip more lldb-mi tests which occasionally time out on DarwinVedant Kumar2018-03-141-1/+6
| | | | llvm-svn: 327586
* [InstSimplify] add tests for frem and vectors with undef; NFCSanjay Patel2018-03-141-3/+88
| | | | | | | | | These should all be folded. The vector tests need to have m_AnyZero updated to ignore undef elements, but we need to be careful not to return the existing value in that case and unintentionally propagate undef. llvm-svn: 327585
* Update Error MessageRumeet Dhindsa2018-03-1413-15/+16
| | | | | | | | | | | | | | Summary: Updates error message for dynamic relocation attempt for read only segments. Reviewers: ruiu Reviewed By: ruiu Subscribers: emaste, javed.absar, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D44453 llvm-svn: 327584
* [AMDGPU] Waitcnt pass: Modify the waitcnt pass to propagate info in the case ↵Mark Searles2018-03-142-13/+55
| | | | | | | | of a single basic block loop. mergeInputScoreBrackets() does this for us; update it so that it processes the single bb's score bracket when processing the single bb's preds. It is, after all, a pred of itself, so it's score bracket is needed. Differential Revision: https://reviews.llvm.org/D44434 llvm-svn: 327583
* [X86][Btver2] Add ResourceCycles and NumMicroOps overrides to scalar ↵Simon Pilgrim2018-03-141-2/+8
| | | | | | | | instructions. NFCI. Currently still use default values - this is setup for a future patch. llvm-svn: 327582
* [FastISel] Sink local value materializations to first useReid Kleckner2018-03-1437-407/+750
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Local values are constants, global addresses, and stack addresses that can't be folded into the instruction that uses them. For example, when storing the address of a global variable into memory, we need to materialize that address into a register. FastISel doesn't want to materialize any given local value more than once, so it generates all local value materialization code at EmitStartPt, which always dominates the current insertion point. This allows it to maintain a map of local value registers, and it knows that the local value area will always dominate the current insertion point. The downside is that local value instructions are always emitted without a source location. This is done to prevent jumpy line tables, but it means that the local value area will be considered part of the previous statement. Consider this C code: call1(); // line 1 ++global; // line 2 ++global; // line 3 call2(&global, &local); // line 4 Today we end up with assembly and line tables like this: .loc 1 1 callq call1 leaq global(%rip), %rdi leaq local(%rsp), %rsi .loc 1 2 addq $1, global(%rip) .loc 1 3 addq $1, global(%rip) .loc 1 4 callq call2 The LEA instructions in the local value area have no source location and are treated as being on line 1. Stepping through the code in a debugger and correlating it with the assembly won't make much sense, because these materializations are only required for line 4. This is actually problematic for the VS debugger "set next statement" feature, which effectively assumes that there are no registers live across statement boundaries. By sinking the local value code into the statement and fixing up the source location, we can make that feature work. This was filed as https://bugs.llvm.org/show_bug.cgi?id=35975 and https://crbug.com/793819. This change is obviously not enough to make this feature work reliably in all cases, but I felt that it was worth doing anyway because it usually generates smaller, more comprehensible -O0 code. I measured a 0.12% regression in code generation time with LLC on the sqlite3 amalgamation, so I think this is worth doing. There are some special cases worth calling out in the commit message: 1. local values materialized for phis 2. local values used by no-op casts 3. dead local value code Local values can be materialized for phis, and this does not show up as a vreg use in MachineRegisterInfo. In this case, if there are no other uses, this patch sinks the value to the first terminator, EH label, or the end of the BB if nothing else exists. Local values may also be used by no-op casts, which adds the register to the RegFixups table. Without reversing the RegFixups map direction, we don't have enough information to sink these instructions. Lastly, if the local value register has no other uses, we can delete it. This comes up when fastisel tries two instruction selection approaches and the first materializes the value but fails and the second succeeds without using the local value. Reviewers: aprantl, dblaikie, qcolombet, MatzeB, vsk, echristo Subscribers: dotdash, chandlerc, hans, sdardis, amccarth, javed.absar, zturner, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D43093 llvm-svn: 327581
* [CodeGen] Use MIR syntax for MachineMemOperand printingFrancis Visoiu Mistrih2018-03-1420-318/+261
| | | | | | | | | | Get rid of the "; mem:" suffix and use the one we use in MIR: ":: (load 2)". rdar://38163529 Differential Revision: https://reviews.llvm.org/D42377 llvm-svn: 327580
* [WebAssembly] Fix -Werror=extra failure due to enum in ternaryNicholas Wilson2018-03-141-1/+2
| | | | llvm-svn: 327579
* Remove test deep-ast-tree.cppYaxun Liu2018-03-141-267/+0
| | | | | | | Since there is no reliable way to change the AST depth of this test by supported stack size of the test environment, remove this test for now. llvm-svn: 327578
* [EarlyCSE] Exploit open ended invariant.start scopesPhilip Reames2018-03-143-31/+303
| | | | | | | | | | | | If we have an invariant.start with no corresponding invariant.end, then the memory location becomes invariant indefinitely after the invariant.start. As a result, anything dominated by the start is guaranteed to see the value the memory location had when the invariant.start executed. This patch adds an AvailableInvariants table which tracks the generation a particular memory location became invariant and then uses that information to allow value forwarding that would otherwise be disallowed by potentially aliasing stores. (Reminder: In EarlyCSE everything clobbers everything by default.) This should be compatible with the MemorySSA variant, but design is generational. We can and should add first class support for invariant.start within MemorySSA at a later time. I took a quick look at doing so, but probably need some input from a MemorySSA expert. Differential Revision: https://reviews.llvm.org/D43716 llvm-svn: 327577
* Revert "[ORC] Switch from shared_ptr to unique_ptr for addModule methods."Reid Kleckner2018-03-1417-83/+112
| | | | | | | | | | | | | This reverts commit r327566, it breaks test/ExecutionEngine/OrcMCJIT/test-global-ctors.ll. The test doesn't crash with a stack trace, unfortunately. It merely returns 1 as the exit code. ASan didn't produce a report, and I reproduced this on my Linux machine and Windows box. llvm-svn: 327576
* [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
OpenPOWER on IntegriCloud