Commit Graph

466789 Commits

Author SHA1 Message Date
Andrzej Warzynski
2712b2805b [mlir][linalg] Vectorize 0-d tensor extract
This patch adds the missing logic to vectorise `tensor.extract` for 0-d
tensors.

Fixes #63688

Differential Revision: https://reviews.llvm.org/D154518
2023-07-06 08:34:51 +01:00
Craig Topper
51feb1a72c [RISCV] Use 'int' for return type for clz_64/clo_64 tests in riscv64-xtheadbb.c. NFC
This matches the definition for the underlying builtins and what
is done in the Zbb test.
2023-07-06 00:25:20 -07:00
esmeyi
533af6e5c4 [AIX] make integrated-as as default on AIX.
Summary: Clang uses LLVM's integrated assembler by default on most targets, however non-integrated-as mode is default on AIX. Currently integrated-as mode on AIX has passed tests of LLVM test-suite, bootstrap and Spec2017, therefore this patch sets integrated-as as the default assembler mode on AIX.

Reviewed By: DiggerLin

Differential Revision: https://reviews.llvm.org/D150758
2023-07-06 03:16:10 -04:00
Nikita Popov
8f6e7b2871 [ModRef] Use enum class for IRMemLocation (NFC)
As reported at https://reviews.llvm.org/D153305#4475840.
2023-07-06 09:08:45 +02:00
Serge Pavlov
d4a5673add [AIX][clang][tests] XFail PCH/late-parsed-instantiations.cpp
The issue: https://github.com/llvm/llvm-project/issues/63704
2023-07-06 14:06:30 +07:00
XChy
bfb5d2e6f8 [InstCombine] Transform (A > 0) | (A < 0) -> zext (A != 0) fold
[InstCombine] Transform (A > 0) | (A < 0) -> zext (A != 0) fold

This extends **foldCastedBitwiseLogic** to handle the similar cases.

Actually, for `(A > B) | (A < B)`, when B != 0, it can be optimized to `zext( A != B )` by **foldAndOrOfICmpsUsingRanges**.
However, when B = 0, **transformZExtICmp** will transform `zext(A < 0) to i32` into `A << 31`,
which cannot be optimized by **foldAndOrOfICmpsUsingRanges**.

Because I'm new to LLVM and has no concise knowledge about how LLVM decides the order of optimization,
I choose to extend **foldCastedBitwiseLogic** to fold `( A << (X - 1) ) | ((A > 0) zext to iX) -> (A != 0) zext to iX`.

And the equivalent fold follows:
```
 A << (X - 1) ) | ((A > 0) zext to iX
  -> A < 0 | A > 0
  -> (A != 0) zext to iX
```

It's proved by [[https://alive2.llvm.org/ce/z/33HzjE|alive-tv]]

