Commit Graph

455417 Commits

Author SHA1 Message Date
Ilyas Mustafazade
38fc680c2d Replace strlen with StringRef::size
Replace multiple strlen calls with a StringRef constructor and a
StringRef::size call.

Differential Revision: https://reviews.llvm.org/D146394
2023-03-20 14:18:51 -07:00
Ilyas Mustafazade
d3d6a5ff18 [NFC] Rename ArgSize to SpellingSize, and add ArgStringSize.
Differential Revision: https://reviews.llvm.org/D146394
2023-03-20 14:18:51 -07:00
Anlun Xu
c71fe7c9e8 [mlir][openMP] Add bazel deps
Differential Revision: https://reviews.llvm.org/D146455
2023-03-20 14:05:58 -07:00
Mahesh Ravishankar
c21e88cc02 [mlir][Tensor] Avoid dropping attributes for tensor.pad operations during canonicalization.
Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D146440
2023-03-20 21:03:46 +00:00
Lang Hames
fb1b9945be [JITLink][ELF][AArch64] Add support for ELF R_AARCH64_ABS32 relocation.
This relocation is commonly used in debug sections. Failure to handle it caused
the test failure in https://lab.llvm.org/buildbot/#/builders/197/builds/4272,
which forced the reversion, in f721fcb6ed, of 57aeb30546 ("[JITLink][ELF]
Don't skip debug info sections by default"). This fix should allow us to
re-land 57aeb30546.
2023-03-20 21:00:20 +00:00
Mahesh Ravishankar
3af1c48c66 Changes to SCFFuseProducerOfSliceResult to also return the operations created during fusion.
This is follow up to https://reviews.llvm.org/D145133 that allows
propogating information about ops that are fused back to the caller.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D146254
2023-03-20 20:55:48 +00:00
Philip Reames
091422adc1 [LSR] Fix wrapping bug in lsr-term-fold logic
The existing logic was unsound, in two ways.

First, due to wrapping on the trip count computation, it could compute a value which convert a loop which exiting on iteration 256, to one which exited at 255. (With i8 trip counts.)

Second, it allowed rewriting when the trip count implies wrapping around the alternate IV. As a trivial example, it allowed rewriting an i128 exit test in terms of an i64 IV. This is obviously wrong.

Note that the test change is fairly minimal - i.e. only the targeted test - but that's only because I precommitted a change which switched the test from 32 to 64 bit pointers. For 32 bit point architectures with 32 bit primary inductions, this transform is almost always unsound to perform.

Differential Revision: https://reviews.llvm.org/D146429
2023-03-20 13:47:21 -07:00
Arthur Eubanks
eecb8c5f06 [SampleProfile] Use LazyCallGraph instead of CallGraph
The function order in some tests had to be changed because they relied on ordering of functions returned in an SCC which is consistent but unspecified.
2023-03-20 13:43:54 -07:00
Nemanja Ivanovic
da40f7e8b1 [PowerPC][NFC] Pre-commit a test case for upcoming patch 2023-03-20 15:42:07 -05:00
giuseros
82ac02e4a8 Add scalar support for amdgpu.raw_buffer_{load,store}
Introduce the possibility to load/store scalars via amdgpu.raw_buffer_{load,store}

Reviewed By: krzysz00

Differential Revision: https://reviews.llvm.org/D146413
2023-03-20 20:19:20 +00:00
Nadeem, Usman
f67b481098 [Flang] Exit gracefully with a useful message when we fail to lookup a target
Without this patch we were asserting with a generic message `Failed to
create Target`, but we already have a detailed error message stored in
the variable `error` after calling `lookupTarget()` but this error was not
getting used/printed.

With this patch we will emit a message with more details instead of a
stack dump with a generic message.

Differential Revision: https://reviews.llvm.org/D146333

Change-Id: I7ddee917cf921a2133ca3e6b35791b2142f770a2
2023-03-20 12:08:34 -07:00
Alexey Bataev
59ff9d3777 [SLP]Fix PR61554: use of missing vectorized value in buildvector nodes.
If the buildvector node matches the vector node, it reuse the vector
value from this vector node, but its VectorizedValue field is not
updated. Need to update this field to avoid misses during the analysis
of the reused gather/buildvector nodes.
2023-03-20 12:05:26 -07:00
Eli Friedman
5452d86071 [llvm-readobj] Pretty-print IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY. 2023-03-20 11:59:52 -07:00
Nathan Ridge
57bfe25574 [clangd] Remove reundant use of getSpellingLoc()
getFileLoc() is guaranteed to return a file loc, and getSpellingLoc()
on a file loc is a no-op.

Differential Revision: https://reviews.llvm.org/D146377
2023-03-20 14:52:10 -04:00
Akash Banerjee
2d373e4dc7 [MLIR][OpenMP] Added OMPIRBuilder support for Target Data directives
This patch adds OpenMP IRBuilder support for the Target Data directives to allow lowering to LLVM IR.

The mlir::Translation is responsible for generating supporting code for processing the map_operands through the processMapOperand function, and also generate code for the r>

The OMPIRBuilder is responsible for generating the begin and end mapper function calls.

Limitations:
        - use_device_ptr and use_device_addr clauses are NOT supported for Target Data operation.
        - nowait clauses are NOT supported for Target Enter and Exit Data operations.
        - Only LLVMPointerType is supported for map_operands.

Differential Revision: https://reviews.llvm.org/D142914
2023-03-20 18:48:21 +00:00
Jakub Kuderski
92416b63a5 [ADT] Work around enumerate compilation error with modules enabled
This manifests on Apple clang 14 with `-DLLVM_ENABLE_MODULES=1` and
`-DLLVM_ENABLE_ASSERTIONS=1` and seems like a host compiler bug.

Sample compilation failure:
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/52513/consoleFull#-458239162a1ca8a51-895e-46c6-af87-ce24fa4cd561.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D146340
2023-03-20 14:27:51 -04:00
Philip Reames
272ebd6957 [LSR] Inline getAlternateIVEnd and simplify [nfc]
Also, add a comment to highlight that the "good" result on this test is accidental, and not based on a principled decision.  I matched the original behavior to make this nfc, but selecting the last legal IV is not well motivated here.
2023-03-20 11:22:21 -07:00
Amara Emerson
41e9c4b88c [NFC][Outliner] Delete default ctors for Candidate & OutlinedFunction.
I think it's good practice to avoid having default ctors unless they're really
valid/useful. For OutlinedFunction the default ctor was used to represent a
bail-out value for getOutliningCandidateInfo(), so I changed the API to return
an optional<getOutliningCandidateInfo> instead which seems a tad cleaner.

Differential Revision: https://reviews.llvm.org/D146375
2023-03-20 11:17:10 -07:00
Joseph Huber
6bd4d717d5 [libc] Add environment variables to GPU libc test for AMDGPU
This patch performs the same operation to copy over the `argv` array to
the `envp` array. This allows the GPU tests to use environment
variables.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D146322
2023-03-20 13:16:58 -05:00
Jan Svoboda
d1e00b6f13 [clang][deps] Only cache files with specific extension
In the scanner's VFS, we cache all files by default and only avoid caching stat failures for certain files. This tanks the performance of scanning with pre-populated module cache. When there is a stale PCM file, it gets cached by the scanner at the start and the rebuilt version never makes it through the VFS again. The TU invocation that rebuilds the PCM only sees the copy in its InMemoryModuleCache, which is invisible to other invocations. This means the PCM gets rebuilt for every TU given to the scanner.

This patch fixes the situation by flipping the default, only caching files that are known to be important, and letting everything else fall through to the underlying VFS.

rdar://106376153

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D146328
2023-03-20 11:12:00 -07:00
Florian Hahn
0c0468e6df
[InstCombine] Add test for issue fixed by 50fe87a5c8.
Extra test that was fixed by 50fe87a5c8 to make sure it doesn't
regress again.
2023-03-20 17:59:36 +00:00
Alexey Bataev
427136dc35 [SLP][NFC]Add a test with missed buildvector node, matching the
vectorized node.
2023-03-20 10:58:52 -07:00
Kadir Cetinkaya
fb3f6a9539
Revert "[clangd] Fix AddUsing in the face of typo-correction"
This reverts commit 6f23fee4ef.
Breaks windows buildbots
2023-03-20 18:57:53 +01:00
Michael Francis
5259da75b9 [AIX][Clang] Respect -r when invoking the linker
On AIX, libraries are still being linked when `-r` is passed to the driver. This patch corrects this error.

Differential Revision: https://reviews.llvm.org/D145899
2023-03-20 17:56:39 +00:00
Amy Wang
6ac632ad83 [MLIR][Linalg] Generate unique LibraryCallName for LinalgOps.
When lowering LinalgToStandard for named UnaryFn/BinaryFn ops, ensure
the fun name appears in the generated library name. Further, for
linalg.copy to/from different address spaces, ensure the to/from
address spaces are appended onto the library name for uniqueness.
This fixes the lowering error with the linalg.copy testcase shown in
this patch.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D145467
2023-03-20 13:50:22 -04:00
Maryam Moghadas
60b117aa81 [PowerPC] Adding test coverage for vector compatibility warning
This is to test D143210 patch to have the same vector
compatibility logic for error and warning diagnostics.

Reviewed By: lei

Differential Revision: https://reviews.llvm.org/D144611
2023-03-20 12:48:45 -05:00
Alex Langford
c47da7f109 [lldb] Introduce CMake variable LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS
The goal of this patch is to add the ability for the CMake configure to
fail when some optional test dependencies are not met. LLDB tries to be
flexible when test dependencies are not present but there are cases
where it would be useful to know that these dependencies are missing
before we run the test suite.

The intent here is to apply this setting on CI machines and make sure
that they have useful optional dependencies installed. We recently hit a
case where some CI machines were timing out while running the test suite
because a few tests were hanging. With this option, we'll be able to
know if the machine does not have psutil installed so we can install it
and avoid the timeout scenario altogether.

rdar://103194447

Differential Revision: https://reviews.llvm.org/D146335
2023-03-20 10:41:22 -07:00
Philip Reames
b9521484ec [LSR] Rewrite IV match for term-fold using existing utilities
Main benefit here is making the logic easier to follow, slightly more efficient, and more in line with LFTR.  This is not NFC.  There are three semantic changes here.

First, we drop handling for constants on the LHS of the comparison.  These are non-canonical, and we're very late in the optimization pipeline here, so there's no point in supporting this.  I removed a test which covered this case.

Second, we don't need the almost dead IV to be an addrec.  We just need SCEV to be able to compute a trip count for it.

Third, we require a simple IV for the almost dead IV.  In theory, this removes cases we could have previously handled, but given a) zero testing and b) multiple known correctness issues, I'm adopting an attidute of narrowing this down to something which works correctly, and *then* expanding.
2023-03-20 10:41:01 -07:00
John Brawn
72073fc95c [Serialization] Place command line defines in the correct file
Fix several problems related to serialization causing command line
defines to be reported as being built-in defines:
 * When serializing the <built-in> and <command line> files don't
   convert them into absolute paths.
 * When deserializing SM_SLOC_BUFFER_ENTRY we need to call
   setHasLineDirectives in the same way as we do for
   SM_SLOC_FILE_ENTRY.
 * When created suggested predefines based on the current command line
   options we need to add line markers in the same way that
   InitializePreprocessor does.
 * Adjust a place in clangd where it was implicitly relying on command
   line defines being treated as builtin.

