Commit Graph

438073 Commits

Author SHA1 Message Date
Florian Hahn c9fa457933
[ConstraintElimination] Remove fixme addressed in 8e3e96298f. 2022-10-06 18:24:50 +01:00
Sanjay Patel 8da2fa856f [InstCombine] fold sdiv with hidden common factor
(X * Y) s/ (X << Z) --> Y s/ (1 << Z)

https://alive2.llvm.org/ce/z/yRSddG

issue #58137
2022-10-06 13:11:50 -04:00
Sanjay Patel 241893f99f [PhaseOrdering] add test for mul + sdiv; NFC
issue #58137
2022-10-06 13:11:50 -04:00
Ben Langmuir 8d9a3a6b9b [clang][test] Make headers unique to avoid linking issues
Make the empty headers used by cl-pch-showincludes.cpp unique so that
filesystems that link these files together by contents will not see
different behaviour in this test, which is not testing linked files
specifically.

This was uncovered by 5ea78c4113 which made us stop mutating the name
of the presumed loc for the file in ContentCache, but that just surfaced
an underlying issue that the filename of multiple includes of linked
files are not separately tracked.

Differential Revision: https://reviews.llvm.org/D135373
2022-10-06 10:09:22 -07:00
Florian Hahn c5e1ddb6fd
[ConstraintElimination] Update tests to use opaque pointers. 2022-10-06 18:07:25 +01:00
Gulfem Savrun Yeniceri da594649fe [InstrProf] Add version into llvm-profdata
This patch adds support of printing profile version
into llvm-profdata which was proposed in:
https://discourse.llvm.org/t/llvm-profdata-failure-guarantees-for-code-coverage/64924

Differential Revision: https://reviews.llvm.org/D135317
2022-10-06 17:02:16 +00:00
bixia1 9409bbb2e0 [mlir][sparse] Implement insertion sort for the stable sort operator.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135182
2022-10-06 09:48:39 -07:00
Erich Keane 6ebc3abd76 [NFC] Replace use of !isTranslationUnit && !isNamespace with !isFileContext
isFileContext is exactly equal to these two, so simplify the function.
2022-10-06 09:40:51 -07:00
Ivan Tetyushkin 0e6c1576e6 [RISCV] Optimization for using compressed beqz and bnez PR#56391
Optimization for using compressed beqz and bnez

If there is pattern
```
br_cc val1 constval eq/neq place
select_cc val1 constval eq/neq trueval falseval
```
and constval does not fit in compressed imm format(6 bit), but fit in
imm format(12 bit), we can replace by non compress sub and compress
c.beqz/c.bneqz:

```
addi val val -constval
c.beqz val place
```

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D132839
2022-10-06 09:33:32 -07:00
Shubham Sandeep Rastogi 870b74d590 Revert "Remove the dependency between lib/DebugInfoDWARF and MC."
This reverts commit 0008990479.
2022-10-06 09:30:46 -07:00
Ellis Hoag 69549de865 [llvm-reduce] Remove debug metadata elements
There can be lots of `MDTuple` debug metadata nodes. For example, `globals: !{!1, !2}` in `!DICompileUnit()`. Search through all debug info to find `MDTuple`'s and remove some of their elements.

For D135114 I was able to get a reproducer with 364 lines without manually deleting elements. After this patch I got it down to 67 lines.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D135237
2022-10-06 09:28:55 -07:00
Shubham Sandeep Rastogi 0008990479 Remove the dependency between lib/DebugInfoDWARF and MC.
Differential Revision: https://reviews.llvm.org/D134817
2022-10-06 09:25:57 -07:00
Florian Hahn a7ac0dd0cf
[ConstraintElimination] Generalize AND matching.
Extend more general matching used for chains of ORs to also support
chains of ANDs.
2022-10-06 17:17:38 +01:00
Valentin Clement 5a0722e046
[flang] Update fir.dispatch operation
Update the `fir.dispatch` operation to prepare
the lowering part. `nopass` and `pass_arg_pos` attributes
are added in the arguments list so accessors are generated
by MLIR tablegen. A verifier is added as well as some tests.

This patch is part of the implementation of the poltymorphic
entities.
https://github.com/llvm/llvm-project/blob/main/flang/docs/PolymorphicEntities.md

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D135358
2022-10-06 18:11:56 +02:00
Petr Hosek 2d4fd0b6d5 [CMake] Provide Findzstd module
This module is used to find the system zstd library. The imported
targets intentionally use the same name as the generate zstd config
CMake file so these can be used interchangeably.

Differential Revision: https://reviews.llvm.org/D134990
2022-10-06 16:10:48 +00:00
LLVM GN Syncbot 57b9985653 [gn build] Port 79df8e19be 2022-10-06 16:02:20 +00:00
Sam McCall 4b53c00173 [Format] Drop speculative test added in previous patch, it hits asserts? 2022-10-06 17:57:58 +02:00
Tyker 1654b22ac0 [ADT] Add support for more formats in APFixedPoint
Prior to this patch FixedPointSemantics and APFixedPoint only support semantics where
the Scale larger or equal to zero and the Width is larger or equal to the Scale.
This patch removes both those requirements while staying API compatible.
2022-10-06 17:55:31 +02:00
Peter Steinfeld 7ad7c4ea86 [flang] Add a "not yet implemented" message for large, constant arrays
Rather than crashing in llvm code, nip things in the bud.

