[pull] main from llvm:main - #1663
Merged
Merged
Conversation
Editor lock files (e.g. Emacs' `.#foo.td`) are dangling symlinks that `file(GLOB *.td)` picks up and passes to add_library(), which then fails with "Cannot find source file". Filter them out with an EXISTS check, as already done for header files in add_header_files_for_glob. Co-authored-by: Claude (Claude Opus 4.8)
Instead of computing a cycle info (SccInfo) internally in
BranchProbabilityInfo, use CycleInfo and remove the use of LoopInfo.
After recent improvements to CycleInfo, the extra analysis is cheaper
than computing the same information internally.
Replacing LoopInfo with CycleInfo has some impliciation that the
loop/cycle forest can differ if the header of an irreducible loop (which
is ignored by loop info) also happens to be the header of a different
natural loop. (Simple example: S -> A, B; A -> A, B; B -> A, B --
LoopInfo will find {{A}, {B}}; CycleInfo will find {A, {B}}].) In these
cases, the default weights will differ.
This change also makes the handling of entering/exiting edges
consistent between reducible and irreducible loops, therefore,
there are also minor changes for reducible CFGs.
Reverts #209465 Causes verifier issues: #209465 (comment)
…mics (#210854) Following the decision in WebAssembly/relaxed-atomics#3
Reviewers: Pull Request: #211080
ClangIR keeps a `_BitInt(N)` at its literal width, but in memory it has to live in a wider padded integer, the same way `bool` is `i1` as a value and `i8` in memory. Because CIRGen emitted the constant at its exact width, the storage padding was left undefined: a `signed _BitInt(6) = -1` wrote `0x3f` where classic CodeGen and GCC write `0xff`. @andykaylor pointed this out on [#205605](#205605). The fix widens `_BitInt` to its storage integer `iM` and sign/zero-extends by signedness during lowering to the LLVM dialect, the same place `bool` becomes `i8` (`convertTypeForMemory` and the to/from-memory helpers). CIRGen keeps the literal `!cir.int<N, bitint>` unchanged. The byte-array storage form for wide "split" widths, where the storage integer's alloc size exceeds its store size (e.g. `_BitInt(129)` to `i192`, 32 vs 24 bytes), is not implemented. The global, alloca, load, and store lowerings report an NYI error and the aggregate type converters fail the conversion, rather than emit a wrong-sized integer. Atomic read-modify-write on a padded `_BitInt` and vector-of-`_BitInt` are also unimplemented. The storage width comes from `IntType::getABIAlignment`, which assumes a fixed 64-bit maximum alignment (x86-64). It is verified byte-for-byte on x86-64; on targets with a larger maximum (e.g. AArch64) any width that would be mis-sized instead hits the split-storage NYI. On a target whose `_BitInt` maximum alignment is below 64 bits (e.g. a 32-bit target) the storage can be mis-sized. Making the computation target-aware needs the target's `getBitIntAlign`, which is not in the data layout, and is left as a follow-up. The approach follows the RFC [Widen bool / _BitInt / ext-vector-bool to their in-memory types in lowering](https://discourse.llvm.org/t/rfc-clangir-widen-bool-bitint-ext-vector-bool-to-their-in-memory-types-in-lowering/91160). It supersedes [#205605](#205605), which emitted the constant at its literal width.
Recent upstream LLVM changes enabled `LoopInterchangePass` by default through `PipelineTuningOptions`. TLTO observes that state directly from the LTO config, but DTLTO was not forwarding the equivalent Clang option to the remote compiler. As a result, TLTO could run loop interchange pass while DTLTO did not, producing codegen differences for configurations that exposed profitable/legally interchangeable loops. Note that this was a pre-existing issue, the change in default has simply exposed it. Forward `C.PTO.LoopInterchange` as `-floop-interchange` when constructing the common DTLTO remote compiler options. Extend the testing to check that the SN-DBS remote command line includes the forwarded option. The code for forwarding such options is only intended as a temporary measure. A more comprehensive solution is in discussion here: https://discourse.llvm.org/t/synchronizing-lto-code-generation-configuration-between-clang-and-lld-dtlto
…pes" (#211070) Reverts #201237. The PR did not update the test assertions for `Sema/builtins-elementwise-math.c` #201237 (comment)
… from targets into common code. (#210896) Consolidates the multiple copies across the targets of the `to_tframeindex` `SDNodeXForm` (frame index => target frame index) and its GISel counterpart/equiv `renderFrameIndex`, moving them into appropriate common areas. As suggested/requested in #206885 (comment)
Raw getNum{Scalar,Vector}Insts() counted one-time, LICM-hoisted
broadcasts/buildvectors against the loop body, rejecting profitable loop
trees (508.namd_r). Weight each entry by its loop-nest trip
count and drop nest-invariant ones; flat code is unchanged (scale 1).
Fixes #207572
Reviewers: bababuck, RKSimon, hiraditya
Pull Request: #210074
After removing SccInfo, this data structure is largely pointless.
This seemingly is only added for GCC libstdcxx 11.1's C++17 support, but our support matrix is 7.4. Replace it with a loop that implements the same requirement.
After partial revert of #208330 in #209928, the libcxx build started failing because of missing `<cstdint>` include required for `uintptr_t` declaration used only by code behind `ptrauth_calls` feature check. See https://lab.llvm.org/buildbot/#/builders/227/builds/3358 This patch adds the missing include.
…210116) fixes #194293 fixes #194432 In HLSL we need both Location and and Flat must be emitted as a single `spirv.Decorations` node. Also we need to apply Flat decoration to pixe/fragment shades with inputs of integer or double because only 32 bit floats can be interpolated. Assisted with Claude Opus 4.8 via Copilot
This reverts commit 3f928ae to fix buildbots https://lab.llvm.org/buildbot/#/builders/11/builds/44691 Reviewers: Pull Request: #211091
…210079) Extend logic added in #209199 to also derive signed facts. To do so, we keep track of whether LowerBound = Start + Step overflows signed/unsigned. Code that previously bailed out if we were handling a post-increment induction has been updated to use the computed LowerBound, if it does not signed-wrap. Alive2 Proof: https://alive2.llvm.org/ce/z/frskVt PR: #210079
…d report failure (#211074) Switch GitHub API interactions to use actions/github-script instead of pygithub, as is done in other Github workflows in the repository. This is simpler and it also resolves the issue that if setting up the Python virtual environment fails, there's no way to communicate the issue back since doing so would require pygithub. As a drive-by, also report the failure when a step in the libc++ PR benchmark job fails, instead of leaving a "Running benchmarks in ..." comment indefinitely. Assisted by Claude Fixes #210985
Enable CUDA device procedures to call !$acc routine procedures. - Treat ACC routines as device-callable during CUDA semantic checking. - Apply implicit-device dummy argument handling to ACC routines called from CUDA device code. - Defer CUDA cloning of ACC routines until ACC lowering materializes and moves the specialized routine into the GPU module. - Add a CUF device-function transform regression test.
Emit external device symbols for OpenACC declare create and copyin globals in -gpu=mem:unified; preserve device definitions for device_resident globals.
Raw getNum{Scalar,Vector}Insts() counted one-time, LICM-hoisted
broadcasts/buildvectors against the loop body, rejecting profitable loop
trees (508.namd_r). Weight each entry by its loop-nest trip
count and drop nest-invariant ones; flat code is unchanged (scale 1).
Fixes #207572
Original Pull Request: #210074
Recommit after revert in bf42992
Reviewers:
Pull Request: #211096
The avx512vlbw-builtins.c test was using the now-nonexistant avx10.1-512 target feature in several of its run lines. Because the feature no longer exists with that spelling it was being silently ignored. Apparently it isn't needed for the test upstream because the test has been passing, but I received reports from a downstream user that the test was failing for them. There was a recent change to more strictly enforce always-inlining if target features didn't match. I suspect that this downstream project has a different version of some intrinsic header files so that it requires "avx10.1" (the correct spelling of the feature). This change updates the test run lines to use the correct feature spelling.
…dConstructor (#211098) This allows to register different allocators when needed.
In DXC, when `/Qpdb_in_private` flag is specified, debug info PDB is emitted into PRIV part of the output DXContainer (as well as into separate PDB file, if its name is specified with `/Fd`). This patch reimplements similar behavior in llc and Clang. MC is modified to be able to emit PRIV part. Depends on #204166.
This fixes db816fe. Buildkite error link: https://buildkite.com/llvm-project/upstream-bazel/builds?commit=db816fe2ed4e0be51192d3030d90a176d5fec9d5 Co-authored-by: Google Bazel Bot <google-bazel-bot@google.com>
The new CFI directive directly assigns an RA signing state to the RA_SIGN_STATE DWARF pseudo-register for use when unwinding, to indicate whether the value of PC has been used as a diversifier for return address signing. The new directive subsumes and replaces .cfi_negate_ra_state_with_pc, which was found to be unsuitable for descibing some block layouts [1], particularly in hot-cold-split functions. 1: ARM-software/abi-aa#346
fixes #191070 In the SPIR-V backend an optimization has widened a narrow cbuffer load into a wider vector load that reads trailing padding (e.g. a <1 x float> float1x4 column loaded as <4 x float>). loadVectorFromVector only handled down-casts and asserts when the target has more elements than the source. We need to handle the widening case by loading the available lanes and inserting them into a poison target vector, leaving the padding lanes as poison. Assisted by Claude Opus 4.8
Let's back this out in favor of emitting pseudoprobe data in favor of emitting in the __LLVM segment, and let dsymutil collect the debug map objects and merge them into the final sections. This is to prevent older ld toolchains that don't ignore the new `__PSEUDO_PROBE` segments from accidentally leaking the probe metadata into the final image.
The code will be updated and used for wide character printf functions implemented in wchar/, so __support/ is a more consistent shared location. Assisted-by: Automated tooling, human reviewed.
Reverts #192515 We have addressed the CFI related workflow by introducing a new MD_callgraph and by disambiguating it from MD_type used for CFI.
This change adds support for CFG flattening of loop operations with cleanup regions. Rather than re-invent the entire branch through cleanup mechanism, I am first rewriting the loop by sinking the condition into the body (as a test + break-if-false) and hoisting the step into the body, and surrounding the entire body with a cir.cleanup.scope op. Then the greedy flattening algorithm runs the newly formed loop through the existing flattening mechanisms so that the loop cleanup handling ends up being done by the same code that flattens other cleanup scopes. Assisted-by: Cursor / various models
In order to eliminate TargetOptions ABI fields the front and middle end need to know what value the backend is going to choose for the ABI properties. This is similar to how we have getDefaultExceptionHandling and getDefaultWCharSize. The clang driver seems to have a different notion of which targets are default soft. This followed ARMTargetMachine as the authority. Co-authored-by: Claude (Claude-Opus-4.8) <noreply@anthropic.com>
Module flags `sign-return-address-buildattr` and `tag-stack-memory-buildattr` are never exercised elsewhere by existing tests or code across the whole LLVM source tree, and there are no known cases of them being used. Moreover, the `sign-return-address-buildattr` flag emission was gated by `ptrauth` target feature which does not actually exist: see `AArch64TargetInfo::computeFeatureLookup()` and `ARMTargetInfo::hasFeature(StringRef Feature)`. So, it was never emitted. This patch removes code responsible for these stale module flags emission. Note: the flags was previously introduced in https://reviews.llvm.org/D112421
The LLVM offload test suite is current failing layout keyword orientation tests. While initially appearing to be a layout problem in the SPIR-V legalizer caused by matrix vector sizes exceeding 4, the root cause is actually persistent dead function definitions in the SPIR-V backend. This behavior is standard for OpenCL, which relies on a linker to clean up unused definitions; however, since shaders lack a linker and require full inlining, we must handle this in a special shader only pass. This change adds SPIRVFinalizeShaderLinkage (a shader-only analogue of DXILFinalizeLinkage): internalize non-entry, non-exported helpers and erase the dead ones. Globals are left alone since unreferenced externals become interface OpVariables. Fixes #201712 Assisted with Claude Opus 4.8
Otherwise we run into crashes when loading BC that has a module summary. This is a no-op if we load existing GUIDs, so probably makes sense to run regardless. Reviewers: mtrofin Pull Request: #208965
It is not expensive to do, and doing it unconditionally avoids edge cases like the one in the added test case. Reviewers: arsenm, mtrofin Pull Request: #208966
A defaulted union copy or move assignment operator has an empty synthesized body because Sema skips union fields, leaving no AST expression for the implied whole-object copy. CIRGen emitted that empty body and silently dropped the assignment. Report NYI for defaulted union assignment instead. Struct and array assignments are unaffected because their synthesized bodies contain the memberwise copies needed by the existing body-emission path.
The x86_64 aggregate calling-convention bridge rejects a zero-field record as NYI, even though the SysV classifier already treats an empty record as NoClass/NoClass (so it returns Ignore) and the rewriter already drops arguments and returns classified Ignore. Dropping the zero-field reject in `isSupportedType` lets a C empty struct classify as Ignore: the argument slot is removed, the remaining arguments shift down, and an empty-record return lowers to void. The C++ empty class stays NYI. CIRGen lays it out as a single padded byte, which the padded reject still catches. Unions, packed, and all-float aggregates remain NYI as before. --------- Co-authored-by: Andy Kaylor <akaylor@nvidia.com>
…211075) getLastArgValue() only returned the final --ocloc-options= occurrence, silently dropping earlier ones when the option is passed multiple times (one token per occurrence). Use getAllArgValues() so every occurrence is forwarded to ocloc.
If we have a BB that has a single conditional branch instruction it that is identical to the previous block's branch instruction, we can delete the BB as it is redundant. This doesn't directly impact performance as such instructions are never executed, but this can help decrease code size which can help with overall icache pressure (though likely only slightly). The biggest impact would probably be fitting more instructions into a single cache line. This is probably almost a no-op with PLO but definitely doesn't hurt. Fixes #202763. Reviewers: RKSimon, arsenm, krzysz00, topperc, lei137 Pull Request: #203110
…ions This is a resubmit of the original patch: 6344e3a: Make result variables obey their dynamic values in subsequent expressions (#168611) When I originally submitted this, it caused intermittent flakey failures on systems I didn't have access to, and I didn't have time to sort them out, so I reverted the patch. I'm resubmitting this so I can run the bots on it a few rounds to see if I can reproduce and diagnose those intermittent failures. Here's the commit log from the original submission describing the change: When you run an expression and the result has a dynamic type that is different from the expression's static result type, we print the result variable using the dynamic type, but at present when you use the result variable in an expression later on, we only give you access to the static type. For instance: ``` (lldb) expr MakeADerivedReportABase() (Derived *) $0 = 0x00000001007e93e0 (lldb) expr $0->method_from_derived() ^ error: no member named 'method_from_derived' in 'Base' (lldb) ``` The static return type of that function is `Base *`, but we printed that the result was a `Derived *` and then only used the `Base *` part of it in subsequent expressions. That's not very helpful, and forces you to guess and then cast the result types to their dynamic type in order to be able to access the full type you were returned, which is inconvenient. This patch makes lldb retain the dynamic type of the result variable (and ditto for persistent result variables). It also adds more testing of expression result variables with various types of dynamic values, to ensure we can access both the ivars and methods of the type we print the result as.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )