441017 Commits

Author SHA1 Message Date
Nikolas Klauser
89b356f05a [libc++] Granularize <concept> includes
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D137283
2022-11-05 20:59:29 +01:00
Simon Pilgrim
edf885531e [X86] Replace unnecessary int2float and float2double overrides with better base class defs
Broadwell/Haswell were completely overriding the class defs - we can remove those overrides entirely by just choosing better class defs (plus a fix for missing mmx folded load).
2022-11-05 19:07:01 +00:00
Michał Górny
45dead4b8f [flang] Add one missing "llvm_" prefix to gtest_main
The `target_link_libraries()` call operates on `gtest_main` rather than
`llvm_gtest_main`.  I think it was missed while prefixing all the tools
in 38151a08c21e0cdacd52af03e4bdff258f0bac6f.

Differential Revision: https://reviews.llvm.org/D137080
2022-11-05 19:48:51 +01:00
Simon Pilgrim
23ba5bc528 [MCA][X86] Add more avx512 cvt instructions test coverage 2022-11-05 17:28:29 +00:00
Amaury Séchet
82209fd96e [NFC] Refactor DAGCombiner::foldSelectOfConstants to reduce nesting 2.0 2022-11-05 17:10:06 +00:00
Florian Hahn
a41cb8bf58
[SimpleLoopUnswitch] Forget block & loop dispos during trivial unswitch.
Unswitching adjusts the CFG in ways that may invalidate cached loop
dispositions. Clear all cached block and loop dispositions during
trivial unswitching. The same is already done for non-trivial
unswitching.