Differential Revision: https://reviews.llvm.org/D135321
2022-10-06 08:54:20 -07:00
bixia1 330d48c4aa [mlir][sparse] Add rewrite rules for sparse-to-sparse reshape operators.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135077
2022-10-06 08:50:30 -07:00
Sanjay Patel 6b869be810 [InstCombine] fold udiv with hidden common factor
(X * Y) u/ (X << Z) --> Y u>> Z

https://alive2.llvm.org/ce/z/4G9D_W
2022-10-06 11:35:27 -04:00
Sanjay Patel 34cca2bd4a [InstCombine] add tests for div with common factor; NFC 2022-10-06 11:35:27 -04:00
Pavel Labath 08c4a6795a [lldb] Move breakpoint hit reset code to Target::CleanupProcess
This ensures it is run regardless of the method we use to initiate the
session (previous version did not handle connects), and it is the same
place that is used for resetting watchpoints.

Differential Revision: https://reviews.llvm.org/D134882
2022-10-06 17:18:51 +02:00
Pavel Labath 8d1de7b34a [lldb/gdb-server] Better reporting of launch errors
Use our "rich error" facility to propagate error reported by the stub to
the user. lldb-server reports rich launch errors as of D133352.

To make this easier to implement, and reduce code duplication, I have
moved the vRun/A/qLaunchSuccess handling into a single
GDBRemoteCommunicationClient function.

Differential Revision: https://reviews.llvm.org/D134754
2022-10-06 17:18:51 +02:00
Sam McCall 561443818a [clangd] Optimize Dex::generateProximityURIs().
Production profiles show that generateProximityURIs is roughly 3.8% of
buildPreamble. Of this, the majority (3% of buildPreamble) is parsing
and reserializing URIs.

We can do this with ugly string manipulation instead.

Differential Revision: https://reviews.llvm.org/D135226
2022-10-06 17:01:04 +02:00
Sam McCall 882a05afa1 [Format] Fix crash when hitting eof while lexing JS template string
Different loop termination conditions resulted in confusion of whether
*Offset was intended to be inside or outside the token.
This ultimately led to constructing an out-of-range SourceLocation.

Fix by making Offset consistently point *after* the token.

Differential Revision: https://reviews.llvm.org/D135356
2022-10-06 17:00:41 +02:00
Philip Reames d89d45ca9a [RISCV][InsertVSETVLI] Default to MA not MU
This changes the default value used for mask policy from mask undisturbed to mask agnostic. In hardware, there may be a minor preference for ta/ma, but since this is only going to apply to instructions which don't use the mask policy bit, this is functionally mostly a nop. The main value is to make future changes to using MA when legal for masked instructions easier to review by reducing test churn.

The prior code was motivated by a desire to minimize state transitions between masked and unmasked code. This patch achieves the same effect using the demanded field logic (landed in afb45ff), and there are no regressions I spotted in the test diffs. (Given the size, I have only been able to skim.) I do want to call out that regressions are possible here; the demanded analysis only works on a block local scope right now, so e.g. a tight loop mixing masked and unmasked computation might see an extra vsetvli or two.

Differential Revision: https://reviews.llvm.org/D133803
2022-10-06 07:59:39 -07:00
Nikolas Klauser 79df8e19be [libc++] Implement P0591R4 (Utility functions to implement uses-allocator construction)
Reviewed By: ldionne, #libc, huixie90

Spies: huixie90, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D131898
2022-10-06 16:58:51 +02:00
Florian Hahn 8e3e96298f
[ConstraintElimination] Order cmps for signed <-> unsigned transfer first.
Make sure conditions with constant operands come before conditions
without constant operands. This increases the effectiveness of the
current signed <-> unsigned fact transfer logic.
2022-10-06 15:56:25 +01:00
Bjorn Pettersson cbbf1ebb70 [test][InstCombine] Use opaque pointers in wcslen test cases. NFC 2022-10-06 16:43:59 +02:00
Joseph Huber ac135f9ee5 [Clang] Fix using LTO with the new driver in RDC-mode
The new driver supports LTO for RDC-mode compilations. However, this was
not correctly handled for non-LTO compilations. HIP can handle this as
it is fed to `lld` which will perform the LTO itself. CUDA however would
require every work which is wholly useless in non-RDC mode so it should
report an error.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D135305
2022-10-06 09:36:09 -05:00
Tobias Gysi f47d5dce61 [mlir][llvmir] Simpler error handling in ConvertFromLLVMIR (nfc).
The revision renames some methods of the Importer and changes
the error handling to be closer the ModuleTranslation. In particular,
processValue -> lookupValue and processType -> convertType
now fail if the translation fails (instead of returning an error),
which simplifies the error handling.

