Commit Graph

437777 Commits

Author SHA1 Message Date
Chris Bieneman c0a76c2c71 [DirectX] Add DXIL metadata `dx.shaderModel`
This captures the target shader model and pipeline stage into the DXIL
metadata for consumption by the DirectX runtime.

Reviewed By: python3kgae

Differential Revision: https://reviews.llvm.org/D134469
2022-10-03 13:00:11 -05:00
Craig Topper 31bca38ad1 [RISCV] Pass the destination register to getVLENFactoredAmount instead of returning it. NFC
This is a refactor for another patch. For now we move the vreg
creation to the caller.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D135008
2022-10-03 10:59:35 -07:00
Fangrui Song 1721404b54 [Driver] Remove unneeded RenderAsInput flag
RenderAsInput is for -Wa,/-Wl, style options which forward their values
as used by llvm::opt::Arg::renderAsInput. These short options don't use RenderAsInput.
2022-10-03 10:58:34 -07:00
Florian Hahn bdfe986d66
[ConstraintElimination] Simplify logic for using inverse predicate (NFC)
Recent improvements to the code structure mean we don't need to reset
the condition's predicate in the IR and later restore it. Remove the
restorer logic.
2022-10-03 18:35:59 +01:00
natashaknk 9bcda47afc [mlir][tosa] Swap the reshape at the end of the reduce op for an expand_shape in tosa-to-linalg
Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D133877
2022-10-03 10:32:23 -07:00
Florian Hahn 017552e8b8
[ConstraintElimination] Remove stray comment (NFC).
The comment doens't apply in the current context, remove it.
2022-10-03 18:20:48 +01:00
Aart Bik e202886cbb [mlir][sparse] sorted coo co-iteration check test
Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D134971
2022-10-03 10:18:41 -07:00
Jessica Paquette 970cb99e0a [GlobalISel] Combine `(x + y) - y -> x` and friends
This adds a combine that handles

```
(x + y) - y -> x
(x + y) - x -> y
x - (y + x) -> 0 - y
x - (x + z) -> 0 - z
```

On AArch64, we get added benefit for `0 - y` because it can be selected to a
`neg` instruction.

Differential Revision: https://reviews.llvm.org/D135010
2022-10-03 10:06:48 -07:00
Florian Hahn a2efc29e99
[ConstraintElimination] Remove unused StackEntry::IsNot field. (NFC)
The field is no unused and can be removed.
2022-10-03 18:05:25 +01:00
bixia1 2fe75248ea [mlir][sparse][taco] Avoid hard-coding DimLevelType values.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135034
2022-10-03 10:02:57 -07:00
Keith Smiley 10f22335f3
[llvm-libtool-darwin] Add support for -dependency_info
When using llvm-libtool-darwin as a drop in replacement for cctools
libtool, Xcode expects you to create a dependency info file. This file
is a very simple format describing the input files, the output files,
and the version of the tool. This logic is mirrored from that of
ld64.lld, which supports creating this file as well. Ideally we could
extract it, but I don't think we want to throw this into one of the
grab-bag libraries given how small the logic is.

Differential Revision: https://reviews.llvm.org/D134322
2022-10-03 09:53:02 -07:00
Keith Smiley e8c10fc181
[llvm-libtool-darwin] Parse and ignore -syslibroot
cctools libtool allows you to link dynamic libraries by passing through
a number of arguments to ld64. Because of this the default arguments
libtool receives in Xcode contains arguments that only matter in that
case. This change ignores this argument, at least until we ever support
that dynamic use case, so that you can use llvm-libtool-darwin as a
drop-in replacement in Xcode for cctools libtool. There are more
arguments we could ignore for this case, but we can probably add those
as the use case comes up.

Differential Revision: https://reviews.llvm.org/D134309
2022-10-03 09:53:01 -07:00
Philip Reames 21f97fdc97 [DAG] Use getSplatBuildVector in a couple more places [nfc] 2022-10-03 09:48:49 -07:00
Michał Górny b6c24c1619 [lldb] [gdb-remote] Move ReadPacketWithOutputSupport() to client
Move ReadPacketWithOutputSupport() from GDBRemoteCommunication
to GDBRemoteClientBase.  This function is client-specific and moving
it there simplifies followup patches that split communication into
separate thread.

Sponsored by: The FreeBSD Foundation

Differential Revision: https://reviews.llvm.org/D135028
2022-10-03 18:42:49 +02:00
Jacques Pienaar 9181673bef [mlir][c] Init MLProgram C API
Add MLIR upstream C api library definition.

