522456 Commits

Author SHA1 Message Date
Fangrui Song
edc42b2dc1 [SLP] Migrate away from PointerUnion::get 2024-12-27 21:01:09 -08:00
Vitaly Buka
092966a44d
[Driver] Make regex stricter (#121243)
Follow up to #121221.
2024-12-27 19:32:06 -08:00
Amr Hesham
48bf0a9457
[Clang][ASTMatcher] Add dependentScopeDeclRefExpr matcher (#120996)
Fixes https://github.com/llvm/llvm-project/issues/120937
2024-12-27 19:10:24 -05:00
Vitaly Buka
b2fd0a7a70
[Driver] Fix implicit-check-not regex (#121221)
We need to exclude more than builtins, but it's
 tricky with FileCheck regex. So switching to list
 of libs we want to check.
2024-12-27 13:02:51 -08:00
Kyungwoo Lee
815343e7dd
[CGData][Merger] Avoid merging the attached call target (#121030)
For global function merging, the target of the arc-attached call must be
a constant and cannot be parameterized.
This change adds a check to bypass this case in `canParameterizeCallOperand()`.
2024-12-27 11:59:25 -08:00
Zequan Wu
4d8f9594b2 Revert "Reland "[LoopVectorizer] Add support for partial reductions" (#120721)"
This reverts commit c858bf620c3ab2a4db53e84b9365b553c3ad1aa6 as it casuse optimization crash on -O2, see https://github.com/llvm/llvm-project/pull/120721#issuecomment-2563192057
2024-12-27 11:51:54 -08:00
kleines Filmröllchen
1f90797f6a
[clangd] Allow specifying what headers are always included via "" or <> (#67749)
Projects can now add config fragments like this to their .clangd:

```yaml
Style:
  QuotedHeaders: "src/.*"
  AngledHeaders: ["path/sdk/.*", "third-party/.*"]
```

to force headers inserted via the --header-insertion=iwyu mode matching
at least one of the regexes to have <> (AngledHeaders) or ""
(QuotedHeaders) around them, respectively. For other headers (and in
conflicting cases where both styles have a matching regex), the current
system header detection remains.

Fixes https://github.com/clangd/clangd/issues/1247
2024-12-27 14:14:29 -05:00
Florian Hahn
8caeb2e0c2
[VPlan] Always create initial blocks in constructor (NFC).
Update C++ unit tests to use VPlanTestBase to construct initial VPlan,
using a constructor that creates the VP blocks directly in the
constructor.

Split off from and in preparation for
https://github.com/llvm/llvm-project/pull/120918.
2024-12-27 17:43:22 +00:00
Kunwar Grover
91bbebc7e1
[mlir][scf] Add getPartialResultTilePosition to PartialReductionOpInterface (#120465)
This PR adds a new interface method to PartialReductionOpInterface which
allows it to query the result tile position for the partial result.
Previously, tiling the reduction dimension with
SplitReductionOuterReduction when the result has transposed parallel
dimensions would produce wrong results.

Other fixes that were needed to make this PR work:

- Instead of ad-hoc logic to decide where to place the new reduction
dimensions in the partial result based on the iteration space, the
reduction dimensions are always appended to the partial result tensor.
- Remove usage of PartialReductionOpInterface in Mesh dialect. The
implementation was trying to just get a neutral element, but ended up
trying to use PartialReductionOpInterface for it, which is not right. It
was also passing the wrong sizes to it.
2024-12-27 16:52:34 +00:00
Alexey Bataev
07ba457525 [SLP][NFC]Add dump of combined entries, where applicable 2024-12-27 07:56:10 -08:00
Ivan Butygin
9ab16d49c9
[mlir][IntRangeInference] Fix arith.ceildivsi range inference when it includes INT_MIN (#121062)
There is a special case in `arith.ceildivsi` range inference for
handling `lhs.smin()==INT_MIN`, but when `lhs` is not a single value, it
can cause it to skip entire negative range. Add `lhs.smin() + 1` check
to handle it.
2024-12-27 16:50:21 +03:00
Kunwar Grover
5ad4213ef4
[mlir][Linalg] Allow PartialReductionOpInterface ops in tile_reduction_using_for (#120118)
The API used internally expects PartialReductionOpInterface. This patch
allows any operation implementing this interface to use this transform
op (instead of just LinalgOp).
2024-12-27 13:19:58 +00:00
Hassnaa Hamdi
ccfe0de0e1
[LV]: Teach LV to recursively (de)interleave. (#89018)
Currently available intrinsics are only ld2/st2, which don't support interleaving factor > 2.
This patch teaches the LV to use ld2/st2 recursively to support high
interleaving factors.
2024-12-27 12:42:07 +00:00
NAKAMURA Takumi
aa2fdc69d3
[Coverage] Move SingleByteCoverage out of CountedRegion (#110966)
`SingleByteCoverage` is not per-region attribute at least.
Move it into `CoverageData` since it comes from `profdata`.

Depends on: #120841
2024-12-27 20:42:26 +09:00
NAKAMURA Takumi
223521b13e
llvm-cov: Introduce --binary-counters (#120841)
In `llvm-cov show`, this option rounds counters (line, branch) to
`[1,0]` at rendering. This will be useful when the number of counts
doesn't interest but **Covered/uncoverd** does.
2024-12-27 19:48:30 +09:00
Matt Arsenault
ac8bb7353a
Attributor: Do not treat pointer vectors as valid for unsupported attributes (#121149)
The memory attributes, noalias, and dereferenceable do not support
vectors of pointers according to the IR verifier, so don't report
them as valid.
2024-12-27 15:57:20 +07:00
Dhruv Srivastava
1ead155128
[lldb] clang-format changes for some basic #if _AIX changes (#120978)
This PR is in reference to porting LLDB on AIX.

Link to discussions on llvm discourse and github:

1. https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640
2. https://github.com/llvm/llvm-project/issues/101657
The complete changes for porting are present in this draft PR:
https://github.com/llvm/llvm-project/pull/102601

Added clang-format changes for changes related to some base #if _AIX
changes:

- https://github.com/llvm/llvm-project/pull/120979
2024-12-27 09:13:43 +01:00
Matthias Springer
2b5b3cf60d
[mlir][sparse_tensor] Migrate SparseIterationToScf.cpp to dialect conversion (#121054)
Use the regular dialect conversion driver instead of the 1:N dialect
conversion driver. The 1:N dialect conversion driver will be removed
soon.
2024-12-27 09:13:15 +01:00
Dhruv Srivastava
bca055f2ac
[lldb] AIX Changes for MainLoop polling (#120378)
This PR is in reference to porting LLDB on AIX.

Link to discussions on llvm discourse and github:

1. https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640
2. https://github.com/llvm/llvm-project/issues/101657
The complete changes for porting are present in this draft PR:
https://github.com/llvm/llvm-project/pull/102601

Dropping changes for MainLoop polling in AIX, as `ppoll` is not
supported in AIX currently.
This change is part of the couple of minimal changes required to build a
minimal `lldb` binary on AIX
2024-12-27 09:12:26 +01:00
Vitaly Buka
5807d0efb9 [Drive] Don't match libclang_rt.builtins
Fixes fuchsia bots.
2024-12-26 23:17:04 -08:00
Craig Topper
814902a03a [RISCV] Fix XTheadba patterns broken since cfc574a6cd13d2d0b77110b579c5cfcec744129f.
Adding an OperandTransform to CSImm12MulBy4 and CSImm12MulBy8 for
Zba broke these patterns. They should have been changed in the same,
but we lacked sufficient testing.
2024-12-26 21:50:35 -08:00
Craig Topper
cd3c1658ee [RISCV] Add more tests to rv*xtheadba.ll. NFC
XTheadba has similarities with Zba and shares some of the same
codegen code and has similar isel patterns. This patch makes the
testing more similar.
2024-12-26 21:46:19 -08:00
NAKAMURA Takumi
3d9f9684a5 llvm-cov: Split out sumRegions() from FunctionCoverageSummary::get(). NFC. 2024-12-27 14:37:01 +09:00
NAKAMURA Takumi
8230b8a60e test/llvm-cov/branch-noShowBranch.test: Align CHECK-NOTs to branch-c-general.test's in #113114 2024-12-27 14:36:51 +09:00
Vitaly Buka
f51db95e06
[NFC][Driver] Use global --implicit-check-not=libclang_rt (#121081)
To simplify and improve precision of the test.
2024-12-26 19:49:45 -08:00
Patryk Wychowaniec
c6ea7fb2f8
[AVR] Wrap out-of-bounds relative jumps (#118015)
This commit improves the relative jumps, so that we are able to emit
`rjmp` that wraps around the memory boundary on devices with 8KB flash.
2024-12-27 11:44:55 +08:00
Fangrui Song
179344d9a8 [MC] Move AIX specific function to PPCAsmPrinter
https://reviews.llvm.org/D95518 used switchSectionNoPrint,
which seems buggy as .ll -> .s -> .o will be different from
.ll -> .o, but this change intends to be a NFC.
2024-12-26 18:53:42 -08:00
Elvis Wang
47e1c87a61
[VPlan] Set debug location for VPReduction/VPWidenIntrinsicRecipe. (#120054)
This patch add missing debug location for
VPReduction/VPWidenIntrinsicRecipe.
2024-12-27 10:37:21 +08:00
YunQiang Su
9d3f9f47e6 Revert "[llvm-lib] Handle MIPS architecture (#121007)"
This reverts commit 5d529c32cc2d5342a0d183881b6c3023435ed5d3.
2024-12-27 09:57:42 +08:00
Maksim Levental
6b53a9546c
[mlir][arith] DCE getPredicateByName (#121165) 2024-12-26 17:38:18 -08:00
Hervé Poussineau
5d529c32cc
[llvm-lib] Handle MIPS architecture (#121007)
- add a test to check values for /machine argument
- add a test to check if machine is correctly inferred from inputs
2024-12-27 08:43:19 +08:00
Prabhuk
7deaed975e
[libc] Reduce binary size for baremetal targets (#121164)
For `math` functions we must choose size optimized implementations.
Removing framepointers will also help with binary size savings.
2024-12-26 15:55:39 -08:00
Vitaly Buka
8e9fda1c11
Reapply "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)" (#121162)
This reverts commit ca28fcc6fce516129d117f5f5a14ba7f54a045d8.

Android targets pass on Windows buildbots, but fails on buildkite
https://buildkite.com/llvm-project/github-pull-requests/builds/132244

Re-apply  #121160
2024-12-26 15:32:50 -08:00
Vitaly Buka
ca28fcc6fc Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)"
Revert #121160.
It fails Android targets on Windows.

This reverts commit 377755c87e9d5494237f0e2e88f70886b5107342.
2024-12-26 14:59:37 -08:00
hill
7ecbeace01
[clang-tidy] fix incorrect argument names in documentation for ExtraArgs and ExtraArgsBefore (#120963) 2024-12-26 22:44:14 +01:00
Florian Hahn
2dfe1b4042
[VPlan] Remove stray space when printing reverse vector pointer.
printFlags() takes care of printing the required space, remove the extra
printed space between flags and operands.
2024-12-26 21:26:17 +00:00
Vitaly Buka
377755c87e
[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)
These are not Windows tests
2024-12-26 12:46:11 -08:00
Vitaly Buka
b59a0a6f40
[NFC][Driver] Define %{filecheck} as suggested on #121081 (#121159)
We will introduce `--implicit-check-not=libclang_rt` in #121081,
this let us to avoid repeating the flag.
2024-12-26 12:25:16 -08:00
Oleksandr "Alex" Zinenko
776ac21c7f
[mlir] minor documentation fix in GPUTransformOps.td (#121157)
- do not refer to handles as `PDLOperation`, this is an outdated and
incorrect vision of what they are based on the type used in the early
days;
 - use backticks around inline code.
2024-12-26 20:18:35 +01:00
Davide Italiano
62c39d7734
[BOLT/docs] The support for macro-op fusion was removed. (#121158)
Update the documentation accordingly.
2024-12-26 11:18:12 -08:00
Franklin
6e8a1a45a7
[BOLT] Detect Linux kernel version if the binary is a Linux kernel (#119088)
This makes it easier to handle differences (e.g. of exception table
entry size) between versions of Linux kernel
2024-12-26 09:54:23 -08:00
srcarroll
8906b7be91
Enable custom alloc-like ops in promoteBufferResultsToOutParams (#120288)
In `buffer-results-to-out-params`, when `hoist-static-allocs` option is
enabled the pass was looking for `memref.alloc`s in order to attempt to
avoid copies when it can. Which makes it not extensible to external ops
that have allocation like properties. This patch simply changes
`memref::AllocOp` to `AllocationOpInterface` in the check to enable for
any allocation op.
Moreover, for function call updates, we enable setting an allocation
function callback in `BufferResultsToOutParamsOpts` to allow users to
emit their own alloc-like op.
2024-12-26 11:32:51 -06:00
Min-Yih Hsu
831e1ac12e
[MIPatternMatch] Add m_GUMin and m_GUMax (#121068)
And make all unsigned and signed versions of min/max matchers
commutative, since we already made a precedent of m_GAdd that is
commutative by default.
2024-12-26 09:28:17 -08:00
Min-Yih Hsu
d21f300f06
[MIPatternMatch] Fix incorrect argument type of m_Type (#121074)
m_Type is supposed to extract the underlying value type (equality type
comparison is covered by m_SpecificType), therefore it should take a LLT
reference as its argument rather than passing by value.

This was originated from de256478e61d6488db751689af82d280ba114a6f, which
refactored out a good chunk of LLT reference usages. And it's just so
happen that (for some reasons) no one is using m_Type and no test was
covering it.
2024-12-26 09:09:02 -08:00
Sergei Barannikov
4a92c27f9d
[TableGen][GISel] Remove check for LLT when emitting renderers (#121144)
Types used in the destination DAG of a pattern should not matter for
GlobalISel. All necessary checks are emitted in the form of matchers
when traversing the source DAG.

In particular, the check prevented importing patterns containing iPTR in
the middle of the destination DAG.

This reduces the number of skipped patterns on Mips and RISCV:
```
Mips   1270  -> 1212  (-58)
RISCV 42165 -> 42088  (-77)
```

Most of these patterns are for atomic operations.
2024-12-26 17:45:29 +03:00
Vikash Gupta
c21a3776c9
[GlobalIsel] [Utility] [NFC] Added isConstantOrConstantSplatVectorFP to handle float constants. (#120935)
Needed for #120104
2024-12-26 18:57:19 +05:30
Alexey Bataev
889215a30e [SLP]Followup fix for the poisonous logical op in reductions
If the VectorizedTree still may generate poisonous value, but it is not
the original operand of the reduction op, need to check if Res still the
operand, to generate correct code.

Fixes #114905
2024-12-26 05:11:26 -08:00
Brad Smith
1b476ecdcf
[lldb] A few more pieces towards OpenBSD support (#121051) 2024-12-26 08:04:44 -05:00
Hongren Zheng
698bb5f239
[mlir][docs] Add C example for C-compatible wrapper for LLVM IR (#120955)
`TargetLLVMIR` documentation introduced the C-compatible wrapper
function for a MLIR function and ways to generate it, but did not
demonstrate the corresponding C function signature for them.

The C function signature is not obvious, in that
* `MemrefDescriptor` should be passed as _pointer_.
+ For example, MLIR function could return a new Descriptor, so pointer
is a must.
+ Surprisingly, directly pass the struct, by C convention, is also a
pointer so some function will work, but that is implicit and
error-prone.
* for `@foo() -> memref<>`, the return type becomes the first argument
in `_mlir_ciface_foo(%arg0: !llvm.ptr)`.
+ This is described in
f70ab7d909/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp (L110-L167)
Especially by code `size_t argOffset = resultStructType ? 1 : 0;` saying
the actual argument starts at 1 when result is a struct (memref)

Users using the wrong signature will get incorrect results. LLVM
discourse has some example of it
*
https://discourse.llvm.org/t/how-to-compile-and-link-with-other-c-c-programs/4835/10
*
https://discourse.llvm.org/t/segmentation-fault-on-memref-store/80286/3
* https://discourse.llvm.org/t/memref-store-storing-a-memref-load/80307

Cc @ftynse for relevent commit history. Cc @charitha22 and @Wheest from
discourse post.
2024-12-26 12:58:11 +01:00
Thirumalai Shaktivel
cbe583b0bd
[Flang] Add translation support for MutexInOutSet and InOutSet (#120715)
Implementatoin details:
Both Mutexinoutset and Inoutset is recognized as flag=0x4 
and 0x8 respectively, the flags is set to `kmp_depend_info` and 
passed as argument to `__kmpc_omp_task_with_deps` runtime call
2024-12-26 15:02:09 +05:30