The revision prepares a follow up commit that will import
LLVMIR intrinsics using tablegen.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135349
2022-10-06 17:33:09 +03:00
oToToT 87883740eb [ASTMatchers][NFC] Fix wrong code ending command in documentation comments 2022-10-06 22:32:15 +08:00
Philip Reames afb45ffce7 [RISCV][InsertVSETVLI] Treat mask policy as undemanded if usesMaskPolicy is false
Differential Revision: https://reviews.llvm.org/D135327
2022-10-06 07:20:16 -07:00
Michał Górny bc4bcbcfc8 [llvm] [test] Add missing canonicalization of LLVM_ENABLE_ZSTD
Add LLVM_ENABLE_ZSTD to llvm_canonicalize_cmake_booleans().  This is
needed to ensure that the substitutions in lit.site.cfg.py resolve
to correct Python booleans.

Differential Revision: https://reviews.llvm.org/D135357
2022-10-06 16:09:19 +02:00
Aaron Ballman f7170500cf Silence a duplicate diagnostic about K&R C function definitions
We would issue the same diagnostic twice in the case that the K&R C
function definition is preceded by a static declaration of the function
with a prototype.

Fixes #58181
2022-10-06 10:08:23 -04:00
Utkarsh Saxena 364003e2da [clang][C++20] Note github issue in the FIXME matching requires clause. 2022-10-06 16:00:54 +02:00
Florian Hahn a2f96a10cf
[ConstraintElimination] Add tests with logical ANDs. 2022-10-06 14:50:13 +01:00
Sanjay Patel 563545685f [VectorCombine] remove unused test prefixes; NFC
These would change with D135278, but for now everything is the same.
2022-10-06 09:41:46 -04:00
Nico Weber 3dfa3a12ba [gn build] port d1f13c54f1 (Inclusions/Stdlib) 2022-10-06 09:41:27 -04:00
Sanjay Patel b598c2c24a [VectorCombine] add tests for scalar fneg with insert/extract; NFC 2022-10-06 08:57:55 -04:00
Nico Weber e2378d3438 [gn build] port d785a8eaa2 2022-10-06 07:31:06 -04:00
Utkarsh Saxena 38b9d313e6 [C++20][Clang] P2468R2 The Equality Operator You Are Looking For
Implement
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2468r2.html.

Primarily we now accept
```
template<typename T> struct CRTPBase {
  bool operator==(const T&) const;
  bool operator!=(const T&) const;
};
struct CRTP : CRTPBase<CRTP> {};
bool cmp_crtp = CRTP() == CRTP();
bool cmp_crtp2 = CRTP() != CRTP();
```

Differential Revision: https://reviews.llvm.org/D134529
2022-10-06 13:21:34 +02:00
Nikita Popov 956f7f2b4f [CodeGenCXX] Remove typed pointer check lines from test (NFC)
This test already has check lines for opaque pointers, remove the
unnecessary typed pointer check lines.
2022-10-06 13:06:02 +02:00
Florian Hahn 349375d093
[ConstraintElimination] Generalize OR matching.
Extend OR handling to traverse chains of ORs.
2022-10-06 11:56:22 +01:00
Nikita Popov 89810cee54 [RelativeVTablesABI] Convert tests to opaque pointers (NFC)
Converted using https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
with manual fixup, primarily to drop check lines for types that
no longer appear with opaque pointers.
2022-10-06 12:37:42 +02:00
Dmitry Makogon 6474d7faea [Test] Add test showing missed branch elimination due to loop predication transform 2022-10-06 17:34:09 +07:00
Guray Ozen 040805dc47 [mlir] Add bar.warp.sync to NVVM
It adds the missing `bar.warp.sync` to the nvvm dialect. It is a barrier to synchronize for threads in a warp.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135253
2022-10-06 12:27:53 +02:00
Nikita Popov 1b9a6e58a8 [CodeGenCXX] Convert some tests to opaque pointers (NFC)
Conversion done using the script at
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34.

These are tests where the conversion worked out of the box and no
manual fixup was performed.
2022-10-06 12:22:03 +02:00
Nikita Popov 2d433aebc1 Revert "[CMake] Provide Findzstd module"
This reverts commit 849059861c.

This breaks running llvm tests:

llvm-lit: /home/npopov/repos/llvm-project/llvm/utils/lit/lit/TestingConfig.py:138: fatal: unable to parse config file '/home/npopov/repos/llvm-project/build/test/lit.site.cfg.py', traceback: Traceback (most recent call last):
  File "/home/npopov/repos/llvm-project/llvm/utils/lit/lit/TestingConfig.py", line 127, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/home/npopov/repos/llvm-project/build/test/lit.site.cfg.py", line 48, in <module>
    config.have_zstd = FALSE
NameError: name 'FALSE' is not defined
2022-10-06 12:03:20 +02:00