summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Fix return value of snprintf_l() on Windows when buffer is too smallThomas Anderson2019-03-261-4/+5
| | | | | | | | | | | | | | | | | When the output buffer is too small to contain the output, `vsnprintf()` fills the buffer and returns the number of characters that __would have__ been written if the buffer was sufficiently large. `_vnsprintf_s()` on the other hand fills the buffer and returns -1 when this happens. We want the former behavior, but we also want to be able to pass in a locale to prevent having to call `setlocale()`. `__stdio_common_vsprintf()` is the only function general enough to get the behavior we want. Differential Revision: https://reviews.llvm.org/D59727 llvm-svn: 357024
* Revert "[coroutines] Add std::experimental::task<T> type"Brian Gesiak2019-03-2615-1687/+8
| | | | | | | | This revision is causing build and test failures, such as http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv8-linux/builds/648/steps/test.libcxx/logs/stdio, so I'll revert it. llvm-svn: 357023
* [WebAssembly] Initial implementation of PIC code generationSam Clegg2019-03-2623-244/+717
| | | | | | | | | | | | | | | | | | | | | | | | This change implements lowering of references global symbols in PIC mode. This change implements lowering of global references in PIC mode using a new @GOT reference type. @GOT references can be used with function or data symbol names combined with the get_global instruction. In this case the linker will insert the wasm global that stores the address of the symbol (either in memory for data symbols or in the wasm table for function symbols). For now I'm continuing to use the R_WASM_GLOBAL_INDEX_LEB relocation type for this type of reference which means that this relocation type can refer to either a global or a function or data symbol. We could choose to introduce specific relocation types for GOT entries in the future. See the current dynamic linking proposal: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md Differential Revision: https://reviews.llvm.org/D54647 llvm-svn: 357022
* gn build: Format all build filesNico Weber2019-03-264-7/+7
| | | | | | Re-ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`. llvm-svn: 357021
* [lld] Reapply "Prevent duplicate files in debug line header in dwarf 5."Ali Tamur2019-03-262-9/+7
| | | | | | | | | | | | | | | Reapply rL356943; the previous attempt was reverted because the patch rL356941 that this depended on had broken a test. Original commit message: [lld] Prevent duplicate files in debug line header in dwarf 5. Tags: #llvm Differential Revision: https://reviews.llvm.org/D59671 llvm-svn: 357020
* gn build: Merge r356929 (effectively relands r353518, reverted in r353621)Nico Weber2019-03-265-6/+7
| | | | llvm-svn: 357019
* [llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5."Ali Tamur2019-03-2614-26/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reapply rL356941 after regenerating the object file in the failing test llvm/test/tools/llvm-objdump/embedded-source.test from source. Original commit message: [llvm] Prevent duplicate files in debug line header in dwarf 5. Motivation: In previous dwarf versions, file name indexes started from 1, and the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes the primary source file to be explicitly given an entry with an index number 0. The current implementation honors the specification by just duplicating the main source file, once with index number 0, and later maybe with another index number. While this is compliant with the letter of the standard, the duplication causes problems for consumers of this information such as lldb. (Some files are duplicated, where only some of them have a line table although all refer to the same file) With this change, dwarf 5 debug line section files always start from 0, and the zeroth entry is not duplicated whenever possible. This requires different handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5) However, I think the minor complication is worth it, because it enables all consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the file name list homogenously. Tags: #llvm, #debug-info Differential Revision: https://reviews.llvm.org/D59515 llvm-svn: 357018
* [llvm-objcopy] - Strip sections before symbols.George Rimar2019-03-262-2/+54
| | | | | | | | | | | | This is a fix for https://bugs.llvm.org/show_bug.cgi?id=40007. Idea is to swap the order of stripping. So that we strip sections before symbols what allows us to strip relocation sections without emitting the error about relative symbols. Differential revision: https://reviews.llvm.org/D59763 llvm-svn: 357017
* Add lldb-vscode as a dependency of lldb tests.Jorge Gorbe Moya2019-03-261-0/+4
| | | | | | | | | | | | | | | | | Summary: In the current state, 'ninja check-lldb' runs the lldb-vscode tests, but it won't rebuild lldb-vscode if any of its sources has changed. This is very confusing when you fix something and the tests keep failing, or vice versa. Reviewers: clayborg Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D59828 llvm-svn: 357016
* [WebAssembly] Don't analyze branches after CFGStackifyHeejin Ahn2019-03-263-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `WebAssembly::analyzeBranch` now does not analyze anything if the function is CFG stackified. We were previously doing similar things by checking if a branch's operand is whether an integer or an MBB, but this failed to bail out when a BB did not have any terminators. Consider this case: ``` bb0: try $label0 call @foo // unwinds to %ehpad bb1: ... br $label0 // jumps to %cont. can be deleted ehpad: catch ... cont: end_try ``` Here `br $label0` will be deleted in CFGStackify's `removeUnnecessaryInstrs` function, because we jump to the %cont block even without the branch. But in this case, MachineVerifier fails to verify this, because `ehpad` is not a successor of `bb1` even if `bb1` does not have any terminators. MachineVerifier incorrectly thinks `bb1` falls through to the next block. This pass now consistently rejects all analysis after CFGStackify whether a BB has terminators or not, also making the MachineVerifier work. (MachineVerifier does not try to verify relationships between BBs if `analyzeBranch` fails, the behavior we want after CFGStackify.) This also adds a new option `-wasm-disable-ehpad-sort` for testing. This option helps create the sorted order we want to test, and without the fix in this patch, the tests in cfg-stackify-eh.ll fail at MachineVerifier with `-wasm-disable-ehpad-sort`. Reviewers: dschuff Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59740 llvm-svn: 357015
* [ConstantRange] Fix outdated comment; NFCNikita Popov2019-03-261-1/+1
| | | | | | Full/empty is required now, so there is no default. llvm-svn: 357014
* [InstCombine] Add tests for ssubo X, C -> saddo X, -C; NFCNikita Popov2019-03-262-0/+177
| | | | | | | | | | | Add baseline tests for canonicalization of ssubo X, C -> saddo X, -C. Patch by Dan Robertson. Differential Revision: https://reviews.llvm.org/D59653 llvm-svn: 357013
* [InstCombine] form uaddsat from add+umin (PR14613)Sanjay Patel2019-03-263-22/+94
| | | | | | | | | | | | | | | | | | This is the last step towards solving the examples shown in: https://bugs.llvm.org/show_bug.cgi?id=14613 With this change, x86 should end up with psubus instructions when those are available. All known codegen issues with expanding the saturating intrinsics were resolved with: D59006 / rL356855 We also have some early evidence in D58872 that using the intrinsics will lead to better perf. If some target regresses from this, custom lowering of the intrinsics (as in the above for x86) may be needed. llvm-svn: 357012
* [WebAssembly] Add CFGStacikfied field to WebAssemblyFunctionInfoHeejin Ahn2019-03-264-4/+19
| | | | | | | | | | | | | | | | Summary: This adds `CFGStackified` field and its serialization to WebAssemblyFunctionInfo. Reviewers: dschuff Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59747 llvm-svn: 357011
* [coroutines] Add std::experimental::task<T> typeBrian Gesiak2019-03-2615-8/+1687
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds the coroutine `std::experimental::task<T>` type described in proposal P1056R0. See https://wg21.link/P1056R0. This implementation allows customization of the allocator used to allocate the coroutine frame by passing std::allocator_arg as the first argument, followed by the allocator to use. This supports co_awaiting the same task multiple times. The second and subsequent times it returns a reference to the already-computed value. This diff also adds some implementations of other utilities that have potential for standardization as helpers within the test/... area: - `sync_wait(awaitable)` - See P1171R0 - `manual_reset_event` Move the definition of the __aligned_allocation_size helper function from <experimental/memory_resource> to <experimental/__memory> so it can be more widely used without pulling in memory_resource. Outstanding work: - Use C++14 keywords directly rather than macro versions eg. use `noexcept` instead of `_NOEXCEPT`). - Add support for overaligned coroutine frames. This may need wording in the Coroutines TS to support passing the extra `std::align_val_t`. - Eliminate use of `if constexpr` if we want it to compile under C++14. Patch by @lewissbaker (Lewis Baker). llvm-svn: 357010
* [WebAssembly] Support WebAssemblyFunctionInfo serializationHeejin Ahn2019-03-265-0/+74
| | | | | | | | | | | | | | | | | | | | Summary: The framework for supporting target-specific MachineFunctionInfo was added in r356215. This adds serialization support for WebAssemblyFunctionInfo on top of that. This patch only adds the framework and does not actually serialize anything at this point; we have to add YAML mapping later for the fields in WebAssemblyFunctionInfo we want to serialize if necessary. Reviewers: dschuff, arsenm Subscribers: sunfish, wdng, sbc100, jgravelle-google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59737 llvm-svn: 357009
* [WebAssembly] Fix a bug when mixing TRY/LOOP markersHeejin Ahn2019-03-262-1/+35
| | | | | | | | | | | | | | | | | | | Summary: When TRY and LOOP markers are in the same BB and END_TRY and END_LOOP markers are in the same BB, END_TRY should be _before_ END_LOOP, because LOOP is always before TRY if they are in the same BB. (TRY is placed in the latest possible position, whereas LOOP is in the earliest possible position.) Reviewers: dschuff Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59751 llvm-svn: 357008
* [WebAssembly] Fix bugs in BLOCK/TRY placementHeejin Ahn2019-03-262-42/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before we placed all TRY/END_TRY markers before placing BLOCK/END_BLOCK markers. This couldn't handle this case: ``` bb0: br bb2 bb1: // nearest common dominator of bb3 and bb4 br_if ... bb3 br bb4 bb2: ... bb3: call @foo // unwinds to ehpad bb4: call @bar // unwinds to ehpad ehpad: catch ... ``` When we placed TRY markers, we placed it in bb1 because it is the nearest common dominator of bb3 and bb4. But because bb0 jumps to bb2, when we placed block markers, we ended up with interleaved scopes like ``` block try end_block catch end_try ``` which was not correct. This patch fixes the bug by placing BLOCK and TRY markers in one pass while iterating BBs in a function. This also adds some more routines to `placeTryMarkers`, because we now have to assume that there can be previously placed BLOCK and END_BLOCK. Reviewers: dschuff Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59739 llvm-svn: 357007
* [ScriptInterpreterPython] Try to make the sanitizer bot green again.Davide Italiano2019-03-261-1/+1
| | | | | | Removing a use-after-free error. llvm-svn: 357006
* [InstCombine] add tests for uaddsat using min; NFCSanjay Patel2019-03-261-0/+86
| | | | llvm-svn: 357005
* [InstCombine] update tests to use FileCheck; NFCSanjay Patel2019-03-262-45/+83
| | | | llvm-svn: 357004
* [llvm-exegesis] Allow the target to disable the selection of some registers.Clement Courbet2019-03-265-2/+38
| | | | | | | | | | | | | | | | | | | | Summary: This prevents "Cannot encode high byte register in REX-prefixed instruction" from happening on instructions that require REX encoding when AH & co get selected. On the down side, these 4 registers can no longer be selected automatically, but this avoids having to expose all the X86 encoding complexity. Reviewers: gchatelet Subscribers: tschuett, jdoerfert, llvm-commits, bdb Tags: #llvm Differential Revision: https://reviews.llvm.org/D59821 llvm-svn: 357003
* [RISCV] Update setcc-logic.ll codegen testLuis Marques2019-03-261-12/+8
| | | | | | This should have been updated as part of D59753. llvm-svn: 357002
* [CodeGen] Delete never used LValueAlignFangrui Song2019-03-261-2/+0
| | | | | | It was added by rC176658 but never used since then. llvm-svn: 357001
* [MCA] Correctly update the UsedResourceGroups mask in the InstrBuilder.Andrea Di Biagio2019-03-265-10/+16
| | | | | | | | Found by inspection when looking at the debug output of MCA. This problem was latent, and none of the upstream models were affected by it. No functional change intended. llvm-svn: 357000
* Test commit: fix typoRonald Wampler2019-03-261-1/+1
| | | | llvm-svn: 356999
* [libomptarget] Introduce LIBOMPTARGET_ENABLE_DEBUG cmake option.Michael Kruse2019-03-262-5/+9
| | | | | | | | | | | | | | | | | | | At the moment, support for runtime debug output using the OMPTARGET_DEBUG=1 environment variable is only available with CMAKE_BUILD_TYPE=Debug builds. The patch allows setting it independently using the LIBOMPTARGET_ENABLE_DEBUG option, which is enabled by default depending on CMAKE_BUILD_TYPE. That is, unless this option is set explicitly, nothing changes. This is the same mechanism used by LLVM for LLVM_ENABLE_ASSERTIONS. This patch also removes adding -g -O0 in debug builds, it should be handled by cmake's CMAKE_{C|CXX}_FLAGS_DEBUG configuration option. Idea by Hal Finkel Differential Revision: https://reviews.llvm.org/D55952 llvm-svn: 356998
* [SystemZ] Remove LRMux pseudo instruction.Jonas Paulsson2019-03-261-3/+0
| | | | | | | This instruction is unused and not needed. Review: Ulrich Weigand. llvm-svn: 356997
* [DAG] Avoid smart constructor-based dangling nodes.Nirav Dave2019-03-2649-3723/+3300
| | | | | | | | | | | | | | | Various SelectionDAG non-combine operations (e.g. the getNode smart constructor and legalization) may leave dangling nodes by applying optimizations or not fully pruning unused result values. This can result in nodes that are never added to the worklist and therefore can not be pruned. Add a node inserter as the current node deleter to make sure such nodes have the chance of being pruned. Many minor changes, mostly positive. llvm-svn: 356996
* python 2/3 compat: commands vs subprocessSerge Guelton2019-03-269-17/+28
| | | | | | Differential Revision: https://reviews.llvm.org/D59584 llvm-svn: 356995
* Moved body of methods dump to .cpp file to fix compilation when modulesMikhail R. Gadelha2019-03-262-3/+7
| | | | | | are enabled llvm-svn: 356994
* Remove the TypePair classPavel Labath2019-03-264-148/+46
| | | | | | | | | | | | | | | | Summary: After D59297, the TypePair class kind of lost its purpose as it was no longer a "pair". This finishes the job started in that patch and deletes the class altogether. All usages have been updated to use CompilerType class directly. Reviewers: clayborg, jingham, zturner Subscribers: mehdi_amini, dexonsmith, jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D59414 llvm-svn: 356993
* Minidump: Use minidump types defined in llvmPavel Labath2019-03-265-180/+82
| | | | | | | | This is the next step in moving the minidump parsing into llvm. I remove the minidump structures already defined in the llvm Object library and convert our parser to use those. NFC. llvm-svn: 356992
* [RISCV] Improve codegen for icmp {ne,eq} with a constantLuis Marques2019-03-262-0/+26
| | | | | | | | | Adds two patterns to improve the codegen of GPR value comparisons with small constants. Instead of first loading the constant into another register and then doing an XOR of those registers, these patterns directly use the constant as an XORI immediate. llvm-svn: 356990
* [TargetLowering] Add SimplifyDemandedBits support for ISD::INSERT_VECTOR_ELTSimon Pilgrim2019-03-269-31/+65
| | | | | | | | | | | | This helps us relax the extension of a lot of scalar elements before they are inserted into a vector. Its exposes an issue in DAGCombiner::convertBuildVecZextToZext as some/all the zero-extensions may be relaxed to ANY_EXTEND, so we need to handle that case to avoid a couple of AVX2 VPMOVZX test regressions. Once this is in it should be easier to fix a number of remaining failures to fold loads into VBROADCAST nodes. Differential Revision: https://reviews.llvm.org/D59484 llvm-svn: 356989
* Fix nondeterminism introduced in r353954Yi Kong2019-03-263-2/+52
| | | | | | | | | | DenseMap iteration order is not guaranteed, use MapVector instead. Fix provided by srhines. Differential Revision: https://reviews.llvm.org/D59807 llvm-svn: 356988
* [OpenCL] Allow variadic macros as Clang feature.Anastasia Stulova2019-03-264-7/+23
| | | | llvm-svn: 356987
* [TableGen] Let list elements have a trailing commaJaved Absar2019-03-262-0/+8
| | | | | | | | | | | Let lists have an trailing comma to allow cleaner diffs e.g: def : Features<[FeatureA, FeatureB, ]>; Reviewed By: hfinkel Differential Revision: https://reviews.llvm.org/D59247 llvm-svn: 356986
* [TableGen] Give meaningful msg for def use in multiclassJaved Absar2019-03-262-2/+18
| | | | | | | | | | | | | When one mistakenly specifies 'def' instead of using 'defm', the error message is quite misleading: 'Couldn't find class..' Instead, it should recommend using defm if the multiclass of same name exists. Reviewed By: hfinkel Differential Revision: https://reviews.llvm.org/D59294 llvm-svn: 356985
* [ARM][Asm] Accept upper case coprocessor number and registersOliver Stannard2019-03-263-2/+58
| | | | | | Differential revision: https://reviews.llvm.org/D59760 llvm-svn: 356984
* update the release notes after the change of 'clang -dumpversion'Sylvestre Ledru2019-03-261-0/+2
| | | | llvm-svn: 356983
* [llvm-dlltool] Set a proper machine type for weak symbol object filesMartin Storsjo2019-03-262-1/+4
| | | | | | | | | | | | | | | This makes GNU binutils not reject the libraries outright. GNU ld handles weak externals slightly differently though, so it can't use them for aliases in import libraries, but this makes GNU ld able to use the rest of the import libraries. LLD accepted object files with machine type 0 aka IMAGE_FILE_MACHINE_UNKNOWN. Differential Revision: https://reviews.llvm.org/D59742 llvm-svn: 356982
* [RISCV] Pass -target-abi to -cc1asRoger Ferrer Ibanez2019-03-264-4/+33
| | | | | | | | | | | | | | | | | The RISC-V assembler needs the target ABI because it defines a flag of the ELF file, as described in [1]. Make clang (the driver) to pass the target ABI to -cc1as in exactly the same way it does for -cc1. Currently -cc1as knows about -target-abi but is not handling it. Handle it and pass it to the MC layer via MCTargetOptions. [1] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#file-header Differential Revision: https://reviews.llvm.org/D59298 llvm-svn: 356981
* [ADT] Update SmallVectorTest.EmplaceBack tests after rL356312Fangrui Song2019-03-261-36/+42
| | | | | | | | | | | | | | | | | rL356312 changed the return type of emplace_back from void to reference. Update the tests to check the behavior. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59809 llvm-svn: 356980
* [X86] In matchBitExtract, place all of the new nodes before Node's position ↵Craig Topper2019-03-261-10/+9
| | | | | | | | | | in the DAG for the topological sort. We were using OrigNBits, but that put all the nodes before the node we used to start the control computation. This caused some node earlier than the sequence we inserted to be selected before the sequence we created. We want our new sequence to be selected first since it depends on OrigNBits. I don't have a test case. Found by reviewing the code. llvm-svn: 356979
* [X86] In matchBitExtract, if we need to truncate the BEXTR make sure we put ↵Craig Topper2019-03-261-1/+1
| | | | | | | | the BEXTR at Node's position in the DAG for the topological sort. We were using OrigNBits, but that doesn't guarantee that it will be selected before the nodes that make up X. llvm-svn: 356978
* [X86] Remove unneeded FIXME. NFCCraig Topper2019-03-261-2/+0
| | | | | | We do fold loads right below this. llvm-svn: 356977
* Reland "[WebAssembly] Add linker options to control feature checking"Thomas Lively2019-03-268-19/+224
| | | | | | | | | Do not pipe binary data between processes in lit tests this time, since it turns out that can break on Windows. This reverts commit 84c8652fc3085155d0f9c355455e5a797c6d9db6. llvm-svn: 356975
* [clangd][xpc][cmake] Respect explicit value of CLANGD_BUILD_XPCJan Korous2019-03-261-3/+10
| | | | | | | | | | | | | We shouldn't prevent user from disabling XPC framework build on Darwin. However, by keeping it on by default our CI systems also test it by default on macOS. Based on user request: http://lists.llvm.org/pipermail/cfe-dev/2019-March/061778.html Differential Revision: https://reviews.llvm.org/D59808 llvm-svn: 356974
* X86Parser: Fix potential reference to deleted objectCraig Topper2019-03-261-9/+9
| | | | | | | | Within the MatchFPUWaitAlias function, Operands[0] is potentially overwritten leading to &Op referencing a deleted object. To fix this, assign the reference after the function. Differential Revision: https://reviews.llvm.org/D57376 llvm-svn: 356973
OpenPOWER on IntegriCloud