aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [libcxx] Force -Wl,-z,defsgentoo-9999-1gentooMichał Górny2021-04-221-0/+12
| | | | Gentoo-Component: libcxx
* [compiler-rt] Apply Gentoo compiler-rt-prefix-paths.patchMichał Górny2021-04-224-23/+7
| | | | Gentoo-Component: compiler-rt
* [clang ]Apply Gentoo's prefix-dirs.patchMichał Górny2021-04-222-4/+13
| | | | | | | | | | | | | | This mirrors cmake-*-prefix-dirs.patch It add EPREFIX to search paths for c/cxx headers. It also adds EPREFIX/MacOSX.sdk to search paths for c and Frameworks. Assumes that c++ lib and headers will be installed in the prefix. Also, a couple of args are populated by inspecting the SDK, so, default to EPREFIX/MacOSX.sdk when the sysroot is not specified. (This does NOT set sysroot). Gentoo-Component: clang
* [llvm] [llvm-config] Clean up exported valuesMichał Górny2021-04-221-1/+5
| | | | | | | | | | | Gentoo-specific fixup for llvm-config, including: - making --src-root return invalid path (/dev/null). Thanks to Steven Newbury for the initial patch. Bug: https://bugs.gentoo.org/565358 Bug: https://bugs.gentoo.org/501684 Gentoo-Component: llvm
* [AArch64] Fix calling windows varargs with floats in fixed args from ↵Martin Storsjö2021-04-224-19/+151
| | | | | | | | | | | | | non-windows functions When inspecting the calling convention, for calling windows functions from a non-windows function, inspect the calling convention of the called function, not the caller. Also remove an unnecessary parameter to AArch64CallLowering OutgoingArgHandler. Differential Revision: https://reviews.llvm.org/D100890
* [clang][deps] Include "-cc1" in the argumentsJan Svoboda2021-04-222-8/+6
| | | | | | | | To simplify tools consuming dependency scanning results, prepend the "-cc1" argument by default. Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D100942
* [mlir][linalg] remove interchange option on linalg to loop lowering.Tobias Gysi2021-04-224-185/+50
| | | | | | The interchange option attached to the linalg to loop lowering affects only the loops and does not update the memory accesses generated in to body of the operation. Instead of performing the interchange during the loop lowering use the interchange pattern. Differential Revision: https://reviews.llvm.org/D100758
* clang-format: [JS] do not merge side-effect imports.Martin Probst2021-04-222-0/+8
| | | | | | | | The if condition was testing the current element, but forgot to check the previous element (doh), so it would fail depending on sort order of the imports. Differential Revision: https://reviews.llvm.org/D101020
* [AMDGPU] SIWholeQuadMode: don't add duplicate implicit $exec operandsJay Foad2021-04-221-2/+5
| | | | | | | | STRICT_WWM and STRICT_WQM are already defined with Uses = [EXEC], so there is no need to add another implicit use of $exec when lowering them to V_MOV_B32 instructions. Differential Revision: https://reviews.llvm.org/D100969
* [RISCV] Custom lowering of SET_ROUNDINGSerge Pavlov2021-04-223-0/+130
| | | | Differential Revision: https://reviews.llvm.org/D91242
* [LoopVectorize] Don't create unnecessary vscale intrinsic callsDavid Sherwood2021-04-223-4/+13
| | | | | | | | | | In quite a few cases in LoopVectorize.cpp we call createStepForVF with a step value of 0, which leads to unnecessary generation of llvm.vscale intrinsic calls. I've optimised IRBuilder::CreateVScale and createStepForVF to return 0 when attempting to multiply vscale by 0. Differential Revision: https://reviews.llvm.org/D100763
* [CSSPGO][llvm-profdata] Support trimming cold context when merging profilesWenlei He2021-04-229-67/+157
| | | | | | The change adds support for triming and merging cold context when mergine CSSPGO profiles using llvm-profdata. This is similar to the context profile trimming in llvm-profgen, however the flexibility to trim cold context after profile is generated can be useful. Differential Revision: https://reviews.llvm.org/D100528
* [libcxx] [test] Fix testing on windows with c++experimental enabledMartin Storsjö2021-04-222-1/+13
| | | | | | | | The straightforward `AddLinkFlag('-lc++experimental')` approach doesn't work on e.g. MSVC. For linking to libc++ itself, a more convoluted logic is used (see configure_link_flags_cxx_library). Differential Revision: https://reviews.llvm.org/D99177
* [clang-tidy] Avoid bugprone-macro-parentheses warnings after goto argumentGeorgy Komarov2021-04-222-7/+28
| | | | | | | | | | | | | | | clang-tidy should not generate warnings for the goto argument without parentheses, because it would be a syntax error. The only valid case where an argument can be enclosed in parentheses is "Labels as Values" gcc extension: https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html. This commit adds support for the label-as-values extension as implemented in clang. Fixes bugzilla issue 49634. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D99924
* [NewPM] Mark some more wrapper passes as ignoredArthur Eubanks2021-04-211-1/+2
| | | | We shouldn't print IR when seeing these passes.
* [RISCV] Use TargetConstant for condition code of RISCVISD::SELECT_CC.Craig Topper2021-04-212-5/+7
| | | | | | | The value is always an immediate and can never be in a register. This the kind of thing TargetConstant is for. Saves a step GenDAGISel to convert a Constant to a TargetConstant.
* [GVN] Introduce loop load PREMax Kazantsev2021-04-223-9/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows PRE of the following type of loads: ``` preheader: br label %loop loop: br i1 ..., label %merge, label %clobber clobber: call foo() // Clobbers %p br label %merge merge: ... br i1 ..., label %loop, label %exit ``` Into ``` preheader: %x0 = load %p br label %loop loop: %x.pre = phi(x0, x2) br i1 ..., label %merge, label %clobber clobber: call foo() // Clobbers %p %x1 = load %p br label %merge merge: x2 = phi(x.pre, x1) ... br i1 ..., label %loop, label %exit ``` So instead of loading from %p on every iteration, we load only when the actual clobber happens. The typical pattern which it is trying to address is: hot loop, with all code inlined and provably having no side effects, and some side-effecting calls on cold path. The worst overhead from it is, if we always take clobber block, we make 1 more load overall (in preheader). It only matters if loop has very few iteration. If clobber block is not taken at least once, the transform is neutral or profitable. There are several improvements prospect open up: - We can sometimes be smarter in loop-exiting blocks via split of critical edges; - If we have block frequency info, we can handle multiple clobbers. The only obstacle now is that we don't know if their sum is colder than the header. Differential Revision: https://reviews.llvm.org/D99926 Reviewed By: reames
* [AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs installedPushpinder Singh2021-04-2214-8/+267
| | | | | | | | | | | | | This patch adds new clang tool named amdgpu-arch which uses HSA to detect installed AMDGPU and report back latter's march. This tool is built only if system has HSA installed. The value printed by amdgpu-arch is used to fill -march when latter is not explicitly provided in -Xopenmp-target. Reviewed By: JonChesterfield, gregrodgers Differential Revision: https://reviews.llvm.org/D99949
* [CodeGen] Do not split functions with attr "implicit-section-name".Snehasish Kumar2021-04-212-1/+24
| | | | | | | | | | | | The #pragma clang section can be used at a coarse granularity to specify the section used for bss/data/text/rodata for global objects. When split functions is enabled, the function may be split into two parts violating user expectations. Reference: https://clang.llvm.org/docs/LanguageExtensions.html#specifying-section-names-for-global-objects-pragma-clang-section Differential Revision: https://reviews.llvm.org/D101004
* scudo: Obtain tag from pointer instead of loading it from memory. NFCI.Peter Collingbourne2021-04-211-5/+6
| | | | | | | Since we already have a tagged pointer available to us, we can just extract the tag from it and avoid an LDG instruction. Differential Revision: https://reviews.llvm.org/D101014
* [Debug-Info] implement -gstrict-dwarfChen Zheng2021-04-225-3/+30
| | | | | | | | This patch implements -gstrict-dwarf option in clang FE. Reviewed By: dblaikie, probinson, aprantl Differential Revision: https://reviews.llvm.org/D100809
* [RISCV] Custom lowering of FLT_ROUNDS_Serge Pavlov2021-04-223-0/+74
| | | | Differential Revision: https://reviews.llvm.org/D90854
* [mlir][linalg] Add pattern to push reshape after elementwise operationthomasraoux2021-04-215-0/+286
| | | | | | This help expose more fusion opportunities. Differential Revision: https://reviews.llvm.org/D100685
* [RISCV] Teach lowerSPLAT_VECTOR_PARTS to detect cases where Hi is sign ↵Craig Topper2021-04-212-0/+48
| | | | | | | | extended from Lo. This recognizes the case when Hi is (sra Lo, 31). We can use SPLAT_VECTOR_I64 rather than splatting the high bits and combining them in the vector register.
* [Coroutine] Collect CoroBegin if all of terminators are dominated by one ↵Chuanqi Xu2021-04-222-9/+67
| | | | | | | | | | | | | | | | | | coro.destroy Summary: The original logic seems to be we could collecting a CoroBegin if one of the terminators could be dominated by one of coro.destroy, which doesn't make sense. This patch rewrites the logics to collect CoroBegin if all of terminators are dominated by one coro.destroy. If there is no such coro.destroy, we would call hasEscapePath to evaluate if we should collect it. Test Plan: check-llvm Reviewed by: lxfind Differential Revision: https://reviews.llvm.org/D100614
* Wordsmith the semantics of invariant.loadEvgeniy Brevnov2021-04-221-4/+4
| | | | | | | | | Don't phrase the semantics in terms of the optimizer. Instead have a more straightforward execution based semantic. Reviewed By: ebrevnov Differential Revision: https://reviews.llvm.org/D63439
* [lldb] Disable TestSimulatorPlatform.py because it's causing a SIGHUPJonas Devlieghere2021-04-211-1/+1
| | | | | | | | | | | | | | | Ever since Dave Zarzycki's patch to sort test start times based on prior test timing data (https://reviews.llvm.org/D98179) the test suite aborts with a SIGHUP. I don't believe his patch is to blame, but rather uncovers an preexisting issue by making test runs more deterministic. I was able to narrow down the issue to TestSimulatorPlatform.py. The issue also manifests itself on the standalone bot on GreenDragon [1]. This patch disables the test until we can figure this out. [1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-standalone/ rdar://76995109
* [mlir][tosa] Add tosa.avg_pool2d loweringRob Suderman2021-04-212-12/+45
| | | | | | Added the float lowerings for avg pool with corresponding tests. Differential Revision: https://reviews.llvm.org/D100793
* AMDGPU: Fix assert when trying to fold reg_sequence of physreg copiesMatt Arsenault2021-04-212-4/+106
|
* [OpenMP] Simplify offloading parallel call codegenGiorgis Georgakoudis2021-04-2133-3851/+67445
| | | | | | | | This revision simplifies Clang codegen for parallel regions in OpenMP GPU target offloading and corresponding changes in libomptarget: SPMD/non-SPMD parallel calls are unified under a single `kmpc_parallel_51` runtime entry point for parallel regions (which will be commonized between target, host-side parallel regions), data sharing is internalized to the runtime. Tests have been auto-generated using `update_cc_test_checks.py`. Also, the revision contains changes to OpenMPOpt for remark creation on target offloading regions. Reviewed By: jdoerfert, Meinersbur Differential Revision: https://reviews.llvm.org/D95976
* Delete le32/le64 targetsFangrui Song2021-04-2129-648/+3
| | | | | | | | | They are unused now. Note: NaCl is still used and is currently expected to be needed until 2022-06 (https://blog.chromium.org/2020/08/changes-to-chrome-app-support-timeline.html). Differential Revision: https://reviews.llvm.org/D100981
* [AArch64][GlobalISel] Fix regbankselect for G_FCMP with vector destinationsJessica Paquette2021-04-212-2/+33
| | | | | | These should always go to a FPR, since they always use the vector registers. Differential Revision: https://reviews.llvm.org/D100885
* [AArch64][GlobalISel] Mark some vector G_ABS cases as legalJessica Paquette2021-04-213-2/+248
| | | | | | | | | | | | | | | | | | | | Each of the cases marked as legal here have an imported pattern in AArch64GenGlobalISel.inc. So, if we mark them as legal, we get selection for free. Technically this is only supposed to happen if we have NEON support. But, we fall back if we don't have that in the legalizer right now. I suppose it'd be better to have a FIXME so we can write the testcase when the time comes. (Plus, it'd just fall back in selection if NEON isn't available, so it's not *wrong*, I guess?) This fixes some fallbacks in the test suite. (Also use `isScalar` from LegalityPredicates.cpp while we're here just to tidy things a little bit.) Differential Revision: https://reviews.llvm.org/D100916
* [CSSPGO][llvm-profgen] Always report dangling probes for frames with real ↵Hongtao Yu2021-04-217-30/+107
| | | | | | | | | | | | | | | | samples. Report dangling probes for frames that have real samples collected. Dangling probes are the probes associated to an empty block. When reported, sample count on a dangling probe will not be trusted by the compiler and we will rely on the counts inference algorithm to get the probe a reasonable count. This actually fixes a bug where previously only those dangling probes with samples collected were reported. This patch also fixes two existing issues. Pseudo probes are stored in `Address2ProbesMap` and their pointers are used in `PseudoProbeInlineTree`. Previously `std::vector` was used to store probes and the pointers to probes may get obsolete as the vector grows. I'm changing `std::vector` to `std::list` instead. The other issue is that all outlined functions shared the same inline frame previously due to the unchanged `Index` value as the dummy inlineSite identifier. Good results seen for SPEC2017 in general regarding profile quality. Reviewed By: wenlei, wlei Differential Revision: https://reviews.llvm.org/D100235
* [HWASan] Untag argument to __hwasan_tag_memory.Matt Morehouse2021-04-211-2/+5
| | | | | __hwasan_tag_memory expects untagged pointers, so make sure our pointer is untagged.
* [mlir] Linalg : do not forward memrefs to outputs when do bufferizationEugene Zhulenev2021-04-212-5/+1
| | | | | | | | | | | | | | | Example: ``` %0 = linalg.init_tensor : tensor<...> %1 = linalg.generic ... outs(%0: tensor<...>) %2 = linalg.generic ... outs(%0: tensor<...>) ``` Memref allocated as a result of `init_tensor` bufferization can be incorrectly overwritten by the second linalg.generic operation Reviewed By: silvas Differential Revision: https://reviews.llvm.org/D100921
* [IR] Add doc about Function::createWithDefaultAttr. NFCFangrui Song2021-04-211-0/+5
|
* [IR][sanitizer] Set nounwind on module ctor/dtor, additionally set uwtable ↵Fangrui Song2021-04-2119-21/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if -fasynchronous-unwind-tables On ELF targets, if a function has uwtable or personality, or does not have nounwind (`needsUnwindTableEntry`), it marks that `.eh_frame` is needed in the module. Then, a function gets `.eh_frame` if `needsUnwindTableEntry` or `-g[123]` is specified. (i.e. If -g[123], every function gets `.eh_frame`. This behavior is strange but that is the status quo on GCC and Clang.) Let's take asan as an example. Other sanitizers are similar. `asan.module_[cd]tor` has no attribute. `needsUnwindTableEntry` returns true, so every function gets `.eh_frame` if `-g[123]` is specified. This is the root cause that `-fno-exceptions -fno-asynchronous-unwind-tables -g` produces .debug_frame while `-fno-exceptions -fno-asynchronous-unwind-tables -g -fsanitize=address` produces .eh_frame. This patch * sets the nounwind attribute on sanitizer module ctor/dtor. * let Clang emit a module flag metadata "uwtable" for -fasynchronous-unwind-tables. If "uwtable" is set, sanitizer module ctor/dtor additionally get the uwtable attribute. The "uwtable" mechanism is generic: synthesized functions not cloned/specialized from existing ones should consider `Function::createWithDefaultAttr` instead of `Function::create` if they want to get some default attributes which have more of module semantics. Other candidates: "frame-pointer" (https://github.com/ClangBuiltLinux/linux/issues/955 https://github.com/ClangBuiltLinux/linux/issues/1238), dso_local, etc. Differential Revision: https://reviews.llvm.org/D100251
* Fix VSCode/TestOptions.testWalter Erquinigo2021-04-211-5/+5
| | | | Found by https://lab.llvm.org/buildbot/#/builders/96/builds/6936
* [libcxx] Stop using use c++ subdirectory for libc++ libraryPetr Hosek2021-04-2131-34/+30
| | | | | | | The new layout more closely matches the layout used by other compilers. This is only used when LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is enabled. Differential Revision: https://reviews.llvm.org/D100869
* [CodeView] Add CodeView support for PGO debug informationMichael Holman2021-04-212-0/+172
| | | | | | | | | | | | | | | | | This change adds debug information about whether PGO is being used or not. Microsoft performance tooling (e.g. xperf, WPA) uses this information to show whether functions are optimized with PGO or not, as well as whether PGO information is invalid. This information is useful for validating whether training scenarios are providing good coverage of real world scenarios, showing if profile data is out of date, etc. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D99994
* Fix TestVSCode_runInTerminalWalter Erquinigo2021-04-211-3/+3
| | | | | | It failed in https://lab.llvm.org/buildbot/#/builders/68/builds/10912 And it was caused due to https://reviews.llvm.org/rG64f47c1e58a1
* [lldb-vscode] Distinguish shadowed variables in the scopes requestWalter Erquinigo2021-04-216-16/+141
| | | | | | | | | | | | | | | | | | | | | VSCode doesn't render multiple variables with the same name in the variables view. It only renders one of them. This is a situation that happens often when there are shadowed variables. The nodejs debugger solves this by adding a number suffix to the variable, e.g. "x", "x2", "x3" are the different x variables in nested blocks. In this patch I'm doing something similar, but the suffix is " @ <file_name:line>), e.g. "x @ main.cpp:17", "x @ main.cpp:21". The fallback would be an address if the source and line information is not present, which should be rare. This fix is only needed for globals and locals. Children of variables don't suffer of this problem. When there are shadowed variables {F16182150} Without shadowed variables {F16182152} Modifying these variables through the UI works Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D99989
* [libc++] Move the debug_level feature to the DSLLouis Dionne2021-04-212-10/+7
|
* [RISCV] Cleanup up the spec version references around fmaxnum/fminnum.Craig Topper2021-04-213-10/+7
| | | | | | | | | | | | | This previously made references to 2.3-draft which was a short lived version number in 2017. It was replaced by date based versions leading up to ratification. This patch uses the latest ratified version number and just says what the behavior is. Nothing here is in flux. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D100878
* [RISCV] Temporary in vmsge(u).vx pseudo instructions can't be V0.Craig Topper2021-04-213-2/+9
| | | | | | | | | | This was checked in some asserts, but not enforced by the instruction matching. There's still a second bug that we don't check that vt and vd are different registers, but that will require custom checking. Differential Revision: https://reviews.llvm.org/D100928
* [lldb-vscode] redirect stderr/stdout to the IDE's consoleWalter Erquinigo2021-04-218-11/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In certain occasions times, like when LLDB is initializing and evaluating the .lldbinit files, it tries to print to stderr and stdout directly. This confuses the IDE with malformed data, as it talks to lldb-vscode using stdin and stdout following the JSON RPC protocol. This ends up terminating the debug session with the user unaware of what's going on. There might be other situations in which this can happen, and they will be harder to debug than the .lldbinit case. After several discussions with @clayborg, @yinghuitan and @aadsm, we realized that the best course of action is to simply redirect stdout and stderr to the console, without modifying LLDB itself. This will prove to be resilient to future bugs or features. I made the simplest possible redirection logic I could come up with. It only works for POSIX, and to make it work with Windows should be merely changing pipe and dup2 for the windows equivalents like _pipe and _dup2. Sadly I don't have a Windows machine, so I'll do it later once my office reopens, or maybe someone else can do it. I'm intentionally not adding a stop-redirecting logic, as I don't see it useful for the lldb-vscode case (why would we want to do that, really?). I added a test. Note: this is a simpler version of D80659. I first tried to implement a RIIA version of it, but it was problematic to manage the state of the thread and reverting the redirection came with some non trivial complexities, like what to do with unflushed data after the debug session has finished on the IDE's side.
* [mlir][mlir-lsp-server] Add some initial documentation on the MLIR LSP serverRiver Riddle2021-04-212-0/+112
| | | | | | This covers some of the basic documentation, but is still missing some documentation/examples of features provided by the server. Feature documentation will be added in a followup. Differential Revision: https://reviews.llvm.org/D100690
* [mlir] Add a vscode language extension for MLIRRiver Riddle2021-04-219-0/+2507
| | | | | | This utilizes the mlir-lsp server to provide language services for MLIR files opened in vscode. The extension currently supports syntax highlighting, as well as tracking definitions/uses/source locations for SSA values and blocks. Differential Revision: https://reviews.llvm.org/D100607
* [mlir][mlir-lsp] Add a new C++ LSP server for MLIR named mlir-lsp-serverRiver Riddle2021-04-2127-1/+2303
| | | | | | | | | | This commits adds a basic LSP server for MLIR that supports resolving references and definitions. Several components of the setup are simplified to keep the size of this commit down, and will be built out in later commits. A followup commit will add a vscode language client that communicates with this server, paving the way for better IDE experience when interfacing with MLIR files. The structure of this tool is similar to mlir-opt and mlir-translate, i.e. the implementation is structured as a library that users can call into to implement entry points that contain the dialects/passes that they are interested in. Note: This commit contains several files, namely those in `mlir-lsp-server/lsp`, that have been copied from the LSP code in clangd and adapted for use in MLIR. This copying was decided as the best initial path forward (discussed offline by several stake holders in MLIR and clangd) given the different needs of our MLIR server, and the one for clangd. If a strong desire/need for unification arises in the future, the existence of these files in mlir-lsp-server can be reconsidered. Differential Revision: https://reviews.llvm.org/D100439