Commit Graph

430437 Commits

Author SHA1 Message Date
Tarun Prabhu 8e48783dcb [flang][nfc] Test folding of bit-population count intrinsics
Test compile-time folding of the leadz, trailz, popcnt and poppar Fortran 2008 intrinsics.

Differential Revision: https://reviews.llvm.org/D129610
2022-07-20 11:34:02 -05:00
Ruobing Han 2b98b8e8fb fix bug for useless malloc elimination in CodeGenPrepare
Put AllocationFn check before I->willReturn can allow CodeGenPrepare to remove useless malloc instruction

Differential Revision: https://reviews.llvm.org/D130126
2022-07-20 16:29:51 +00:00
Mark de Wever 29a66ab766 [libc++][doc] Updates the release notes.
This is a preparation for the upcoming LLVM 16 release.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D130031
2022-07-20 18:20:18 +02:00
Alex Bradbury b1578bf377 [RISCV][test] Add tests showing signext behaviour of cmpxchg 2022-07-20 17:10:16 +01:00
Kazu Hirata 360c1111e3 Use llvm::is_contained (NFC) 2022-07-20 09:09:19 -07:00
Kazu Hirata 993625be80 [flang] Use value instead of getValue (NFC)
Flang C++ Style Guide tells us to use x.value() when no presence test
is obviously protecting the reference.  Since assert can be disabled,
I don't count it as "protection" here.

Differential Revision: https://reviews.llvm.org/D130144
2022-07-20 08:56:23 -07:00
Philip Reames 1a73ef75fa [LV] Autogen a test for ease of update 2022-07-20 08:19:38 -07:00
Joseph Huber b5b20164d2 Revert "[Libomptarget] Make libomptarget an LLVM library"
This reverts commit 643dfd97d5.

This patch still makes the AMDGPU buildbots unhappy. Reverting for now
until the AMD folks figure it out.
2022-07-20 10:18:55 -04:00
Joseph Huber 6b0db92bbd [Libomptarget] Fix LTO command line in test
Summary:
The test passed -offload-lto instead of -foffload-lto.
2022-07-20 10:18:55 -04:00
Jake Egan bd519b9335 redo UNSUPPORT test on 64-bit AIX too
The test failure affects both bitmodes.
2022-07-20 10:18:28 -04:00
Philip Reames be25f52fec [LV] Autogen several tests for ease of update in upcoming change 2022-07-20 07:17:51 -07:00
Jake Egan 7373497a4b UNSUPPORT test on 64-bit AIX too
The test failure affects both bitmodes.
2022-07-20 10:05:03 -04:00
Martin Storsjö 801971e5b4 [LLD] [COFF] Improve the error message for too many exported symbols
Print the actual number of symbols that would have been exported
too, which helps assessing the situation.

Differential Revision: https://reviews.llvm.org/D130117
2022-07-20 16:58:29 +03:00
Roman Rusyaev 394a388d14 [TableGen] Add a location for a class definition that was forward-declared
This change improves ctags generation for tablegen files.

For the following example
```
class A;

class A {
  int a;
}
```
Previously, tags were generated only for a forward declaration of class 'A'.

This patch allows generating tags for the forward declarations
and further definition of class 'A'.

Reviewed By: barannikov88

Original patch by: rusyaev-roman (Roman Rusyaev)
Some adjustments by: nhaehnle (Nicolai Hähnle)

Differential Revision: https://reviews.llvm.org/D129935
2022-07-20 15:56:17 +02:00
Joseph Huber 643dfd97d5 [Libomptarget] Make libomptarget an LLVM library
This patch makes libomptarget depend on LLVM libraries to be built. The
reason for this is because we already have an implicit dependency on
LLVM headers for ELF identification and extraction as well as an
optional dependenly on the LLVMSupport library for time tracing
information. Furthermore, there are changes in the future that require
using more LLVM libraries, and will heavily simplify some future code as
well as open up the large amount of useful LLVM libraries to
libomptarget.