Related issue:
[[https://github.com/llvm/llvm-project/issues/62586  | (a > b) | (a < b) is not simplified only for the case b=0 ]]

Reviewed By: goldstein.w.n

Differential Revision: https://reviews.llvm.org/D154126
2023-07-06 02:02:43 -05:00
XChy
e8744ba32d [InstCombine] Add tests for (A > 0) | (A < 0) -> zext (A != 0) fold (NFC)
Tests for an upcoming  (A > 0) | (A < 0) -> zext (A != 0) fold.
Related issue:
[[ https://github.com/llvm/llvm-project/issues/62586 | (a > b) | (a < b) is not simplified only for the case b=0 ]]

Differential Revision: https://reviews.llvm.org/D154089
2023-07-06 02:02:43 -05:00
Martin Braenne
ca01be54c1 [clang][dataflow] Bug fix: BuiltinFnToFnPtr cast does not produce a pointer.
See comments in the code for details.

Reviewed By: xazax.hun

Differential Revision: https://reviews.llvm.org/D154479
2023-07-06 06:56:02 +00:00
Valery Pykhtin
98aa8439f5 [AMDGPU] Fix register class for a subreg in GCNRewritePartialRegUses.
1. Improved code that deduces register class from instruction definitions. Previously if some instruction didn't contain a reg class for an operand it was considered as no information on register class even if other instructions specified the class.

2. Added check on required size of resulting register because in some cases classes with smaller registers had been selected (for example VReg_1).

Reviewed By: arsenm, #amdgpu

Differential Revision: https://reviews.llvm.org/D152832
2023-07-06 08:48:45 +02:00
Jim Lin
893cc97007 [LibCallsShrinkWrap] Set IsFPConstrained is true for creating quiet floating comparision if function has strictfp attribute
Create a quiet floating-point comparision if function has strictfp attribute.
Avoid unexpected FP exception raised during libcall domain error checking.
It raises an FP exception only in case where an input is a signaling NaN.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D152776
2023-07-06 13:23:34 +08:00
Fangrui Song
f7624b080a [XRay][test] Remove unneeded REQUIRES: x86_64-target-arch
fdr-thread-order.cpp can be very slow when the thread contention is large.
Enable it for AArch64 and x86-64 for now.

fdr-mode.cpp fails on a ppc64le machine. Unsupport it on ppc64le for now.

The remaining modified tests pass on AArch64, ppc64le, and x86-64.
2023-07-05 21:34:02 -07:00
Fangrui Song
93e672489a [LTO] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D123803 2023-07-05 21:08:30 -07:00
Fangrui Song
9e7a052eef [XRay][AArch64] Implement __xray_ArgLoggerEntry 2023-07-05 20:56:00 -07:00
Jianjian GUAN
a813a633d5 [RISCV][NFC] Use common prefix to simlify test.
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D154487
2023-07-06 11:52:51 +08:00
Tom Stellard
c951960e65 GetClangResourceDir: Fix downstream projects that bundle llvm source
A project that bundles the llvm source code may have their own
PACKAGE_VERSION variable, so only use this to compute the
CLANG_RESOURCE_DIR if CLANG_VERSION_MAJOR is undefined.

Reviewed By: sebastian-ne

Differential Revision: https://reviews.llvm.org/D152608
2023-07-05 20:10:28 -07:00
zhanglimin
cea3a89841 [profile] Enable loongarch64
Mark loongarch64 as supported for profile. All tests passed.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154405
2023-07-06 11:06:54 +08:00
Fangrui Song
88b9d4d77e [XRay][test] Replace some XFAIL with more appropriate REQUIRES 2023-07-05 20:06:37 -07:00
Tom Stellard
62748e934c AMDGPU: Remove add_dependencies calls from CMakeLists.txt
These are redundant.  The same dependencies are being added as part
of the add_llvm_component_library() call.  I confirmed this by diff'ing
the build.ninja files before and after the change and saw no change.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D153166
2023-07-05 20:03:11 -07:00
Jacques Pienaar
7b59121be5 [mlir][shape] Remove overzealous Dim verifier
Follow up of D143999 and follow
https://mlir.llvm.org/getting_started/DeveloperGuide/#ir-verifier.

Fixes #60808.
2023-07-05 20:01:32 -07:00
Craig Topper
ee34fa0032 [RISCV] Add DAG combine for (fmv_w_x_rv64 (fmv_x_anyextw_rv64 X))
This pattern started showing up more after D151284
2023-07-05 19:35:13 -07:00
Ben Shi
a824b00452 [RISCV][NFC] Simplify uses of PatFrag binop_oneuse
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D154435
2023-07-06 10:31:40 +08:00
max
4eee9ef976 Add SymbolRefAttr to python bindings
Differential Revision: https://reviews.llvm.org/D154541
2023-07-05 20:51:33 -05:00
Matt Arsenault
e8ed6e35bd DAG: Implement soften float for ffrexp
Fixes #63661

https://reviews.llvm.org/D154555
2023-07-05 21:42:27 -04:00
Volodymyr Sapsai
f7e0aae728
[ODRHash] Stop hashing ObjCMethodDecl::isPropertyAccessor as it doesn't capture inherent method quality.
`isPropertyAccessor` depends on the surrounding code and not on the method
itself. That's why it can be different in different modules. And
mismatches shouldn't be an error.

rdar://109481753

Differential Revision: https://reviews.llvm.org/D154460
2023-07-05 18:04:50 -07:00
Volodymyr Sapsai
18530e5d07
[ODRHash] Stop hashing ObjCMethodDecl::isOverriding as it doesn't capture inherent method quality.
`isOverriding` depends on the surrounding code and not on the method
itself. That's why it can be different in different modules. And
mismatches shouldn't be an error.

rdar://109481753

Differential Revision: https://reviews.llvm.org/D154459
2023-07-05 18:04:32 -07:00
Craig Topper
9c4aa85ec1 [RISCV][TableGen] Remove f32 from XLenFVT for RV32.
We don't expect this to be used on RV32 currently so remove it
to reduce number of entries in the isel table.

Teach RegisterInfoEmitter.cpp to allow a type to be missing for
a particular HwMode.
2023-07-05 17:17:22 -07:00
Nemanja Ivanovic
7cd9084c69 Revert "[PowerPC] Remove extend between shift and and"
This reverts commit a57236de4e.
Causes a bootstrap failure on ppc64be.
2023-07-05 20:04:49 -04:00
Mariusz Borsa
3ff080b53b [Sanitizers][Darwin][Test] Mark symbolize_pc test unsupported in Darwin/LSan context
LSan is unsupported on Darwin anyway, and this test fals on public Darwin bots

Differential Revision: https://reviews.llvm.org/D154389
2023-07-05 16:54:20 -07:00
Joseph Huber
c850ea1498 [libc] Support fopen / fclose on the GPU
This patch adds the necessary support for the fopen and fclose functions
to work on the GPU via RPC. I added a new test that enables testing this
with the minimal features we have on the GPU. I will update it once we
have `fread` and `fwrite` to actually check the outputted strings. For
now I just relied on checking manually via the outpuot temp file.

Reviewed By: JonChesterfield, sivachandra

Differential Revision: https://reviews.llvm.org/D154519
2023-07-05 18:31:58 -05:00
Joseph Huber
7e88e26d38 [libc] Add GPU support for the 'inttypes.h' functions
Another low hanging fruit we can put on the GPU, this ports the tests
over to the hermetic framework so we can run them on the GPU.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D154540
2023-07-05 17:47:10 -05:00
Joseph Huber
e90ab9148b [OpenMP] Delete old plugins
It's time to remove the old plugins as the next-gen has already been set
to default in LLVM 16.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D142820
2023-07-05 17:39:47 -05:00
Joseph Huber
70c08dbcfb [Libomptarget] Remove the remote and ve plugins from libomptarget
These plugins are unmaintained and are not in a workable state. The VE
plugin has not been touched for years and has never had any running
tests. The remote plugin is in an unfinished state and is not production
ready upstream. These will need to be ported to the new nextgen
interface in the future if they are needed.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D154548
2023-07-05 17:39:46 -05:00
Fangrui Song
49dfbc6efc [ELF] Remove one unneeded unquote from D124266
This one is unneeded after commit d60ef9338d (2023-02-03).
2023-07-05 15:08:53 -07:00
Roger Pau Monne
7cab385a8f [lld/elf] support quote usage in section names
Section names used in ELF linker scripts can be quoted, but such
quotes must not be propagated to the binary ELF section names.  As
such strip the quotes from the section names when processing them, and
also strip them from linker script functions that take section names
as parameters.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D124266
2023-07-05 14:56:16 -07:00
Matthew Voss
a1ca3af31e [llvm] A Unified LTO Bitcode Frontend
Here's a high level summary of the changes in this patch. For more
information on rational, see the RFC.
(https://discourse.llvm.org/t/rfc-a-unified-lto-bitcode-frontend/61774).

  - Add config parameter to LTO backend, specifying which LTO mode is
    desired when using unified LTO.
  - Add unified LTO flag to the summary index for efficiency. Unified
    LTO modules can be detected without parsing the module.
  - Make sure that the ModuleID is generated by incorporating more types
    of symbols.

Differential Revision: https://reviews.llvm.org/D123803
2023-07-05 14:53:14 -07:00
Arthur Eubanks
156913cb77 Revert "[X86] Fold BITOP(PACKSS(X,Z),PACKSS(Y,W)) --> PACKSS(BITOP(X,Y),BITOP(Z,W))"
This reverts commit a32d14fd4c.

Causes crashes, see https://reviews.llvm.org/rGa32d14fd4c0a43c154f251df1ccfe57e8b0a711a.
2023-07-05 14:52:57 -07:00
varconst
baf6f91851 [libc++][ranges] Implement the changes to basic_string from P1206 (ranges::to):
- add the `from_range_t` constructors and the related deduction guides;
- add the `insert_range`/`assign_range`/etc. member functions.

(Note: this patch is split from https://reviews.llvm.org/D142335)

Differential Revision: https://reviews.llvm.org/D149832
2023-07-05 14:50:59 -07:00
Louis Dionne
99dcc9ff0e [libc++][NFC] Remove leftover entry for <experimental/span> in header_information.py 2023-07-05 17:48:04 -04:00
Nikolas Klauser
75f6af82c3 [libc++] Mark LWG2994 as complete and remove Clang from the version
Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D154381
2023-07-05 14:43:04 -07:00
Edoardo Sanguineti
5e807c38bf [libc++] add basic runtime assertions to <latch>
Adding assertions will aid users that have bugs in their code to
receive better error messages.

Differential Revision: https://reviews.llvm.org/D154425
2023-07-05 17:34:23 -04:00
Matt Arsenault
20964c901a DAG: Fix dropping flags when widening unary vector ops 2023-07-05 17:25:24 -04:00
Matt Arsenault
5491666248 AMDGPU: Correctly lower llvm.exp.f32
The library expansion has too many paths for all the permutations of
DAZ, unsafe and the 3 exp functions. It's easier to expand it in the
backend when we know all of these things. The library currently misses
the no-infinity check on the overflow, which this handles optimizing
out.

Some of the <3 x half> fast tests regress due to vector widening
dropping flags which will be fixed separately.

Apparently there is no exp10 intrinsic, but there should be. Adds some
deadish code in preparation for adding one while I'm following along
with the current library expansion.
2023-07-05 17:23:49 -04:00
Matt Arsenault
ed556a1ad5 AMDGPU: Correctly lower llvm.exp2.f32
Previously this did a fast math expansion only.
2023-07-05 17:23:48 -04:00
Joseph Huber
515bd1c9b8 [libc][Obvious] Fix timing on AMDGPU not being initialized
Summary:
Reviewer requested that this routine not be a macro, however that means
that it was not being intitialized as the static initializer was done
before the memcpy from the device. Fix this so we can get timing
information.
2023-07-05 16:08:37 -05:00
Akira Hatanaka
a2b7297dff Don't pass -ibuiltininc, which is used only by the driver, to CC1
This fixes a fallout from 5b77e752dc.

Differential Revision: https://reviews.llvm.org/D154388
2023-07-05 14:03:21 -07:00
Oskar Wirga
198df5f682 Weaken MFI Max Call Frame Size Assertion
A year ago when I was not invested at all into compilers, I found an assertion error when building an AArch64 debug build with LTO + CFI, among other combinations.

It was posted as a github issue here: https://github.com/llvm/llvm-project/issues/54088

I took it upon myself to revisit the issue now that I have spent some more time working on LLVM.

Reviewed By: MatzeB

Differential Revision: https://reviews.llvm.org/D151276
2023-07-05 14:02:51 -07:00
Renato Golin
93d038a0ea Revert "[MLIR][Linalg] Add more arith named ops to linalg"
This reverts commit eda47fdd25.

It failed on NVidia, AMD and Windows bots. Investigating.
2023-07-05 22:02:23 +01:00
Joseph Huber
80504b06ad [libc][Obvious] Fix bad macro check on NVPTX tests
Summary:
I forgot to add the `defined()` check on NVPTX.
2023-07-05 15:54:12 -05:00
Matt Arsenault
9c82dc6a6b AMDGPU: Always use v_rcp_f16 and v_rsq_f16
These inherited the fast math checks from f32, but the manual suggests
these should be accurate enough for unconditional use. The definition
of correctly rounded is 0.5ulp, but the manual says "0.51ulp". I've
been a bit nervous about changing this as the OpenCL conformance test
does not cover half. Brute force produces identical values compared to
a reference host implementation for all values.
2023-07-05 16:53:01 -04:00
Matt Arsenault
59c311c5d4 AMDGPU: Add more tests for f16 fdiv lowering
Probably should merge the DAG and gisel tests.
2023-07-05 16:53:01 -04:00