Differential Revision: https://reviews.llvm.org/D135083
2022-10-03 09:38:17 -07:00
Zain Jaffal 966411790e
[AArch64] Add support to loop vectorization for non temporal loads
Currently, AArch64 doesn't support vectorization for non temporal loads because `isLegalNTLoad` is not implemented for the target.
This patch applies similar functionality as `D73158` but for non temporal loads

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D131964
2022-10-03 17:06:47 +01:00
Alex Richardson 3890a456d8 [SimplifyLibCalls] Reduce code duplication. NFC
Reviewed By: nikic, nickdesaulniers, xbolva00

Differential Revision: https://reviews.llvm.org/D135073
2022-10-03 15:44:00 +00:00
Joseph Huber 11adae5089 [Clang] Make offloading flags accept '-' and '--'
Currently all of the flags beginning with `--offload` such as
`--offload-arch` or `--offload-device-only` require the double-dash
form. However, if a user uses a single dash it will instead name a file
'ffload-arch' for example. This has been the cause of a lot of user
confusion. This patch changes these options to also accept a single
dash. This is similar to many other driver arguments beginning with
`-o`.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D135076
2022-10-03 10:35:51 -05:00
Sam Clegg 664a5c6d03 [WebAssembly] Fix return type of __builtin_return_address under wasm64
Differential Revision: https://reviews.llvm.org/D135005
2022-10-03 08:31:52 -07:00
Jonathan Peyton f8d081c1a5 [OpenMP][libomp] Allow unused-but-set warnings
Only a few remaining which are taken care of by this patch.

Differential Revision: https://reviews.llvm.org/D133528
2022-10-03 10:24:33 -05:00
Sanjay Patel ba7da14d83 Revert "[InstSimplify] reduce code duplication for fmul folds; NFC"
This reverts commit 7b7940f9da.
This missed a test update.
2022-10-03 11:21:23 -04:00
Florian Hahn 22fe40068c
[ConstraintElimination] Add tests for chained GEPs with const offsets.
Add extra tests for chained GEPs where the second GEP has a constant
offset. Inspired by missed optimizations from #51358.
2022-10-03 15:55:36 +01:00
Yevgeny Rouban e351821088 Fix compilation of CodeLayout.cpp for MacOS
llvm/lib/Transforms/Utils/CodeLayout.cpp uses std::abs() with double argument,
which is provided by cmath header, which is not explicitly included into CodeLayout.cpp.
The implicit include in llvm/include/llvm/Support/MathExtras.h was removed in
commit 16544cbe64

Inserting explicit include of cmath into CodeLayout.cpp in order to fix build on MacOS.

Committed on behalf of alsemenov (Aleksei Semenov)
Reviewed By: thieta
Differential Revision: https://reviews.llvm.org/D135072
2022-10-03 21:47:43 +07:00
Sanjay Patel 7b7940f9da [InstSimplify] reduce code duplication for fmul folds; NFC
The constant is already commuted for an fmul opcode,
but this code can be called more directly for fma,
so we have to swap for that caller. There are tests
in InstSimplify and InstCombine to verify that this
works as expected.
2022-10-03 10:36:02 -04:00
David Green 4987ae8462 [ARM][AArch64] Dont use macros for half instrinsics in NeonEmitter
We don't require arm_neon.h fp16 intrinsics to be treated as macros any
more.

Differential Revision: https://reviews.llvm.org/D131504
2022-10-03 15:27:23 +01:00
David Green 1441d49bb6 [AArch64] Add pr58109 tests, one showing incorrect lowering of SUBS. NFC
Also added global-isel coverage for the same file.
2022-10-03 15:08:46 +01:00
Igor Kirillov a94a85552c [LoopVectorize] Add missing test for D133687 2022-10-03 14:54:17 +01:00
Christian Sigg 5faebb5624 [mlir][shape] fix test added in 9f77909.
The stderr to stdout piping results in the two streams being interleaved on Windows.
Write stderr to a temp-file instead and run separate FileCheck on it.
2022-10-03 15:48:23 +02:00
Tomasz Kamiński 73716baa30 [analyzer][NFC] Add tests for D132236
D132236 would have introduced regressions in the symbol lifetime
handling. However, the testsuite did not catch this, so here we have
some tests, which would have break if D132236 had landed.

This patch addresses the comment https://reviews.llvm.org/D132236#3753238

