summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [X86] Support function attribute "patchable-function-entry"Fangrui Song2020-01-102-3/+73
| | | | | | | For x86-64, we diverge from GCC -fpatchable-function-entry in that we emit multi-byte NOPs. Differential Revision: https://reviews.llvm.org/D72220
* [AArch64] Add function attribute "patchable-function-entry" to add NOPs at ↵Fangrui Song2020-01-107-2/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function entry The Linux kernel uses -fpatchable-function-entry to implement DYNAMIC_FTRACE_WITH_REGS for arm64 and parisc. GCC 8 implemented -fpatchable-function-entry, which can be seen as a generalized form of -mnop-mcount. The N,M form (function entry points before the Mth NOP) is currently only used by parisc. This patch adds N,0 support to AArch64 codegen. N is represented as the function attribute "patchable-function-entry". We will use a different function attribute for M, if we decide to implement it. The patch reuses the existing patchable-function pass, and TargetOpcode::PATCHABLE_FUNCTION_ENTER which is currently used by XRay. When the integrated assembler is used, __patchable_function_entries will be created for each text section with the SHF_LINK_ORDER flag to prevent --gc-sections (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93197) and COMDAT (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93195) issues. Retrospectively, __patchable_function_entries should use a PC-relative relocation type to avoid the SHF_WRITE flag and dynamic relocations. "patchable-function-entry"'s interaction with Branch Target Identification is still unclear (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424 for GCC discussions). Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D72215
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-101-1/+1
| | | | Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
* [AIX] Allow vararg calls when all arguments reside in registersjasonliu2020-01-103-24/+376
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch pushes the AIX vararg unimplemented error diagnostic later and allows vararg calls so long as all the arguments can be passed in register. This patch extends the AIX calling convention implementation to initialize GPR(s) for vararg float arguments. On AIX, both GPR(s) and FPR are allocated for floating point arguments. The GPR(s) are only initialized for vararg calls, otherwise the callee is expected to retrieve the float argument in the FPR. f64 in AIX PPC32 requires special handling in order to allocated and initialize 2 GPRs. This is performed with bitcast, SRL, truncation to initialize one GPR for the MSW and bitcast, truncations to initialize the other GPR for the LSW. A future patch will follow to add support for arguments passed on the stack. Patch provided by: cebowleratibm Reviewers: sfertile, ZarkoCA, hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D71013
* [examples] Add missing dependency in llvm examplesHiroshi Inoue2020-01-113-0/+3
| | | | To fix build failure with BUILD_SHARED_LIBS=ON
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-101-1/+1
| | | | Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-101-1/+1
| | | | Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately).
* [X86][AVX] lowerShuffleAsLanePermuteAndShuffle - consistently normalize ↵Simon Pilgrim2020-01-101-2/+2
| | | | | | | | multi-input shuffle elements We only use lowerShuffleAsLanePermuteAndShuffle for unary shuffles at the moment, but we should consistently handle lane index calculations for multiple inputs in both the AVX1 and AVX2 paths. Minor (almost NFC) tidyup as I'm hoping to use lowerShuffleAsLanePermuteAndShuffle for binary shuffles soon.
* [gn build] Port 5e7beb0a414LLVM GN Syncbot2020-01-101-0/+1
|
* [clangd] Fix targetDecl() on certain usage of ObjC properties.Sam McCall2020-01-102-6/+12
| | | | | | | | | | | | | | | Summary: In particular there's a common chain: OpaqueValueExpr->PseudoObjectExpr->ObjCPropertyRefExpr->ObjCPropertyDecl and we weren't handling the first two edges Reviewers: dgoldman, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72494
* [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcsYonghong Song2020-01-1036-142/+381
| | | | | | | | | | | | | | Previously extern function is added as BTF_KIND_VAR. This does not work well with existing BTF infrastructure as function expected to use BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO. This patch added extern function to BTF_KIND_FUNC. The two bits 0:1 of btf_type.info are used to indicate what kind of function it is: 0: static 1: global 2: extern Differential Revision: https://reviews.llvm.org/D71638
* [InstCombine] add tests for fsub; NFCSanjay Patel2020-01-101-0/+135
| | | | | Conflicting/missing canonicalizations are visible in PR44509: https://bugs.llvm.org/show_bug.cgi?id=44509
* [mlir][spirv] Fix typos related to (de)serialization.Denis Khalikov2020-01-102-5/+5
| | | | | | Fix typos related to (de)serialization of spv.selection. Differential Revision: https://reviews.llvm.org/D72503
* [analyzer] Add PlacementNewCheckerGabor Marton2020-01-106-0/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This checker verifies if default placement new is provided with pointers to sufficient storage capacity. Noncompliant Code Example: #include <new> void f() { short s; long *lp = ::new (&s) long; } Based on SEI CERT rule MEM54-CPP https://wiki.sei.cmu.edu/confluence/display/cplusplus/MEM54-CPP.+Provide+placement+new+with+properly+aligned+pointe This patch does not implement checking of the alignment. Reviewers: NoQ, xazax.hun Subscribers: mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat Tags: #clang Differential Revision: https://reviews.llvm.org/D71612
* Add missing nullptr checks.Adrian Prantl2020-01-108-29/+42
| | | | | | | | | | GetPersistentExpressionStateForLanguage() can return a nullptr if it cannot construct a typesystem. This patch adds missing nullptr checks at all uses. Inspired by rdar://problem/58317195 Differential Revision: https://reviews.llvm.org/D72413
* Add support for __declspec(guard(nocf))Andrew Paverd2020-01-1011-28/+252
| | | | | | | | | | | | | | | | | | Summary: Avoid using the `nocf_check` attribute with Control Flow Guard. Instead, use a new `"guard_nocf"` function attribute to indicate that checks should not be added on indirect calls within that function. Add support for `__declspec(guard(nocf))` following the same syntax as MSVC. Reviewers: rnk, dmajor, pcc, hans, aaron.ballman Reviewed By: aaron.ballman Subscribers: aaron.ballman, tomrittervg, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D72167
* [PowerPC] Handle constant zero bits in BitPermutationSelectorNemanja Ivanovic2020-01-102-4/+148
| | | | | | | | | | We currently crash when analyzing an AssertZExt node that has some bits that are constant zeros (i.e. as a result of an and with a constant). This issue was reported in https://bugs.llvm.org/show_bug.cgi?id=41088 and this patch fixes that. Differential revision: https://reviews.llvm.org/D72038
* [NFC] format unittest for ExprMutAnalyzerJonas Toth2020-01-101-29/+24
| | | | | | This formatting is a preparation for review in https://reviews.llvm.org/D54943 to separate pure formatting changes from actual testing changes.
* [DebugInfo][NFC] Remove unused variable/fix variable namingJames Henderson2020-01-101-1181/+1179
| | | | | | Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D72159
* [DebugInfo] Improve error message textJames Henderson2020-01-104-766/+770
| | | | | | | | | | Unlike most of our errors in the debug line parser, the "no end of sequence" message was missing any reference to which line table it refererred to. This change adds the offset to this message. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D72443
* [LIBOMPTARGET]Ignore empty target descriptors.Alexey Bataev2020-01-102-0/+21
| | | | | | | | | | | | | | | | | | Summary: If the dynamically loaded module has been compiled with -fopenmp-targets and has no target regions, it has empty target descriptor. It leads to a crash at the runtime if another module has at least one target region and at least one entry in its descriptor. The runtime library is unable to load the empty binary descriptor and terminates the execution. Caused by a clang-offload-wrapper. Reviewers: grokos, jdoerfert Subscribers: caomhin, kkwli0, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72472
* AMDGPU/GlobalISel: Clamp G_ZEXT source sizesMatt Arsenault2020-01-108-240/+970
| | | | | Also clamps G_SEXT/G_ANYEXT, but the implementation is more limited so fewer cases actually work.
* [lldb][tests] Make it possible to expect failure for a whole categoryTatyana Krasnukha2020-01-104-4/+24
| | | | | | | | | | | | | There already are decorators and "--excluded" option to mark test-cases/files as expected to fail. However, when a new test file is added and it which relates to a feature that a target doesn't support, this requires either adding decorators to that file or modifying the file provided as "--excluded" option value. The purpose of this patch is to avoid any modifications in such cases. E.g. if a target doesn't support "watchpoints" and passes "--xfail-category watchpoint" to dotest, a testing job will not fail after a new watchpoint-related test file is added. Differential Revision: https://reviews.llvm.org/D71906
* [lldb][tests][NFC] Unify variable naming conventionTatyana Krasnukha2020-01-105-45/+45
|
* [FPEnv] Invert sense of MIFlag::FPExcept flagUlrich Weigand2020-01-1013-106/+130
| | | | | | | | | | | | | | | | | | In D71841 we inverted the sense of the SDNode-level flag to ensure all nodes default to potentially raising FP exceptions unless otherwise specified -- i.e. if we forget to propagate the flag somewhere, the effect is now only lost performance, not incorrect code. However, the related flag at the MI level still defaults to nodes not raising FP exceptions unless otherwise specified. To be fully on the (conservatively) safe side, we should invert that flag as well. This patch does so by replacing MIFlag::FPExcept with MIFlag::NoFPExcept. (Note that this does also introduce an incompatible change in the MIR format.) Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D72466
* [ARM][MVE] Tail predicate VMAX,VMAXA,VMIN,VMINASam Parker2020-01-102-0/+20
| | | | | | | Add the MVE min and max instructions to our tail predication whitelist. Differential Revision: https://reviews.llvm.org/D72502
* RangeDataVector: Support custom sorting for D63540Jan Kratochvil2020-01-102-23/+54
| | | | | | | | | | | As suggested by @labath extended RangeDataVector so that user can provide custom sorting of the Entry's `data' field for D63540. https://reviews.llvm.org/D63540 RangeData functions were used just by RangeDataVector (=after I removed them LLDB still builds fine) which no longer uses them so I removed them. Differential revision: https://reviews.llvm.org/D72460
* ARMLowOverheadLoops: a few more dbg msgs to better trace rejected TP loops. NFC.Sjoerd Meijer2020-01-101-7/+16
|
* Sprinkle some constexpr on default ctors so the compiler can diagnose unused ↵Benjamin Kramer2020-01-105-5/+3
| | | | instances. NFCI.
* Reverting, broke some bots. Need further investigation.Diogo Sampaio2020-01-1024-698/+147
| | | | | | | | Summary: This reverts commit 8c12769f3046029e2a9b4e48e1645b1a77d28650. Reviewers: Subscribers:
* [lldb][tests] Cleanup '.categories'Tatyana Krasnukha2020-01-106-5/+1
|
* [FPEnv] Generate constrained FP comparisons from clangUlrich Weigand2020-01-104-11/+360
| | | | | | | | | | | | | | | | | | | | | Update the IRBuilder to generate constrained FP comparisons in CreateFCmp when IsFPConstrained is true, similar to the other places in the IRBuilder. Also, add a new CreateFCmpS to emit signaling FP comparisons, and use it in clang where comparisons are supposed to be signaling (currently, only when emitting code for the <, <=, >, >= operators). Note that there is currently no way to add fast-math flags to a constrained FP comparison, since this is implemented as an intrinsic call that returns a boolean type, and FMF are only allowed for calls returning a floating-point type. However, given the discussion around https://bugs.llvm.org/show_bug.cgi?id=42179, it seems that FCmp itself really shouldn't have any FMF either, so this is probably OK. Reviewed by: craig.topper Differential Revision: https://reviews.llvm.org/D71467
* [lldb][test] NFC, re-use _getTestPath() functionTatyana Krasnukha2020-01-101-21/+14
|
* [lldb][tests] Take into account all parent's categories when traverse ↵Tatyana Krasnukha2020-01-102-12/+13
| | | | | | | | | | | | folders upwards This is needed to not re-write parent's categories by categories of a nested folder, e.g. commands/expression/completion specify "cmdline" category, however it still belongs to parent's "expression" category. The sentinel ".categories" in the test-suite root directory is no longer needed. Differential Revision: https://reviews.llvm.org/D71905
* [Support] ThreadPoolExecutor fixes for Windows/MinGWAndrew Ng2020-01-102-21/+68
| | | | | | | | | | | | | | | | | | | | | Changed ThreadPoolExecutor to no longer use detached threads and instead to join threads on destruction. This is to prevent intermittent crashing on Windows when doing a normal full exit, e.g. via exit(). Changed ThreadPoolExecutor to be a ManagedStatic so that it can be stopped on llvm_shutdown(). Without this, it would only be stopped in the destructor when doing a full exit. This is required to avoid intermittent crashing on Windows due to a race condition between the ThreadPoolExecutor starting up threads and the process doing a fast exit, e.g. via _exit(). The Windows crashes appear to only occur with the MSVC static runtimes and are more frequent with the debug static runtime. These changes also prevent intermittent deadlocks on exit with the MinGW runtime. Differential Revision: https://reviews.llvm.org/D70447
* [lldb] Surpress "bitfield too small" gcc warningPavel Labath2020-01-101-3/+3
| | | | | | | Gcc produces this (technically correct) warning when storing an explicitly-sized enum in a bitfield. Surpress that by changing the type of the bitfield to an integer. The same approach is used elsewhere in llvm (e.g. 56b5eab12).
* [CodeComplete] Suggest 'return nullptr' in functions returning pointersIlya Biryukov2020-01-102-0/+31
| | | | | | | | | | Reviewers: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72497
* [lldb/DWARF] Don't automatically search dwo unit attributesPavel Labath2020-01-104-23/+7
| | | | | | | | | | | | This patch removes the code (deep inside DWARFDebugInfoEntry) which automagically returned the attributes of the dwo unit DIE when asking for the attributes of the skeleton unit. This is fairly hacky, and not consistent with how llvm DWARF parser operates. Instead, I change the code the explicitly request (via GetNonSkeletonUnit) the right unit to search (there were just two places that needed this). If it turns out we need this more often, we can create a utility function (external to DWARFUnit) for doing this.
* [lldb/lua] Make convenience_variables.test compatible with lua-5.1Pavel Labath2020-01-101-5/+5
|
* [ARM][Thumb2] Fix ADD/SUB invalid writes to SPDiogo Sampaio2020-01-1024-147/+698
| | | | | | | | | | | | | | | | | | | | Summary: This patch fixes pr23772 [ARM] r226200 can emit illegal thumb2 instruction: "sub sp, r12, #80". The violation was that SUB and ADD (reg, immediate) instructions can only write to SP if the source register is also SP. So the above instructions was unpredictable. To enforce that the instruction t2(ADD|SUB)ri does not write to SP we now enforce the destination register to be rGPR (That exclude PC and SP). Different than the ARM specification, that defines one instruction that can read from SP, and one that can't, here we inserted one that can't write to SP, and other that can only write to SP as to reuse most of the hard-coded size optimizations. When performing this change, it uncovered that emitting Thumb2 Reg plus Immediate could not emit all variants of ADD SP, SP #imm instructions before so it was refactored to be able to. (see test/CodeGen/Thumb2/mve-stacksplot.mir where we use a subw sp, sp, Imm12 variant ) It also uncovered a disassembly issue of adr.w instructions, that were only written as SUBW instructions (see llvm/test/MC/Disassembler/ARM/thumb2.txt). Reviewers: eli.friedman, dmgreen, carwil, olista01, efriedma Reviewed By: efriedma Subscribers: john.brawn, efriedma, ostannard, kristof.beyls, hiraditya, dmgreen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70680
* [ARM,MVE] Make `vqrshrun` generate the right instruction.Simon Tatham2020-01-102-9/+9
| | | | | | | | | | | | | | | | | | Summary: A copy-paste error in `arm_mve.td` meant that the MVE `vqrshrun` intrinsic family was generating the `vqshrun` machine instruction, because in the IR intrinsic call, the rounding flag argument was set to 0 rather than 1. Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard Reviewed By: dmgreen Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72496
* Fix "pointer is null" static analyzer warnings. NFCI.Simon Pilgrim2020-01-101-0/+1
| | | | Assert that the pointers are non-null before dereferencing them.
* Data formatters: Look through array element typedefsJaroslav Sevcik2020-01-106-6/+54
| | | | | | | | | | | | | | | | | Summary: Motivation: When formatting an array of typedefed chars, we would like to display the array as a string. The string formatter currently does not trigger because the formatter lookup does not resolve typedefs for array elements (this behavior is inconsistent with pointers, for those we do look through pointee typedefs). This patch tries to make the array formatter lookup somewhat consistent with the pointer formatter lookup. Reviewers: teemperor, clayborg Reviewed By: teemperor, clayborg Subscribers: clayborg, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72133
* Fix Wdocumentation warning. NFCI.Simon Pilgrim2020-01-101-2/+0
|
* Fix Wdocumentation warning. NFCI.Simon Pilgrim2020-01-101-2/+0
|
* [X86][AVX] Add tests for v8f32/v8i32 089abcde and 0189abcd shufflesSimon Pilgrim2020-01-101-0/+118
| | | | Mentioned in D66004
* Don't use dyn_cast_or_null if we know the pointer is nonnull.Simon Pilgrim2020-01-101-4/+2
| | | | Fix clang static analyzer null dereference warning by using dyn_cast instead.
* [LV] Silence unused variable warning in Release builds. NFC.Benjamin Kramer2020-01-101-0/+1
|
* [MIR] Fix cyclic dependency of MIR formatterPeng Guo2020-01-109-33/+27
| | | | | | | | | | | | | | Summary: Move MIR formatter pointer from TargetMachine to TargetInstrInfo to avoid cyclic dependency between target & codegen. Reviewers: dsanders, bkramer, arsenm Subscribers: wdng, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72485
* XFAIL load_extension.ll test on macOS onlySerge Guelton2020-01-101-1/+1
| | | | Other setup have been fixed by 346de9b67228f42eb9b55fa3b426b5dedfdb1d40
OpenPOWER on IntegriCloud