495344 Commits

Author SHA1 Message Date
Andreas Jonson
e0d49066c1
[IR] Add new Range attribute using new ConstantRange Attribute type (#83171)
implementation as discussed in
https://discourse.llvm.org/t/rfc-metadata-attachments-for-function-arguments/76420
2024-03-08 23:20:04 +08:00
Krzysztof Parzyszek
c4a89f1538
[flang][OpenMP] Fix use-after-free in OMPFunctionFiltering (#84373)
When walking over functions (in pre-order), if the function being
visited needs to be erased, skip visiting its regions.

This was detected by address sanitizer.
2024-03-08 09:15:59 -06:00
Simon Pilgrim
ce683273aa [X86] PBLENDW instructions can run on Port1 or Port5
When we copied the SkylakeServer model we missed this diff

Confirmed with uops.info and Agner
2024-03-08 15:10:47 +00:00
Joseph Huber
cb6f657a70 [CUDA][HIP][NFC] Precommit new driver changes to tests
Summary:
A lot of these tests implicitly rely on `--no-offload-new-driver` a
patch in the future will change the default so this patch makes it
explicit in locations where it matters.
2024-03-08 09:07:00 -06:00
Guillaume Chatelet
23c397c7c9
[libc] Provide LIBC_TYPES_HAS_INT128 (#84149)
Umbrella bug #83182
2024-03-08 16:06:56 +01:00
Stephen Tozer
01e5d4609b
[RemoveDIs] Add documentation for IR debug records (#81156)
This patch adds minimal documentation for the IR representation of the
RemoveDIs model of debug info. This patch assumes
that the default for all cases is still debug intrinsic functions, and
so does not update all existing text to refer to debug records, but only
adds a section in the LangRef and SourceLevelDebugging documents to
explain the new format.
2024-03-08 15:03:15 +00:00
Will Hawkins
ba2236d300
[libcxx][NFC] Consolidate testing concept CanBePiped (#80154)
Almost every test needed a CanBePiped concept and each implemented it
separately, but identically. Consolidate all implementations into
test_range.h.
2024-03-08 09:25:51 -05:00
Balazs Benics
f07157eb2e Fixup 7457e2c1535acd54 by adding a switch case
This fixups 7457e2c1535acd548d2619dfb34eb93d27d15908 as I forgot one
switch to update, which then broke this build bot:
https://lab.llvm.org/buildbot/#/builders/57/builds/33272
2024-03-08 14:55:10 +01:00
AtariDreams
d2c49f13d8
[Hexagon] Use LiveRegUnits (#84112) 2024-03-08 07:43:45 -06:00
AtariDreams
7c21495fee
Reapply "Convert many LivePhysRegs uses to LiveRegUnits" (#84338)
This only converts the instances where all that is needed is to change
the variable type name.

Basically, anything that involves a function that LiveRegUnits does not
directly have was skipped to play it safe.

Reverts
7a0e222a17
2024-03-08 19:05:00 +05:30
paperchalice
d2dff43170
[CodeGen] Skip declaration in ModuleToMachineFunctionPassAdaptor (#84417)
Like ModuleToFunctionPassAdaptor.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2024-03-08 21:26:10 +08:00
Haojian Wu
7415524b45
[clang] Implement CTAD for type alias template. (#77890)
Fixes #54051

This patch implements the C++20 feature -- CTAD for alias templates (P1814R0, specified in https://eel.is/c++draft/over.match.class.deduct#3). It is an initial patch:
- it cover major pieces, thus it works for most cases;
- the big missing piece is to implement the associated constraints (over.match.class.deduct#3.3) for the synthesized deduction guides, see the FIXME in code and tests;
- Some enhancements on the TreeTransform&TemplateInstantiator to allow performing instantiation on `BuildingDeductionGuides` mode;
2024-03-08 14:24:03 +01:00
Krzysztof Parzyszek
141ebdd242
[Frontend][OpenMP] introduce OMP.h header file, use it instead of OMP… (#84188)
….h.inc

The consumers of OpenMP-related definitions include a TableGen-generated
file OMP.h.inc. Having a separate OMP.h allows putting additional
declarations in there that are not auto-generated.

This patch is NFC.
2024-03-08 07:21:42 -06:00
Krzysztof Parzyszek
aa26faf05e
[flang][unittests] Fix buffer overrun in FrontendActionTest (#84381)
When` SmallVector<char>` is used as a backing storage, it can't be
assumed to end with a \x0. When creating a `StringRef` from it, pass the
length explicitly.

This was detected by address sanitizer.
2024-03-08 07:21:21 -06:00
Krzysztof Parzyszek
65524fcb5d
[flang][CodeGen] Replace correct op in BoxedProcedurePass (#84375) 2024-03-08 07:20:55 -06:00
Krzysztof Parzyszek
10b01563da
[flang][HLFIR] Fix use-after-free when rewriting users in canonicalize (#84371)
Rewriting an op can invalidate the operator range being iterated on.
Store the users in a separate list, and iterate over the list instead.

This was detected by address sanitizer.
2024-03-08 07:20:20 -06:00
Congcong Cai
912ea6e335
[clang-tidy]avoid bugprone-unused-return-value false positive for function with the same prefix as the default argument (#84333) 2024-03-08 21:18:58 +08:00
Guillaume Chatelet
aa6e7a61c5
[libc][NFC] Remove integer_utils.h (#84466)
Its sole user is `BigInt` so moving `full_mul` inside UInt.h.
2024-03-08 14:16:42 +01:00
Guillaume Chatelet
9baa4140f2
[libc][NFC] Simplify BigInt::mul (#84468) 2024-03-08 14:16:07 +01:00
Balazs Benics
7457e2c153
[clang][ASTMatcher] Add matchers for isExplicitObjectMemberFunction() (#84446)
Note that this patch will be necessary to fix
`forEachArgumentWithParam()` and `forEachArgumentWithParamType()`
matchers for deducing "this"; which is my true motivation. There the bug
is that with explicit obj params, one should not adjust the number of
arguments in presence of `CXXMethodDecls`, and this causes a mismatch
there mapping the argument to the wrong param. But, I'll come back there
once we have this matcher.
2024-03-08 13:57:27 +01:00
Joseph Huber
4d1d1271b8
[HIP] Make the HIP default architecture use the enum value (#84400)
Summary:
This default enum is used in other places, we should keep it consistent.
2024-03-08 06:54:52 -06:00
Shengchen Kan
1ca8092e87
[X86][MC] Support encoding/decoding for APX CCMP/CTEST (#83863)
APX assembly syntax recommendations:
  https://cdrdv2.intel.com/v1/dl/getContent/817241

NOTE:
The change in llvm/tools/llvm-exegesis/lib/X86/Target.cpp is for test
LLVM ::
tools/llvm-exegesis/X86/latency/latency-SETCCr-cond-codes-sweep.s

For `SETcc`, llvm-exegesis would randomly choose 1 other instruction to
test with `SETcc`, after selecting the instruction, llvm-exegesis would
check if the operand is initialized and valid, if not
`randomizeTargetMCOperand` would choose a value for invalid operand, it
misses support for condition code operand, which cause the flaky failure
after `CCMP` supported.

llvm-exegesis can choose `CCMP` without specifying ccmp feature b/c it
use `MCSubtarget` and only16/32/64 bit is considered.
llvm-exegesis doesn't choose other instructions b/c requirement in
`hasAliasingRegistersThrough`: the instruction should use GPR (defined
by `SETcc`) and define `EFLAGS` (used by `SETcc`).
2024-03-08 20:54:33 +08:00
Kiran Chandramohan
d74287226a
[Flang][AArch64] Add support for complex16 params/returns (#84217)
Fixes #84088
2024-03-08 12:43:39 +00:00
Jay Foad
430de48a61 [GISel] Simplify getConstantVRegValWithLookThrough. NFC. 2024-03-08 12:26:43 +00:00
Younan Zhang
5d98d8822c
[Sema] Avoid unnecessary copy on MultiLevelTemplateArgumentList. NFC (#84459)
We don't modify the MLTAL parameter in `SetupConstraintScope`, and it is
better if we don't copy the 120-byte object each time we call the
function.
2024-03-08 20:26:31 +08:00
Paul Walker
bd6eb54886
[LLVM][CodeGen] Teach SelectionDAG how to expand FREM to a vector math call. (#83859)
This removes, at least when a vector library is available, a failure
case for scalable vectors. Doing so means we can confidently cost vector
FREM instructions without making an assumption that later passes will
transform the IR before it gets to the code generator.

NOTE: Whilst only FREM has been implemented the same mechanism
can be used for the other libm related ISD nodes.
2024-03-08 12:09:05 +00:00
Dmitry Chernenkov
4d478bcb4f [bazel] Add support_uint dep in libc unittest 2024-03-08 11:54:19 +00:00
David Spickett
235332150d [lldb][Docs] Add Curses version note to build page
This explains a thing that hit me on FreeBSD because the base system
has an ncursesw at one version and I installed from pkg another
version that was simply ncurses (no wide char support).

For whatever reason, when we pass -lcurses to the linker it ends up
picking bits of both installs. This led to lldb crashing immediately
if you tried to use the `gui` command.

In a way that gave little information but I stumbled onto
https://github.com/vifm/vifm/issues/325 which is very similar.

```
ec2-user@freebsd:~/build-llvm $ ldd ./bin/lldb | grep curses
	libncursesw.so.9 => /lib/libncursesw.so.9 (0x6a515206e000)
	libncurses.so.6 => /usr/local/lib/libncurses.so.6 (0x6a5158e86000)
```

We should only see one version, and it and libpanel etc should
all have "w" or not have "w". This was not the case for my build.

What I can see from the CMake side seemed fine, it found the pkg
installed ncurses in /usr/local. Something else must decide that
-lcurses should pull in the other one.

Regardless, I don't know how to fix that but the solution for most
people is just not to add another ncurses if they already have one.
So I've added a note saying so, and how to check what your lldb
is using.
2024-03-08 11:33:17 +00:00
Amirreza Ashouri
6a0618a028
[clang][NFC] Refactor clang/test/SemaCXX/type-traits.cpp to use modern static_assert (#77584)
static_assert is supported in all modes, so the T/F macros aren't needed
anymore.
2024-03-08 11:57:35 +01:00
Krystian Stasiowski
ee94bd20ba
Revert "[Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (#83842)" (#84457)
This reverts commit a642eb89bdaf10c6b4994fc1187de27b441236ed (see #83842)
2024-03-08 05:57:04 -05:00
Christian Sigg
005e182ecb
[clang][bazel] Fix BUILD after da00c60dae0040185dc45039c4397f6e746548e9
Second attempt. This also reverts 50633868538d4fd6875a7de57804b3dde5c86108.
2024-03-08 11:55:19 +01:00
Christian Sigg
5063386853
[clang][bazel] Fix BUILD after da00c60dae0040185dc45039c4397f6e746548e9 2024-03-08 11:47:38 +01:00
David Spickett
0f8cb6818d [lldb][Docs] Update the build guide
* gmake is needed on FreeBSD
* pkg can install libxml2 on FreeBSD
* Make the swig note into an RST note box.
2024-03-08 10:43:17 +00:00
Christian Sigg
dd547d5cca
[mlir][bazel] Fix BUILD after 5669660f37ef1800f4a7852577364b024d75e3d8
Second attempt.
2024-03-08 11:39:59 +01:00
Christian Sigg
419e8da2da
[mlir][bazel] Fix BUILD after 5669660f37ef1800f4a7852577364b024d75e3d8 2024-03-08 11:37:10 +01:00
Tom Eccles
c76d853c17
[flang][TBAABuilder] not all loads and stores are inside of functions (#84305)
TBAA builder assumed that all loads/stores are inside of functions and
hit an assertion once it found loads and stores inside of an
omp::ReductionDeclareOp.

For now just don't add TBAA tags to those loads and stores. They would
end up in a different TBAA tree to the host function after
OpenMPIRBuilder inlines them anyway so there isn't an easy way of making
this work.
2024-03-08 10:34:00 +00:00
Tom Eccles
860a40057d
[flang][NFC] move loadIfRef to FIRBuilder (#84306)
This will be useful for OpenMP too.

I changed the definition slightly to use `fir::isa_ref_type` (which also
includes llvm pointers) because I think it reads better using the common
type helpers. There shouldn't be any llvm pointers in lowering so this
isn't a functional change.
2024-03-08 10:33:43 +00:00
zhongyunde 00443407
a110a1c0ed [AArch64] MachineCombiner msub matching for i64 2024-03-08 18:14:26 +08:00
zhongyunde 00443407
3a62edcf52 [AArch64] MachineCombiner msub matching
Pattern should be sorted in priority order since the pattern evalutor
stops checking as soon as it finds a faster sequence.
so for a * b - c * d, we prefer to match the 2nd operands of sub,
which can be use msub to fold them.

Refer to https://www.slideshare.net/chimerawang/instruction-combine-in-llvm

Fix https://github.com/llvm/llvm-project/issues/84152
2024-03-08 18:14:25 +08:00
David Green
d36d805373 [AArch64] Ensure Neoverse-N2 scheduling model includes all SVE pseudos.
Similar to #84187, this enables the existing test we have for checking the
scheduling info of the pseudos matches the real instructions, and adjusts the
scheduling info in the NeoverseN2 model to make sure all cases were handled.
2024-03-08 09:52:49 +00:00
Sizov Nikita
ef1eb0315e
[AArch64] Add neon bici test for haddu and shadd (#84073)
Add neon bici test for haddu and shadd, prerequisite for #76644
2024-03-08 09:45:58 +00:00
Jie Fu
881df55750 [clang] Fix -Wunused-variable in SemaChecking.cpp (NFC)
llvm-project/clang/lib/Sema/SemaChecking.cpp:19192:15:
error: unused variable 'Field1Parent' [-Werror,-Wunused-variable]
  const Type *Field1Parent = Field1->getParent()->getTypeForDecl();
              ^
llvm-project/clang/lib/Sema/SemaChecking.cpp:19193:15:
error: unused variable 'Field2Parent' [-Werror,-Wunused-variable]
  const Type *Field2Parent = Field2->getParent()->getTypeForDecl();
              ^
2 errors generated.
2024-03-08 17:03:51 +08:00
Mariya Podchishchaeva
dd36138e9c
[clang] Error on explicit specialization of lambda call operator (#84343)
Fixes https://github.com/llvm/llvm-project/issues/83267
2024-03-08 09:52:42 +01:00
OverMighty
851ab41d33
[clang][test] Fix constant __builtin_popcountg test requiring __int128 (#84412)
See
https://lab.llvm.org/buildbot/#/builders/245/builds/21611/steps/5/logs/FAIL__Clang__constant-builtins-2_c.
2024-03-08 09:50:21 +01:00
Alex Richardson
80a9574d36 [compiler-rt] Unbreak GCC builds after bfa6444a332f82843
GCC complains if we pass -Werror=format-security without -Wformat.
Reported at https://github.com/llvm/llvm-project/pull/83779#issuecomment-1985246797
2024-03-08 00:45:33 -08:00
Guillaume Chatelet
6a8e6c9a31
[libc][NFC] Move BigInt out of the cpp namespace (#84445)
As noted in
https://github.com/llvm/llvm-project/pull/84035#discussion_r1516817755
only files under the CPP folder should be in the `cpp` namespace.
2024-03-08 09:41:23 +01:00
Pierre van Houtryve
4b1910b11d
[GlobalISel][AMDGPU] Import patterns with multiple defs (#84171)
Fixes #63216
2024-03-08 09:39:10 +01:00
Tina Jung
0ddb122147
[mlir][emitc] Arith to EmitC conversion: constants (#83798)
* Add a conversion from `arith.constant` to `emitc.constant`.
* Drop the translation for `arith.constant`s.
2024-03-08 09:16:10 +01:00
Aiden Grossman
9f5be5f009
[Github] Add repository checks to release-binaries workflow (#84437)
This patch adds repository checks to the release-binaries workflow jobs.
People were observing that the job was running on a schedule in their
forks. This only happens on old forks, but those probably exist in great
number given how prolific LLVM is. This is also good practice anyways,
on top of solving the direct problem of these jobs running with the cron
schedule on people's forks.
2024-03-08 00:13:11 -08:00
Balázs Kéri
d72b7f9133
[clang][analyzer] Fix StreamChecker ftell and fgetpos at indeterminate file position. (#84191)
These functions should not be allowed if the file position is
indeterminate (they return the file position).
This condition is now checked, and tests are improved to check it.
2024-03-08 08:56:10 +01:00