Co-authored-by: Balazs Benics <balazs.benics@sonarsource.com>

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D134941
2022-10-03 15:42:38 +02:00
Hansang Bae 772fb97c0b [OpenMP] Ignore schedule modifier in static scheduling
The modifier bits in the schedule type is not used/supported in the
static scheduler, so it should be ignored.

Differential Revision: https://reviews.llvm.org/D134983
2022-10-03 08:29:57 -05:00
chenglin.bi b0fff3db6a [ARM64EC][clang-cl] Add /arm64EC flag
Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D134788
2022-10-03 21:20:51 +08:00
Nico Weber 248237364b [lld/mac] Extract a reportUndefinedSymbol function
Makes things look more similar to the ELF port, and removes some
slightly deep nesting.

No behavior change.

Differential Revision: https://reviews.llvm.org/D135032
2022-10-03 09:17:57 -04:00
Alex Zinenko 8291fa0817 [mlir] fix markdown headers in structured ops doc 2022-10-03 13:17:10 +00:00
Markus Böck 36af4c8418 [SelectionDAG] Fix use-after-free introduced in D130881
The code introduced in https://reviews.llvm.org/D130881 has a bug as it may cause a use-after-free error that can be caught by ASAN.
The bug essentially boils down to iterator invalidation of `DenseMap`. The expression `SDEI[To] = I->second;` may cause `SDEI` to grow if `To` is inserted for the very first time. When that happens, all existing iterators to the map are invalidated as their backing storage has been freed. Accessing `I->second` is then invalid and attempts to access freed memory (as `I` is an iterator of `SDEI`).

This patch fixes that quite simply by first making a copy of `I->second`, and then moving into the possibly newly inserted KV of the ` DenseMap`.

No test attached as I am not sure it is practible to test.

Differential revision: https://reviews.llvm.org/D135019
2022-10-03 15:09:14 +02:00
Hans Wennborg 20a269cf77 Revert "[CMake] Use libcxx-abi-* targets for in-tree sanitizer C++ ABI"
It casued some runtimes builds to fail with cmake error

  No target "libcxx-abi-static"

see code review.

> When in-tree libcxx is selected as the sanitizer C++ ABI, use
> libcxx-abi-* targets rather than libcxxabi and libunwind directly.
>
> Differential Revision: https://reviews.llvm.org/D134855

This reverts commit 414f9b7d2f.
2022-10-03 14:56:07 +02:00
Alex Richardson 0a893cfb44 [libc++] Avoid relying on non-portable behaviour in std::align
Round-tripping pointers via size_t is not portable, the C/C++ standards
only require this to be valid when using (u)intptr_t.
Originally committed to the CHERI fork of LLVM as
dd01245185,
but I forgot to upstream the change. I rediscovered this issue due to a
compiler warning when building libc++ on a Arm Morello system.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D134363
2022-10-03 12:45:21 +00:00
Tobias Gysi 12b68ad886 [mlir][llvmir] Add filename debug info when converting from LLVMIR.
The revision enriches the debug locations generated during LLVMIR to MLIR translation with file name information and adds a separate test to exercise the debug location translation.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135069
2022-10-03 15:14:37 +03:00
Rainer Orth 1774a8a763 [flang] Add Sparc support to Optimizer/CodeGen/Target.cpp
As described in Issue #57642, `flang` currently lacks SPARC support in
`Optimizer/CodeGen/Target.cpp`, which causes a considerable number of tests
to `FAIL` with

  error: flang/lib/Optimizer/CodeGen/Target.cpp:310: not yet implemented:
target not implemented

