summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a C++11 and C2x spelling for the availability attribute in the clang ↵Aaron Ballman2018-02-243-8/+37
| | | | | | | | vendor namespace. This attribute has custom parsing rules that previously prevented it from being supported with square bracket notation. Rework the clang attribute argument parsing to be more easily extended for other custom-parsed attributes. llvm-svn: 326036
* [DebugInfo] Fix buildbot failure on non-X86 targetsScott Linder2018-02-241-0/+1
| | | | llvm-svn: 326035
* [X86][SSE] combineSubToSubus - support v8i64 handling from SSSE3Simon Pilgrim2018-02-242-242/+164
| | | | | | Our UMIN/UMAX, vector truncation and shuffle combining is good enough to efficiently handle v8i64 with the number of leading zeros that are necessary for PSUBUS. llvm-svn: 326034
* [X86][SSE] combineSubToSubus - support v8i32 handling from SSSE3 (not SSE41)Simon Pilgrim2018-02-242-80/+57
| | | | | | Now that UMIN etc are Legal/Custom for SSE2+, we can efficiently match SUBUS v8i32 cases from SSSE3 which can perform efficient truncation with PSHUFB. llvm-svn: 326033
* [ubsan-minimal] Fix the ubsan_minimal debug build (COMPILER_RT_DEBUG=1) on ↵Dan Liew2018-02-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | macOS. `ubsan_minimal` makes use of the `_sanitizer::atomic_load` function. This function uses the `DCHECK` macro which in debug builds will use the `_sanitizer::CheckFailed` function. This function is part of `sanitizer_common` but `ubsan_minimal` doesn't use this so the implementation is missing which leads to link failures on macOS when trying to link `libclang_rt.ubsan_minimal_osx_dynamic.dylib`. This is in contrast to the BFD linker on Linux which doesn't seem to care about the missing symbol. A basic implementation of `_sanitizer::CheckFailed` has been added to the `ubsan_minimal` debug build to avoid the link error. The implementation could definitely be improved but I don't know which functions can be used in this context so I decided to restrict myself to functions only being used in `ubsan_minimal` already. llvm-svn: 326032
* [X86][SSE] combineSubToSubus - begun generalizing to work with any type ↵Simon Pilgrim2018-02-242-18/+25
| | | | | | sizes with SplitBinaryOpsAndApply llvm-svn: 326030
* Fix spelling in comment. NFCI.Simon Pilgrim2018-02-241-1/+1
| | | | llvm-svn: 326029
* [Sparc] Return true in enableMultipleCopyHints().Jonas Paulsson2018-02-244-33/+25
| | | | | | | | | | Enable multiple COPY hints to eliminate more COPYs during register allocation. Note that this is something all targets should do, see https://reviews.llvm.org/D38128. Review: James Y Knight llvm-svn: 326028
* Cleanup __config indention NFCLogan Chien2018-02-241-420/+432
| | | | | | | | | | | | | | | | | | This commit indents each level by two space characters, e.g. #if defined(CONDITION) # define _LIBCPP_NAME VALUE #else # define _LIBCPP_NAME VALUE #endif The simple #ifndef, #define, and #endif sequences are not indented, e.g. #ifndef _LIBCPP_NAME #define _LIBCPP_NAME ... #endif llvm-svn: 326027
* [X86] Remove GCCBuiltin from some intrinsics that are no longer used by clang.Craig Topper2018-02-241-2/+2
| | | | llvm-svn: 326026
* [cfi] Lazy initialization of CFI interceptorsVitaly Buka2018-02-241-3/+18
| | | | | | | | | | | | | | Summary: Interceptors initialization may need to allocate memory. So if we initialize too early we can crash in non initialized allocator. Reviewers: pcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43669 llvm-svn: 326025
* Remove unused variable. We should be warning-free.Daniel Jasper2018-02-241-1/+1
| | | | llvm-svn: 326024
* Make module use diagnostics refer to the top-level moduleDaniel Jasper2018-02-242-3/+3
| | | | | | | | | | All use declarations need to be directly placed in the top-level module anyway, knowing the submodule doesn't really help. The header that has the offending #include can easily be seen in the diagnostics source location. Review: https://reviews.llvm.org/D43673 llvm-svn: 326023
* [X86] Remove __builtin_ia32_permvarsf256_mask and ↵Craig Topper2018-02-243-46/+28
| | | | | | __builtin_ia32_permvarsi256_mask and use the avx2 unmasked versions and a select instead. llvm-svn: 326022
* [CFG] Keep speculatively working around an MSVC compiler crash.Artem Dergachev2018-02-241-9/+31
| | | | | | | | | | | | | Replace if() with a switch(). Because random changes in the code seem to suppress the crash. Story so far: r325966 - Crash introduced. r325969 - Speculative fix had no effect. r325978 - Tried to bisect the offending function, crash suddenly disappeared. r326016 - After another random change in the code, bug appeared again. llvm-svn: 326021
* [X86] Use SelectionDAG::getNot instead of implementing manually. NFCCraig Topper2018-02-241-2/+1
| | | | llvm-svn: 326020
* [CFG] Provide construction contexts for temporaries in conditional operators.Artem Dergachev2018-02-243-14/+30
| | | | | | | | | | | | | When a lifetime-extended temporary is on a branch of a conditional operator, materialization of such temporary occurs after the condition is resolved. This change allows us to understand, by including the MaterializeTemporaryExpr in the construction context, the target for temporary materialization in such cases. Differential Revision: https://reviews.llvm.org/D43483 llvm-svn: 326019
* [WebAssembly] Remove dead code.Rui Ueyama2018-02-241-1/+0
| | | | llvm-svn: 326018
* [WebAssembly] Remove dead code.Rui Ueyama2018-02-241-4/+0
| | | | llvm-svn: 326017
* [CFG] Provide construction contexts for temporaries bound to const references.Artem Dergachev2018-02-244-26/+29
| | | | | | | | | | In order to bind a temporary to a const lvalue reference, a no-op cast is added to make the temporary itself const, and only then the reference is taken (materialized). Skip the no-op cast when looking for the construction context. Differential Revision: https://reviews.llvm.org/D43481 llvm-svn: 326016
* [CFG] Provide construction contexts for functional cast-like constructors.Artem Dergachev2018-02-242-8/+32
| | | | | | | | | | When a constructor of a temporary with a single argument is treated as a functional cast expression, skip the functional cast expression and provide the correct construction context for the temporary. Differential Revision: https://reviews.llvm.org/D43480 llvm-svn: 326015
* [CFG] Provide construction contexts for lifetime-extended temporaries.Artem Dergachev2018-02-244-11/+53
| | | | | | | | | | | | | | When constructing a temporary that is going to be lifetime-extended through a MaterializeTemporaryExpr later, CFG elements for the respective constructor can now be queried to obtain the reference to that MaterializeTemporaryExpr and therefore gain information about lifetime extension. This may produce multi-layered construction contexts when information about both temporary destruction and lifetime extension is available. Differential Revision: https://reviews.llvm.org/D43477 llvm-svn: 326014
* [WebAssebmly] Minor simplification. NFC.Rui Ueyama2018-02-241-5/+6
| | | | llvm-svn: 326013
* Do not use `auto` for type that is not obvious in a local context.Rui Ueyama2018-02-241-2/+2
| | | | llvm-svn: 326012
* [AMDGPU] Shrinking V_SUBBREV_U32Stanislav Mekhanoshin2018-02-243-7/+8
| | | | | | | | | | V_SUBBREV_U32 is a commute opcode for V_SUBB_U32. However, when we try to commute V_SUBB_U32 in order to shrink it we do not then process V_SUBBREV_U32 and it stay VOP3. This is fixed. Differential Revision: https://reviews.llvm.org/D43699 llvm-svn: 326011
* Correct ctype(3) functions with NLS on NetBSDKamil Rytarowski2018-02-242-1/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The setlocale(3) function reloads the ctype(3) arrays from external files. This happens behind the scenes in the internals of libc (citrus library, runes functions etc). ctype(3) functions like isspace(3) can be provided with two variations on NetBSD: inlined or via a global symbol in libc: ``` #if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \ !defined(__cplusplus) #include <sys/ctype_inline.h> #else #include <sys/ctype_bits.h> #endif ``` The in-lined versions are de-facto array lookup operations. ``` #define isspace(c) ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_S)) ``` After setting setlocale(3) the ctype(3) arrays (_ctype_tab_, _toupper_tab_, _tolower_tab_) are reload behind the scenes and they are required to be marked as initialized. Set them initialized inside the common setlocale(3) interceptor. The arrays are of size of 257 elements: 0..255 + 1 (EOF). This corrects errors on NetBSD/amd64 in applications prebuilt with MSan. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, dvyukov, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42020 llvm-svn: 326008
* [Sanitizers] Increase allocated chunk limit for LargeMmapAllocatorAlex Shlyapnikov2018-02-242-11/+64
| | | | | | | | | | | | | | | | | | | | | | | Summary: There are applications out there which allocate more than 1 << 18 large chunks of memory (those handled by LargeMmapAllocator, aka secondary allocator). For 64 bits, secondary allocator stores allocated chunks in a growing on demand region of memory, growing in blocks of 128K, up to 1 << 20 chunks total. Sanitizer internal allocator's secondary uses fixed size array storing up to 1 << 15 chunks (down to 256K from 2Mb of memory used for that array). Nothing is changed for 32 bits, chunks are still stored in the fixed size array (up to 1 << 15 chunks). Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D43693 llvm-svn: 326007
* Fix build breakage from r326003Pavel Labath2018-02-242-3/+2
| | | | | | | | | | - an ambiguous reference to Optional<T> in llvm-dwarfdump.cpp (fixed with an explicit prefix). - a missing base class initialization in Entry copy constructor (fixed by using the implicitly default constructor, which is possible after some changes which were done during review). llvm-svn: 326006
* [llvm-objcopy] Fix typo in setSymTabAlexander Shaposhnikov2018-02-241-2/+3
| | | | | | | | | | | | This diff fixes the name of the argument of setSymTab and makes setSymTab/setStrTab private (to make the public interface a bit cleaner). Test plan: make check-all Differential revision: https://reviews.llvm.org/D43661 llvm-svn: 326005
* [WebAssembly] Add exception handling option and featureHeejin Ahn2018-02-2410-10/+30
| | | | | | | | | | | | | | Summary: Add a llc command line option and WebAssembly architecture feature for exception handling. Reviewers: dschuff Subscribers: jfb, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43683 llvm-svn: 326004
* Implement equal_range for the DWARF v5 accelerator tablePavel Labath2018-02-244-56/+540
| | | | | | | | | | | | | | | | | | | Summary: This patch implements the name lookup functionality of the .debug_names accelerator table and hooks it up to "llvm-dwarfdump -find". To make the interface of the two kinds of accelerator tables more consistent, I've created an abstract "DWARFAcceleratorTable::Entry" class, which provides a consistent interface to access the common functionality of the table entries (such as getting the die offset, die tag, etc.). I've also modified the apple table to vend entries conforming to this interface. Reviewers: JDevlieghere, aprantl, probinson, dblaikie Subscribers: vleschuk, clayborg, echristo, llvm-commits Differential Revision: https://reviews.llvm.org/D43067 llvm-svn: 326003
* Delete dead code in MachVMMemory.cpp, NFCVedant Kumar2018-02-241-36/+0
| | | | | | This addresses a compiler warning. llvm-svn: 326002
* [unittests] Disable lldb-server tests if an external debug server is in useVedant Kumar2018-02-242-3/+9
| | | | | | | | | | | | The lldb-server unit tests don't test the right thing when the debug server in use is copied from somewhere else. This can lead to spurious test failures. Disable these unit tests when an external debug server is in use. Fixes llvm.org/PR36494. llvm-svn: 326001
* [MemorySSA] Remove a redundant dyn_cast.George Burgess IV2018-02-241-3/+2
| | | | | | StartingAccess is a MemoryUseOrDef. No need to check again. llvm-svn: 326000
* [X86] Remove checks for '(scalar_to_vector (i8 (trunc GR32:)))' from scalar ↵Craig Topper2018-02-242-14/+8
| | | | | | | | masked move patterns. This portion can be matched by other patterns. We don't need it to make the larger pattern valid. It's sufficient to have a v1i1 mask input without caring where it came from. llvm-svn: 325999
* Add another test for PR36157.Richard Smith2018-02-241-0/+8
| | | | llvm-svn: 325998
* [ExprConstant] Fix crash when initialize an indirect field with another field.Volodymyr Sapsai2018-02-232-4/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | When indirect field is initialized with another field, you have MemberExpr with CXXThisExpr that corresponds to the field's immediate anonymous parent. But 'this' was referring to the non-anonymous parent. So when we were building LValue Designator, it was incorrect as it had wrong starting point. Usage of such designator would cause unexpected APValue changes and crashes. The fix is in adjusting 'this' for indirect fields from non-anonymous parent to the field's immediate parent. Discovered by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4985 rdar://problem/36359187 Reviewers: rsmith, efriedma Reviewed By: rsmith Subscribers: cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D42498 llvm-svn: 325997
* bpf: Hook target feature "alu32" with LLVMYonghong Song2018-02-231-1/+8
| | | | | | | | | | | | | | LLVM has supported a new target feature "alu32" which could be enabled or disabled by "-mattr=[+|-]alu32" when using llc. This patch link Clang with it, so it could be also done by passing related options to Clang, for example: -Xclang -target-feature -Xclang +alu32 Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325996
* [AMDGPU] Fixed madak.ll test on VI, added GFX10. NFC.Stanislav Mekhanoshin2018-02-231-33/+45
| | | | llvm-svn: 325995
* [Sema][ObjC] Process category attributes before checking protocol usesAlex Lorenz2018-02-232-4/+25
| | | | | | | | | This ensures that any availability attributes are attached to the category before the availability for the referenced protocols is checked. rdar://37829755 llvm-svn: 325994
* bpf: New disassembler testcases for 32-bit subregister supportYonghong Song2018-02-233-7/+40
| | | | | | | | | | | | This patch test disassembler output for load/store instructions when -mattr=+alu32 specified for which we want to use "w" register format. Also, this patch extended the existing insn-unit.s and insn-unit-32.s to make sure disassemblers for all other instructions are not affected. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325993
* bpf: New codegen testcases for 32-bit subregister supportYonghong Song2018-02-234-0/+541
| | | | | | | | | | This patch adds some unit tests for 32-bit subregister support. We want to make sure ALU32, subregister load/store and new peephole optimization are truely enabled once -mattr=+alu32 specified. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325992
* bpf: New optimization pass for eliminating unnecessary i32 promotionsYonghong Song2018-02-234-0/+197
| | | | | | | | | | | | | | | | | | This pass performs peephole optimizations to cleanup ugly code sequences at MachineInstruction layer. Currently, the only optimization in this pass is to eliminate type promotion sequences for zero extending 32-bit subregisters to 64-bit registers. If the compiler could prove the zero extended source come from 32-bit subregistere then it is safe to erase those promotion sequece, because the upper half of the underlying 64-bit registers were zeroed implicitly already. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325991
* bpf: New decoder namespace for 32-bit subregister load/storeYonghong Song2018-02-231-2/+43
| | | | | | | | | | | | | | | | | | | | | | | When -mattr=+alu32 passed to the disassembler, use decoder namespace for 32-bit subregister. This is to disassemble load and store instructions in preferred B format as described in previous commit: w = *(u8 *) (r + off) // BPF_LDX | BPF_B w = *(u16 *)(r + off) // BPF_LDX | BPF_H w = *(u32 *)(r + off) // BPF_LDX | BPF_W *(u8 *) (r + off) = w // BPF_STX | BPF_B *(u16 *)(r + off) = w // BPF_STX | BPF_H *(u32 *)(r + off) = w // BPF_STX | BPF_W NOTE: all other instructions should still use the default decoder namespace. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325990
* bpf: Enable 32-bit subregister support for -mattr=+alu32Yonghong Song2018-02-231-0/+2
| | | | | | | | | After all those preparation patches, now we could enable 32-bit subregister support once -mattr=+alu32 specified. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325989
* bpf: Support 32-bit subregister in various InstrInfo hooksYonghong Song2018-02-231-0/+10
| | | | | | | | | This patch support 32-bit subregister in three InstrInfo hooks, i.e. copyPhysReg, loadRegFromStackSlot and storeRegToStackSlot, Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325988
* bpf: New instruction patterns for 32-bit subregister load and storeYonghong Song2018-02-232-10/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The instruction mapping between eBPF/arm64/x86_64 are: eBPF arm64 x86_64 LD1 BPF_LDX | BPF_B ldrb movzbl LD2 BPF_LDX | BPF_H ldrh movzwl LD4 BPF_LDX | BPF_W ldr movl movzbl/movzwl/movl on x86_64 accept 32-bit sub-register, for example %eax, the same for ldrb/ldrh on arm64 which accept 32-bit "w" register. And actually these instructions only accept sub-registers. There is no point to have LD1/2/4 (unsigned) for 64-bit register, because on these arches, upper 32-bits are guaranteed to be zeroed by hardware or VM, so load into the smallest available register class is the best choice for maintaining type information. For eBPF we should adopt the same philosophy, to change current format (A): r = *(u8 *) (r + off) // BPF_LDX | BPF_B r = *(u16 *)(r + off) // BPF_LDX | BPF_H r = *(u32 *)(r + off) // BPF_LDX | BPF_W *(u8 *) (r + off) = r // BPF_STX | BPF_B *(u16 *)(r + off) = r // BPF_STX | BPF_H *(u32 *)(r + off) = r // BPF_STX | BPF_W into B: w = *(u8 *) (r + off) // BPF_LDX | BPF_B w = *(u16 *)(r + off) // BPF_LDX | BPF_H w = *(u32 *)(r + off) // BPF_LDX | BPF_W *(u8 *) (r + off) = w // BPF_STX | BPF_B *(u16 *)(r + off) = w // BPF_STX | BPF_H *(u32 *)(r + off) = w // BPF_STX | BPF_W There is no change on encoding nor how should they be interpreted, everything is as it is, load the specified length, write into low bits of the register then zeroing all remaining high bits. The only change is their associated register class and how compiler view them. Format A still need to be kept, because eBPF LLVM backend doesn't support sub-registers at default, but once 32-bit subregister is enabled, it should use format B. This patch implemented this together with all those necessary extended load and truncated store patterns. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325987
* bpf: Support i32 in getScalarShiftAmountTy methodYonghong Song2018-02-232-0/+7
| | | | | | | | | | getScalarShiftAmount method should be implemented for eBPF backend to make sure shift amount could still get correct type once 32-bit subregisters support are enabled. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325986
* bpf: Support condition comparison on i32Yonghong Song2018-02-233-27/+126
| | | | | | | | | | | | | | | | | | | We need to support condition comparison on i32. All these comparisons are supposed to be combined into BPF_J* instructions which only support i64. For ISD::BR_CC we need to promote it to i64 first, then do custom lowering. For ISD::SET_CC, just expand to SELECT_CC like what's been done for i64. For ISD::SELECT_CC, we also want to do custom lower for i32. However, after 32-bit subregister support enabled, it is possible the comparison operands are i32 while the selected value are i64, or the comparison operands are i64 while the selected value are i32. We need to define extra instruction pattern and support them in custom instruction inserter. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325985
* bpf: Handle i32 for ALU operations without ISA supportYonghong Song2018-02-231-21/+26
| | | | | | | | | | | | There is no eBPF ISA support for BSWAP, ROTR, ROTL, SREM, SDIVREM, MULHU, ADDC, ADDE etc on i32. They could be emulated by other basic BPF_ALU operations, we'd set their lowering action the same as i64. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Yonghong Song <yhs@fb.com> llvm-svn: 325984
OpenPOWER on IntegriCloud