57023 Commits

Author SHA1 Message Date
sakria9
7050e7d2a3
[clang] [ASTDump] Add support for structural value template arguments in TextNodeDumper (#126341)
It was missed in 5518a9d which introduced this new template argument kind.
2025-02-13 14:06:45 +08:00
Koakuma
30a9941624
[SPARC][IAS] Add IAS flag handling for ISA levels
Add IAS flag handling for ISA levels we support in LLVM.

Reviewers: MaskRay, rorth, brad0, s-barannikov

Reviewed By: MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/125151
2025-02-13 10:22:31 +07:00
S. Bharadwaj Yadavalli
f2650c54c9
[DirectX] Set Shader Flag DisableOptimizations (#126813)
- Set the shader flag `DisableOptimizations` based on `optnone`
attribute of shader entry functions.

- Add DXIL Metadata Analysis pass as pre-requisite for Shader Flags pass
to obtain entry function information collected therein.

- Named module metadata `dx.disable_optimizations` is intended to
indicate disabling optimizations (`-O0`) via commandline flag. However,
its intent is fulfilled by `optnone` attribute of shader entry functions as 
implemented in a recent change, and thus not needed. Delete
generation of named metadata and corresponding test file
`disable_opt.ll`.

- Add tests to verify correctness of setting shader flag.

Closes #112263
2025-02-12 16:45:01 -05:00
Nick Sarnie
cb3498c670
[OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (#126801)
We should be able to use `spirv64` as a device variant match and it
should be considered a GPU.

Also add the triple to an RTTI check.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-02-12 16:40:05 +00:00
Alex MacLean
a282b6c486
[NVPTX] Convert scalar function nvvm.annotations to attributes (#125908)
Replace some more nvvm.annotations with function attributes,
auto-upgrading the annotations as needed. These new attributes will be
more idiomatic and compile-time efficient than the annotations.

- !"maxclusterrank" / !"cluster_max_blocks" -> "nvvm.maxclusterrank"
- !"minctasm" -> "nvvm.minctasm"
- !"maxnreg" -> "nvvm.maxnreg"
2025-02-12 07:33:22 -08:00
Donát Nagy
257754011c
[NFC][analyzer] OOB test consolidation II: constraint checking (#126748)
This commit heavily refactors `out-of-bounds-constraint-check.c`:
1. The complex combinations of several `clang_analyzer_eval` calls were
replaced by `clang_analyzer_value`, which can directly query the range
of a symbol.
2. Testcases were renamed to a (hopefully) more consistent scheme.
3. The use of `size_t` as an argument type was replaced by `unsigned
long long`, which is usually a no-op, but seems to be a better choice if
I look for `64u` in the output of `clang_analyzer_value`.
4. The single "dynamic extent" case was generalized into a full set of
tests that use `malloc`.
5. Half of the testcases (the ones that don't use `malloc`) were changed
to use an `int[5]` array instead of a string literal. After this change
the tests in this file cover every functionality that was tested by the
testcases `test_assume_after_access{,2}` in the file `out-of-bounds.c`
so I was able to delete those two testcases (and therefore consolidate
the validation of these constraints within a single test file).

This is the second commit in a series that reorganizes the tests of
`security.ArrayBound` to system that's easier to understand and
maintain. (Note that this file wasn't significantly modified by the
recent commit 6e17ed9b04e5523cc910bf171c3122dcc64b86db which renamed
`alpha.security.ArrayBoundV2` to `security.ArrayBound`; but I still felt
that this cleanup may be useful.)
2025-02-12 16:18:27 +01:00
Balazs Benics
be25d61832
[clang][analysis] Fix flaky clang/test/Analysis/live-stmts.cpp test (#126913)
Multiple people reported flaky bot failures tied to
`clang/test/Analysis/live-stmts.cpp` I tried reproducing the flaky
behavior on my Linux x86_64 system, but the tests appears to be stable
in my context.

Only by looking at the failures reported, I could formulate a potential
diagnosis.
The output always looked almost the same, except that the Exprs dumped
per Basic block were shuffled compared to my expectation. This suggests
to me some ordering issue.

If you look at the backing storage of
`blocksEndToLiveness[B].liveExprs`,
it uses `llvm::ImmutableSet<const Expr *>`.
That container likely uses the pointer values as keys, thus the runtime
values of the addresses influence the iteration order.

To fix this, before dumping, I sort the expressions by their
"beginLocs". It should be efficient enough for a debug checker, where
there is no performance constraint.

This should hopefully fix the flaky behavior on systems where ASLR works
differently than (my) Linux system.

Hopefully fixes #126619
Hopefully fixes #126804
2025-02-12 16:07:49 +01:00
Farzon Lotfi
767b15f9d5
[HLSL] Change clang Driver Options to not set CXXOperatorNames (#126758)
- Disable `CXXOperatorNames` for HLSL
- Add tests to confirm we can use the alt names as functions
2025-02-12 09:21:39 -05:00
Matt
a1826b4d26
[OpenMP][SIMD][FIX] Use conservative "omp simd ordered" lowering (#126172)
A proposed fix for the issue #95611, [OpenMP][SIMD] ordered has no
effect in a loop SIMD region as of LLVM 18.1.0

Changes:

- Implement new lowering behavior: Conservatively serialize "omp simd"
loops that have `omp simd ordered` directive to prevent incorrect
vectorization (which results in incorrect execution behavior of the
miscompiled program).

Implementation outline:

- We start with the optimistic default initial value of
`LoopStack.setParallel(/Enable=/true);` in
`CodeGenFunction::EmitOMPSimdInit(const OMPLoopDirective &D)`.
- We only disable the loop parallel memory access assumption with `if
(HasOrderedDirective) LoopStack.setParallel(/Enable=/false);` using the
`HasOrderedDirective` (which tests for the presence of an
`OMPOrderedDirective`).
- This results in no longer incorrectly vectorizing the loop when the
`omp simd ordered` directive is present.

Motivation: We'd like to prevent incorrect vectorization of the loops
marked with the `#pragma omp ordered simd` directive which has
previously resulted in miscompiled code.

At the same time, we'd like the usage outside of the `#pragma omp
ordered simd` context to remain unaffected: Note that in the test
"clang/test/OpenMP/ordered_codegen.cpp" we only "lose" the
`!llvm.access.group` metadata in `foo_simd` alone.

This is conservative, in that it's possible some of the loops would be
possible to vectorize, but we prefer to avoid miscompilation of the
loops that are currently illegal to vectorize.

A concrete example follows:

```cpp
// "test.c"
#include <float.h>
#include <math.h>
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int compare_float(float x1, float x2, float scalar) {
    const float diff = fabsf(x1 - x2);
    x1 = fabsf(x1);
    x2 = fabsf(x2);
    const float l = (x2 > x1) ? x2 : x1;
    if (diff <= l * scalar * FLT_EPSILON)
        return 1;
    else
        return 0;
}

#define ARRAY_SIZE 256

__attribute__((noinline)) void initialization_loop(
    float X[ARRAY_SIZE][ARRAY_SIZE], float Y[ARRAY_SIZE][ARRAY_SIZE]) {
    const float max = 1000.0;
    srand(time(NULL));
    for (int r = 0; r < ARRAY_SIZE; r++) {
        for (int c = 0; c < ARRAY_SIZE; c++) {
            X[r][c] = ((float)rand() / (float)(RAND_MAX)) * max;
            Y[r][c] = X[r][c];
        }
    }
}

__attribute__((noinline)) void omp_simd_loop(float X[ARRAY_SIZE][ARRAY_SIZE]) {
    for (int r = 1; r < ARRAY_SIZE; ++r) {
        for (int c = 1; c < ARRAY_SIZE; ++c) {
#pragma omp simd
            for (int k = 2; k < ARRAY_SIZE; ++k) {
#pragma omp ordered simd
                X[r][k] = X[r][k - 2] + sinf((float)(r / c));
            }
        }
    }
}

__attribute__((noinline)) int comparison_loop(float X[ARRAY_SIZE][ARRAY_SIZE],
                                              float Y[ARRAY_SIZE][ARRAY_SIZE]) {
    int totalErrors_simd = 0;
    const float scalar = 1.0;
    for (int r = 1; r < ARRAY_SIZE; ++r) {
        for (int c = 1; c < ARRAY_SIZE; ++c) {
            for (int k = 2; k < ARRAY_SIZE; ++k) {
                Y[r][k] = Y[r][k - 2] + sinf((float)(r / c));
            }
        }
        // check row for simd update
        for (int k = 0; k < ARRAY_SIZE; ++k) {
            if (!compare_float(X[r][k], Y[r][k], scalar)) {
                ++totalErrors_simd;
            }
        }
    }
    return totalErrors_simd;
}

int main(void) {
    float X[ARRAY_SIZE][ARRAY_SIZE];
    float Y[ARRAY_SIZE][ARRAY_SIZE];

    initialization_loop(X, Y);
    omp_simd_loop(X);
    const int totalErrors_simd = comparison_loop(X, Y);

    if (totalErrors_simd) {
        fprintf(stdout, "totalErrors_simd: %d \n", totalErrors_simd);
        fprintf(stdout, "%s : %d - FAIL: error in ordered simd computation.\n",
                __FILE__, __LINE__);
    } else {
        fprintf(stdout, "Success!\n");
    }

    return totalErrors_simd;
}
```

Before:

```
$ clang -fopenmp-simd -O3 -ffast-math -lm test.c -o test && ./test
totalErrors_simd: 15408
test.c : 76 - FAIL: error in ordered simd computation.
```

clang 19.1.0: https://godbolt.org/z/6EvhxqEhe

After:

```
$ clang -fopenmp-simd -O3 -ffast-math test.c -o test && ./test
Success!
```

Co-authored-by: Matt P. Dziubinski <matt-p.dziubinski@hpe.com>
2025-02-12 08:53:47 -05:00
Donát Nagy
edbc1fb228
[analyzer] Add option assume-at-least-one-iteration (#125494)
This commit adds the new analyzer option
`assume-at-least-one-iteration`, which is `false` by default, but can be
set to `true` to ensure that the analyzer always assumes at least one
iteration in loops.

In some situations this "loop is skipped" execution path is an important
corner case that may evade the notice of the developer and hide
significant bugs -- however, there are also many situations where it's
guaranteed that at least one iteration will happen (e.g. some data
structure is always nonempty), but the analyzer cannot realize this and
will produce false positives when it assumes that the loop is skipped.

This commit refactors some logic around the implementation of the new
feature, but the only functional change is introducing the new analyzer
option. If the new option is left in its default state (false), then the
analysis is functionally equivalent to an analysis done with a version
before this commit.
2025-02-12 11:56:02 +01:00
Timm Baeder
20506a0a15
[clang][bytecode] Fix operator new source expression (#126870)
... for composite element types. Looks like I forgot this in
e6030d389571b3f1b0f0c5a35b7fa45937ed0f6c
2025-02-12 10:05:49 +01:00
Amit Kumar Pandey
46f1bab793
Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."… (#126671)
- This reverts commit
0c6c4a9993.
  - Add '-mcode-object-version=5' as to explicitly use code object
    version 5 to match with 'FAIL' diagnostic.
  - Add Requires directive to support lit test run on platforms
    registered with x86_64 and amdgpu.
2025-02-12 13:40:51 +05:30
Kazu Hirata
67e1e98811 Revert "[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#119891)"
This reverts commit 070f84ebc89b11df616a83a56df9ac56efbab783.

Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/51/builds/10694
2025-02-11 12:39:01 -08:00
Nick Sarnie
c2fea0d837
[clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-tools feature is available (#126756)
My last change made the test not run when the `spirv-tools` feature is
not available, which is always the case in CI for clang tests, but it
fails if `spirv-tools` is available for the following reasons:
1) We didn't build `spirv-link` as part of the internal `SPIRV-Tools`
build, which is required by the `clang` call in `clang-linker-wrapper`,
I already fixed that
[here](https://github.com/llvm/llvm-project/pull/126319).
2) We didn't depend on the `SPIRV-Tools` CMake targets in clang tests,
so depending on what CMake targets were built before running
`check-clang`, `SPIRV-Tools` might not have been built.
3) We didn't check for `llvm-spirv` being available, which is not part
of `SPIRV-Tools` but is currently required for SPIR-V compilation.

Manually confirmed this works. This test is the bane of my existence.

---------

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-02-11 20:04:53 +00:00
Ryosuke Niwa
8c67f14f62
[WebKit Checkers] Allow operator T&() in a const member function (#126470)
Allow operator T&() in a member function which returns a const member
variable.

In particular, this will allow UniqueRef::operator T&() and
Ref::operator T&() to be treated as a safe pointer origin when they're
called on a const member.
2025-02-11 11:07:52 -08:00
Zahira Ammarguellat
070f84ebc8
[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#119891)
Implement basic parsing and semantic support for `#pragma omp stripe`
constuct introduced in
https://www.openmp.org/wp-content/uploads/[OpenMP-API-Specification-6-0.pdf](https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-6-0.pdf),
section 11.7.
2025-02-11 13:58:21 -05:00
Ryosuke Niwa
71478ecdb4
[WebKit Checkers] Treat const Objective-C ivar as a safe origin (#126353)
Like const C++ member variables, treat const Ref, RefPtr, CheckedRef,
CheckedPtr Objective-C ivars as a safe pointer origin in WebKit
checkers.
2025-02-11 10:00:09 -08:00
S. Bharadwaj Yadavalli
b92bab3c01
[HLSL] Appropriately set function attribute optnone (#125937)
When optimization is disabled, set `optnone` attribute all module entry
functions.

Updated test in accordance with the change.

Closes #124796
2025-02-11 12:29:05 -05:00
Sharjeel Khan
f574d82353
[Clang][Driver][HIP] Fix test for HIP as it was failing (#126585)
This PR #125646 added this test and it was failing in Android's compiler
and on my machine locally. I removed the "Build config" check and it
passes now.
2025-02-11 09:11:40 -08:00
Timm Baeder
9387fd9631
[clang][bytecode] Fix diagnosing replaceable global allocator functions (#126717)
Don't return true here in InvalidNewDeleteExpr just because we are in
C++26 mode. This invalid there as well.

Testcase reduced from
libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.pass.cpp
2025-02-11 16:51:21 +01:00
Joseph Huber
94f9d5d1a8
[Offload] Treat an empty packager architecture as 'generic' (#126655)
Summary:
The `clang-offload-packager` records the architecture of the job.
Currently there are cases where this will be empty. SYCL, CPU, and when
the user manually overrides it to be empty. In these cases we should
alwas consider it 'generic'. Adding this string both makes it clear how
it behaves and triggers the special handling for this architecture,
allowing it to bind to different architectures.
2025-02-11 09:13:35 -06:00
Yutong Zhu
8d902f2cb0
[clang] Force AttributedStmtClass to not be scope parents (#125370)
Example from the issue:
```c++
void Func(int x) {
    switch (x) {
        [[likely]] case 0:
        case 1:
            int i = 3;
        case 2:
            break;
    }
}
```

Clang checks if ``case 2`` can be reachable by checking its scope. The
variable declaration should create a scope containing ``case 2``, but
due to the structure of the AST, ``case 2`` gets the scope of the
``likely`` statement, but not ``int i = 3;``. Therefore, I changed this
code to force attribute statement not to be scope parents.

Fixes #84072
2025-02-11 08:53:19 -05:00
Donát Nagy
73913275c4
[NFC][analyzer] OOB test consolidation I: no-outofbounds.c (#126539)
Before commit 6e17ed9b04e5523cc910bf171c3122dcc64b86db the test file
`no-outofbounds.c` tested the behavior of the old alpha checker
`alpha.security.ArrayBound` (V1); then that commit converted it into a
test for the checker `security.ArrayBound` which was previously called
`alpha.security.ArrayBoundV2`.

This commit removes this small separate test file and adds some tests to
the "native" test files of `security.ArrayBound` to ensure that the same
functionality is still tested.

This is intended as the first commit in a series that reorganizes the
tests of `security.ArrayBound` to system that's easier to understand and
maintain.
2025-02-11 14:25:42 +01:00
Michael Flanders
560149b5e3
[analyzer] Reapply recent stack addr escape checker changes + buildbot fix (#126620)
Reapplying changes from https://github.com/llvm/llvm-project/pull/125638
after buildbot failures.

Buildbot failures fixed in 029e7e98dc9956086adc6c1dfb0c655a273fbee6,
latest commit on this PR. It was a problem with a declared class member
with same name as its type. Sorry!
2025-02-11 12:54:30 +00:00
Timm Baeder
dfbd764a55
[clang][bytecode][NFC] Add failing memmove testcase (#126682)
Reduced from
libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/move.pass.cpp
2025-02-11 08:45:24 +01:00
higher-performance
90192e8872
Fix false positive of [[clang::require_explicit_initialization]] on copy/move constructors (#126553)
Fixes #126490
2025-02-11 07:52:13 +01:00
Chuanqi Xu
569e94f8f1 [C++20] [Modules] Don't diagnose duplicated declarations in different modules which is not in file scope
Close https://github.com/llvm/llvm-project/issues/126373

Although the root problems should be we shouldn't place the friend
declaration to the incorrect module, let's avoid bleeding the edge by
stoping diagnosing declarations not in file scope.
2025-02-11 14:12:32 +08:00
Ben Shi
170b9caf33
[clang][Sema] Emit warnings about incorrect AVR interrupt/signal handlers (#125997)
1. interrupt/signal handlers can not have parameters
2. interrupt/signal handlers must be 'void' type
2025-02-11 14:04:28 +08:00
Helena Kotas
1a0de96c95
[HLSL] Constant buffer layout struct update (#124840)
Updates layout struct to be `struct` with public fields instead of
`class` with private fields and chang the name prefix to `__cblayout_`.
Also adds Packed attribute to prevent struct padding and filters
additional types from the layout that were missed previously (arrays of
resources and groupshared declarations).
2025-02-10 21:19:13 -08:00
Mikołaj Piróg
af522c5dd3
[AVX10.2] Fix wrong mask casting in some convert intrinsics (#126627)
Found during work on #120927. This caused the compiler to silently drop
ignore half of the mask in the specific intrinsics.
2025-02-11 13:13:36 +08:00
Ryosuke Niwa
595195e86e
[WebKit checkers] Treat an implicit value initialization as trivial (#126203)
Implicit value initialization is trivial for our purposes.
2025-02-10 20:40:34 -08:00
Oleksandr T.
aeeeeabe58
[Clang] disallow attributes on void parameters (#124920)
Fixes #108819 

--- 

This PR introduces diagnostics to disallow the use of attributes on void
parameters

```cpp
void f([[deprecated]] void) {}
```
2025-02-11 02:42:39 +02:00
Florian Mayer
0c6c4a9993
Revert "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP." (#126628)
Reverts llvm/llvm-project#126186

This broke the sanitizer buildbot:
https://lab.llvm.org/buildbot/#/builders/55/builds/6846
2025-02-10 16:35:26 -08:00
Nico Weber
44fcc5cdac [clang] Disaqble test/Analysis/live-stmts.cpp on aarch64
See https://github.com/llvm/llvm-project/issues/126619 and discussion
on https://github.com/llvm/llvm-project/pull/125840
2025-02-10 18:04:01 -05:00
Gábor Horváth
3c6d1dd362
Revert "[analyzer] Remove some false negatives in StackAddrEscapeChec… (#126614)
…ker (#125638)"

This reverts commit 7ba3c55d91dcd7da5a5eb1c58225f648fb38b740.

Co-authored-by: Gabor Horvath <gaborh@apple.com>
2025-02-10 22:34:45 +00:00
Michael Flanders
7ba3c55d91
[analyzer] Remove some false negatives in StackAddrEscapeChecker (#125638)
Fixes https://github.com/llvm/llvm-project/issues/123459.

Previously, when the StackAddrEscapeChecker checked return values, it
did not scan into the structure of the return SVal. Now it does, and we
can catch some more false negatives that were already mocked out in the
tests in addition to those mentioned in
https://github.com/llvm/llvm-project/issues/123459.

The warning message at the moment for these newly caught leaks is not
great. I think they would be better if they had a better trace of why
and how the region leaks. If y'all are happy with these changes, I would
try to improve these warnings and work on normalizing this SVal checking
on the `checkEndFunction` side of the checker also.

Two of the stack address leak test cases now have two warnings, one
warning from return expression checking and another from`
checkEndFunction` `iterBindings` checking. For these two cases, I prefer
the warnings from the return expression checking, but I couldn't figure
out a way to drop the `checkEndFunction` without breaking other
`checkEndFunction` warnings that we do want. Thoughts here?
2025-02-10 22:20:10 +00:00
Sarah Spall
db1dd87642
[HLSL] Desugar type when converting from a ConstantArrayType to an ArrayParameterType (#126561)
Desugar type when converting from a ConstantArrayType to an
ArrayParameterType in getArrayParameterType
Closes #125743
2025-02-10 13:05:51 -08:00
Joseph Huber
3d9409f5bc
[NVPTX] Make ctor/dtor lowering always enabled in NVPTX (#126544)
Summary:
Currently we conditionally enable NVPTX lowering depending on the
language (C/C++/OpenMP). Unfortunately this causes problems because this
option is only present if the backend was enabled, which causes this to
error if you try to make LLVM-IR.

This patch instead makes it the only accepted lowering. The reason we
had it as opt-in before is because it is not handled by CUDA. So, this
pach also introduces diagnostics to prevent *all* creation of
device-side global constructors and destructors. We already did this for
variables, now we do it for attributes as well.

This inverts the responsibility of blocking this from the backend to the
langauage like it should be given that support for this is language
dependent.
2025-02-10 14:25:44 -06:00
Nick Sarnie
f3cd223838
[OpenMP][OpenMPIRBuilder] Add initial changes for SPIR-V target frontend support (#125920)
As Intel is working to add support for SPIR-V OpenMP device offloading
in upstream clang/liboffload, we need to modify the OpenMP frontend to
allow SPIR-V as well as generate valid IR for SPIR-V. For example, we
need the frontend to generate code to define and interact with device
globals used in the DeviceRTL.

This is the beginning of what I expect will be (many) other changes, but
let's get started with something simple.

---------

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-02-10 16:16:40 +00:00
Amit Kumar Pandey
c69be3fe4b
[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP. (#126186)
ASan gpu runtime (asanrtl.bc) linking is dependent on 'ockl.bc'. Link
'ockl.bc' only when ASan is enabled for openmp amdgpu offloading
application.
2025-02-10 21:41:49 +05:30
Nico Weber
783275eb7b
[clang] Handle f(no-)strict-overflow, f(no-)wrapv, f(no-)wrapv-pointer like gcc (#126524)
We now process all 6 options left-to-right and pick whatever is active
at the end.

Fixes #124868.
2025-02-10 10:57:22 -05:00
Haojian Wu
4d2a1bf563
[clang] CTAD alias: Respect explicit deduction guides defined after the first use of the alias template. (#125478)
Fixes #103016

This is the last missing piece for the C++20 CTAD alias feature. No
release note being added in this PR yet, I will send out a follow-up
patch to mark this feature done.

(Since the release 20 branch is cut, I think we should target on
clang21).
2025-02-10 15:05:49 +01:00
Nico Weber
71adb05402
[clang] Expose -f(no-)strict-overflow as a clang-cl option (#126512)
Also move the -fno-strict-overflow option definition next to the
-fstrict-overflow one while here.

Also add test coverage for f(no-)wrapv-pointer being a clang-cl option.
2025-02-10 09:00:31 -05:00
Timm Baeder
199c791a1d
[clang][bytecode] Support partial initializers for CXXNewExprs (#126494)
For `new A[N]{1,2,3}`, we need to allocate N elements of type A, and
initialize the first three with the given InitListExpr elements.
However, if N is larger than 3, we need to initialize the remaining
elements with the InitListExpr array filler.

Similarly, for `new A[N];`, we need to initilize all fields with the
constructor of A. The initializer type is a CXXConstructExpr of
IncompleteArrayType in this case, which we can't generally handle.
2025-02-10 14:28:40 +01:00
Aniket Lal
cab893ab8e
[Clang][Driver][HIP] Do not specify explicit target cpu in host compilation run line (#126488)
This PR fixes the post merge check fails from PR
https://github.com/llvm/llvm-project/pull/125646

Co-authored-by: anikelal <anikelal@amd.com>
2025-02-10 10:24:13 +00:00
Jan Patrick Lehr
6fd99de318
Revert "[LinkerWrapper] Clean up options after proper forwarding" (#126495)
Reverts llvm/llvm-project#126297

Broken buildbots
https://lab.llvm.org/staging/#/builders/105/builds/15554
https://lab.llvm.org/buildbot/#/builders/30/builds/15490

Error is
```
# .---command stderr------------
# | FileCheck error: '/work/janplehr/git/llvm-project/bot-tester-builds/cmakecachebuild/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/bug51781.c.tmp.custom' is empty.
# | FileCheck command line:  /home/janplehr/git/llvm-project/bot-tester-builds/cmakecachebuild/./bin/FileCheck /work/janplehr/git/llvm-project/offload/test/offloading/bug51781.c -check-prefix=CUSTOM -input-file=/work/janplehr/git/llvm-project/bot-tester-builds/cmakecachebuild/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/offloading/Output/bug51781.c.tmp.custom
```
The file is empty, while the `CUSTOM` check-target expects to find
```
// CUSTOM: Rewriting generic-mode kernel with a customized state machine.
```
2025-02-10 10:58:56 +01:00
Aniket Lal
d9cdf27834
[Driver][HIP] Do not pass -dependency-file flag for HIP Device offloading (#125646)
When we launch hipcc with multiple offload architectures along with -MF
dep_file flag, the clang compilation invocations for host and device
offloads write to the same dep_file, and can lead to collision during
file IO operations. This can typically happen during large workloads.
This commit provides a fix to generate dep_file only in host
compilation.

---------

Co-authored-by: anikelal <anikelal@amd.com>
2025-02-10 13:57:52 +05:30
Mikołaj Piróg
161cfc6f39
[AVX10.2] Fix wrong intrinsic names after rename (#126390)
In my previous PR (#123656) to update the names of AVX10.2 intrinsics
and mnemonics, I have erroneously deleted `_ph` from few intrinsics.
This PR corrects this.
2025-02-10 12:48:02 +08:00
Alexander Richardson
d2047242e6
[CSKY] Default to unsigned char
This matches the ABI document found at
https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf

Partially addresses https://github.com/llvm/llvm-project/issues/115957

Reviewed By: zixuan-wu

Pull Request: https://github.com/llvm/llvm-project/pull/115961
2025-02-09 12:18:52 -08:00
Joseph Huber
a32efd8edc [Clang] Disable failing offload test on darwin
Summary:
We don't support offloading on Darwin. This fails because there's some
handling missing somewhere else that likely won't ever be added.
2025-02-09 07:32:50 -06:00