525512 Commits

Author SHA1 Message Date
Dave Lee
e89e7c4685
[lldb] Fix lldb-dotest.in to use args determined by CMake (#124811)
This change is required as a result of the changes made in D132642
(bb26ebb4d18c1877cc6fd17aa803609abeb95096).
2025-01-28 13:36:40 -08:00
Alex Langford
9d7999885a
[lldb] Update API headers for SBProgress (#124836)
Some clients only include LLDB.h and they won't get access to SBProgress
without this.
2025-01-28 13:30:14 -08:00
Joseph Huber
26f4e2a701 [libc][docs] Fix the RPC documentation leaking ports
Summary:
Forgot to close it, that'll make it deadlock after awhile.
2025-01-28 15:26:10 -06:00
Matheus Izvekov
2cbf2798ae
[clang] fix nondeduced mismatch with nullptr template arguments (#124498)
In deduction, when comparing template arguments of value kind, we should
check if the value matches. Values of different types can still match.
For example, `short(0)` matches `int(0)`.

Values of nullptr kind always match each other, since there is only one
such possible value. Similarly to integrals, the type does not matter.
2025-01-28 18:08:14 -03:00
lntue
ed199c8d76
[libc] Workaround for gcc complaining about implicit conversions with the ternary ?: operator. (#124820)
Fixes https://github.com/llvm/llvm-project/issues/120427,
https://github.com/llvm/llvm-project/issues/122745

This is caused by a -Wconversion false-positive bug in gcc:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101537
2025-01-28 16:04:57 -05:00
Florian Hahn
6338bde568
[VPlan] Use cast<VPRecipeBase> in verifier (NFC).
All users of VPValue must be a VPRecipeBase, use cast.
2025-01-28 21:01:02 +00:00
lntue
c47a57393c
[libc] Fix conversion warnings for float16 tests. (#124830)
Fixes https://github.com/llvm/llvm-project/issues/124801.
2025-01-28 16:00:05 -05:00
Louis Dionne
9f660625be
[libc++] Disable CFI in __libcpp_allocate (#124805)
Since we're casting uninitialized memory, we must disable CFI checks.
2025-01-28 15:43:21 -05:00
vdonaldson
9d8dc45d17
[flang] IEEE underflow control for Arm (#124807)
Update IEEE_SUPPORT_UNDERFLOW_CONTROL, IEEE_GET_UNDERFLOW_MODE, and
IEEE_SET_UNDERFLOW_MODE code for Arm.
2025-01-28 15:41:04 -05:00
Thurston Dang
7bd9c780e3
[msan][NFCI] Generalize handleIntrinsicByApplyingToShadow to allow alternative intrinsic for shadows (#124831)
https://github.com/llvm/llvm-project/pull/124159 uses
handleIntrinsicByApplyingToShadow for horizontal add/sub, but Vitaly
recommends always using the add version to avoid false negatives for
fully uninitialized data
(https://github.com/llvm/llvm-project/issues/124662).

This patch lays the groundwork by generalizing
handleIntrinsicByApplyingToShadow to allow using a different intrinsic
(of the same type as the original intrinsic) for the shadow. Planned
work will apply it to horizontal sub.
2025-01-28 12:35:07 -08:00
Yi Zhang
bfefa15cc1
[mlir][bufferization] Use original type when convert arg for users (#124826)
This change will keep the memory space information for the tensor if
there is any.
2025-01-28 15:30:16 -05:00
Matheus Izvekov
b1972689a4
[clang] fix template argument conversion (#124386)
Converted template arguments need to be converted again, if the
corresponding template parameter changed, as different conversions might
apply in that case.
2025-01-28 17:25:05 -03:00
Alex Prabhat Bara
a255da0c53
[libc] clean up duplicated includes in generated headers (#124524)
Fixes: #124149
2025-01-28 12:22:51 -08:00
Oleksandr T.
5dab5bf085
[Clang] handle [[warn_unused]] attribute for unused private fields (#120734)
Fixes #62472
2025-01-28 22:19:12 +02:00
Artem Belevich
310f55875f
[CUDA] Make target intrinsics work with ptx 8.7 (#124818)
Fixes build break with CUDA-12.8 introduced in #123398
2025-01-28 12:14:46 -08:00
Alex Voicu
964565c868
[NFC][docs][HIP] Update HIP docs around hipstdpar and SPIR-V (#124803)
This addresses an odd ommision from the 19 release cycle, wherein we
upstreamed HIPSTDPAR support without adding the relevant documentation.
As an added bonus, we also remove a reference to `amdgcnspirv` not
mixing with concrete targets, as that limitation has been addressed.
2025-01-28 20:03:05 +00:00
Stephen Tozer
de9b0ddedc Add explicit triple to fix errors from #110102
Attempted fix for errors observed on:
https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8724497761651154417/overview

Several tests that required an explicit triple had none present; this
patch adds those triples.
2025-01-28 19:34:41 +00:00
mgcsysinfcat
589bef333e
[emacs][lsp][tblgen] add tblgen-lsp-server support for emacs lsp-mode (#76337)
Co-authored-by: mgcsysinfcat <p779yqwdf@mozmail.com>
Co-authored-by: Ronan Keryell <ronan.keryell@amd.com>
2025-01-28 20:26:14 +01:00
Maksim Panchenko
ef232a7e34
[BOLT][AArch64] Remove nops in functions with defined control flow (#124705)
When a function has an indirect branch with unknown control flow, we
preserve nops in order to keep all instruction offsets (from the start
of the function) the same in case the indirect branch is used by a
PC-relative jump table. However, when we know the control flow of the
function, we should be able to safely remove nops.
2025-01-28 11:03:49 -08:00
Kazu Hirata
1d5ce614a7
[CodeGen] Avoid repeated hash lookups (NFC) (#124677) 2025-01-28 10:57:29 -08:00
Kazu Hirata
69c9bed21b
[Serialization] Migrate away from PointerUnion::dyn_cast (NFC) (#124676)
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>

Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses dyn_cast
because we expect FD->TemplateOrSpecialization to be nonnull.
2025-01-28 10:57:01 -08:00
Kazu Hirata
2ef497e5b0
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#124675)
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>

Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses dyn_cast
because we expect TransExpr to be nonnull.
2025-01-28 10:56:26 -08:00
Kazu Hirata
986581f6bc
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124674)
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>

This patch migrates uses of PointerUnion::dyn_cast to
dyn_cast_if_present (see the definition of PointerUnion::dyn_cast).
Note that we already have dyn_cast_if_present<T*>(ExplicitInfo)
elsewhere in ClassTemplateSpecializationDecl and
VarTemplateSpecializationDecl, meaning that ExplicitInfo is not
guaranteed to be nonnull in those classes.
2025-01-28 10:56:09 -08:00
Matheus Izvekov
e29c085812
[clang] disallow narrowing when matching template template parameters (#124313)
This fixes the core issue described in P3579, following the design
intent of P0522 to not introduce any new cases where a template template
parameter match is allowed for a template which is not valid for all
possible uses.

With this patch, narrowing conversions are disallowed for TTP matching.

This reuses the existing machinery for diagnosing narrowing in a
converted constant expression.
Since P0522 is a DR and we apply it all the way back to C++98, this
brings that machinery to use in older standards, in this very narrow
scope of TTP matching.

This still doesn't solve the ambiguity when partial ordering NTTPs of
different integral types, this is blocked by a different bug which will
be fixed in a subsequent patch (but the test cases are added).
2025-01-28 15:51:17 -03:00
Matheus Izvekov
eb10e94180
NFC: convert clang/test/AST/HLSL/StructuredBuffers-AST.hlsl to unix line endings 2025-01-28 15:48:34 -03:00
Jorge Gorbe Moya
b108fbe6ea [bazel] Fixes for 7f37b34, 0165e33 and 3c64f86 2025-01-28 10:42:46 -08:00
Nathan Ridge
a4d17c44f1
[clang][Sema] Generalize HeuristicResolver::resolveTypeToRecordDecl() to resolveTypeToTagDecl() (#124699) 2025-01-28 13:37:30 -05:00
Kazu Hirata
8578b816fa [Driver] Fix a build error
This patch fixes:

  clang/include/clang/Driver/Options.td:4356:3: error: Expected comma
  before next argument
2025-01-28 10:36:43 -08:00
Stephen Tozer
822f74a911
[Clang] Cleanup docs and comments relating to -fextend-variable-liveness (#124767)
This patch contains a number of changes relating to the above flag;
primarily it updates comment references to the old flag names,
"-fextend-lifetimes" and "-fextend-this-ptr" to refer to the new names,
"-fextend-variable-liveness[={all,this}]". These changes are all NFC.

This patch also removes the explicit -fextend-this-ptr-liveness flag
alias, and shortens the help-text for the main flag; these are both
changes that were meant to be applied in the initial PR (#110000), but
due to some user-error on my part they were not included in the merged
commit.
2025-01-28 18:25:32 +00:00
Brad Smith
cfdd937b30
[llvm] Android has sched_getaffinity() now (#124689) 2025-01-28 13:21:14 -05:00
Thurston Dang
063db51cd4 Reapply "[msan] Add handlers for AVX masked load/store intrinsics (#123857)"
This reverts commit b9d301cc7e4fe4c442ec15169686fa4a18f5cdfc i.e.,
relands db79fb2a91df31a07f312f8e061936927ac5c506.

I had mistakenly thought this caused a buildbot breakage (the actual
culprit was my other patch,
https://github.com/llvm/llvm-project/pull/123980, which landed at the
same time) and thus had reverted it even though AFAIK it is not broken.
2025-01-28 18:11:44 +00:00
Joseph Huber
17d1523207 [Clang] Minor fixes to 'gpuintrin.h' header
Summary:
The bitmask gives different results to the AMDGPU implementation so it's
not needed. Also fix some comments and casts.
2025-01-28 12:07:02 -06:00
Fraser Cormack
bb95335982 [libclc][NFC] Clang-format includes 2025-01-28 18:00:25 +00:00
Slava Zakharin
0b80491cd5
[flang] Support non-index shape/shift/slice for CG box operations. (#124625)
That is another problem uncovered during hlfir.reshape inlining,
where the shape bits could be any integer type.
This patch adds explicit convertions to `index` type where needed.
2025-01-28 09:38:33 -08:00
Matthias Gehre
1b729c3d70 Revert "[mlir][python] allow DenseIntElementsAttr for index type (#118947)"
This reverts commit 9dd762e8b10586e749b0ddf3542e5dccf8392395.
2025-01-28 18:35:50 +01:00
Matthias Gehre
9dd762e8b1
[mlir][python] allow DenseIntElementsAttr for index type (#118947)
Model the `IndexType` as `uint64_t` when converting to a python integer. 

With the python bindings, 
```python
DenseIntElementsAttr(op.attributes["attr"])
```
used to `assert` when `attr` had `index` type like `dense<[1, 2, 3, 4]>
: vector<4xindex>`.

---------

Co-authored-by: Christopher McGirr <christopher.mcgirr@amd.com>
Co-authored-by: Tiago Trevisan Jost <tiago.trevisanjost@amd.com>
2025-01-28 18:31:58 +01:00
Slava Zakharin
2f077dfbdf
[flang] Support non-index shape in hlfir.get_extent codegen. (#124622)
hlfir.reshape inlining uncovered an existing bug that non-index shapes
result in failures during hlfir.get_extent conversion to FIR.
I could have "fixed" the shape during hlfir.reshape inlining,
but this seems like a better fix.
2025-01-28 09:25:36 -08:00
Alexey Bataev
947d8ebbf3
[SLP]Unify getNumberOfParts use
Adds getNumberOfParts and uses it instead of similar code across code
base, fixes analysis of non-vectorizable types in
computeMinimumValueSizes.

Reviewers: RKSimon

Reviewed By: RKSimon

Pull Request: https://github.com/llvm/llvm-project/pull/124774
2025-01-28 12:16:44 -05:00
Maksim Levental
1bc5fe669f
[mlir][python] implement GenericOp bindings (#124496) 2025-01-28 12:02:26 -05:00
gbMattN
822954b4a9
[TySan] Add initial documentation for Type Sanitizer (#123595)
Add some initial documentation for type sanitizer [From issue #122522]
2025-01-28 16:58:03 +00:00
lntue
a080498c92
[libc] Update include directory for libcMPCommon target when LLVM_LIBC_MPFR_INSTALL_PATH is set. (#124765)
Fix the current riscv32 bot failures.
2025-01-28 11:54:55 -05:00
Ramkumar Ramachandra
d76ea250c8
Reland [InstCombine] Teach foldSelectOpOp about samesign (#124320)
Changes: There was a serious bug in the previous patch, leading to a
miscompile. See #122723 for the miscompile report from Alexander, and
the follow-up investigation by Nikita. The patch has since been
reworked, and now includes the testcase from the miscompile.

Follow up on 4a0d53a (PatternMatch: migrate to CmpPredicate) to get rid
of one of the FIXMEs it introduced by replacing a predicate comparison
with CmpPredicate::getMatching.

Co-authored-by: Nikita Popov <npopov@redhat.com>
2025-01-28 16:53:01 +00:00
Thurston Dang
ef92e6b99f
[BoundsChecking] Update ubsantrap to use GuardKind (#124613)
This change makes it consistent with other uses of ubsantrap.

This also updates the tests. Notably, BoundsChecking/runtimes.ll had guard=3 which passed only because the method of calculating the parameter (`IRB.GetInsertBlock()->getParent()->size()`) happened to give the same answer.
2025-01-28 08:52:31 -08:00
c8ef
f388ca3d9d
[NFC] Remove redundant sys/file.h header. (#124684)
Closes #124652.

This header was introduced in
536736995b,
but it appears that including only `fnctl.h` should be enough.
Hopefully, this patch will not cause build issues on other Unix
platforms.
2025-01-29 00:50:24 +08:00
c8ef
648912582c
[libc] Add FILENO related macros to unistd.h. (#124688)
Closes #124637.

This is necessary to build LLVM with LLVM-libc and align the behavior
with other libc implementations.
ref: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/unistd.h.html
2025-01-29 00:45:01 +08:00
Renaud Kauffmann
56a0a7f6d1
[flang][cuda] Adding support for more atomic calls (#124671)
The PR follows the earlier
https://github.com/llvm/llvm-project/pull/123840 PR for atomic operation
support in CUF
2025-01-28 08:36:43 -08:00
Vyacheslav Levytskyy
df122fc734
[SPIR-V] Change a way SPIR-V Backend API works with user facing options (#124745)
This PR fixes https://github.com/llvm/llvm-project/issues/124703:
* added a new API call `SPIRVTranslate` that is to replace entirely old
`SPIRVTranslateModule` after existing clients switch into the new
function;
* the new `SPIRVTranslate` doesn't require option parsing, replacing the
`Opts` argument with explicit `CodeGenOptLevel` and `Triple` arguments;
* the old `SPIRVTranslateModule` call is a wrapper for `SPIRVTranslate`,
it doesn't require option parsing either and doesn't hold any logic
inside except for converting string options into `CodeGenOptLevel` and
`Triple` arguments;
* usage of the extensions list is reworked to avoid writes to the global
cl::opt variable `lib/Target/SPIRV/SPIRVSubtarget.cpp::Extensions` --
instead a new class member in SPIRVSubtarget.cpp is implemented that
allows to replace supported extensions after SPIRVSubtarget.cpp is
created;
* both API calls don't require option parsing and don't write to global
cl::opt variables.

Other related/required changes:
* SPIRV::Capability::Shader is marked as an capability of lesser
priority for OpenCL environment (to remediate absence of the
"avoid-spirv-capabilities" command line option in API calls);
* unit tests are updated and extended to cover testing of a newer API
call;
* old API call is marked with TODO to remove it after existing clients
switch into the new function.
2025-01-28 17:33:11 +01:00
Jack Frankland
a58e774fba
[mlir][tosa] Make TOSA MUL's Shift an Input (#121953)
The TOSA-v1.0 specification makes the shift attribute of the MUL
(Hammard product) operator an input. Move the `shift` parameter of the
MUL operator in the MILR TOSA dialect from an attribute to an input and
update any lit tests appropriately.

Expand the verifier of the `tosa::MulOp` operation to check the various
constraints defined in the TOSA-v1.0 specification. Specifically, ensure
that all input operands (excluding the optional shift) are of the same
rank. This means that broadcasting tests which previously checked rank-0
tensors would be broadcast are no longer valid and are removed.

Signed-off-by: Jack Frankland <jack.frankland@arm.com>
Co-authored-by: TatWai Chong <tatwai.chong@arm.com>
2025-01-28 16:25:22 +00:00
c8ef
5a8fe9e9a7
[libc] Revise the definition of {get, set}rlimit. (#124701)
Closes #124633.

Some parameter types in the definition of `{get, set}rlimit` currently
do not match the standard. This patch resolves the issue.
ref: https://man7.org/linux/man-pages/man2/getrlimit.2.html
2025-01-29 00:24:11 +08:00
Fraser Cormack
a8c82d5fde
[libclc] Optimize isfpclass-like CLC builtins (#124145)
The builtins we were using to implement __clc_is(finite|inf|nan|normal)
-- __builtin_isfinite, etc. -- don't take vector types so we were
previously scalarizing. The __builtin_isfpclass builtin does take vector
types and thus allows us to keep things in vectors.

There is no change in codegen to the scalar versions of any of these
builtins.
2025-01-28 16:23:52 +00:00