515355 Commits

Author SHA1 Message Date
Jie Fu
f42785d0c8 [Polly] Remove unused variable 'IdentTy' in LoopGeneratorsKMP.cpp (NFC)
/llvm-project/polly/lib/CodeGen/LoopGeneratorsKMP.cpp:396:15: error: unused variable 'IdentTy' [-Werror,-Wunused-variable]
  StructType *IdentTy =
              ^
/llvm-project/polly/lib/CodeGen/LoopGeneratorsKMP.cpp:460:15: error: unused variable 'IdentTy' [-Werror,-Wunused-variable]
  StructType *IdentTy =
              ^
2 errors generated.
2024-10-17 19:48:38 +08:00
David Spickett
2882bb192b [lldb][docs] Add link to LoongArch tracking issue
https://github.com/llvm/llvm-project/issues/112693 will be
tracking the overall state of LoongArch support.

This means anyone can check without having to track down
an expert.
2024-10-17 12:48:03 +01:00
Mariya Podchishchaeva
e21c80ac73
[clang] Reject if constexpr in C (#112685)
Fixes https://github.com/llvm/llvm-project/issues/112587
2024-10-17 13:42:35 +02:00
jeanPerier
2f0b4f43fc
[flang][extension] support concatenation with absent optional (#112678)
Fix #112593 by adding support in lowering to concatenation with an
absent optional _assumed length_ dummy argument because:
1. Most compilers seem to support it (most likely by accident).
2. This actually makes the compiler codegen simpler. Codegen was going
out of its way to poke the LLVM optimizer bear by producing an undef
argument for the length.

I insist on the fact that no compiler support this with _explicit
length_ optional arguments and the executable will segfault and I would
discourage users from using that "feature" because runtime checks for
bad optional dereference will kick when used (For instance, "nagfor
-C=present" will produce an executable that abort with an error message
. Flang does not have such runtime check option so far).

Hence, I am not updating the Extensions.md document because this is not
something I think we should advertise.
2024-10-17 13:25:09 +02:00
Benjamin Kramer
9c80eb7c83 Silence -Wswitch after cb43021e5726a4462f28a999fb66a8dc20dc354b
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4885:13: warning: enumeration value 'SveMFloat8' not handled in switch [-Wswitch]
 4885 |     switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind()) {
      |
2024-10-17 13:15:05 +02:00
NAKAMURA Takumi
40d9561b2d InstrProfilingMerge.c: Fix potential misalignment in SrcBitmapStart
Currently it is not an issue. It will be a problem if Bitmap is
located after single byte counters.
2024-10-17 20:04:00 +09:00
NAKAMURA Takumi
5bcc66dc00 VisitIfStmt: Prune a redundant condition.
`S->isConsteval()` is evaluated at the top of this method.
Likely mis-merging in #75425
2024-10-17 20:04:00 +09:00
NAKAMURA Takumi
83953c7df1 APInt.cpp: Prune a stray semicolon. 2024-10-17 20:04:00 +09:00
Nashe Mncube
ab90d2793c
[llvm][ARM]Add widen global arrays pass (#107120)
- Pass optimizes memcpy's by padding out destinations and sources to a
full word to make backend generate full word loads instead of loading a
single byte (ldrb) and/or half word (ldrh). Only pads destination when
it's a stack allocated constant size array and source when it's constant
array. Heuristic to decide whether to pad or not is very basic and could
be improved to allow more examples to be padded.
- Pass works within GlobalOpt but is disabled by default on all targets
except ARM.
2024-10-17 11:56:00 +01:00
Jie Fu
2954d1f7bc [include-cleaner] Fix -Wpessimizing-move in IncludeCleaner.cpp (NFC)
/llvm-project/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp:302:14:
error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
      return std::move(llvm::errorCodeToError(Err));
             ^
/llvm-project/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp:302:14: note: remove std::move call here
      return std::move(llvm::errorCodeToError(Err));
             ^~~~~~~~~~                           ~
1 error generated.
2024-10-17 18:51:40 +08:00
Jie Fu
584e00a316 [ARM] Fix -Wunused-variable in ARMFrameLowering.cpp (NFC)
/llvm-project/llvm/lib/Target/ARM/ARMFrameLowering.cpp:1028:9:
error: unused variable 'FPOffset' [-Werror,-Wunused-variable]
    int FPOffset = MFI.getObjectOffset(FramePtrSpillFI);
        ^
1 error generated.
2024-10-17 18:46:26 +08:00
Benjamin Kramer
4d228e1ebd [mlir][vector] Escape variable usage in test
Otherwise the shell might expand this in the command line.
2024-10-17 12:43:32 +02:00
Timm Bäder
1251687448 [clang][bytecode][NFC] Remove a leftover dump call 2024-10-17 12:40:14 +02:00
Timm Baeder
5b4071c755
[clang][bytecode] Explicitly truncate in IntegralAP::from() (#112683)
Add Integral::toAPInt(), which truncates to the given BitWidth, similar
to the toAPSInt() we already have.
2024-10-17 12:26:44 +02:00
SpencerAbson
53d89ef340
[AArch64][Clang][NEON] Remove undefined vcmla intrinsics (#112575)
arm_neon.td currently generates the same 24 `vcmla` intrinsic prototypes
for each of the f16, f32, and f64 base types. This is incorrect, the
only valid vcmla intrinsics for the f64 base type are:
- `vcmlaq_f64`
- `vcmlaq_rot90_f64`
- `vcmlaq_rot180_f64`
- `vcmlaq_rot270_f64`

(see ACLE
https://github.com/ARM-software/acle/blob/main/neon_intrinsics/advsimd.md)

This patch removes the incorrect intrinsic prototypes.
2024-10-17 11:16:06 +01:00
John Brawn
ad45eb4a9c
[ARM] Fix problems with register list in vscclrm (#111825)
The register list in vscclrm is unusual in three ways:
 * The encoded size can be zero, meaning the list contains only vpr.
* Double-precision registers past d15 are permitted even when the
subtarget doesn't have them, they are instead ignored when the
instruction executes.
* The single-precision variant allows double-precision registers d16
onwards, which are encoded as a pair of single-precision registers.

Fixing this also incidentally changes a vlldm/vlstm error message: when
the first register is in the range d16-d31 we now get the "operand must
be exactly..." error instead of "register expected".
2024-10-17 11:15:08 +01:00
Rajveer Singh Bharadwaj
b091701d01
[mlir] Add a method on MLIRContext to retrieve the operations for a given dialect (#112344)
Currently we have `MLIRContext::getRegisteredOperations` which returns
all operations for the given context, with the addition of
`MLIRContext::getRegisteredOperationsByDialect` we can now retrieve the
same for a given dialect class.

Closes #111591
2024-10-17 12:02:24 +02:00
Sergio Afonso
4091bc61e3
[MLIR][OpenMP] Split region-associated op verification (#112355)
This patch moves the part of operation verifiers dependent on the
contents of their regions to the corresponding `verifyRegions` method.
This ensures these are only triggered after the operations in the region
have themselved already been verified in advance, avoiding checks based
on invalid nested operations.

The `LoopWrapperInterface` is also updated so that its verifier runs
after operations in the region of ops with this interface have already
been verified.
2024-10-17 10:46:38 +01:00
Lukacma
b584478e00
[AArch64] Introduce new armv9.6 features (#111677)
This patch implements new features introduced in 2024 release of ARM ISA
and creates predicates, which will be used by new instructions.


Co-authored-by: Caroline Concatto caroline.concatto@arm.com
Co-authored-by: Spencer Abson spencer.abson@arm.com
2024-10-17 10:43:17 +01:00
Youngsuk Kim
2ab2539ce9
[polly] Avoid llvm::Type::getPointerTo() (NFC) (#112651)
`llvm::Type::getPointerTo()` is to be deprecated & removed soon.
2024-10-17 05:40:43 -04:00
Pradeep Kumar
9b713f5d23
[MLIR][NVVM] Add PTX predefined special registers (#112343)
This commit adds support for the following PTX predefined special
registers
* warpid
* nwarpid
* smid
* nsmid
* gridid
* lanemask.*
* globaltimer
* envreg* And added lit tests under nvvmir.mlir
2024-10-17 15:03:00 +05:30
Ivan Butygin
6902b39b6f
[mlir] UnsignedWhenEquivalent: use greedy rewriter instead of dialect conversion (#112454)
`UnsignedWhenEquivalent` doesn't really need any dialect conversion
features and switching it normal patterns makes it more composable with
other patterns-based transformations (and probably faster).
2024-10-17 12:23:11 +03:00
Matt Arsenault
77ea619bc6
clang/HIP: Remove REQUIRES windows from a test (#112411) 2024-10-17 13:17:10 +04:00
Matt Arsenault
375690c0a1
clang/HIP: Remove REQUIRES libgcc from a test (#112412) 2024-10-17 13:15:12 +04:00
Simon Pilgrim
d51af6c215 [X86] Regenerate test checks with vpternlog comments 2024-10-17 09:54:24 +01:00
David Sherwood
671976ff59
[NFC][LoopVectorize] Add more simple early exit tests (#112529)
I realised we are missing tests to cover more loops with multiple early
exits - some countable and some uncountable.

I've also added a few SVE versions of the test in the AArch64 directory.
Once we can vectorise such early exit loops it's a good sanity check to
make sure they also vectorise for SVE. Also, for some of the tests I
expect there to be some divergence from the same tests in the top level
directory once we start vectorising them.
2024-10-17 09:49:51 +01:00
Oliver Stannard
e1f8f84ace
[ARM] Fix frame chains with M-profile PACBTI (#110285)
When using AAPCS-compliant frame chains with PACBTI return address
signing, there ware a number of bugs in the generation of the frame
pointer and function prologues. The most obvious was that we sometimes
would modify r11 before pushing it to the stack, so it wasn't preserved
as required by the PCS. We also sometimes did not push R11 and LR
adjacent to one another on the stack, or used R11 as a frame pointer
without pointing it at the saved value of R11, both of which are
required to have an AAPCS compliant frame chain.

The original work of this patch was done by James Westwood, reviewed as
 #82801 and #81249, with some tidy-ups done by Mark Murray and myself.
2024-10-17 09:32:44 +01:00
CarolineConcatto
cb43021e57
[CLANG]Add Scalable vectors for mfloat8_t (#101644)
This patch adds these new vector sizes for sve:
    svmfloat8_t

According to the ARM ACLE PR#323[1].

[1] ARM-software/acle#323
2024-10-17 09:22:55 +01:00
Byoungchan Lee
4cda28c1ad
[clang-include-cleaner] Fix incorrect directory issue for writing files (#111375)
If the current working directory of `clang-include-cleaner` differs from
the directory of the input files specified in the compilation database,
it doesn't adjust the input file paths properly. As a result,
`clang-include-cleaner` either writes files to the wrong directory or
fails to write files altogether.

This pull request fixes the issue by adjusting the input file paths
based on the directory specified in the compilation database. If that
directory is not writable, `clang-include-cleaner` will write the output
relative to the current working directory.

Fixes #110843.
2024-10-17 10:16:07 +02:00
Hans Wennborg
9d5ceccbd9 Speculatively un-XFAIL TestCases/Misc/Posix/ubsan_options.cpp on Darwin
After https://github.com/llvm/llvm-project/pull/111497 the test started
unexpectedly passing (https://crbug.com/373891811), probably because it
does actually work but wasn't run when it lived in the Misc/Linux/
directory.
2024-10-17 10:00:00 +02:00
Paschalis Mpeis
cb9bacf57d
[AArch64][BOLT] Ensure tentative code layout for cold BBs runs. (#96609)
When split functions is used, BOLT may skip tentative code layout
estimation in some cases, like:
- when there is no profile data for some blocks (ie cold blocks)
- when there are cold functions in lite mode
- when skip functions is used
     
However, when rewriting the binary we still need to compute PC-relative
distances between hot and cold basic blocks. Without cold layout
estimation, BOLT uses '0x0' as the address of the first cold block,
leading to incorrect estimations of any PC-relative addresses.
 
This affects large binaries as the relaxStub method expands more
branches than necessary using the short-jump sequence, at it wrongly
believes it has exceeded the branch distance boundary.
 
This increases code size with both a larger and slower sequence;
however,
performance regression is expected to be minimal since this only affects
any called cold code.
 
Example of such an unnecessary relaxation:
from:
```armasm
b       .Ltmp1234
```
 
to:
```armasm
adrp    x16, .Ltmp1234
add     x16, x16, :lo12:.Ltmp1234
br      x16
```
2024-10-17 08:59:05 +01:00
Stanislav Mekhanoshin
1cc5290a30
[AMDGPU] Factor out getNumUsedPhysRegs(). NFC. (#112624)
I will need it from one more place.
2024-10-17 00:47:19 -07:00
Nikita Popov
267be4a7f4 [MLIR] Reference issue for implicit trunc TODOs (NFC) 2024-10-17 09:03:39 +02:00
Nikita Popov
255a99c29f
[APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (#80309)
This fixes all the places that hit the new assertion added in
https://github.com/llvm/llvm-project/pull/106524 in tests. That is,
cases where the value passed to the APInt constructor is not an N-bit
signed/unsigned integer, where N is the bit width and signedness is
determined by the isSigned flag.

The fixes either set the correct value for isSigned, set the
implicitTrunc flag, or perform more calculations inside APInt.

Note that the assertion is currently still disabled by default, so this
patch is mostly NFC.
2024-10-17 08:48:08 +02:00
Lang Hames
3ae6b57671 [ORC] Remove extraneous lines in comment. 2024-10-17 17:33:50 +11:00
Mikael Holmen
23d4fe6c5c [RISCV] Fix gcc -Wparentheses warning [NFC]
Without this gcc warned like
 ../lib/Target/RISCV/RISCVVLOptimizer.cpp:760: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   760 |            VLOp.getReg() != RISCV::X0 && "Did not expect X0 VL");
       |
2024-10-17 08:00:31 +02:00
Vitaly Buka
3142dff704
[nfc][lsan] Extract significant part of the loop into a function (#112610)
Co-authored-by: thetruestblue <92476612+thetruestblue@users.noreply.github.com>
2024-10-16 22:45:40 -07:00
thetruestblue
927af63fdd
[SanitizerCoverage] Add an option to gate the invocation of the tracing callbacks (#108328)
Implement -sanitizer-coverage-gated-trace-callbacks to gate the
invocation of the tracing callbacks based on the value of a global
variable, which is stored in a specific section.
When this option is enabled, the instrumentation will not call into the
runtime-provided callbacks for tracing, thus only incurring in a trivial
branch without going through a function call. It is up to the runtime to
toggle the value of the global variable in order to enable tracing.

This option is only supported for trace-pc-guard. 

Note: will add additional support for trace-cmp in a follow up PR.

Patch by Filippo Bigarella

rdar://101626834
2024-10-16 21:52:38 -07:00
Florian Hahn
81bbe19383
[VPlan] Add VPSingleDefRecipe::dump() to resolve ambigous lookup (NFC).
This allows calling ::dump() on various sub-classes of VPSingleDefRecipe
directly, as it resolves an ambigous name lookup.

Previously, calling VPWidenRecipe::dump() (and others), would result in

the following errors:
llvm/unittests/Transforms/Vectorize/VPlanTest.cpp:1284:19: error: member 'dump' found in multiple base classes of different types
 1284 |           WidenR->dump();
      |                   ^
llvm/include/../lib/Transforms/Vectorize/VPlanValue.h:434:8: note: member found by ambiguous name lookup
  434 |   void dump() const;
      |        ^
llvm/include/../lib/Transforms/Vectorize/VPlanValue.h:108:8: note: member found by ambiguous name lookup
  108 |   void dump() const;
      |        ^
1 error generated.
2024-10-17 05:31:29 +01:00
Helena Kotas
4512bbe746
[HLSL] Collect explicit resource binding information (#111203)
Scans each global variable declaration and its members and collects all
required resource bindings in a new `SemaHLSL` data member `Bindings`.

New fields are added `HLSLResourceBindingAttr` for storing processed
binding information so that it can be used by CodeGen (`Bindings` or any
other Sema information is not accessible from CodeGen.)

Adjusts the existing register binding attribute handling and diagnostics
to:
- do not create HLSLResourceBindingAttribute if it is not valid
- diagnose only the simple/local errors when a register binding
attribute is parsed
- additional diagnostic of binding type mismatches is done later and
uses the new `Bindings` data

Fixes #110719
2024-10-16 21:24:13 -07:00
Florian Hahn
1b4a173fa4
[LV] Remove unneeded LoopScalarBody member variable. (NFC) 2024-10-17 04:15:47 +01:00
Wu Yingcong
d54953ef47
[fuzzer] fix clang-cl build fuzzer lit test failure (#112339)
The `check-fuzzer` runs fine with cl build llvm, but the following lit
tests fail with clang-cl build llvm
```
********************
Timed Out Tests (2):
  libFuzzer-x86_64-default-Windows :: fork-ubsan.test
  libFuzzer-x86_64-default-Windows :: fuzzer-oom.test

********************
Failed Tests (22):
  libFuzzer-x86_64-default-Windows :: acquire-crash-state.test
  libFuzzer-x86_64-default-Windows :: cross_over_copy.test
  libFuzzer-x86_64-default-Windows :: cross_over_insert.test
  libFuzzer-x86_64-default-Windows :: exit_on_src_pos.test
  libFuzzer-x86_64-default-Windows :: fuzzer-alignment-assumption.test
  libFuzzer-x86_64-default-Windows :: fuzzer-implicit-integer-sign-change.test
  libFuzzer-x86_64-default-Windows :: fuzzer-implicit-signed-integer-truncation-or-sign-change.test
  libFuzzer-x86_64-default-Windows :: fuzzer-implicit-signed-integer-truncation.test
  libFuzzer-x86_64-default-Windows :: fuzzer-implicit-unsigned-integer-truncation.test
  libFuzzer-x86_64-default-Windows :: fuzzer-printcovpcs.test
  libFuzzer-x86_64-default-Windows :: fuzzer-timeout.test
  libFuzzer-x86_64-default-Windows :: fuzzer-ubsan.test
  libFuzzer-x86_64-default-Windows :: minimize_crash.test
  libFuzzer-x86_64-default-Windows :: minimize_two_crashes.test
  libFuzzer-x86_64-default-Windows :: null-deref-on-empty.test
  libFuzzer-x86_64-default-Windows :: null-deref.test
  libFuzzer-x86_64-default-Windows :: print-func.test
  libFuzzer-x86_64-default-Windows :: stack-overflow-with-asan.test
  libFuzzer-x86_64-default-Windows :: trace-malloc-2.test
  libFuzzer-x86_64-default-Windows :: trace-malloc-unbalanced.test
  libFuzzer-x86_64-default-Windows :: trace-malloc.test
```

The related commits are
53a81d4d26
and
e31efd8f6f.
Following the change in
e31efd8f6f
can fix these failures.

As for the issue mentioned in the comment that alternatename support in
clang not good enough(https://bugs.llvm.org/show_bug.cgi?id=40218). I
find that using `__builtin_function_start(func)` instead of directly
using `func` would make it work as intended.
2024-10-17 10:17:16 +08:00
Jim Lin
5e9166e02a [SLP] Remove TTI parameter from vectorizeHorReduction and vectorizeRootInstruction. NFC.
Since TTI is a member variable.
2024-10-17 09:35:22 +08:00
Vitaly Buka
6ffd3bbcd7
[nfc][lsan] Restructure loop in ProcessThreads (#112609)
The goal is to move `SuspendedThreadsList` related code into
the beginning of the loop, and prepare for extraction the rest
of the loop body into a function.
2024-10-16 18:32:14 -07:00
Vitaly Buka
dd9a34fd7e
[nfc][lsan] Move up vectors cleanup (#112608) 2024-10-16 18:30:20 -07:00
Vitaly Buka
4c98a71993
[nfc][sanitizer] Unmap memory in test (#112644) 2024-10-16 18:29:15 -07:00
Longsheng Mou
9930a5a333
[mlir][tosa] Update document of tosa.rescale(NFC) (#112531)
This PR formats the `supported rescalings` using a table. The previous
structure was disorganized, as seen in the documentation:
https://mlir.llvm.org/docs/Dialects/TOSA/#tosarescale-mlirtosarescaleop.
2024-10-17 09:08:51 +08:00
Longsheng Mou
f5aee1f18b
[mlir][memref] Fix type conversion in emulate-wide-int and emulate-narrow-type (#112214)
This PR follows with #112104, using `nullptr` to indicate that type
conversion failed and no fallback conversion should be attempted.
2024-10-17 09:08:24 +08:00
Jonas Devlieghere
90767bc41b
[lldb] Remove more mentions of ASLLogCallback (#112639) 2024-10-16 17:33:12 -07:00
John Harrison
c5c11f3404
[lldb-dap] Creating an API for sending dap events from a script in lldb-dap. (#112384)
Custom DAP events can be detected using
https://code.visualstudio.com/api/references/vscode-api#debug.onDidReceiveDebugSessionCustomEvent.

This API allows an lldb python script to send events to the DAP
client to allow extensions to handle these custom events.
2024-10-16 17:19:51 -07:00