Commit Graph

480807 Commits

Author SHA1 Message Date
Benjamin Maxwell
783ac3b6fb [mlir][ArmSME] Make use of backend function attributes for enabling ZA storage (#71044)
Previously, we were inserting za.enable/disable intrinsics for functions
with the "arm_za" attribute (at the MLIR level), rather than using the
backend attributes. This was done to avoid a dependency on the SME ABI
functions from compiler-rt (which have only recently been implemented).

Doing things this way did have correctness issues, for example, calling
a streaming-mode function from another streaming-mode function (both
with ZA enabled) would lead to ZA being disabled after returning to the
caller (where it should still be enabled). Fixing issues like this would
require re-doing the ABI work already done in the backend within MLIR.

Instead, this patch switches to use the "arm_new_za" (backend) attribute
for enabling ZA for an MLIR function. For the integration tests, this
requires some way of linking the SME ABI functions. This is done via the
`%arm_sme_abi_shlib` lit substitution. By default, this expands to a
stub implementation of the SME ABI functions, but this can be overridden
by providing the `ARM_SME_ABI_ROUTINES_SHLIB` CMake cache variable
(pointing it at an alternative implementation). For now, the ArmSME
integration tests pass with just stubs, as we don't make use of nested
ZA-enabled calls.

A future patch may add an option to compiler-rt to build the SME
builtins into a standalone shared library to allow easily
building/testing with the actual implementation.
2023-11-14 12:50:38 +00:00
Simon Pilgrim
668454183a [X86] Regenerate expand-vp-int-intrinsics.ll
Add missing X86 checks
2023-11-14 12:48:52 +00:00
Ivan Kosarev
9ee68f8f7b [AMDGPU] Fix subtarget predicates for MUBUF instructions. (#72110)
Resolves AsmParser ambiguities, e.g., between BUFFER_WBINVL1_vi and
BUFFER_WBINVL1_gfx6_gfx7.

Part of <https://github.com/llvm/llvm-project/issues/69256>.
2023-11-14 12:45:24 +00:00
Akash Banerjee
8701b178e0 [MLIR][OpenMP] Changes to function-filtering pass (#71850)
Currently, when deleting the device functions in the second stage of filtering during MLIR to LLVM translation we can end up with invalid calls to these functions. This is because of the removal of the EarlyOutliningPass which would have otherwise gotten rid of any such calls.

This patch aims to alter the function filtering pass in the following way:
	- Any host function is completely removed.
	- Call to the host function are also removed and their uses replaced with Undef values.
	- Any host function with target region code is marked to be removed during the the second stage.
	- Calls to such functions are still removed and their uses replaced with Undef values.

Co-authored-by: Sergio Afonso <sergio.afonsofumero@amd.com>
2023-11-14 12:43:31 +00:00
Diana
eb3c02fdc2 [AMDGPU] Use immediates for stack accesses in chain funcs (#71913)
Switch to using immediate offsets instead of the SP register to access
objects on the current stack frame in chain functions. This means we no
longer need to reserve a SP register just for accesing stack objects and
it also allows us to set the SP (when one is actually needed) to the
stack size from the very beginning.

This only works if we use a FixedObject for the ScavengeFI, which is
what we do for entry functions anyway (and we generally want to keep
chain functions close to amdgpu_cs behaviour where we don't have a good
reason to diverge).
2023-11-14 13:17:46 +01:00
Anatoly Trosinenko
9bc142a023 [AArch64][PAC] Refactor aarch64-ptrauth pass (#70446)
Refactor Pointer Authentication pass in preparation for adding more
PAUTH_* pseudo instructions:
* dropped early return from runOnMachineFunction() as other PAUTH_*
  instructions need expansion even when pac-ret is disabled
* refactored runOnMachineFunction() to first collect all the
  instructions of interest without modifying anything and then performing
  changes in the later loops. There are two types of relevant
  instructions: PAUTH_* pseudos that should definitely be replaced by this
  pass and tail call instructions that may require attention if pac-ret is
  enabled
* made the loop iterating over all of the instructions handle
  instruction bundles by itself: even though this pass still does not
  support bundled TCRETURN* instructions (such as produced by KCFI) it
  does not crash anymore when no support is actually required
2023-11-14 15:14:57 +03:00
QuietMisdreavus
63537872ae ExtractAPI: use zero-based indices for line/column in symbol graph (#71753)
Other implementations of the symbol graph format use zero-based indices
for source locations, which causes problems when combined with clang's
current one-based indices. This commit sets ExtractAPI's symbol graph
output to use zero-based indices to align with other implementations.

rdar://107639783
2023-11-14 11:46:12 +00:00
Matthew Devereau
cc1244980b [AArch64][SME2] Add ldr_zt, str_zt builtins and intrinsics (#71795)
Adds the builtins:
void svldr_zt(uint64_t zt, const void *rn)
void svstr_zt(uint64_t zt, void *rn)

And the intrinsics:
call void @llvm.aarch64.sme.ldr.zt(i32, ptr)
tail call void @llvm.aarch64.sme.str.zt(i32, ptr)

Patch by: Kerry McLaughlin <kerry.mclaughlin@arm.com>
2023-11-14 11:27:41 +00:00
S. B. Tam
4ee747f8d3 [libc++][test] Don't use __libcpp_is_constant_evaluated in tests (#72226) 2023-11-14 19:04:57 +08:00
Momchil Velikov
65eaec82c0 [CFIFixup] Precommit test ahead of multi-block prologues support (#72033)
Precommit test for https://github.com/llvm/llvm-project/pull/68984
2023-11-14 10:45:28 +00:00
Michael Buch
27c5a9bbb0 [lldb][test] TestConstStaticIntegralMember.py: fix on older clang versions
`638a8393615e911b729d5662096f60ef49f1c65e` removed the `dsym`
condition for older compiler versions which caused the `dwarf`
variants tests to XPASS. This patch reverts to only XFAIL-ing
the `dsym` variant.

`15c80852028ff4020b3f85ee13ad3a2ed4bce3be` added
`test_shadowed_static_inline_members` which isn't supported
on older compiler versions.
2023-11-14 10:31:07 +00:00
Endre Fülöp
d9be232191 new-prs-labeler: update clang:dataflow paths (#72153)
The given glob needed to be fixed; static analyzer-related PRs were also
assigned this label erroneously.
2023-11-14 11:07:37 +01:00
Balázs Kéri
41fe5c9a08 [clang][analyzer] Improve StdLibraryFunctionsChecker 'readlink' modeling. (#71373)
The functions 'readlink' and 'readlinkat' do return 0 only if the
'bufsize' argument is 0.
2023-11-14 10:58:05 +01:00
Jie Fu
e582fe6444 [llvm] Fix -Wunused-variable in ConstantFold.cpp (NFC)
/llvm-project/llvm/lib/IR/ConstantFold.cpp:137:12: error: unused variable 'CSize' [-Werror,-Wunused-variable]
  unsigned CSize = cast<IntegerType>(C->getType())->getBitWidth()/8;
           ^
1 error generated.
2023-11-14 16:57:24 +08:00
Fangrui Song
47eeee2977 [Driver] Default LoongArch to -fno-direct-access-external-data for non-PIC (#72221)
For -fno-pic, if an extern variable is defined in a DSO, a copy
relocation will be needed. However, loongarch*-linux does not and will
not support copy relocations.

Change Driver to default to -fno-direct-access-external-data for
LoongArch && non-PIC.
Keep Frontend conditions unchanged (-fdirect-access-external-data ||
-fno-direct-access-external-data && PIC>0 => direct access).

Fix #71645
2023-11-14 00:43:40 -08:00
Fangrui Song
6229cd0272 [CodeGen] Drop some references to getInt8PtrTy. NFC
Similar to https://reviews.llvm.org/D157550
2023-11-14 00:28:58 -08:00
Nikita Popov
56c1d30183 [IR] Remove support for lshr/ashr constant expressions (#71955)
Remove support for the lshr and ashr constant expressions. All places
creating them have been removed beforehand, so this just removes the
APIs and uses of these constant expressions in tests.

This is part of
https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179.
2023-11-14 09:25:14 +01:00
David Spickett
9cb1673fa5 [GitHub] Remove pr-subscriber-wait.py download (#72120)
This file and uses of it were removed in
64d5da60d4.
2023-11-14 08:21:33 +00:00
Mike Hommey
87f5dc03e1 [llvm] Add missing include for std::set after 01702c3f7f (#72161)
Cc: @kazutakahirata
2023-11-14 09:10:01 +01:00
Haojian Wu
b837361b80 [LLDB] Display artificial __promise and __coro_frame variables. (#71928)
See the discussion in #69309.
2023-11-14 09:06:40 +01:00
Nikita Popov
a3eeef82da [FileCheck] Avoid capturing group for {{regex}} (#72136)
For `{{regex}}` we don't really need a capturing group, and only add it
to properly handle cases like `{{foo|bar}}`. This is problematic,
because the use of capturing groups makes our regex implementation
slower (we have to go through the "dissect" stage, which can have
quadratic complexity).

Unfortunately, our regex implementation does not support non-capturing
groups like `(?:regex)`. So instead, avoid adding the group entirely if
the regex doesn't contain any alternations.

This causes a slight difference in escaping behavior, where previously
it was possible to write `{{{{}}` and get the same behavior as
`{{\{\{}}`. This will no longer work. I don't think this is a problem,
especially as we recently taught update_analyze_test_checks.py to emit
`{{\{\{}}`, so this shouldn't get introduced in any new tests.

For CodeGen/X86/vector-interleaved-store-i16-stride-7.ll (our slowest
X86 test) this drops FileCheck time from 6s to 5s (the remainder is
spent in a different regex issue). I expect similar speedups in other
tests using a lot of `{{}}`.
2023-11-14 09:03:54 +01:00
Nikita Popov
c9832da350 [CGP] Drop nneg flag when moving zext past instruction (#72103)
Fix the issue by not reusing the zext at all. The code already handles
creation of new zexts if more than one is needed. Always use that
code-path instead of trying to reuse the old zext in some case.
(Alternatively we could also drop poison-generating flags on the old
zext, but it seems cleaner to not reuse it at all, especially if it's
not always possible anyway.)

Fixes https://github.com/llvm/llvm-project/issues/72046.
2023-11-14 09:03:06 +01:00
Phoebe Wang
e96eddec5e Reland "[X86][AVX10] Fix a bug when using -march with no-evex512 attribute (#72126)"
Fixes #72106
2023-11-14 15:39:30 +08:00
Phoebe Wang
17dd0c70c8 Revert "[X86][AVX10] Fix a bug when using -march with no-evex512 attribute (#72126)"
This reverts commit 451c594bcb.

Revert due to buildbot fails.
2023-11-14 15:34:38 +08:00
Phoebe Wang
451c594bcb [X86][AVX10] Fix a bug when using -march with no-evex512 attribute (#72126)
#71318 failed to clear EVEX512 feature for intended intrinsics.

Fixes #72106
2023-11-14 15:15:34 +08:00
pvanhout
4574fe977c Reenable note-amd-valid-v2.test on big endian 2023-11-14 07:59:10 +01:00
Paulo Matos
5ef9ba7412 [compiler-rt] Remove reference to Type::getInt8PtrTy; NFC (#71570)
Removed as part of 7b9d73c2f9 .
2023-11-14 07:57:27 +01:00
Craig Topper
c14602b318 [RISCV] Add PseudoCCADDIW/SLLW/SRLW/SRAW/SLLIW/SRLIW/SRAIW to RISCVOptWInstrs.
These can be treated simlarly to PseudoCCADDW/SUBW.
2023-11-13 22:41:52 -08:00
Pierre van Houtryve
d3876c58a8 [ELFDumper] Always read AMD Code Object notes as little-endian (#70775)
Should avoid issues on big-endian hosts.

Note that we use aligned types because primitive integers are also
aligned. If we don't use aligned types, `HSAILProperties` ends up being
11 bytes instead of 12 (1 byte padding at the end of the struct added by
the compiler).
Technically only the first type needs to be aligned, but I just used
aligned types everywhere to be consistent.

Fixes #65280
2023-11-14 07:26:09 +01:00
Kai Luo
acdf7c8f27 [PowerPC] Precommit test to show impact of early-ifcvt on target without isel. NFC. 2023-11-14 06:10:05 +00:00
Z572
3c037b7306 [InstCombine] When -A + B both have nsw flag, set nsw flag. (#72127)
Fixes #72119

https://alive2.llvm.org/ce/z/5f_QuC
2023-11-14 13:48:51 +08:00
long.chen
1609f1c2a5 [mlir][affine][nfc] cleanup deprecated T.cast style functions (#71269)
detail see the docment: https://mlir.llvm.org/deprecation/

Not all changes are made manually, most of them are made through a clang
tool I wrote https://github.com/lipracer/cpp-refactor.
2023-11-14 13:01:19 +08:00
Craig Topper
028ed6125f [RISCV][GISel] Support G_UMIN/UMAX/SMIN/SMAX legal with Zbb. (#72182) 2023-11-13 20:57:38 -08:00
HaohaiWen
a908920201 [NFC][CodeGen] clang-format RegAllocFast.cpp (#72199) 2023-11-14 12:57:02 +08:00
Jeremy Kun
f778eafdd8 [IntegerRangeAnalysis] remove constraint on integer-typed results (#72007) 2023-11-13 22:10:47 -06:00
Gedare Bloom
a852869398 [clang-format] Fix a bug in parsing function/variable names
Function and variable names are not detected when there is a
__attribute__((x)) preceding the name.

Fixes #64137.

Differential Revision: https://reviews.llvm.org/D156370
2023-11-13 19:35:28 -08:00
Craig Topper
3161102f10 [RISCV][GISel] Attempt to simplify how we handle type legality for F and D extensions. (#72174)
Add helper that creates a lambda similar to typeIs, but containing the
predicate check for hasStdExtF and hasStdD. We can use this with legalIf
and all to reduce the number of manual lambdas we need to write.
2023-11-13 19:19:56 -08:00
Renaud Kauffmann
725115d7bb Fix fir::unwrapSeqOrBoxedSeqType (#72171)
Fixing fir::unwrapSeqOrBoxedSeqType check for fir::BaseBoxType to add
support for fir::BoxType and fir::ClassType
2023-11-13 18:55:07 -08:00
Akira Hatanaka
5079b27c55 [ARC][Documentation] Explicitly state that messaging weak objects keeps a strong reference during call lifetime (#72169)
rdar://113636046
2023-11-13 18:53:15 -08:00
Maksim Levental
e9453f3c3c [mlir][python] fix scf.for_ convenience builder (#72170) 2023-11-13 20:25:41 -06:00
Yingwei Zheng
ed96430402 [SCCP] Infer nneg on existing zext (#72143)
This patch infers `nneg` flags for existing zext instructions in SCCP.

Similar patch: https://github.com/llvm/llvm-project/pull/72052
2023-11-14 10:18:23 +08:00
Maksim Panchenko
f633f325a1 [BOLT] Fix NOP instruction emission on x86 (#72186)
Use MCAsmBackend::writeNopData() interface to emit NOP instructions on
x86. There are multiple forms of NOP instruction on x86 with different
sizes. Currently, LLVM's assembly/disassembly does not support all forms
correctly which can lead to a breakage of input code semantics, e.g. if
the program relies on NOP instructions for reserving a patch space.

Add "--keep-nops" option to preserve NOP instructions.
2023-11-13 18:12:39 -08:00
LLVM GN Syncbot
d29d4cb4ab [gn build] Port d9ec4b24a8 2023-11-14 02:10:41 +00:00
Walter Erquinigo
d9ec4b24a8 [lldb-dap] Add an option to provide a format for stack frames (#71843)
When this option gets enabled, descriptions of stack frames will be
generated using the format provided in the launch configuration instead
of simply calling `SBFrame::GetDisplayFunctionName`. This allows
lldb-dap to show an output similar to the one in the CLI.
2023-11-13 21:10:16 -05:00
Matt Arsenault
0e1a52f556 ValueTracking: Handle compare gt to -inf in class identification (#72086)
This apparently shows up somewhere in chromium. We also are missing a
canonicalization to an equality compare with inf.
2023-11-14 10:05:38 +09:00
HaohaiWen
45a92acfd9 [DebugInfo] Move jump table test to X86 directory (#72118)
This test is currently only enabled for X86 target.
2023-11-14 08:48:47 +08:00
Michael Spencer
731152e18f [clang][DependencyScanner] Remove all warning flags when suppressing warnings (#71612)
Since system modules don't emit most warnings, remove the warning flags
to increase module reuse.
2023-11-13 16:45:38 -08:00
Peter Klausler
c3148e9f69 [flang] Identify misparsed statement function in BLOCK in ASSOCIATE (#72148)
When a BLOCK construct is within an ASSOCIATE or related construct,
don't misinterpret an assignment to an array element of a construct
entity as being an impermissible definition of a local statement
function.
2023-11-13 16:37:18 -08:00
lntue
86c57b9795 [libc][arm] Use __ARM_FP to detect floating point support for FEnvImpl. (#72177)
https://github.com/llvm/llvm-project/issues/72157
2023-11-13 19:36:57 -05:00
Peter Klausler
94d47e6325 [flang] Catch nasty order-of-declarations case (#71881)
It is possible to declare the rank of an object after that object has
been used in the same specification part in a specification function
reference whose result or generic resolution may well have depended on
the object being apparently a scalar.

Catch this case, and emit a warning -- not an error, yet, due to fear of
false positives.

See the new test for examples.
2023-11-13 16:24:43 -08:00