Commit Graph

480210 Commits

Author SHA1 Message Date
Konstantin Varlamov
4a9c71b8c2
[libc++][hardening] Fix references to old names for hardening modes (#71743)
This should fix some builds broken by
https://github.com/llvm/llvm-project/pull/70575
2023-11-08 13:16:01 -10:00
Maksim Levental
950f68991f
[mlir][cmake] export list of CAPI libs (#71722) 2023-11-08 16:59:17 -06:00
Anthony Cabrera
8803211a32
[flang][hlfir] patch for assumed shape dummy with VALUE keyword when lowering to HLFIR (#70391)
Adds functionality for assumed shape dummy with value keyword when
lowering to HLFIR
2023-11-08 16:21:51 -06:00
Quinn Dawkins
f6d487207d
[mlir][vector] Add folders for full constant transfer masks (#71676)
When the mask bounds of a `vector.constant_mask` exactly equal the shape
of the vector, any transfer op consuming that mask will be unaffected by
it. Drop the mask in such cases.
2023-11-08 16:35:28 -05:00
spupyrev
ef6d187115
[ELF] Fix assertion in cdsort (#71708)
It seems that some functions (.text.unlikely.xxx) may have zero size,
which
makes some builds with enabled assertions fail. Removing the assertion
and
extending one test to fix the build.
The sorting can process such zero-sized functions so no changes there
are needed
2023-11-08 12:34:36 -08:00
Aleksei Nurmukhametov
76947e0405
[LLD][COFF] Support /DEPENDENTLOADFLAG[:flags] (#71537)
This should fix https://github.com/llvm/llvm-project/issues/43935
2023-11-08 15:21:05 -05:00
Fabian Mora
fd389f46de
[flang] Change uniqueCGIdent separator from . to X (#71338)
Change the separator in the `uniqueCGIdent` method to `X`. This change
is required to enable OpenMP offloading for the NVPTX target, as dots
are not valid identifiers in PTX and `uniqueCGIdent` is used to mangle
some literals. Follow up patches will change the remainder of `.`
appearances in names to `X` and add support for the NVPTX target.
2023-11-08 15:04:00 -05:00
Krzysztof Drewniak
05fa923a9b
Fix SmallVector usage in SerailzeToHsaco (#71702)
Enable merging #71439 by removing a definitely-wrong usage of
std::unique_ptr<SmallVectorImpl<char>> as a return value with passing in
a SmallVectorImpl<char>&

Also change the following function to take ArrayRef<char> instead of
const SmalVectorImpl<char>& .
2023-11-08 13:57:41 -06:00
Arthur Eubanks
955dd8800b
Revert "Reland [clang] Canonicalize system headers in dependency file when -canonical-prefixes" (#71697)
This reverts commit 578a4716f5.

This causes multiple issues. Compile time slowdown due to more path
canonicalization, and weird behavior on Windows.

Will reland under a separate flag `-f[no-]canonical-system-headers` to
match gcc in the future and further limit when it's passed by default.

Fixes #70011.
2023-11-08 11:43:35 -08:00
Jun Wang
54470176af
[AMDGPU] Add inreg support for SGPR arguments (#67182)
Function parameters marked with inreg are supposed to be allocated to
SGPRs. However, for compute functions, this is ignored and function
parameters are allocated to VGPRs. This fix modifies CC_AMDGPU_Func in
AMDGPUCallingConv.td to use SGPRs if input arg is marked inreg.
---------

Co-authored-by: Jun Wang <jun.wang7@amd.com>
2023-11-08 11:35:52 -08:00
Peiming Liu
c99951d491
[mlir][sparse] end-to-end matmul between Dense and BSR tensors (#71448) 2023-11-08 11:28:00 -08:00
Konstantin Varlamov
64d413efdd
[libc++][hardening] Rework macros for enabling the hardening mode. (#70575)
1. Instead of using individual "boolean" macros, have an "enum" macro
`_LIBCPP_HARDENING_MODE`. This avoids issues with macros being
mutually exclusive and makes overriding the hardening mode within a TU
more straightforward.

2. Rename the safe mode to debug-lite.

This brings the code in line with the RFC:
https://discourse.llvm.org/t/rfc-hardening-in-libc/73925

Fixes #65101
2023-11-08 09:10:00 -10:00
LLVM GN Syncbot
b8a0620615 [gn build] Port c6cf329502 2023-11-08 18:54:05 +00:00
Jacob Lambert
c6cf329502
[CodeGen] Implement post-opt linking option for builtin bitocdes (#69371)
In this patch, we create a new ModulePass that mimics the LinkInModules
API from CodeGenAction.cpp, and a new command line option to enable the
pass. As part of the implementation, we needed to refactor the
BackendConsumer class definition into a new separate header (instead of
embedded in CodeGenAction.cpp). With this new pass, we can now re-link
bitcodes supplied via the -mlink-built-in bitcodes as part of the
RunOptimizationPipeline.

With the re-linking pass, we now handle cases where new device library
functions are introduced as part of the optimization pipeline.
Previously, these newly introduced functions (for example a fused sincos
call) would result in a linking error due to a missing function
definition. This new pass can be initiated via:

      -mllvm -relink-builtin-bitcode-postop

Also note we intentionally exclude bitcodes supplied via the
-mlink-bitcode-file option from the second linking step
2023-11-08 10:53:49 -08:00
Maksim Panchenko
254ccb95e8
[BOLT] Follow-up to "Fix incorrect basic block output addresses" (#71630)
In 8244ff6739, I've introduced an
assertion that incorrectly used BasicBlock::empty(). Some basic blocks
may contain only pseudo instructions and thus BB->empty() will evaluate
to false, while the actual code size will be zero.
2023-11-08 10:53:36 -08:00
Greg Clayton
5aa934e2af
Make DWARFUnitVector threadsafe. (#71487)
The DWARFUnitVector class lives inside of the DWARFContextState. Prior
to this fix a non const reference was being handed out to clients. When
fetching the DWO units, there used to be a "bool Lazy" parameter that
could be passed that would allow the DWARFUnitVector to parse individual
units on the fly. There were two major issues with this approach:
- not thread safe and causes crashes
- the accessor would check if DWARFUnitVector was empty and if not empty
it would return a partially filled in DWARFUnitVector if it was
constructed with "Lazy = true"

This patch fixes the issues by always fully parsing the DWARFUnitVector
when it is requested and only hands out a "const DWARFUnitVector &".
This allows the thread safety mechanism built into the DWARFContext
class to work corrrectly, and avoids the issue where if someone
construct DWARFUnitVector with "Lazy = true", and then calls an API that
partially fills in the DWARFUnitVector with individual entries, and then
someone accesses the DWARFUnitVector, they would get a partial and
incomplete listing of the DWARF units for the DWOs.
2023-11-08 10:20:02 -08:00
LLVM GN Syncbot
070fde30a7 [gn build] Port 7ef7a92ead 2023-11-08 18:12:25 +00:00
Jonas Devlieghere
7ef7a92ead
[lldb] Add Checksum class to lldbUtility (#71456)
This commit adds an MD5 checksum (`Checksum`) class to LLDB. Its purpose
is to store the MD5 hash added to the DWARF 5 line table.
2023-11-08 10:11:58 -08:00
Adrian Prantl
767ce07c2d
Simplify ValueObject::GetQualifiedRepresentationIfAvailable(). (#71559)
I received a couple of nullptr-deref crash reports with no line numbers
in this function. The way the function was written it was a bit
diffucult to keep track of when result_sp could be null, so this patch
simplifies the function to make it more obvious when a nullptr can be
contained in the variable.
2023-11-08 09:54:41 -08:00
Aart Bik
5ef446790f
[mlir][sparse][gpu] cleanup GPUDataTransferStrategy (#71615)
The flag seems to be doing practically the same thing for zero cost and
pinned dma. In addition, the register host is not truly the right zero
cost mechanism according to Thomas. So we are simplifying the setup for
now, until we have a better definition for what to implement and test.
    
https://github.com/llvm/llvm-project/issues/64316
2023-11-08 09:45:11 -08:00
ChiaHungDuan
048ece4413
[scudo] Calling initCache() in init() of SizeClassAllocatorLocalCache (#71427)
initCacheMaybe() will init all the size class arrays at once and it
doesn't have much work to do even if it supports partial initialization.
This avoids the call to initCacheMaybe in each allocate()/deallocate().
2023-11-09 01:31:58 +08:00
Graham Hunter
34f83e86b4 [InstSimplify] Precommit extra tests for PR71528 2023-11-08 17:02:10 +00:00
Anna Thomas
29f03bf48d [GuardWidening] Require analyses only if necessary
We need to request analyses needed for guard widening only if there are
guards/widenable conditions.
2023-11-08 11:54:10 -05:00
Mark de Wever
3d131f960e
[libc++][CI] Adds a new CMake version in Docker. (#71582)
This allows testing the upcoming CMake 3.28 release in the CI. CMake
3.28 will have non-experimental support for C++20 modules. So this would
be a better CMake version for the modular builds.

The goal is to remove CMake 3.27 from the CI when the builder work
properly with 3.28.
2023-11-08 17:51:27 +01:00
Mark de Wever
7cc72a0a2e Implement syncstream (p0053)
This patch implements `std::basic_syncbuf` and `std::basic_osyncstream` as specified in paper p0053r7. ~~For ease of reviewing I am submitting this patch before submitting a patch for `std::basic_osyncstream`. ~~

~~Please note, this patch is not 100% complete. I plan on adding more tests (see comments), specifically I plan on adding tests for multithreading and synchronization.~~

Edit: I decided that it would be far easier for me to keep track of this and make changes that affect both `std::basic_syncbuf` and `std::basic_osyncstream` if both were in one patch.

The patch was originally written by @zoecarver

Implements
- P0053R7 - C++ Synchronized Buffered Ostream
- LWG-3127 basic_osyncstream::rdbuf needs a const_cast
- LWG-3334 basic_osyncstream move assignment and destruction calls basic_syncbuf::emit() twice
- LWG-3570 basic_osyncstream::emit should be an unformatted output function
- LWG-3867 Should std::basic_osyncstream's move assignment operator be noexcept?

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D67086
2023-11-08 17:45:06 +01:00
Jeremy Morse
f1b0a54451 Reapply 7d77bbef4a, adding new debug-info classes
This reverts commit 957efa4ce4.

Original commit message below -- in this follow up, I've shifted
un-necessary inclusions of DebugProgramInstruction.h into being forward
declarations (fixes clang-compile time I hope), and a memory leak in the
DebugInfoTest.cpp IR unittests.

I also tracked a compile-time regression in D154080, more explanation
there, but the result of which is hiding some of the changes behind the
EXPERIMENTAL_DEBUGINFO_ITERATORS compile-time flag. This is tested by the
"new-debug-iterators" buildbot.

[DebugInfo][RemoveDIs] Add prototype storage classes for "new" debug-info

This patch adds a variety of classes needed to record variable location
debug-info without using the existing intrinsic approach, see the rationale
at [0].

The two added files and corresponding unit tests are the majority of the
plumbing required for this, but at this point isn't accessible from the
rest of LLVM as we need to stage it into the repo gently. An overview is
that classes are added for recording variable information attached to Real
(TM) instructions, in the form of DPValues and DPMarker objects. The
metadata-uses of DPValues is plumbed into the metadata hierachy, and a
field added to class Instruction, which are all stimulated in the unit
tests. The next few patches in this series add utilities to convert to/from
this new debug-info format and add instruction/block utilities to have
debug-info automatically updated in the background when various operations
occur.

This patch was reviewed in Phab in D153990 and D154080, I've squashed them
together into this commit as there are dependencies between the two
patches, and there's little profit in landing them separately.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
2023-11-08 16:42:35 +00:00
Simon Pilgrim
671d10ad39 [X86] Add fabs test coverage for Issue #70947 2023-11-08 16:20:34 +00:00
Simon Pilgrim
45f1db4855 [X86] vec_fabs.ll - add AVX2 test coverage 2023-11-08 16:20:34 +00:00
Jonathan Peyton
5cc603cb22
[OpenMP] Add skewed iteration distribution on hybrid systems (#69946)
This commit adds skewed distribution of iterations in
nonmonotonic:dynamic schedule (static steal) for hybrid systems when
thread affinity is assigned. Currently, it distributes the iterations at
60:40 ratio. Consider this loop with dynamic schedule type,
for (int i = 0; i < 100; ++i). In a hybrid system with 20 hardware
threads (16 CORE and 4 ATOM core), 88 iterations will be assigned to
performance cores and 12 iterations will be assigned to efficient cores.
Each thread with CORE core will process 5 iterations + extras and with
ATOM core will process 3 iterations.

Differential Revision: https://reviews.llvm.org/D152955
2023-11-08 10:19:37 -06:00
Nikita Popov
3dff285679 [OCaml] Fix tests after const_uitofp removal (NFC) 2023-11-08 17:15:07 +01:00
Nikita Popov
2c61f9cab5 [CVP] Fix use after scope
Store the result of ConstantRange::sdiv() in a variable, as
getSingleElement() will return a pointer to the APInt it contains.
2023-11-08 16:53:47 +01:00
David Green
3ccbd68480
[InstCombine] Handle scalable geps in EmitGEPOffset (#71565)
This adds scalable handling for scalable vectors in emitGEPOffset. This
was noticed in some tests that Biplob was creating, so might be unlikely
to come up much in practice. I've attempted to add test coverage for
various places EmitGEPOffset is called. The vscale intrinsics will
currently emit multiple copies, relying on later CSE to combine them.
2023-11-08 15:50:32 +00:00
annamthomas
98d8b688bd
[InstSimplify] Check call for FMF instead of CtxI (#71585)
This code was incorrectly checking that the CtxI has required FMF, but
the context instruction need not always be the instrinsic call.

Check that the intrinsic call has the required FMF.

Fixes PR71548.
2023-11-08 10:25:11 -05:00
David Spickett
ea82853499 [lldb][test] Skip ScriptedProcess missing methods test on Windows
No dylib on Windows, so the test fails to build.
2023-11-08 15:23:03 +00:00
David Spickett
b663d6a310 [llvm][AArch64][NFC] Correct 70ea64de8b
Accidentally dropped a * around the language name.
2023-11-08 15:01:16 +00:00
David Spickett
70ea64de8b [llvm][AArch64][NFC] Correct AArch64Combine.td filename in license comment 2023-11-08 14:59:50 +00:00
Ilya Leoshkevich
a933e1417b
[SystemZ] Do not run mbackchain-4.c test without SystemZ target (#71678)
mbackchain-4.c requires running the backend and causes CI failures when
this target is not configured.
2023-11-08 15:53:10 +01:00
Jie Fu
5259fae710 [AArch64] Remove unused variable 'MaskSize' in GenerateFixedLengthSVETBL (NFC)
/llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:26139:12: error: unused variable 'MaskSize' [-Werror,-Wunused-variable]
  unsigned MaskSize = ShuffleMask.size();
           ^
1 error generated.
2023-11-08 22:42:20 +08:00
Dinar Temirbulatov
3f9d385e58
[AArch64][SME] Shuffle lowering, assume that the minimal SVE register is 128-bit, when NOEN is not available. (#71647)
We can assume that the minimal SVE register is 128-bit, when NEON is not
available. And we can lower the shuffle shuffle operation with one
operand to TBL1 SVE instruction.
2023-11-08 14:37:49 +00:00
Krzysztof Parzyszek
9cdaeefc45 [flang] Fix typo in ExpressionAnalyzer::CheckIntrinsicKind, NFC 2023-11-08 08:31:58 -06:00
Florian Hahn
26ab444e88
[ConstraintElim] Make sure add-rec is for the current loop.
Update addInfoForInductions to also check if the add-rec is for the
current loop. Otherwise we might add incorrect facts or crash.

Fixes a miscompile & crash introduced by 00396e6a1a.
2023-11-08 14:07:28 +00:00
alexfh
067632e141
Revert "[DAGCombiner] Transform (icmp eq/ne (and X,C0),(shift X,C1)) to use rotate or to getter constants." due to a miscompile (#71598)
- Revert "[DAGCombiner] Transform `(icmp eq/ne (and X,C0),(shift X,C1))`
to use rotate or to getter constants." - causes a miscompile, see
112e49b381 (commitcomment-131943923)
- Revert "[X86] Fix gcc warning about mix of enumeral and non-enumeral
types. NFC", which fixes a compiler warning in the commit above
2023-11-08 15:07:12 +01:00
Ilya Leoshkevich
d79fff0abb
[SystemZ] Add backchain target-feature (#71668)
GCC supports building individual functions with backchain using the
__attribute__((target("backchain"))) syntax, and Clang should too.

Clang translates this into the "target-features"="+backchain" attribute,
and the -mbackchain command-line option into the "backchain" attribute.
The backend currently checks only the latter; furthermore, the backchain
target feature is not defined.

Handle backchain like soft-float. Define a target feature, convert
function attribute into it in getSubtargetImpl(), and check for target
feature instead of function attribute everywhere. Add an end-to-end test
to the Clang testsuite.
2023-11-08 15:05:47 +01:00
Florian Hahn
0d48a4645d
[ConstraintElim] Add test for mis-compile with adjacent loops.
In the added test case, the AddRec from the first loop is used
incorrectly in the second loop.
2023-11-08 14:01:25 +00:00
Nikita Popov
d687057de8 [CVP] Try to fold sdiv to constant
If we know that the sdiv result is a single constant, directly
use that instead of performing narrowing.

Fixes https://github.com/llvm/llvm-project/issues/71659.
2023-11-08 14:49:24 +01:00
Nikita Popov
dc2cfd0407 [CVP] Add additional sdiv tests (NFC) 2023-11-08 14:49:24 +01:00
Nicolas Vasilache
5967375fcf [mlir][python] Add support for arg_attrs and other attrs to NamedSequenceOp 2023-11-08 13:42:16 +00:00
Björn Pettersson
d5cfdcaacb [clangd] Allow hover over 128-bit variable without crashing (#71415)
When hovering over variables larger than 64 bits, with more than 64
active bits, there were assertion failures since Hover is trying to
print the value as a 64-bit hex value.

There is already protection avoiding to call printHex if there is more
than 64 significant bits. And we already truncate and print negative
values using only 32 bits, when possible. So we can simply truncate
values with more than 64 bits to avoid the assert when using
getZExtValue. The result will be that for example a negative 128 bit
variable is printed using 64 bits, when possible.

There is still no support for printing more than 64 bits. That would
involve more changes since for example llvm::FormatterNumber is limited
to 64 bits.

This is a second attempt at landing this patch. Now with protection
to ensure we use a triple that supports __int128_t.
2023-11-08 14:13:11 +01:00
Jie Fu
fdf99b21f3 [AMDGPU] Fix -Wunused-variable in SIFrameLowering.cpp (NFC)
/llvm-project/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:1829:8: error: unused variable 'IsChainFunction' [-Werror,-Wunused-variable]
  bool IsChainFunction = MF.getInfo<SIMachineFunctionInfo>()->isChainFunction();
       ^
1 error generated.
2023-11-08 20:48:44 +08:00
Vlad Serebrennikov
5e09c4e6a8 [clang][NFC] Partially annotate IdentifierInfo with preferred_type
This patch leaves `ObjCOrBuiltinID` alone, because of performance concerns with potential refactoring that would enable correct types in debug info.
2023-11-08 15:44:46 +03:00