Differential Revision: https://reviews.llvm.org/D144651
2023-03-20 17:36:01 +00:00
Dmitri Gribenko
cd11f55a0c [clang][dataflow] Fix indentation in a test 2023-03-20 18:34:16 +01:00
Jonas Devlieghere
e4f62da812
[lldb] Sidestep -Wformat warning by using LLDB_LOG instead of LLDB_LOGF
Fixes warning: format specifies type 'unsigned long' but the argument
has type 'DataType' (aka 'unsigned long long') [-Wformat]
2023-03-20 10:32:02 -07:00
Roland McGrath
4e298c32d5 [libc] Make string tests compatible with the Fuchsia build
Some test code was doing loose conversions caught by compiler
warnings in  the Fuchsia build.  This included duplicated code
in a few tests that was reconsolidated with the existing header
file copy of the same functions.

The MemoryMatcher abstraction presumes gtest-style matcher support,
which is not available in Fuchsia's zxtest library.  It's avoided
in favor of simpler memory-comparing assertions.

Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D146343
2023-03-20 10:22:52 -07:00
Teresa Johnson
dfb40d3fd7 [SimpleLoopUnswitch] Skip non-trivial unswitching of cold loop nests
This fixes a compile time issue due to guarding loop unswitching based
on whether the enclosing function is cold. That approach is very
inefficient in the case of large cold functions that contain numerous
loops, since the loop pass calls isFunctionColdInCallGraph once per
loop, and that function walks all BBs in the function (twice for Sample
PGO) looking for any non-cold blocks.

