summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [SelectionDAG] Use INT_MIN as (1 << 31) is UB for signed integers. NFCI.Simon Pilgrim2019-05-031-2/+2
| | | | llvm-svn: 359873
* [SelectionDAG] computeKnownBits - remove some duplicate/shadow variables. NFCI.Simon Pilgrim2019-05-031-6/+4
| | | | llvm-svn: 359872
* [X86] LowerMULH - remove unused Lo/Hi vector indices. NFCI.Simon Pilgrim2019-05-031-5/+2
| | | | | | Leftover from before we had the extract128BitVector helpers. llvm-svn: 359871
* [MIR] Add simple PRE pass to MachineCSEAnton Afanasyev2019-05-039-2084/+1515
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the second part of the commit fixing PR38917 (hoisting partitially redundant machine instruction). Most of PRE (partitial redundancy elimination) and CSE work is done on LLVM IR, but some of redundancy arises during DAG legalization. Machine CSE is not enough to deal with it. This simple PRE implementation works a little bit intricately: it passes before CSE, looking for partitial redundancy and transforming it to fully redundancy, anticipating that the next CSE step will eliminate this created redundancy. If CSE doesn't eliminate this, than created instruction will remain dead and eliminated later by Remove Dead Machine Instructions pass. The third part of the commit is supposed to refactor MachineCSE, to make it more clear and to merge MachinePRE with MachineCSE, so one need no rely on further Remove Dead pass to clear instrs not eliminated by CSE. First step: https://reviews.llvm.org/D54839 Fixes llvm.org/PR38917 Reviewers: RKSimon Subscribers: hfinkel, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D56772 llvm-svn: 359870
* Reduce variable scope to just the if() block its actually used in. NFCI.Simon Pilgrim2019-05-031-2/+1
| | | | llvm-svn: 359869
* C.128 override, virtual keyword handlingRaphael Isemann2019-05-0335-65/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: According to [C128] "Virtual functions should specify exactly one of `virtual`, `override`, or `final`", I've added override where a virtual function is overriden but the explicit `override` keyword was missing. Whenever both `virtual` and `override` were specified, I removed `virtual`. As C.128 puts it: > [...] writing more than one of these three is both redundant and > a potential source of errors. I anticipate a discussion about whether or not to add `override` to destructors but I went for it because of an example in [ISOCPP1000]. Let me repeat the comment for you here: Consider this code: ``` struct Base { virtual ~Base(){} }; struct SubClass : Base { ~SubClass() { std::cout << "It works!\n"; } }; int main() { std::unique_ptr<Base> ptr = std::make_unique<SubClass>(); } ``` If for some odd reason somebody removes the `virtual` keyword from the `Base` struct, the code will no longer print `It works!`. So adding `override` to destructors actively protects us from accidentally breaking our code at runtime. [C128]: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final [ISOCPP1000]: https://github.com/isocpp/CppCoreGuidelines/issues/1000#issuecomment-476951555 Reviewers: teemperor, JDevlieghere, davide, shafik Reviewed By: teemperor Subscribers: kwk, arphaman, kadircet, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D61440 llvm-svn: 359868
* Split TestVLA into two and XFAIL one partPavel Labath2019-05-031-3/+10
| | | | | | | The part which checks whether vla_expr shows up in the variable list does not pass on non-darwin platforms. Add the appropriate decorator. llvm-svn: 359867
* [clangd] Minor code style cleanups in Protocol.h. NFCIlya Biryukov2019-05-031-6/+5
| | | | | | | | | | - Remove a parameter name that was misspelled (OS used for non-stream parameter) - Declare operator == (TextEdit, TextEdit) outside the struct, for consistency with other user-declared ops in our code. - Fix naming style of a parameter. llvm-svn: 359866
* Avoid duplicate function aliases on MinGW after SVN r359835Martin Storsjo2019-05-032-4/+6
| | | | | | | On MinGW, the same alias mechanism as for ELF, using __attribute__((__alias__())), is used. llvm-svn: 359865
* [Sema][ObjC] Disable -Wunused-parameter for ObjC methodsAkira Hatanaka2019-05-033-5/+7
| | | | | | | | | | The warning isn't very useful when the function is an ObjC method. rdar://problem/41561853 Differential Revision: https://reviews.llvm.org/D61147 llvm-svn: 359864
* [X86] Add more one checks to masked compare patterns that were missed in ↵Craig Topper2019-05-031-46/+48
| | | | | | | | | r358358. This covers the patterns we use for widening 128/256 comparisons to 512-bit when AVX512VL isn't supported. llvm-svn: 359863
* Revert "Initialization: move InstructionEmulation to full initialization"Pavel Labath2019-05-033-13/+14
| | | | | | | This change is bogus. lldb-server definitely uses instruction emulation on some architectures. llvm-svn: 359862
* [docs] Add support for Markdown documentation when creating man pagesIgor Kudrin2019-05-031-14/+32
| | | | | | | | | | rL358749 added a documentation page in the Markdown format. Currently, such pages are ignored in the configuration script for manual pages. This patch fixes that. Differential Revision: https://reviews.llvm.org/D60964 llvm-svn: 359860
* Revert "[Attribute/Diagnostics] Print macro if definition is an attribute ↵Leonard Chan2019-05-0333-407/+20
| | | | | | | | declaration" This reverts commit fc40cbd9d8c63e65eed3590ba925321afe782e1d. llvm-svn: 359859
* Revert r359814 "[Sema] Emit warning for visibility attribute on ↵Nico Weber2019-05-035-23/+2
| | | | | | | | internal-linkage declaration" See cfe-commits thread for r359814. llvm-svn: 359858
* [IRTranslator] Use the alloc size instead of the store size when translating ↵Quentin Colombet2019-05-032-1/+20
| | | | | | | | | | | | | | allocas We use to incorrectly use the store size instead of the alloc size when creating the stack slot for allocas. On aarch64 this can be demonstrated by allocating weirdly sized types. For instance, in the added test case, we use an alloca for i19. We used to allocate a slot of size 24-bit (19 rounded up to the next byte), whereas we really want to use a full 32-bit slot for this type. llvm-svn: 359856
* [AArch64][MC] Reject "add x0, x1, w2, lsl #1" etc.Eli Friedman2019-05-032-5/+11
| | | | | | | | | | Looks like just a minor oversight in the parsing code. Fixes https://bugs.llvm.org/show_bug.cgi?id=41504. Differential Revision: https://reviews.llvm.org/D60840 llvm-svn: 359855
* SemaOverload: Complete candidates before emitting the error, to ensure ↵David Blaikie2019-05-0310-179/+338
| | | | | | | | | | | | | | | | | diagnostics emitted (or suppressed) during completion don't interfere with the overload notes Because diagnostics and their notes are not connected at the API level, if the error message for an overload is emitted, then the overload candidates are completed - if a diagnostic is emitted during that work, the notes related to overload candidates would be attached to the latter diagnostic, not the original error. Sort of worse, if the latter diagnostic was disabled, the notes are disabled. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D61357 llvm-svn: 359854
* [ELF] Place SHT_NOTE sections with the same alignment into one PT_NOTEFangrui Song2019-05-033-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: While the generic ABI requires notes to be 8-byte aligned in ELF64, many vendor-specific notes (from Linux, NetBSD, Solaris, etc) use 4-byte alignment. In a PT_NOTE segment, if 4-byte aligned notes are followed by an 8-byte aligned note, the possible 4-byte padding may make consumers fail to parse the 8-byte aligned note. See PR41000 for a recent report about .note.gnu.property (NT_GNU_PROPERTY_TYPE_0). (Note, for NT_GNU_PROPERTY_TYPE_0, the consumers should probably migrate to PT_GNU_PROPERTY, but the alignment issue affects other notes as well.) To fix the issue, don't mix notes with different alignments in one PT_NOTE. If compilers emit 4-byte aligned notes before 8-byte aligned notes, we'll create at most 2 segments. sh_size%sh_addralign=0 is actually implied by the rule for linking unrecognized sections (in generic ABI), so we don't have to check that. Notes that match in name, type and attribute flags are concatenated into a single output section. The compilers have to ensure sh_size%sh_addralign=0 to make concatenated notes parsable. An alternative approach is to create a PT_NOTE for each SHT_NOTE, but we'll have to incur the sizeof(Elf64_Phdr)=56 overhead every time a new note section is introduced. Reviewers: ruiu, jakehehrlich, phosek, jhenderson, pcc, espindola Subscribers: emaste, arichardson, krytarowski, fedor.sergeev, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61296 llvm-svn: 359853
* Tidy up a comment, fix a typo, remove a comment that's obsolete.Eric Christopher2019-05-031-3/+2
| | | | llvm-svn: 359852
* [crtbegin] Fix an off-by-1 bug in __do_finiFangrui Song2019-05-031-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D61367 llvm-svn: 359850
* [AArch64][Windows] Compute function length correctly in unwind tables.Eli Friedman2019-05-034-9/+66
| | | | | | | | | | | | | | | | | | | | | | The primary fix here is to WinException.cpp: we need to exclude jump tables when computing the length of a function, or else we fail to correctly compute the length. (We can only compute the number of bytes consumed by certain assembler directives after the entire file is parsed. ".p2align" is one of those directives, and is used by jump table generation.) The secondary fix, to MCWin64EH, is to make sure we don't silently miscompile if we hit a similar situation in the future. It's possible we could extend ARM64EmitUnwindInfo so it allows function bodies that contain assembler directives, but that's a lot more complicated; see the FIXME in MCWin64EH.cpp. Fixes https://bugs.llvm.org/show_bug.cgi?id=41581 . Differential Revision: https://reviews.llvm.org/D61095 llvm-svn: 359849
* [Reproducers] Improve reproducer helpJonas Devlieghere2019-05-031-7/+18
| | | | | | Extend the documentation for the reproducer command. llvm-svn: 359848
* RegisterContextLLDB::GetFullUnwindPlanForFrame has four verboseJason Molenda2019-05-021-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | logging messages that are written the same, making it difficult to know for certain which code path was taken based on a logfile. Add some words to make each unique. Right now the ordering for finding a FullUnwindPlan (ignoring fallback unwind plan logic) is 1. If this is a _sigtramp like function, try eh_frame which is hand written on darwin systems to account for finding the saved register context correctly. 2. Ask the DynamicLoader if eh_frame should be preferred for this frame. Some binaries on the system may have hand-written eh_frame and the DynamicLoader is the source for this. (primarily this is for hand-written assembly in the objc runtime, and we tell lldb to trust that for functions in libobjc.dylib.) 3. if 0th frame, use GetUnwindPlanAtNonCallSite plan. 4. GetUnwindPlanAtCallSite {for 0th or any other} 5. GetUnwindPlanAtNonCallSite {now for non-0th frames, only if not from a compiler? hm.} 6. GetUnwindPlanArchitectureDefaultAtFunctionEntry if we're on the first instruction 7. Architectural default unwind plan ABI::CreateDefaultUnwindPlan I'm moving #6 -- DefaultAtFunctionEntry -- up to between #3 and #4, where we're already doing things specific to the zeroth frame. If we're on the zeroth frame and the GetUnwindPlanAtNonCallSite plan has failed for some reason, and we're on the first instruction, we should definitely use DefaultAtFunctionEntry instead of any other unwind plan. If we're trying to step out of some rando function on the system that we couldn't assembly instruction inspect, this is sufficient for us to step out of it. llvm-svn: 359847
* Fix tests on non-Darwin platforms.Adrian Prantl2019-05-022-1/+6
| | | | llvm-svn: 359846
* [MemorySSA] Check that block is reachable when adding phis.Alina Sbirlea2019-05-023-1/+109
| | | | | | | | | | | | | | | | | | | Summary: Originally the insertDef method was only used when building MemorySSA, and was limiting the number of Phi nodes that it created. Now it's used for updates as well, and it can create additional Phis needed for correctness. Make sure no Phis are created in unreachable blocks (condition met during MSSA build), otherwise the renamePass will find a null DTNode. Resolves PR41640. Reviewers: george.burgess.iv Subscribers: jlebar, Prazek, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61410 llvm-svn: 359845
* Fix -Wunsequenced false-positives in code controlled by a branch onRichard Smith2019-05-022-3/+8
| | | | | | | | | | __builtin_constant_p. If the operand of __builtin_constant_p is not constant and has side-effects, then code controlled by a branch on it is unreachable and we should not emit runtime behavior warnings in such code. llvm-svn: 359844
* Upstreaming an apple local patch by Frederic Riss.Jason Molenda2019-05-021-1/+32
| | | | | | | | | | | | | | | | | | | lldb has an expression that runs in the inferior process to collect the isa values and hash of the class names for classes in the system's shared cache. In recent OSes, swift classes are in this table and the function the jitted expression calls returns demangled names. We need to compute the hashes based on the mangled names. So for these names, return a hash value of 0 which indicates that lldb should read the class name directly out of the runtime tables and compute the hash itself. When this patch is absent, the lldb+swift testsuite has many failures on a recent macOS system; there isn't a direct non-swift way to test for this being correct. <rdar://problem/47935062> llvm-svn: 359843
* [MemorySSA] Refactor removing multiple trivial phis [NFC].Alina Sbirlea2019-05-022-6/+12
| | | | | | | | | | | | | | Summary: Create a method to clean up multiple potentially trivial phis, since we will need this often. Reviewers: george.burgess.iv Subscribers: jlebar, Prazek, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61471 llvm-svn: 359842
* Hide runtime support values such as clang's __vla_expr from frame variableAdrian Prantl2019-05-0210-4/+146
| | | | | | | | | | | | by respecting the "artificial" attribute on variables. Function arguments that are artificial and useful to end-users are being whitelisted by the language runtime. <rdar://problem/45322477> Differential Revision: https://reviews.llvm.org/D61451 llvm-svn: 359841
* [X86] Remove LEA16r references from X86FixupLEAs. NFCICraig Topper2019-05-021-9/+2
| | | | | | As far as I know, we never emit LEA16r llvm-svn: 359840
* [CUDA] Do not pass deprecated option fo fatbinaryArtem Belevich2019-05-021-1/+2
| | | | | | | | | CUDA 10.1 tools deprecated some command line options. fatbinary no longer needs --cuda. Differential Revision: https://reviews.llvm.org/D61470 llvm-svn: 359838
* [X86] Correct the register class for specific mask register constraints in ↵Craig Topper2019-05-022-0/+50
| | | | | | | | | | | | | | | | getRegForInlineAsmConstraint when the VT is a scalar type The default impementation in the base class for TargetLowering::getRegForInlineAsmConstraint doesn't work for mask registers when the VT is a scalar type integer types since the only legal mask types are vXi1. So we end up just getting whatever the first register class that contains the register. Currently this appears to be VK1, but its really dependent on the order tablegen outputs the register classes. Some code in the caller ends up looking up the type for this register class and find v1i1 then generates a copyfromreg from the physical k-register with the v1i1 type. Then it generates an any_extend from v1i1 to the scalar VT which isn't legal. This bad any_extend sticks around until isel where it selects a MOVZX32rr8 with a v1i1 input or maybe a i8 input. Not sure but eventually we pick up a copy from VK1 to GR8 in MachineIR which isn't supported. This leads to a failure in physical register copying. This patch uses the scalar type to find a VK class of the right size. In the attached test case this will be VK16. This causes a bitcast from vk16 to i16 to be generated instead of an any_extend. This will be properly iseled to a VK16 to GR32 copy and a GR32->GR16 extract_subreg. Fixes PR41678 Differential Revision: https://reviews.llvm.org/D61453 llvm-svn: 359837
* [SelectionDAG] Add asserts to verify the vectorness of input and output ↵Craig Topper2019-05-021-0/+12
| | | | | | | | | | types of TRUNCATE/ZERO_EXTEND/ANY_EXTEND/SIGN_EXTEND agree As a result of the underlying cause of PR41678 we created an ANY_EXTEND node with a scalar result type and v1i1 input type. Ideally we would have asserted for this instead of letting it go through to instruction selection and generate bad machine IR Differential Revision: https://reviews.llvm.org/D61463 llvm-svn: 359836
* Fix check-builtins on Windows after alias changesReid Kleckner2019-05-023-1/+21
| | | | llvm-svn: 359835
* [AArch64] Update for ExynosEvandro Menezes2019-05-023-82/+18
| | | | | | Fix the forwarding of multiplication results for Exynos M4. llvm-svn: 359834
* [X86] Remove string literal from an if. NFCCraig Topper2019-05-021-2/+1
| | | | | | | | This if used to be an assert that got refactored into an if, but left the string literal behind. Fixes PR41718 llvm-svn: 359833
* Initialization: move InstructionEmulation to full initializationSaleem Abdulrasool2019-05-023-14/+13
| | | | | | | The debug server does not need to use the instruction emulation. This helps reduce the size of the final lldb-server binary by another ~100K (~1% savings). llvm-svn: 359832
* Revert [ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' changeJordan Rupprecht2019-05-021-2/+2
| | | | | | This reverts r359314 (git commit 5015aa854dc043b2ae5d95e04e00d98518207ce5) llvm-svn: 359831
* Revert [llvm-nm] Fix handling of symbol types + [llvm-nm] Generalize symbol ↵Jordan Rupprecht2019-05-025-95/+41
| | | | | | | | types This reverts r359311 and r359312 (git commit 0bf06a8f59b0074a60871865e828d92db8930c59 and 5f184f17800ea2ac27be5e4ab540cb94a46e80c7) llvm-svn: 359830
* lld-link: Add /force:multipleres extension to make dupe resource diag non-fatalNico Weber2019-05-0210-10/+52
| | | | | | | As a side benefit, lld-link now reports more than one duplicate resource entry before exiting with an error even if the new flag is not passed. llvm-svn: 359829
* [gn] Include the missing BUILD.gn file for libcxxabi includesPetr Hosek2019-05-022-10/+11
| | | | | | | | This was omitted in r359805. Differential Revision: https://reviews.llvm.org/D61462 llvm-svn: 359828
* [libc++][test] Remove non-portable assumption that thread's constructor ↵Casey Carter2019-05-021-10/+19
| | | | | | | | | | | | | allocates with ::new Drive-by: * Fix potential race between check and update of `throw_one` in `operator new` * Fix latent bug in `operator delete`, which shouldn't decrement `outstanding_new` when passed a null pointer * Specifically catch the expected `bad_alloc` in `main` instead of `...` Differential Revision: https://reviews.llvm.org/D50860 llvm-svn: 359827
* [Attribute/Diagnostics] Print macro if definition is an attribute declarationLeonard Chan2019-05-0233-20/+407
| | | | | | | | | | | | | If an address_space attribute is defined in a macro, print the macro instead when diagnosing a warning or error for incompatible pointers with different address_spaces. We allow this for all attributes (not just address_space), and for multiple attributes declared in the same macro. Differential Revision: https://reviews.llvm.org/D51329 llvm-svn: 359826
* [gn] Update the clangd test lit site configurationPetr Hosek2019-05-023-7/+17
| | | | | | This reflects changes made in r359763. llvm-svn: 359825
* [clangd][xpc] Cannonicalize value of CLANGD_BUILD_XPC before cachingJan Korous2019-05-021-0/+2
| | | | llvm-svn: 359824
* Change the metadata for heapallocsite calls when the type is cast.Amy Huang2019-05-023-17/+18
| | | | llvm-svn: 359823
* [OPENMP][NVPTX]Improve code by using parallel level counter.Alexey Bataev2019-05-0210-197/+200
| | | | | | | | | | | | | | | | | | Summary: Previously for the different purposes we need to get the active/common parallel level and with full runtime we iterated over all the records to calculate this level. Instead, we can used the warp-based parallel level counters used in no-runtime mode. Reviewers: grokos, gtbercea, kkwli0 Subscribers: guansong, jfb, jdoerfert, caomhin, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D61395 llvm-svn: 359822
* Typo Functino->Function.Eric Christopher2019-05-021-1/+1
| | | | llvm-svn: 359821
* Another attempt to fix "could not find clang-check" lit warning in ↵Nico Weber2019-05-021-9/+9
| | | | | | | | | | | | | | | analyzer-less builds r359717 added clang-check as a dep of check-clang unconditionally because I had missed lit.local.cfg in test/Tooling. Instead, only add clang-check to the tools if the analyzer is enabled, since the build target only exists then, and since all tests using clang-check are skipped when the analyzer is disabled. Differential Revision: https://reviews.llvm.org/D61418 llvm-svn: 359820
OpenPOWER on IntegriCloud