Fixes #58751.
2022-11-05 16:56:06 +00:00
Amaury Séchet
7c05f092c9 [NFC] Refactor DAGCombiner::foldSelectOfConstants to reduce nesting 2022-11-05 16:17:58 +00:00
Simon Pilgrim
2c79186bce [X86] Cleanup WriteCvtSD2SS/WriteCvtPD2PS overrides
The WriteCvtSD2SS/WriteCvtPD2PS* classes were mostly unused as the models were needlessly overriding all instructions - in some cases the folded pattern overrides were entirely missing (but I've confirmed they just have an additional Port23 use)

There were a couple of typos (confirmed with Agner/uops.info) - Skylake/Icelake uses Port5+Port01 for XMM/YMM, Skylake uses Port5+Port05 for ZMM but Icelake uses Port5+Port0
2022-11-05 15:47:05 +00:00
Nikolas Klauser
660b243120 [libc++] Add [[nodiscard]] extensions to ranges algorithms
This mirrors what we have done in the classic algorithms

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D137186
2022-11-05 16:38:46 +01:00
Simon Pilgrim
0b7f327800 [X86] Fix cvtss2si64/cvttss2si64 typo in SkylakeClient
SS2SI64 conversions use Port0/Port01/Port5 (with/without truncation), but SS2SI32 only uses Port0/Port01 like SD2SI32/SD2SI64
2022-11-05 14:35:41 +00:00
Valentin Clement
4c52a9879b
[flang] Fix controlSuccessor chain for select type construct
Represent the select type statement + type guard statement
the same way the select case statement and case statement are represented.
controlSuccessor was not correctly attributed to the next type guard stmt.

Reviewed By: PeteSteinfeld, vdonaldson

Differential Revision: https://reviews.llvm.org/D137460
2022-11-05 15:11:30 +01:00
Simon Pilgrim
b781ca4df6 [X86] Fix override for CVTPD2PS/CVTPD2DQ/CVTTPD2DQ AVX variants
These were lost when they were converted from instregex to instrs
2022-11-05 13:57:07 +00:00
Simon Pilgrim
ee1ad1a6d0 [X86] Add SchedWriteVecTruncate scheduler per-width wrapper
Replaces hard coded uses of WriteVPMOV256 for all the vector truncations instructions

We still need to work out how to fix folded stores (see Issue #36236)
2022-11-05 12:41:45 +00:00
Simon Pilgrim
184817d0df [X86] Add missing ReadAfterFold attributes from CVTSD2SSrm/CVTSS2SDrm to match the AVX + _Int equivalents
This was never added in D52886, probably because the defs were already missing the old ReadAfterLd attribute, but they do exhibit the same behaviour of reading the dst reg after the load.
2022-11-05 11:32:26 +00:00
Simon Pilgrim
1bd6471c12 [X86] Remove SandyBridge CVTSS2SIrm/CVTSD2SIrm overrides
Just use the default WriteCvtSS2I/WriteCvtSD2I folded variants (already used by the VCVTSS2SI/VCVTSD2SI AVX variants).

Confirmed with agner and uops.info - there should be no difference between the SSE/AVX1 variants in folded load latency
2022-11-05 11:32:26 +00:00
Simon Pilgrim
d95dc5bce9 [X86] Replace unnecessary int2double overrides with a better WriteCvtI2PD def
Broadwell, Haswell and SkylakeClient were completely overriding the WriteCvtI2PD defs - we can remove those overrides entirely by replacing the unused WriteCvtI2PD values

There's plenty more of these in the scheduler models - I'm looking at improving warnings in llvm-tblgen to catch them all
2022-11-05 11:27:53 +00:00
Ivan Butygin
ed4749f937 [mlir] Add populateFunctionOpInterfaceTypeConversionPattern version which operates on any FunctionOpInterface
Exisitng version is always limited to some specific op.

Differential Revision: https://reviews.llvm.org/D137469
2022-11-05 12:10:36 +01:00
Siva Chandra Reddy
b12c677033 [libc][docs] Add a build and test document. 2022-11-05 01:06:01 -07:00
Siva Chandra Reddy
64821f178e [libc][docs] Fix typos. 2022-11-05 00:21:09 -07:00
Siva Chandra Reddy
1bb6f1bb8f [libc][docs] Move links to internal developer guides out of the main side bar.
The links are all now from a "Developer Guides" page which is linked from the
main side bar.
2022-11-05 00:04:50 -07:00
Uday Bondhugula
2951a9323f MLIR. NFC. Remove trailing whitespaces in MemRefOps.td
Remove trailing whitespaces in MemRefOps.td. NFC.
2022-11-05 11:08:44 +05:30
Med Ismail Bennani
acba66fdde [lldb/crashlog] Standardize file path key in the ScriptedProcess Dictionary
This patch replaces the backing file path key to "file_path" to keep it
consistent.

rdar://101652618

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-11-04 22:05:58 -07:00
Med Ismail Bennani
40afc69e6d [lldb/test] Fix StructuredDataTest::GetDescriptionEmpty warning (NFC)
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-11-04 22:05:58 -07:00
Med Ismail Bennani
3e8c1c4fc4 [lldb/crashlog] Fix frame parser regex for when there is no source info
It can happen that the originator of a crash report doesn't have access
to certain images. When that's the case, ReportCrash won't show the
source info in the crash report stack frames, but only the stack address
and image name.

This patch fixes a bug in the crashlog stackframe parser regular
expression to optionally match the source info group.

rdar://101934135

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-11-04 22:05:58 -07:00
chenglin.bi
6703290361 [InstCombine] fold sub + and pattern with specific const value
`C1 - ((C3 - X) & C2) --> (X & C2) + (C1 - (C2 & C3))`
when:
    (C3 - ((C2 & C3) - 1)) is pow2 &&
    ((C2 + C3) & ((C2 & C3) - 1)) == ((C2 & C3) - 1) &&
    C2 is negative pow2 || (C3 - X) is nuw

https://alive2.llvm.org/ce/z/HXQJV-

Fix: #58523

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D136582
2022-11-05 12:58:45 +08:00
Tue Ly
6c6dff7e2c [libc] Add add_with_carry to builtin wrapper.
Add add_with_carry to builtin wrapper to be used by UInt class.

Reviewed By: orex

Differential Revision: https://reviews.llvm.org/D137453
2022-11-04 23:20:37 -04:00
River Riddle
55e899813f [mlir] Attempt to fix windows build after D137374 2022-11-04 18:53:50 -07:00
River Riddle
e83446f43b [mlir:LLVM] Fix translation of DISubRangeAttr to LLVM
We were missing DISubRangeAttr in the type switch. This
also updates a few of the range parameters to be optional.
2022-11-04 18:15:03 -07:00
River Riddle
38c219b4a8 [mlir] Infer SubElementInterface implementations using the storage KeyTy
The KeyTy of attribute/type storage classes provide enough information for
automatically implementing the necessary sub element interface methods. This
removes the need for derived classes to do it themselves, which is both much
nicer and easier to handle certain invariants (e.g. null handling). In cases where
explicitly handling for parameter types is necessary, they can provide an implementation
of `AttrTypeSubElementHandler` to opt-in to support.

This tickles a few things alias wise, which annoyingly messes with tests that hard
code specific affine map numbers.

Differential Revision: https://reviews.llvm.org/D137374
2022-11-04 18:15:03 -07:00
Quentin Colombet
200266a0a1 [mlir][MemRef] Fix the lowering of extract_strided_metadata
The first result of the extract_strided_metadata operation is a MemRef,
not a naked pointer.
This patch fixes the lowering of this operation in MemRefToLLVM so that
we properly materialize the full MemRef structure and not just the base,
naked, pointer.

Differential Revision: https://reviews.llvm.org/D137364
2022-11-05 01:06:38 +00:00
Craig Topper
91aa233bdf [RISCV] Add isel pattern for (and X, 0xffffffff << C) with Zba.
We can use SRLI by C to clear LSBs followed by a SLLI_UW.
2022-11-04 18:00:02 -07:00
Craig Topper
0faac15089 [RISCV] Remove duplicate SDNodeXForm. NFC 2022-11-04 17:26:20 -07:00
Jennifer Yu
eace13928b Back out test that failed.
But I can not reproduce the problem on my local machine. My local machine run:

222 0x5a6780
222 0x7fffbef9400e
222 0x5a677e 0x5a6780 0x7fffbef936c8
222 0x376f8e 0x376f90 0x7fffbef94008
222 0x281f20
222 0x7fffbef9400e
PASSED
2022-11-04 17:23:05 -07:00
Matthew Voss
a4b543a5a5 [llvm-profdata] Check for all duplicate entries in MemOpSize table
Previously, we only checked for duplicate zero entries when merging a
MemOPSize table (see D92074), but a user recently provided a reproducer
demonstrating that other entries can also be duplicated. As demonstrated
by the test in this patch, PGOMemOPSizeOpt can potentially generate
invalid IR for non-zero, non-consecutive duplicate entries. This seems
to be a rare case, since the duplicate entry is often below the
threshold, but possible. This patch extends the existing warning to
check for any duplicate values in the table, both in the optimization
and in llvm-profdata.

Differential Revision: https://reviews.llvm.org/D136211
2022-11-04 17:08:54 -07:00
Craig Topper
d6b224edd3 [RISCV] Rename isAllUsesReadW to hasAllWUsers in RISCVSExtWRemoval. NFC 2022-11-04 17:04:44 -07:00
Peiming Liu
70508b614e [mlir][sparse] fix sparse tensor rewriting patterns that do not propagate sparse tensor SSA properly.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D137468
2022-11-04 23:43:54 +00:00
David Blaikie
7ded25c0cb Fix Bazel build for ba65584d1545951ce958ea5729692374055d6b9f 2022-11-04 23:35:05 +00:00
Peiming Liu
53d5d34011 [mlir][sparse] extend foreach operation to accept reduction arguments.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D137463
2022-11-04 23:34:16 +00:00
Matt Arsenault
026ddced17 R600: Remove broken atomicrmw patterns
inc/dec are not add/sub of 1.
2022-11-04 16:14:04 -07:00
Mircea Trofin
5617fb1411 [MLGO][NFC] Use std::map instead of DenseMap to avoid use after free
In `MLInlineAdvisor::getAdviceImpl`, we call `getCachedFPI` twice, once
for the caller, once for the callee, so the second may invalidate the
reference obtained by the first because the underlying implementation of
the cache is a `DenseMap`. `std::map` doesn't have that problem.
2022-11-04 16:07:24 -07:00
Ryan Prichard
292533324c [libc++abi] Use std::nullptr_t instead of declaring it manually
Sometimes libc++'s stddef.h wrapper gets included, which defines
::nullptr_t. This test is compiled with -Wshadow -Werror, so shadowing
::nullptr_t with a nullptr_t in main is an error. Include cstddef,
which is guaranteed to define std::nullptr_t in C++11 and forward.

Reviewed By: ldionne, #libc_abi

Differential Revision: https://reviews.llvm.org/D137127
2022-11-04 15:51:44 -07:00
Matt Arsenault
ada6aa3f5c AMDGPU: Fold undef rcp to qnan
This matches the behavior in instcombine, and for fdiv.
2022-11-04 15:49:37 -07:00
Matt Arsenault
a38db7bfc6 AMDGPU: Fix test failure 2022-11-04 15:49:37 -07:00
Peiming Liu
838389780e [mlir][sparse] support Parallel for/reduction.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135927
2022-11-04 22:47:27 +00:00
George Hu
03c7cd3a61 Revert "[lldb-vscode] Send Statistics Dump in terminated event"
This reverts commit e3ccbae309273900a42e30b606c15c873d57f1ea.

There is a bug which is failing the test running on mac.
2022-11-04 15:37:18 -07:00
Jennifer Yu
de14befa77 Remove redundant loads.
It is caused by regenerate captured var value when processing the
has_device_addr, the captured var value has been generated in
GenerateOpenMPCapturedVars and passed as Arg in generateInfoForCapture.
The fix just use Arg instead regenerated just same as is_device_ptr
2022-11-04 15:22:25 -07:00
Matt Arsenault
09d38dd770 AMDGPU: Fix assert when trying to overextend liverange
This was trying to add segments beyond the new and use,
so skip additional segments.

This would hit (S < E && "Cannot create empty or backwards segment").
2022-11-04 15:14:43 -07:00
Wanyi Ye
7b7ec60dcc Fix test TestVSCode_terminatedEvent.py
This test is broken due to the flaky encoding of top-level JSON key 'memory'
When I run locally (linux) the test passed. However, it failed the build bot: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48111/
I will find a way to repro before I can actually fix this issue correctly.

https://reviews.llvm.org/D137455
2022-11-04 14:54:29 -07:00
Jakub Kuderski
ce90957461 [mlir][spirv] Fold noop BitcastsOps
This allows for bitcast conversion to roundtrip.

Fixes: https://github.com/llvm/llvm-project/issues/58801

Reviewed By: antiagainst, Hardcode84, mravishankar

Differential Revision: https://reviews.llvm.org/D137459
2022-11-04 17:37:30 -04:00
Xiang Li
4ec7dff27d [CMake] Only set LLVM_DEFAULT_TARGET_TRIPLE to LLVM_HOST_TRIPLE when native target is enabled
This is for case when native target like X86 is not in LLVM_TARGETS_TO_BUILD.
Right now LLVM_DEFAULT_TARGET_TRIPLE is set to LLVM_HOST_TRIPLE even when native target is not enabled,
As a result, many lit tests will fail because default_triple is set for lit test but not enabled when build LLVM.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D134972
2022-11-04 14:34:38 -07:00