Originally, this code only checked if the current Loop's header was cold
(D129599). However, that apparently caused a slowdown on a SPEC
benchmark, and the example given was that of a cold inner loop nested in
a non-cold outer loop (see comments in D129599). The fix was to check if
the whole function is cold, done in D133275.

This is overkill, and we can simply check if the header of any loop in
the current loop's loop nest is non-cold (looking at both outer and
inner loops). This patch drops the compile time for a large module by
40% with this approach.

I also updated PGO-nontrivial-unswitch2.ll since it only had one cold
loop in a non-cold function, so that it instead had IR based off the
example given in the comments relating to the SPEC degradation in
D129599. I confirmed that the new version of the test fails with the
original check done in D129599 of only the current loop's header
coldness.

Similarly updated test PGO-nontrivial-unswitch.ll to contain a cold loop
in a cold loop nest, and created PGO-nontrivial-unswitch3.ll to contain
a non-cold loop in a non-cold loop nest.

Differential Revision: https://reviews.llvm.org/D146383
2023-03-20 10:14:50 -07:00
Alex Bradbury
34f1da3468 [RISCV] Make Zfh PseudoQuietFCMP definitions predicated on HasStdExtZfh
These are currently in a `Predicates = [HasStdExtZfhOrZfhmin]` block,
but Zfhmin has no fcmp instructions so the definition makes no sense for
Zfhmin.