This patch fixes this by following GCC`s documentation of the ABI described
in the Issue.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D133561
2022-10-03 14:03:35 +02:00
Petar Avramovic 1fa2019828 [SelectionDAG] Add check for BUILD_VECTOR in isKnownNeverNaN
Includes handling of constants with vector type in isKnownNeverNaN.
For AMDGPU results in not making fcanonicalize during legalization
for vector inputs to fmaxnum_ieee and fminnum_ieee. Does not affect
end result since there is a combine that eliminates fcanonicalize.

Differential Revision: https://reviews.llvm.org/D88573
2022-10-03 12:47:07 +02:00
Bjorn Pettersson 66fcdfca4d [Analysis][SimplifyLibCalls] Refactor code related to size_t in lib func signatures. NFC
Added a helper in TargetLibraryInfo to get size of "size_t" in bits,
given a Module reference. The new getSizeTSize helper is using the
same strategy as for example isValidProtoForLibFunc has been using
in the past, assuming that the size can be derived by asking
DataLayout about the size/type of a pointer to int.

FortifiedLibCallSimplifier::optimizeStrpCpyChk was changed to use
the new getSizeTSize helper instead of assuming that sizeof(size_t)
is equal to sizeof(int*) by itself (that is the assumption used in
TargetLibraryInfoImpl::getSizeTSize so the result will be the same).

Having a common helper for this ensure that we use the same strategy
when deriving the size of "size_t" in different parts of the code.
One bonus with this refactoring (basing it on Module instead of just
DataLayout) is that it makes it easier to override this for a specific
target triple, in case the assumption of using getPointerSizeInBits
wouldn't hold.

Differential Revision: https://reviews.llvm.org/D110585
2022-10-03 12:02:50 +02:00
Javier Setoain 8199a43a89 [mlir][Affine] Add pass options to supervectorizer
The only current options to create a supervectorization pass from an
external dialect is to use `createSuperVectorizePass` with the virtual
vector dimensions as a parameter, but the pass accepts other parameters.

This patch enables external users to create a supervectorizer pass
exposing all available option.

Differential Revision: https://reviews.llvm.org/D134632
2022-10-03 10:50:31 +01:00
Jean Perier eb1eb7a144 [flang] Do not resolve TRIM/REPEAT length to its argument length
For TRIM and REPEAT calls, semantics was creating ProcedureDesignators
using the length parameter of the arguments. This caused bugs when
folding LEN(TRIM(char_explicit_constant_length)). The same did not
appeared in folding for REPEAT because it is rewritten at a higher
level to LEN(c)*N.

This is not only a folding issue since any place (like lowering) may
try to use the bad length parameter from the created ProcedureDesignator.

Update intrinsic resolution to not copy the length parameter for TRIM
and REPEAT.

Differential Revision: https://reviews.llvm.org/D134970
2022-10-03 11:42:41 +02:00
Max Kazantsev a34b5212ec [Test] Add test showing that Constraint Elimination can deal with case where SCEV fails 2022-10-03 16:41:22 +07:00
Weining Lu 6faac7b822 [DebugInfo][test] XFAIL DebugInfo/Generic/missing-abstract-variable.ll on LoongArch
The same as SPARC and RISCV. See D119122.

Differential Revision: https://reviews.llvm.org/D134932
2022-10-03 17:11:54 +08:00
Valentin Clement a89b04805a
[flang][NFC] Use prefixed accessors for fircg dialect
The raw accessor is going away soon so switch to prefixed accessors in the
fircg dialect. The main dialect was switched some months ago.

https://github.com/llvm/llvm-project/issues/58090

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D135061
2022-10-03 11:02:43 +02:00
Alvin Wong d90633a74b [Clang][MinGW][cygwin] Fix __declspec with -fdeclspec enabled
Fixes https://github.com/llvm/llvm-project/issues/49958

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D135027
2022-10-03 10:58:45 +03:00
Alvin Wong 0ce4f57052 [LLD][COFF] Reduce chance of symbol name collision with delay-load
Delay-loaded imports creats a load thunk with a symbol name. Before this
change, the name uses a `__imp_load_` prefix. On the other hand, normal
import uses the `__imp_` prefix for the import address pointer. If an
import symbol named `load_func` is imported normally and another named
`func` is imported using delay-load, this can cause a symbol name
collision.

This patch changes delay-load imports to use `__imp___load_` prefix.
Because it is less likely for normal imports to have a name starting in
`__load_` this should reduce the chance of a name collision.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D134464
2022-10-03 10:58:45 +03:00
Alvin Wong e2e132c5d9 [LLD][COFF] Set OrdinalBase to 1 for export table
Before this, LLD sets OrdinalBase to 0, which deviates from usual
practices. This technically would allow LLD to export a symbol using
ordinal 0, however LLD never use export ordinal 0, which results in
binaries with export tables always having an empty export at ordinal 0.

This change makes LLD set OrdinalBase to 1 and not create the empty
export with ordinal 0, which makes its behaviour more in line with both
the MSVC linker and the GNU linker.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D134140
2022-10-03 10:58:44 +03:00
Vitaly Buka dd9dfb57da [libc++] Remove a part of reverted D131898 or D130695 2022-10-03 00:51:21 -07:00
Vitaly Buka 724af35849 Revert "[libc++] Updates generated transitve includes."
Looks like a part of reverted D131898.

This reverts commit cfd5b8f111.
2022-10-03 00:42:55 -07:00