This will make "standalone" builds of `libomptarget' more difficult for
vendors wishing to ship their own. This will require a sufficiently new
version of LLVM to be installed on the system that should be picked up
by the existing handling for the implicit headers.

The things this patch changes are as follows:
  - `libomptarget.so` links against LLVMSupport and LLVMObject
  - `libomptarget.so` is a symbolic link to `libomptarget.so.15`
  - If using a shared library build, user applications will depend on LLVM
    libraries as well
  - We can now use LLVM resources in Libomptarget.

Note that this patch only changes this to apply to libomptarget itself,
not the plugins. Additional patches will be necessary for that.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D129875
2022-07-20 09:52:09 -04:00
Ingo Müller 000e426449 [mlir][bufferize][doc] Fix documentation of return type of `to_memref`.
This is my very first contact with this dialect, so I am not very
confident with this commit, but it seems like the op returns a memref,
not a tensor, so that's what comment about the result type should say.

[mlir][bufferization][doc] Improve typesetting of inline code. Fix Typo.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D130159
2022-07-20 13:21:49 +00:00
Louis Dionne 7169659752 [clang] Small adjustments for -fexperimental-library
Move -lc++experimental before -lc++abi (that was forgotten in the
original patch), and mark a test as UNSUPPORTED on AIX. I contacted
the owners of the AIX bot that failed because I was unable to reproduce
the issue locally.
2022-07-20 09:14:55 -04:00
Jay Foad db0a658c61 [AMDGPU] Change RUN lines to not depend on code sinking. NFC.
Change a couple of RUN lines to not depend on the presence or position
of the IR code sinking pass in the codegen pipeline, since it does not
belong in there anyway.
2022-07-20 13:42:19 +01:00
Philip Reames 523a526a02 [LV] Fix miscompile due to srem/sdiv speculation safety condition
An srem or sdiv has two cases which can cause undefined behavior, not just one. The existing code did not account for this, and as a result, we miscompiled when we encountered e.g. a srem i64 %v, -1 in a conditional block.

Instead of hand rolling the logic, just use the utility function which exists exactly for this purpose.

Differential Revision: https://reviews.llvm.org/D130106
2022-07-20 05:35:23 -07:00
Carlos Alberto Enciso f8c13754af Update the Windows packaging script.
As discussed on:
  https://discourse.llvm.org/t/build-llvm-release-bat-script-options/63146/6

Giving:
  call :function if errorlevel 1 exit /b 1

Due to a missing new line, the error code returned by the function
is taking as another argument.

Changed to use standard '||' to exit if the errorlevel greater than zero.

  call :function || exit /b 1

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D130154
2022-07-20 13:22:10 +01:00
Nicolai Hähnle 1ddc51d89d Inliner: don't mark call sites as 'nounwind' if that would be redundant
When F calls G calls H, G is nounwind, and G is inlined into F, then the
inlined call-site to H should be effectively nounwind so as not to lose
information during inlining.

If H itself is nounwind (which often happens when H is an intrinsic), we
no longer mark the callsite explicitly as nounwind. Previously, there
were cases where the inlined call-site of H differs from a pre-existing
call-site of H in F *only* in the explicitly added nounwind attribute,
thus preventing common subexpression elimination.

v2:
- just check CI->doesNotThrow

v3 (resubmit after revert at 3443788087):
- update Clang tests

Differential Revision: https://reviews.llvm.org/D129860
2022-07-20 14:17:23 +02:00
Max Kazantsev e0ccd190ae [SCEV][NFC][CT] Do not waste time proving contextual facts for unreached loops and blocks
In fact, in unreached code we can say that every fact is true. So do not waste time trying to
do something smarter.

Formally it's not an NFC because it may change query results in unreached code, but they
won't have any impact on execution.

Hypothetical CT boost expected but not measured in practice.

Differential Revision: https://reviews.llvm.org/D129878
2022-07-20 19:02:28 +07:00
Nicolai Hähnle 7af2818a99 Update some more tests with update_cc_test_checks.py 2022-07-20 13:27:18 +02:00
Andrzej Warzynski bbdf5c37e3 [flang][driver] Fix opt-level option parsing
This update makes sure that `flang-new -O2 -O0` will run at `-O0` rather
than `-O2`.

This bug was identified and originally fixed by Vyacheslav Zakharin in
https://reviews.llvm.org/D130035. I've extracted the fix into a separate
patch.

co-authored by: Vyacheslav Zakharin <vyacheslav.p.zakharin@intel.com>

Differential Revision: https://reviews.llvm.org/D130104
2022-07-20 11:14:29 +00:00
esmeyi b1847ff068 [XCOFF] write the aux header when the visibility is specified in XCOFF32.
The n_type field in the symbol table entry has two interpretations in XCOFF32, and a single interpretation in XCOFF64.
The new interpretation is used in XCOFF32 if the value of the o_vstamp field in the auxiliary header is 2.
In XCOFF64 and the new XCOFF32 interpretation, the n_type field is used for the symbol type and visibility.
The patch writes the aux header with an o_vstamp field value of 2 when the visibility is specified in XCOFF32 to make the new XCOFF32 interpretation used.

Reviewed By: DiggerLin, jhenderson

Differential Revision: https://reviews.llvm.org/D128148
2022-07-20 07:09:34 -04:00
Simon Pilgrim 029e83b401 [DAG] getNode - don't bother creating ADDO(X,0) or SUBO(X,0) nodes.
Similar to what we already do in getNode for basic ADD/SUB nodes, return the X operand directly, but here we know that there will be no/zero overflow as well.

As noted on D127115 - this path is being exercised by llvm/test/CodeGen/ARM/dsp-mlal.ll, although I haven't been able to get any codegen without a topological worklist.
2022-07-20 12:04:33 +01:00
David Green 4704da1374 [ARM] Fix Thumb2 compare being emitted ExpandCMP_SWAP
Given a patch like D129506, using instructions not valid for the current
target feature set becomes an error. This fixes an issue in
ARMExpandPseudo::ExpandCMP_SWAP where Thumb2 compares were used in
Thumb1Only code, such as thumbv8m.baseline targets.

Differential Revision: https://reviews.llvm.org/D129695
2022-07-20 12:04:22 +01:00
Simon Pilgrim 2b6edc9eda [X86] shuffle-blend.ll - add avx512f-only test coverage 2022-07-20 11:36:07 +01:00
Simon Pilgrim 766cd95481 [DAG] getNode - assert that ADDO/SUBO nodes have the correct ops + types 2022-07-20 11:23:58 +01:00
Simon Pilgrim bb4ff39baf [X86] shuffle-blend.ll - add 32-bit test coverage
Noticed while reviewing D129537
2022-07-20 11:23:57 +01:00
Florian Hahn 5124b21648
[VPlan] Initial def-use verification.
This patch introduces some initial def-use verification. This catches
cases like the one fixed by D129436.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D129717
2022-07-20 11:06:32 +01:00
Simon Pilgrim 9fc347aa4e [DAG] PromoteIntRes_BUILD_VECTOR - extend constant boolean vectors according to target BooleanContents
PromoteIntRes_BUILD_VECTOR currently always ANY_EXTENDs build vector operands, but if this is a constant boolean vector we're losing the useful ability to keep the vector matching the BooleanContents mode used by the target.

This patch extends constant boolean vectors according to target BooleanContents, allowing a number of additional all-bits folds (notable XOR -> NOT conversions) to occur.

Differential Revision: https://reviews.llvm.org/D129641
2022-07-20 10:49:31 +01:00
Benjamin Kramer 439668871a [bazel] Also add -lrt to OrcTargetProcess for 1b1f1c7786 2022-07-20 11:28:47 +02:00
Nikolas Klauser 309aed3068 [libc++] Implement P1423R3 (char8_t backward compatibility remediation)
Reviewed By: Mordante, #libc

Spies: h-vetinari, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D129195
2022-07-20 11:27:51 +02:00
Nikolas Klauser 20d30f709b [libc++] Add clang-tidy for the tests
Reviewed By: Mordante, huixie90, #libc

Spies: aheejin, libcxx-commits

Differential Revision: https://reviews.llvm.org/D129976
2022-07-20 11:26:49 +02:00
Benjamin Kramer 24c88c90a8 [bazel] Add -lrt on non-darwin/non-windows for 1b1f1c7786
For shm_open in orc jit.
2022-07-20 11:24:13 +02:00
Nicolai Hähnle 5a4033c367 update-test-checks: safely handle tests with #if's
There is at least one Clang test (clang/test/CodeGen/arm_acle.c) which
has functions guarded by #if's that cause those functions to be compiled
only for a subset of RUN lines.

This results in a case where one RUN line has a body for the function
and another doesn't. Treat this case as a conflict for any prefixes that
the two RUN lines have in common.

This change exposed a bug where functions with '$' in the name weren't
properly recognized in ARM assembly (despite there being a test case
that was supposed to catch the problem!). This bug is fixed as well.

Differential Revision: https://reviews.llvm.org/D130089
2022-07-20 11:23:49 +02:00
Chenbing Zheng 8ba794be31 [InstCombine] add more tests for xor_of_icmps. nfc 2022-07-20 17:19:00 +08:00
Chuanqi Xu 645d2dd3a9 Revert "Don't treat readnone call in presplit coroutine as not access memory"
This reverts commit 57224ff4a6. This
commit may trigger crashes on some workloads. Revert it for clearness.
2022-07-20 17:00:58 +08:00
Alexandros Lamprineas 051738b08c Reland "[AArch64] Add a tablegen pattern for UZP2."
Converts concat_vectors((trunc (lshr)), (trunc (lshr))) to UZP2
when the shift amount is half the width of the vector element.

Prioritize the ADDHN(2), SUBHN(2) patterns over UZP2.
Fixes https://github.com/llvm/llvm-project/issues/52919

Differential Revision: https://reviews.llvm.org/D130061
2022-07-20 09:47:32 +01:00
River Riddle ee7ccbeaa7 [mlir:LSP][NFC] Make the LSPServer class private
There is no benefit to making it public, and the code is much
cleaner and easier to follow when inlined. This also matches
the pattern within the PDLL lsp server.
2022-07-20 01:43:30 -07:00
David Sherwood 79660d339e [LoopVectorize][AArch64] Add TTI hook preferPredicatedReductionSelect
By default if SVE is enabled we want the select instruction used for
reductions to be inside the loop, rather than outside. This makes it
possible for the backend to fold the select into the operation to
produce a single predicated add, fadd, etc.

Differential Revision: https://reviews.llvm.org/D129763
2022-07-20 09:33:29 +01:00
Lorenzo Albano 07d69d9fc9 [VP] Legalize the stride operand for EXPERIMENTAL_VP_STRIDED SDNodes
Add promotion and expansion of integer operands for
experimental_vp_strided SelectionDAG nodes; the expansion is actually
just a truncation of the stride operand.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D123112
2022-07-20 10:22:43 +02:00
Anush Elangovan f9676d2d22 [mlir] Fix macOS tests
Fix shared library names on macOS for execution_engine.py test.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D130143
2022-07-20 10:19:05 +02:00
Chenbing Zheng 07c90d9e3e [InstCombine] add tests for icmp-shr. nfc 2022-07-20 16:04:00 +08:00
Xi Ruoyao dbec35ccf8 [sanitizer] Port sanitizer_common to LoongArch
Initial libsanitizer support for LoongArch. It survived all GCC UBSan tests.

Major changes:

1. LoongArch port of Linux kernel only supports `statx` for `stat` and its families.  So we need to add `statx_to_stat` and use it for `stat`-like libcalls.  The logic is "borrowed" from Glibc.
2. `sanitizer_syscall_linux_loongarch64.inc` is mostly duplicated from RISC-V port, as the syscall interface is almost same.

Reviewed By: SixWeining, MaskRay, XiaodongLoong, vitalybuka

Differential Revision: https://reviews.llvm.org/D129371
2022-07-20 00:58:40 -07:00
Luo, Yuanke f72e0a8786 [X86] Add test case for shuffle.
The test case focus on shuffle which can be transformed to select or
blend.
2022-07-20 15:51:32 +08:00
Kazu Hirata 76e18cc4f6 [llvm] Use llvm::any_of and llvm::none_of (NFC) 2022-07-20 00:36:19 -07:00
jacquesguan c3d856bf58 [mlir][Math] Add constant folder for Log1pOp.
This patch adds constant folder for Log1pOp which only supports single and double precision floating-point.

Differential Revision: https://reviews.llvm.org/D129979
2022-07-20 14:59:35 +08:00
Fangrui Song e931c2e870 [LegacyPM] Remove InstrOrderFileLegacyPass
Following recent changes removing non-core features of the legacy
PM/optimization pipeline.
2022-07-19 23:58:51 -07:00