Differential Revision: https://reviews.llvm.org/D146435
2023-03-20 17:05:48 +00:00
Joseph Huber
ad9f751a6e [Libomptarget] Add missing explicit moves on llvm::Error
Summary:
Some older compilers, which we still support, have problems handling the
copy elision that allows us to directly move an `Error` to an
`Expected`. This patch adds explicit moves to remove the error. Same as
last patch but I forgot this one.
2023-03-20 12:00:01 -05:00
Joseph Huber
edc0355006 [Libomptarget] Add missing explicit moves on llvm::Error
Summary:
Some older compilers, which we still support, have problems handling the
copy elision that allows us to directly move an `Error` to an
`Expected`. This patch adds explicit moves to remove the error.
2023-03-20 11:49:59 -05:00
Philip Reames
67089a39a2 [LSR] Regen tests to adjust for naming in SCEVExpander [nfc] 2023-03-20 09:39:29 -07:00
David Green
cd22e7c3ad [AArch64] Regenerate neon-vcmla.ll tests and add tests for combining fadd with vcmla. NFC
See D146407.
2023-03-20 16:29:28 +00:00
Arthur Eubanks
313365add2 [Internalize] Don't claim to preserve CallGraph
Follow up to c41c336ee0
2023-03-20 09:25:47 -07:00
Arthur Eubanks
c41c336ee0 [Internalize] Remove interaction with CallGraph
Internalize was trying to update CallGraph if the analysis was available, but the new PM doesn't really use it so there's little reason to update it.
2023-03-20 09:24:11 -07:00
Eric Schweitz
fc7b860e5e [mlir][nfc] Fix syntax to conform with the C++20 restrictions on error-prone redundancy
See: http://eel.is/c++draft/diff.cpp17.class#2

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D146308
2023-03-20 09:11:06 -07:00
Philip Reames
54539fa8b3 [LSR/LFTR] Move two utilities to common code for reuse [nfc]
We're working on a transform in LSR which is essentiall an inverse of LFTR (in certain sub-cases).  Move utilties so that they can be reused.
2023-03-20 09:05:38 -07:00
NagaChaitanya Vellanki
afce10c5b6 [clang][ExtractAPI] Add semicolons for enum, typedef, struct declaration fragments
Fixes https://github.com/llvm/llvm-project/issues/61480

Reviewed By: dang

Differential Revision: https://reviews.llvm.org/D146354
2023-03-20 15:43:00 +00:00
Kirill Stoimenov
b33437c969 Reland "[LSAN][HWASAN] Turn on leak sanitizer in HWASAN for Linux"
This reverts commit 35c05f04e5.
2023-03-20 15:41:05 +00:00
Pavel Kosov
fa326c2191 Revert "[clang][ASTImport] Add support for import of empty records"
This reverts commit 21cd04c46f.
2023-03-20 18:20:41 +03:00
Felipe de Azevedo Piovezan
dc521b9a10 [x86][MemFold] Fix anon namespace in header
D142084 moved an enumeration inside a header from the llvm namespace
into an anon namespace. Some of the bots started failing as a result.

Differential Revision: https://reviews.llvm.org/D146419
2023-03-20 11:16:44 -04:00
Maya Amrami
8bb5ca5832 [mlir] Support bufferization of arith.constant to memref.global with memory space
Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D146381
2023-03-20 17:09:51 +02:00
Paul Scoropan
5a222c0b82 [Flang] [PowerPC] Implement remaining PPC math operation intrinsics that do not require semantic error checks
This review implements the following PowerPC math operations that we care about:
- fnabs
- fre
- fres
- frsqrte
- frsqrtes

None of these intrinsics require additional error checks in semantics. The interfaces handle checking types and kinds

Reviewed By: kkwli0

Differential Revision: https://reviews.llvm.org/D146139
2023-03-20 15:04:16 +00:00
Andrew Litteken
47f528217e [IRSim] Ensure that assignment accurately reduces potential mapping between different candidates
Previous:
When we do not make decisions about commutative operands, we can end up in a situation where two values have two potential canonical numbers between two regions. This ensures that an ordering is decided after the initial structure between two regions is determined.

Current:
Previously the outliner only checked that assignment to a value matched what was already known, this patch makes sure that it matches what has already been found, and creates a mapping between the two values where it is a one-to-one mapping.

Reviewer: paquette
Differential Revision: https://reviews.llvm.org/D139336
2023-03-20 09:40:16 -05:00
Pavel Kosov
21cd04c46f [clang][ASTImport] Add support for import of empty records
Patch represents the clang part of changes in D143347

Reviewed By: balazske

Differential Revision: https://reviews.llvm.org/D145057
2023-03-20 17:33:04 +03:00