521018 Commits

Author SHA1 Message Date
Keith Smiley
bedbafff2d
[bazel] Fix lit tests with bazel 8.x (#119462)
https://github.com/llvm/llvm-project/issues/83066
2024-12-10 14:09:08 -08:00
Valentin Clement (バレンタイン クレメン)
850c932f05
[flang][cuda] Walk through cuf kernel for implicit globals (#119455)
Globals used in cuf kernel need to be flagged as well.
2024-12-10 14:01:53 -08:00
ChiaHungDuan
5a930339a5
[scudo] Minor refactor on element address validation (NFC) (#119436) 2024-12-10 13:58:02 -08:00
Joshua Batista
e7e42ef116
[NFC] Cleanup comments in HLSLExternalSemaSource.cpp (#119444)
Cleaning up some comments that @bogner pointed out were unpolished.
2024-12-10 13:49:26 -08:00
Michael Maitland
9bb29c3dc1
[RISCV][VLOPT] Add support for bitwise logical, single width shift, and vector move (#119412)
Add support and tests for these instructions. Get operand info test
exist in llvm/test/CodeGen/RISCV/rvv/vl-opt-op-info.mir
2024-12-10 16:48:40 -05:00
David Olsen
7eb73b95cb
[CIR] Cleanup: mlirContext and astContext (#119450)
ClangIR CodeGen code uses both `mlir::MLIRContext` and
`clang::ASTContext` objects extensively. Refering to either of those as
just "context" can be confusing.

Change the names of all variables, parameters, and fields in
`clang/lib/CIR/CodeGen` that refer to `MLIRContext` or an `ASTContext`
to be either `mlirContext` or `astContext`.

This change is only the renaming of variables/parameters/fields. There
are no behavior changes. So there are no new tests or changes to
existing tests. This change mimics a recent change in the ClangIR
incubator repository.
2024-12-10 13:46:07 -08:00
Daniel Thornburgh
4dac0dff08
[LLD][ELF] Fix SHF_MERGE misalignment when spilled (#119289)
Section merging can increase section alignment after potential spill
sections are created. Since this operation is never performed on spill
sections, they can keep their earlier, smaller, alignment, which
produces a misalignment if a spill occurs.

This change propagates alignment increases forward after merging.
2024-12-10 13:43:13 -08:00
Zhengxing li
951a284fdf
[HLSL] Implement SV_GroupThreadId semantic (#117781)
Support HLSL SV_GroupThreadId attribute.

For `directx` target, translate it into `dx.thread.id.in.group` in clang
codeGen and lower `dx.thread.id.in.group` to `dx.op.threadIdInGroup` in
LLVM DirectX backend.

For `spir-v` target, translate it into `spv.thread.id.in.group` in clang
codeGen and lower `spv.thread.id.in.group` to a `LocalInvocationId`
builtin variable in LLVM SPIR-V backend.

Fixes: #70122
2024-12-10 13:18:49 -08:00
Ellis Hoag
968e3b6823
[memprof] Add flag to control profile dump at exit (#119452)
Add the `dump_at_exit` flag to control whether or not profiles should be
dumped when the program exits. Since we can call
`__memprof_profile_dump()` directly, we don't necessarily need to dump
profiles at exit.
2024-12-10 13:12:08 -08:00
Valentin Clement (バレンタイン クレメン)
8c19c24a78
[flang][cuda][NFC] Add missing template declaration (#119443) 2024-12-10 13:10:23 -08:00
Nick Desaulniers
5877e5bd12
[bazel] update .bazelversion to 8.0.0 (#119425)
Fixes:

ERROR: The project you're trying to build requires Bazel 7.3.0
(specified
    in llvm-project/utils/bazel/.bazelversion), but it wasn't found in
    /usr/bin.

    You can install the required Bazel version via apt:
      sudo apt update && sudo apt install bazel-7.3.0

If this doesn't work, check Bazel's installation instructions for help:
      https://bazel.build/install/ubuntu

Link: https://blog.bazel.build/2024/12/09/bazel-8-release.html
2024-12-10 13:07:52 -08:00
Jordan Rupprecht
b2cc66b4f2
[bzl][mlir][mlir-vulkan-runner] Add vulkan deps (#119457)
9735873009ca86b03c3283d06edd1b3a190d4af9
2024-12-10 15:05:16 -06:00
Nick Desaulniers
02e39a13c3
[libc][docs] split "String Functions" into string.h, strings.h, stdlib.h, and inttypes.h (#118860)
bcmp, bcopy, and bzero should be moved from libc/src/string/ to
lib/src/strings/ in order for docgen to use existing conventions to find
whether we implement a function or not.

We should add support to docgen for mentioning glibc extensions (mempcpy) or
extensions from other libcs.
2024-12-10 12:59:46 -08:00
Shilei Tian
04269ea0e4
[AMDGPU] Re-enable closed-world assumption as an opt-in feature (#115371)
Although the ABI (if one exists) doesn’t explicitly prohibit
cross-code-object function calls—particularly since our loader can
handle them—such calls are not actually allowed in any of the officially
supported programming models. However, this limitation has some nuances.
For instance, the loader can handle cross-code-object global variables,
which complicates the situation further.

Given this complexity, assuming a closed-world model at link time isn’t
always safe. To address this, this PR introduces an option that enables
this assumption, providing end users the flexibility to enable it for
improved compiler optimizations. However, it is the user’s
responsibility to ensure they do not violate this assumption.
2024-12-10 15:57:41 -05:00
Keith Smiley
f3c675feec
[bazel] Port 9a9c1d4a6155a96ce9be494cec7e25731d36b33e (#119456) 2024-12-10 12:56:26 -08:00
Craig Topper
c835b48a4d [RISCV] Compute liveins for new basic blocks in emitStackProbeInline.
Fixes expensive check failures from #117612.
2024-12-10 12:37:45 -08:00
Valentin Clement (バレンタイン クレメン)
dc5236e6b1
[flang][cuda] Update target rewrite to work on gpu.func (#119283)
Update the pass so it can perform the signature rewrite on gpu.func.
2024-12-10 12:36:49 -08:00
Nick Desaulniers
1d0ca626d8
[bazel] fix libc build (#119433)
Due to moving strings out of string.

Link: #118899
2024-12-10 12:29:49 -08:00
Jordan Rupprecht
68ea7c7e8d
[test][AArch64] Fix test in non-writeable dir (#119448)
cc1a2ea61e3f8e790125b10d9ec4e7d179156ddf adds a test which can fail if
the output directory is not writeable. Following the pattern of other
tests in this package, use `-o -` to print the IR to stdout instead of
to a file.
2024-12-10 14:28:23 -06:00
Schrodinger ZHU Yifan
24162bdaf7
[libc][workflows] fix pre-commit fullbuild dependency problem (#119441)
- fix the issue where `linux-headers-generic` cannot be installed
2024-12-10 15:08:38 -05:00
khaki3
e9866d5d14
[flang][cuda] Fix GPULaunchKernelConversion to generate correct kernel launch parameters (#119431)
For the call to _FortranACUFLaunchKernel, we store the pointer to a
member of a temporary structure in a parameter array. However, when we
obtain an element pointer from the parameter array, its address is
calculated based on the type of the structure. This PR properly treats
the parameter array as an array of pointers.

Example:

```mlir
%30 = llvm.load %29 : !llvm.ptr -> i32
%31 = llvm.mlir.constant(1 : i32) : i32
%32 = llvm.alloca %31 x !llvm.struct<(i64, i64, i32, ptr)> : (i32) -> !llvm.ptr
%33 = llvm.mlir.constant(4 : i32) : i32
%34 = llvm.alloca %33 x !llvm.ptr : (i32) -> !llvm.ptr
%35 = llvm.mlir.constant(0 : i32) : i32
%36 = llvm.getelementptr %32[%35] : (!llvm.ptr, i32) -> !llvm.ptr, !llvm.struct<(i64, i64, i32, ptr)>
llvm.store %8, %36 : i64, !llvm.ptr
%37 = llvm.getelementptr %34[%35] : (!llvm.ptr, i32) -> !llvm.ptr, !llvm.struct<(i64, i64, i32, ptr)>
llvm.store %36, %37 : !llvm.ptr, !llvm.ptr
...
llvm.call @_FortranACUFLaunchKernel(%47, %8, %8, %8, %2, %8, %8, %7, %34, %48) : (!llvm.ptr, i64, i64, i64, i64, i64, i64, i32, !llvm.ptr, !llvm.ptr) -> () 
```
In this example, `%37 = llvm.getelementptr %34[%35] : (!llvm.ptr, i32)
-> !llvm.ptr, !llvm.struct<(i64, i64, i32, ptr)>` will be `%37 =
llvm.getelementptr %34[%35] : (!llvm.ptr, i32) -> !llvm.ptr, !llvm.ptr`.
2024-12-10 11:32:32 -08:00
David Olsen
ffb19f4018
[CIR] Infrastructure: class CIRGenBuilderTy; cache CIR types (#119037)
Small infrastructure and background changes to ClangIR.

Create class `CIRGenBuilderTy` and its base class `CIRBaseBuilderTy`.
These are mostly empty for now, except for what is inherited from
`mlir::OpBuilder`. But they will fill up quickly as more ClangIR code
gen is upstreamed. `CIRGenModule` and `CIRGenTypes` are changed to use
`CIRGenBuilderTy`.

Add cached types to struct `CIRGenTypeCache` for the integral types that
are currently supported. Initialize those cached types in the
`CIRGenModule` constructor. The first uses of those types (well, one of
them) is in `CIRGenTypes::convertType`.

Have `CIRGenTypes::convertType` cache its results in a map from
`clang::Type` to `mlir::Type`, saving it from having to convert the same
type again and again.

There are no new tests or changed tests in this commit. There are no
changes to behavior, just improvements to how the existing behavior is
implemented.
2024-12-10 11:29:48 -08:00
Vitaly Buka
e0f3410be9 [compiler-rt] Fix a few new lines in Maintaners.md 2024-12-10 11:11:45 -08:00
Vitaly Buka
b347b47785 [llvm] Fix a few new lines in Maintainers 2024-12-10 11:09:01 -08:00
Vitaly Buka
4c04bf8116
[compiler-rt] Convert Maintainers.txt into Maintainers.md (#119169)
Structured similarly to llvm/Maintainers.md.

PR has no intent to change any component maintenter.
2024-12-10 11:05:39 -08:00
Aaron Puchert
3376bad132 Eliminate duplicate call in Clang driver (NFC)
The only difference is the usage of `JobAction* JA` versus `Action* A`
in one argument, but `JA = cast<JobAction>(A)`, and the called function
is inherited from `Action`.
2024-12-10 20:01:19 +01:00
Vitaly Buka
9c509a0c6a
[compiler-rt] Update maintainers (#119166) 2024-12-10 11:00:23 -08:00
Vitaly Buka
ff42a9012a
[LLVM] Update sanitizers maintainers (#119165) 2024-12-10 10:59:37 -08:00
anoopkg6
dc04d414df
SystemZ: Add support for __builtin_setjmp and __builtin_longjmp. (#119257)
This pr includes fixes for original pr##116642.
Implementation for __builtin_setjmp and __builtin_longjmp for SystemZ..
2024-12-10 19:50:51 +01:00
Kazu Hirata
806a936b36 [PowerPC] Fix a warning
This patch fixes:

  llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp:293:23: error: unused
  variable 'NewFMAInt' [-Werror,-Wunused-variable]
2024-12-10 10:33:20 -08:00
Adrian Prantl
f6012a209d [lldb] Add cast to fix compile error on 32-bit platforms 2024-12-10 10:28:14 -08:00
LLVM GN Syncbot
faebeddac0 [gn build] Port 9a9c1d4a6155 2024-12-10 18:14:41 +00:00
Nick Desaulniers
d1d5fc381f
[libc] fix up strings.h entrypoints (#119417)
I typo'd riscv, and the newly added baremetal aarch64 entrypoints had a mid air
collision.

Link: #118691
Link: #118899
2024-12-10 10:14:01 -08:00
Nick Desaulniers
1bf1e5f459
[libc] remove old hdrgen diagram (#119424)
FWICT, it was unused even before #117220.

Link: #117220
2024-12-10 10:12:00 -08:00
David Green
6106422ddb [SROA] Escaping readonly nocapture tests. NFC 2024-12-10 18:07:54 +00:00
Joshua Batista
1a5e18a492
[HLSL] Do not print details in IR for target extension types (#115971)
This PR changes how target extension types are printed when they are
emitted as IR.
This prevents repetitive phrases like "struct = type {...}" from being
repeated over and over in the outputted IR.
Additionally, it should allow opt to not crash when parsing the DXIL
output.

Fixes [#114131](https://github.com/llvm/llvm-project/issues/114131)
2024-12-10 10:07:30 -08:00
Adrian Prantl
d300337e93 [lldb] Add cast to fix compile error on 32-but platforms 2024-12-10 10:00:54 -08:00
Haopeng Liu
ebe741fad0
[DSE] Enable initializes improvement (#119116)
Tested with an internal search backend loadtest.

With `-ftrivial-auto-var-init`, this work has a 0.2%-0.3% total QPS
improvement.

Note that, the metric is total QPS instead of cpu-time, even 1%
improvement means a lot.

- Add the "initializes" attr:
https://github.com/llvm/llvm-project/pull/97373
- Apply the attr to DSE:
https://github.com/llvm/llvm-project/pull/107282
2024-12-10 09:58:13 -08:00
Adrian Prantl
0be3348485 [lldb] Improve log message to include missing strings 2024-12-10 09:54:36 -08:00
Valentin Clement (バレンタイン クレメン)
0469bb91aa
[flang][cuda] Fix lowering when step is a variable (#119421)
Add missing conversion.
2024-12-10 09:48:15 -08:00
Alexey Bataev
a42aa8f265 [SLP]Fix adjusting of the mask for the fully matched nodes.
When checking for the poison elements in the matches node, need to
consider the register number, when clearing the corresponding mask
element.

Fixes #119393
2024-12-10 09:47:16 -08:00
Craig Topper
13539c219c [RISCV][GISEl] Simplify GISelPredicateCode for binop_with_non_imm12. NFC
MRI is already available where this is instantiated.
2024-12-10 09:44:25 -08:00
Shilei Tian
15f87bc10c [NFC][AMDGPU] Auto generate check lines for llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit.ll 2024-12-10 12:40:28 -05:00
Adrian Prantl
e2bb47443d [lldb] Add comment 2024-12-10 09:39:51 -08:00
Adrian Prantl
9a9c1d4a61 [lldb] Implement a formatter bytecode interpreter in C++
Compared to the python version, this also does type checking and error
handling, so it's slightly longer, however, it's still comfortably
under 500 lines.
2024-12-10 09:36:38 -08:00
Dave Lee
1a650fde4a [lldb] Load embedded type summary section (#7859) (#8040)
Add support for type summaries embedded into the binary.

These embedded summaries will typically be generated by Swift macros,
but can also be generated by any other means.

rdar://115184658
2024-12-10 09:36:38 -08:00
Zhuoran Yin
d6590c1bcb
[MLIR] Add allow Insert/extract slice option to pack/unpack op (#117340)
This PR adds default option below. The new options will come as default
to true and not change the original lowering behavior of pack and unpack
op.
 - lowerPadLikeWithInsertSlice to packOp (with default = true)
 - lowerUnpadLikeWithExtractSlice to unPackOp (with default = true)

The motivation of the PR is finer granular control of the lowering of
pack and unpack Ops. This is useful in particular when we want to
guarantee that there's no additional insertslice and extractslice that
interfere with tiling. With the original lowering pipeline, packOp and
unPackOp may be lowered to insertslice and extractslice when the high
dimensions are unit dimensions and no transpose is invovled. Under such
circumstances, such insert and extract slice ops will block
producer/consumer fusion tile + fuse transforms. With this PR, we will
be able to disable such lowering path and allow consumer fusion to go
through as expected.
2024-12-10 11:31:30 -06:00
Simon Pilgrim
c5a21c1158 [PhaseOrdering][X86] Add test coverage based off #111431
Add tests for the concatenation of boolean vectors bitcast to integers - similar to the MOVMSK pattern.
2024-12-10 17:31:08 +00:00
Aleksei Vetrov
5041d06730
[MC] Fix DWARF file table for files with empty DWARF (#119020) (#119229)
Update root file in DWARF file/line table as soon as we see the first
"#line" directive.

This was moved from "enabledGenDwarfForAssembly", which is called right
before we emit DWARF information. But if the file is empty or contains
expressions that doesn't need DWARF, it is never called, leaving an
original root file and not the file in the "#line" directive.

Add a test checking for this case.

Fixes: #119020
2024-12-10 09:29:25 -08:00
Fangrui Song
df3397b359 [ELF] Improve canBeOmittedFromSymbolTable tests
A linkonce_odr definition can be omitted in LTO compilation if
`canBeOmittedFromSymbolTable()` is true in all bitcode files.
Test more linkage merge scenarios.

The lo_and_wo symbol tests #111341.
2024-12-10 09:28:23 -08:00