- Feb 02, 2021
-
-
Thomas Symalla authored
-
Thomas Symalla authored
-
Thomas Symalla authored
-
Thomas Symalla authored
-
Thomas Symalla authored
-
Thomas Symalla authored
-
Thomas Symalla authored
-
Thomas Symalla authored
-
Thomas Symalla authored
-
Craig Topper authored
I think this is a more standard way of doing this. Reviewed By: rogfer01 Differential Revision: https://reviews.llvm.org/D95833
-
Wenlei He authored
This change implemented call site prioritized BFS profile guided inlining for sample profile loader. The new inlining strategy maximize the benefit of context-sensitive profile as mentioned in the follow up discussion of CSSPGO RFC. The change will not affect today's AutoFDO as it's opt-in. CSSPGO now defaults to the new FDO inliner, but can fall back to today's replay inliner using a switch (`-sample-profile-prioritized-inline=0`). Motivation With baseline AutoFDO, the inliner in sample profile loader only replays previous inlining, and the use of profile is only for pruning previous inlining that turned out to be cold. Due to the nature of replay, the FDO inliner is simple with hotness being the only decision factor. It has the following limitations that we're improving now for CSSPGO. - It doesn't take inline candidate size into account. Since it's doing replay, the size growth is bounded by previous CGSCC inlining. With context-sensitive profile, FDO inliner is no longer limited by previous inlining, so we need to take size into account to avoid significant size bloat. - The way it looks at hotness is not accurate. It uses total samples in an inlinee as proxy for hotness, while what really matters for an inline decision is the call site count. This is an unfortunate fall back because call site count and callee entry count are not reliable due to dwarf based correlation, especially for inlinees. Now paired with pseudo-probe, we have accurate call site count and callee's entry count, so we can use that to gauge hotness more accurately. - It treats all call sites from a block as hot as long as there's one call site considered hot. This is normally true, but since total samples is used as hotness proxy, this transitiveness within block magnifies the inacurate hotness heuristic. With pseduo-probe and the change above, this is no longer an issue for CSSPGO. New FDO Inliner Putting all the requirement for CSSPGO together, we need a top-down call site prioritized BFS inliner. Here're reasons why each component is needed. - Top-down: We need a top-down inliner to better leverage context-sensitive profile, so inlining is driven by accurate context profile, and post-inline is also accurate. This is already implemented in https://reviews.llvm.org/D70655. - Size Cap: For top-down inliner, taking function size into account for inline decision alone isn't sufficient to control size growth. We also need to explicitly cap size growth because with top-down inlining, we can grow inliner size significantly with large number of smaller inlinees even if each individually passes the cost/size check. - Prioritize call sites: With size cap, inlining order also becomes important, because if we stop inlining due to size budget limit, we'd want to use budget towards the most beneficial call sites. - BFS inline: Same as call site prioritization, if we stop inlining due to size budget limit, we want a balanced inline tree, rather than going deep on one call path. Note that the new inliner avoids repeatedly evaluating same set of call site, so it should help with compile time too. For this reason, we could transition today's FDO inliner to use a queue with equal priority to avoid wasted reevaluation of same call site (TODO). Speculative indirect call promotion and inlining is also supported now with CSSPGO just like baseline AutoFDO. Tunings and knobs I created tuning knobs for size growth/cap control, and for hot threshold separate from CGSCC inliner. The default values are selected based on initial tuning with CSSPGO. Results Evaluated with an internal LLVM fork couple months ago, plus another change to adjust hot-threshold cutoff for context profile (will send up after this one), the new inliner show ~1% geomean perf win on spec2006 with CSSPGO, while reducing code size too. The measurement was done using train-train setup, MonoLTO w/ new pass manager and pseudo-probe. Note that this is just a starting point - we hope that the new inliner will open up more opportunity with CSSPGO, but it will certainly take more time and effort to make it fully calibrated and ready for bigger workloads (we're working on it). Differential Revision: https://reviews.llvm.org/D94001
-
Nicolas Vasilache authored
[s|z]exti ops do not have the same operand and result type. As a consequence, the lowering of the n-D vector form needs to be relaxed a bit. This revision additionally performs a few NFC renamings of variables to make them more intuitive. Differential Revision: https://reviews.llvm.org/D95760
-
Craig Topper authored
[SelectionDAG] Prevent scalable vector warning from ComputeNumSignBits on extract_vector_elt on a scalable vector.
-
xgupta authored
[[ https://clang.llvm.org/docs/RAVFrontendAction.html | Example tutorial ]] giving undefine reference error while building with BUILD_SHARED_LIBS=ON. Differential Revision: https://reviews.llvm.org/D95737
-
Puyan Lotfi authored
This reverts commit 0426be3d. Reverting due to some expensive-checks failures in tests.
-
Fangrui Song authored
-
Fangrui Song authored
-
Lang Hames authored
Once a symbol is Ready its MaterializingInfo entry is unused and can be removed to free up some memory.
-
Fangrui Song authored
-
Gil Rapaport authored
Extend applyLoopGuards() to take into account conditions/assumes proving some value %v to be divisible by D by rewriting %v to (%v / D) * D. This lets the loop unroller and the loop vectorizer identify more loops as not requiring remainder loops. Differential Revision: https://reviews.llvm.org/D95521
-
Fangrui Song authored
-
Fangrui Song authored
-
natashaknk authored
Comitted log, exp, maximum, minimum, comparison, ceil and floor conversions from TOSA to LinAlg. Support for signless integer and floating point. Reviewed By: rsuderman Differential Revision: https://reviews.llvm.org/D95839
-
Kyungwoo Lee authored
Prologs and epilogs handle callee-save registers and tend to be irregular with different immediate offsets that are not often handled by the MachineOutliner. Commit D18619/a5335647 (combining stack operations) stretched irregularity further. This patch tries to emit homogeneous stores and loads with the same offset for prologs and epilogs respectively. We have observed that this canonicalizes (homogenizes) prologs and epilogs significantly and results in a greatly increased chance of outlining, resulting in a code size reduction. Despite the above results, there are still size wins to be had that the MachineOutliner does not provide due to the special handling X30/LR. To handle the LR case, his patch custom-outlines prologs and epilogs in place. It does this by doing the following: * Injects HOM_Prolog and HOM_Epilog pseudo instructions during a Prolog and Epilog Injection Pass. * Lowers and optimizes said pseudos in a AArchLowerHomogneousPrologEpilog Pass. * Outlined helpers are created on demand. Identical helpers are merged by the linker. * An opt-in flag is introduced to enable this feature. Another threshold flag is also introduced to control the aggressiveness of outlining for application's need. This reduced an average of 4% of code size on LLVM-TestSuite/CTMark targeting arm64/-Oz. Differential Revision: https://reviews.llvm.org/D76570
-
Fangrui Song authored
-
Conrad Poelman authored
clang-extra: fix incorrect use of std::lock_guard by adding variable name (identified by MSVC [[nodiscard]] error) `std::lock_guard` is an RAII class that needs a variable name whose scope determines the guard's lifetime. This particular usage lacked a variable name, meaning the guard could be destroyed before the line that it was indented to protect. This line was identified by building clang with the latest MSVC preview release, which declares the std::lock_guard constructor to be `[[nodiscard]]` to draw attention to such issues. Reviewed By: kadircet Differential Revision: https://reviews.llvm.org/D95725
-
Nathan Hawes authored
[VFS] Add support to RedirectingFileSystem for mapping a virtual directory to one in the external FS. Previously file entries in the -ivfsoverlay yaml could map to a file in the external file system, but directories had to list their contents in the form of other file entries or directories. Allowing directory entries to map to a directory in the external file system makes it possible to present an external directory's contents in a different location and (in combination with the 'fallthrough' option) overlay one directory's contents on top of another. rdar://problem/72485443 Differential Revision: https://reviews.llvm.org/D94844
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Fangrui Song authored
-
Fangrui Song authored
-
Fangrui Song authored
The instruction may be `icmp eq i32`. Noticed in an internal Halide+wasm JIT test.
-
Matt Arsenault authored
DBG_VALUES placed between memory instructions would change codegen. Skip over these and re-insert them after the bundle instead of giving up on bundling.
-
MaheshRavishankar authored
Add printer and parser hooks for a custom directive that allows parsing and printing of idioms that can represent a list of values each of which is either an integer or an SSA value. For example in `subview %source[%offset_0, 1] [4, %size_1] [%stride_0, 3]` each of the list (which represents offset, size and strides) is a mix of either statically know integer values or dynamically computed SSA values. Since this is used in many places adding a custom directive to parse/print this idiom allows using assembly format on operations which use this idiom. Differential Revision: https://reviews.llvm.org/D95773
-
Mircea Trofin authored
The switch controls both unused prefix warnings, and warnings about functions which differ under different runs for a prefix, and, thus, end up not having asserts for that prefix. (If the latter case spans to all functions, then the former case kicks in) The switch is on by default, and can be disabled. Differential Revision: https://reviews.llvm.org/D95829
-
Atmn Patel authored
From https://bugs.llvm.org/show_bug.cgi?id=48973, we know that `std::call_once(PM->RTLs.initFlag, &RTLsTy::LoadRTLs, PM->RTLs)` causes compile time problems in libstdc++v3 5.3.1. This is because there was a defect in the standard regarding the `call_once` (LWG 2442). This was fixed in libstdc++ soon thereafter, but there are likely other standard libraries where this will fail. By matching this function call with the other one, we fix this bug. Differential Revision: https://reviews.llvm.org/D95769
-
Philip Reames authored
This is directly analogous to the existing no_caller_saved_registers, but with the opposite intention. A function or call so marked shifts the responsibility of spilling the usual CSRs to it's caller. An indirect call site and callee which don't agree on the attribute is ill defined. The motivation for this change is that being able to prune callee saves (without modifying other details of the calling convention) is sometimes useful when generating stubs and adapters. There's no intention to expose this as a source language feature; this is expected to be used by frontends to implement adapters where warranted. Some specific examples of use cases: * GC compatible compiled code wants to call an externally defined library function without needing to track pointer values through CSRs. * debug enabled code wants to call precompiled library which doesn't provide enough information to track CSRs while preserving debug quality in caller. * adapter stub entering hand written assembler which doesn't follow normal calling conventions.
-
Jonas Devlieghere authored
-
Rahman Lavaee authored
This patch let the yaml encoding use Hex64 values for NumBlocks, BB AddressOffset, BB Size, and BB Metadata. Additionally, it changes the decoded values in elf2yaml to uint64_t to match DataExtractor::getULEB128 return type. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D95767
-