Commit Graph

427202 Commits

Author SHA1 Message Date
Chris Bieneman 3942f8e476 [DirectX] Add DXILAsmPrinter
The DXILAsmPrinter will just write globals into sections, so the
DXILAsmPrinter only needs support for emitting global variables, and is
otherwise a stub.

Depends on D127147

Differential Revision: https://reviews.llvm.org/D127153
2022-06-17 21:17:17 -05:00
Chris Bieneman c0320df9f5 [DirectX] Add MC Register and Frame stubs
This patch adds no-op stubs overrides for the MCRegisterInfo and
MCFrameLowering for the DirectX/DXIL code generation path.

Since DXIL will not generate MCInstrs these stubs do nothing, but they
need to exist so that the MC layer can be used to emit DXContainer
objects.

Differential Revision: https://reviews.llvm.org/D127147
2022-06-17 21:08:17 -05:00
Felipe de Azevedo Piovezan c20381b226 llvm-dwarf-dump: include type name for AT_containing_type
Type attributes are currently printed as:
  DW_AT_type    (<address> "<name>")
For example:
  DW_AT_type    (0x00000086 "double")

However, containing_type attributes omit the name, for example:
  DW_AT_containing_type    (0x00000086)

In order to make the dwarf dumps easier to read, and to have consistency
between the type-like attributes, this commit changes the way
DW_AT_containing_type is printed so that it includes the name of the
type it refers to:
  DW_AT_containing_type    (0x00000086 "double")

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D127078
2022-06-18 00:52:34 +00:00
Vitaly Buka f0ca0a324f [CodeGen] Init EmptyExpr before the first use 2022-06-17 17:40:06 -07:00
David Blaikie 23d6f31a90 Add unit test coverage for cast<T> assertion failures on invalid cast 2022-06-18 00:36:12 +00:00
Akira Hatanaka 8fc3d719ee Stop wrapping GCCAsmStmts inside StmtExprs to destruct temporaries
Instead, just pop the cleanups at the end of the asm statement.

This fixes an assertion failure in BuildStmtExpr. It also fixes a bug
where blocks and C compound literals were destructed at the end of the
asm statement instead of at the end of the enclosing scope.

Differential Revision: https://reviews.llvm.org/D125936
2022-06-17 17:28:00 -07:00
Michael Jones 121c645414 [libc] add printf pointer conv
The pointer converter handles the %p conversion. It uses the hex
converter for most of the conversion.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D127995
2022-06-17 17:18:13 -07:00
Huan Nguyen 28b1dcb122 [BOLT] Allow function fragments to point to one jump table
Resolve a crash related to split functions

Due to split function optimization, a function can be divided to two

fragments, and both fragments can access same jump table. This
violates 
the assumption that a jump table can only have one parent
function, 
which causes a crash during instrumentation.

We want to support the case: different functions cannot access same
jump tables, but different fragments of same function can!

As all fragments are from same function, we point JT::Parent to one
specific fragment. Right now it is the first disassembled fragment, but
we can point it to the function's main fragment later.

Functions are disassembled sequentially. Previously, at the end of
processing a function, JT::OffsetEntries is cleared, so other fragment
can no longer reuse JT::OffsetEntries. To extend the support for split
function, we only clear JT::OffsetEntries after all functions are
disassembled.

Let say A.hot and A.cold access JT of three targets {X, Y, Z}, where
X and Y are in A.hot, and Z is in A.cold. Suppose that A.hot is
disassembled first, JT::OffsetEntries = {X',Y',INVALID_OFFSET}. When
A.cold is disassembled, it cannot reuse JT::OffsetEntries above due to
different fragment start. A simple solution:
A.hot  = {X',Y',INVALID_OFFSET}
A.cold = {INVALID_OFFSET, INVALID_OFFSET, INVALID_OFFSET}

We update the assertion to allow different fragments of same function
to get the same JumpTable object.

Potential improvements:
A.hot  = {X',Y',INVALID_OFFSET}
A.cold = {INVALID_OFFSET, INVALID_OFFSET, Z'}
The main issue is A.hot and A.cold have separate CFGs, thus jump table
targets are still constrained within fragment bounds.

Future improvements:
A.hot  = {X, Y, Z}
A.cold = {X, Y, Z}

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D127924
2022-06-17 16:22:30 -07:00
bixia1 e5e7e51473 [mlir][sparse][taco] Support complex types.
Support complex types of float and double. See the added test for an example.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D128076
2022-06-17 16:06:53 -07:00
Arthur Eubanks 2538a411ff [test][RPOFuncAttrs] Update norecurse.ll
Use opaque pointers, remove obsolete FIXMEs, precommit test.
Add extra `CHECK-NOT: norecurse`s because it can appear before the checked attributes.
2022-06-17 15:55:45 -07:00
Christopher Bate 829c84ec5b [mlir][nvgpu] fix MSVC warning regarding left shift
Differential Revision: https://reviews.llvm.org/D128088
2022-06-17 16:26:40 -06:00
Jonas Devlieghere 91688716ba
[lldb] Fix modernize-use-equals-default warnings (NFC)
Fix modernize-use-equals-default warnings. Because this check is listed
in LLDB's top level .clang-tidy configuration, the check is enabled by
default and the resulting warnings show up in my editor.

I've audited the modified lines. This is not a blind change.
2022-06-17 15:08:02 -07:00
Jonas Devlieghere 9916633997
[lldb] Fix modernize-use-override warnings (NFC)
Fix modernize-use-override warnings. Because this check is listed in
LLDB's top level .clang-tidy configuration, the check is enabled by
default and the resulting warnings show up in my editor.

I've audited the modified lines. This is not a blind change.
2022-06-17 15:08:02 -07:00
Jan Svoboda 92c6ffa14c [clang][driver] Ensure we don't accumulate entries in -MJ files
Previously, each job would overwrite the -MJ file. This didn't quite work for Clang invocations with multiple architectures, which got fixed in D121997 by always appending to the -MJ file. That's not correct either, since the file would grow indefinitely on subsequent Clang invocations. This patch ensures the driver always removes the file before jobs fill it in by appending.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D128098
2022-06-18 00:00:43 +02:00
Sunho Kim 7bc00ce5cd [clang-repl] Remove memory leak of ASTContext/TargetMachine.
Removes memory leak of ASTContext and TargetMachine. When DisableFree is turned on, it intentionally leaks these instances as they can be trivially deallocated. This patch turns this off and delete Parser instance early so that they will not reference dangling pargma headers.

Asan shouldn't detect these as leaks normally, since burypointer is called for them. But, every invocation of incremental parser createa an additional leak of TargetMachine. If there are many invocations within a single test case, we easily reach number of leaks exceeding kGraveYardMaxSize (which is 12) and leaks start to get reported by asan buildbots.

Reviewed By: v.g.vassilev

Differential Revision: https://reviews.llvm.org/D127991
2022-06-18 06:36:25 +09:00
Louis Dionne 8da8b61430 [libc++] Make sure we install libc++abi headers on Apple
Differential Revision: https://reviews.llvm.org/D127526
2022-06-17 17:35:05 -04:00
Dave Lee 4cc8f2a017 [lldb][tests] Automatically call compute_mydir (NFC)
Eliminate boilerplate of having each test manually assign to `mydir` by calling
`compute_mydir` in lldbtest.py.

Differential Revision: https://reviews.llvm.org/D128077
2022-06-17 14:34:49 -07:00
Louis Dionne 303c4c37ea [libc++] Don't force -O2 when building the benchmarks
The optimization level used when building the benchmarks should
match the optimization level of the current build. Otherwise, we
can end up mixing an -O3 or -O0 optimized dylib with benchmarks
built with -O2, which is really misleading.

Differential Revision: https://reviews.llvm.org/D127987
2022-06-17 17:34:02 -04:00
Craig Topper cbf6737cc4 [RISCV] Use RVVBitsPerBlock instead of hardcoding multiples of 64. NFC 2022-06-17 14:10:39 -07:00
Benjamin Kramer d5c29b23e1 [mlir][sparse] Inline the definition of LLVM_ATTRIBUTE_WEAK
This library is supposed not to have a dependency on LLVM, and linking
LLVMSupport into it breaks its shared library setup.
2022-06-17 22:41:10 +02:00
Rafael Auler 9d5e6ccd9b [BOLT] Fix for missing entry offset
Temporary fix for missing entry offset when creating address
translation tables (BAT) after D127935 landed. Will later work on
assigning a more reasonable offset different than zero.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D128092
2022-06-17 13:14:42 -07:00
Benjamin Kramer feb8313fbf [bazel] Add missing dependency after 455679413
This is supposed to be header-only. Don't know how to express that in
bazel.
2022-06-17 22:09:13 +02:00
Benjamin Kramer 3420cd7caf [mlir][sparse] Add testing for bf16 and fallback for software bf16
This adds weak versions of the truncation libcalls in case the runtime
environment doesn't have them.

Differential Revision: https://reviews.llvm.org/D128091
2022-06-17 21:54:01 +02:00
Aart Bik 86d5d34c72 [mlir][sparse] renable f16 tests
Sparse library ABI issues are fixed.

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

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D128086
2022-06-17 12:48:24 -07:00
Philip Reames fb8ecca06f [RISCV] Remove redundant code checking for exact VTYPE match [nfc]
Should be fully covered by the generic demanded field based logic just below, and this ensures better coverage of that logic.
2022-06-17 12:20:20 -07:00
Philip Reames 4d245f1bc2 [RISCV] Move store policy and mask reg ops into demanded handling in InsertVSETVLI
Doing so let's the post-mutation pass leverage the demanded info to rewrite vsetvlis before a store/mask-op to eliminate later vsetvlis.

Sorry for the lack of store test change; all of my attempts to write something reasonable have been handled through existing logic.
2022-06-17 12:09:50 -07:00
Florian Hahn e9cced2739
Recommit "[LAA] Initial support for runtime checks with pointer selects."
This reverts commit 7aa8a67882.

This version includes fixes to address issues uncovered after
the commit landed and discussed at D11448.

Those include:

* Limit select-traversal to selects inside the loop.
* Freeze pointers resulting from looking through selects to avoid
  branch-on-poison.
2022-06-17 21:06:26 +02:00
Sanjay Patel f126643862 [AArch64] add tests for masked subtract; NFC 2022-06-17 14:56:32 -04:00
Nikolas Klauser db1978b674 [libc++] Mark standard-mandated includes as such
Reviewed By: ldionne, Mordante, #libc, saugustine

Spies: saugustine, MaskRay, arichardson, mstorsjo, jloser, libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D127953
2022-06-17 20:43:33 +02:00
Chris Bieneman d5745d0015 [docs] Adding table of object file formats
The added section and table here list the object file formats LLVM MC
supports and which targets support each format.

Differential Revision: https://reviews.llvm.org/D127645
2022-06-17 13:37:52 -05:00
Chris Bieneman f9e49644f4 Revert "wip"
This reverts commit 0dd243fa8a.

I accidentally pushed this! Oops!
2022-06-17 13:36:53 -05:00
Frederik Gossen e694b22344 [mlir][nvgpu] Fix Bazel BUILD file
Differential Revision: https://reviews.llvm.org/D128078
2022-06-17 14:35:30 -04:00
Chris Bieneman 5b77a45c7f [docs] Adding DirectX target usage doc
This document is a work in progress to begin fleshing out documentation
for the DirectX backend and related changes in the LLVM project.

This is not intended to be exhaustive or complete, it is intended as a
starting
point so taht future changes have a place for documentation to land.

Differential Revision: https://reviews.llvm.org/D127640
2022-06-17 13:34:25 -05:00
Chris Bieneman 0dd243fa8a wip 2022-06-17 13:34:21 -05:00
Arthur Eubanks 05704e785a [docs] Fix typo 2022-06-17 11:29:07 -07:00
isuckatcs e77ac66b8c [Static Analyzer] Structured binding to data members
Introducing structured binding to data members.

Differential Revision: https://reviews.llvm.org/D127643
2022-06-17 19:50:10 +02:00
Stanislav Gatev ba53906cef [clang][dataflow] Add support for comma binary operator
Add support for comma binary operator.

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

Reviewed-by: ymandel, xazax.hun
2022-06-17 17:48:21 +00:00
Philip Reames b595cddea7 [riscv] Extract isMaskRegOp helper [nfc] 2022-06-17 10:40:54 -07:00
Nico Weber 527395bd10 [gn build] (manually) port 2040b6df0a (DebugInfoSymbolizerTests) 2022-06-17 13:37:11 -04:00
Daniel Thornburgh 2040b6df0a [Symbolize] Parser for log symbolizer markup.
This adds a parser for the log symbolizer markup format discussed in
https://discourse.llvm.org/t/rfc-log-symbolizer/61282. The parser
operates in a line-by-line fashion with minimal memory requirements.

This doesn't yet include support for multi-line tags or specific parsing
for ANSI X3.64 SGR control sequences, but it can be extended to do so.
The latter can also be relatively easily handled by examining the
resulting text elements.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D124686
2022-06-17 10:26:24 -07:00
Kiran Chandramohan 914b9eec04 [Flang] Fixes for XArrayCoorOp
The upstreamed code was not incrementing the sliceOffset in multiples
of 3. This issue is fixed by using Offsets and incrementing by 3 during
every iteration.
In the conversion pattern, we were comparing the definingOp of an
operand with an FIR::UndefOp. Use LLVM::UndefOp for conversion.

Reviewed By: clementval, Leporacanthicus

Differential Revision: https://reviews.llvm.org/D128017
2022-06-17 17:14:55 +00:00
LLVM GN Syncbot fd5a26e610 [gn build] Port 971e9c80e9 2022-06-17 17:10:15 +00:00
Nikolas Klauser 971e9c80e9 [libc++] Implement std::boyer_moore{, _horspool}_searcher
This mostly copys the `<experimental/functional>` stuff and updates the code to current libc++ style.

Reviewed By: ldionne, #libc

Spies: nlopes, adamdebreceni, arichardson, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D121074
2022-06-17 19:09:40 +02:00
Philip Reames e1f1407beb [RISCV] Delete dead elideCopy code in InsertVSETVLI [nfc]
This code should be dead. A simple whole register copy of an IMPLICIT_DEF, is simply an IMPLICIT_DEF of it's own. (This would not be true for freeze, but is for copy.)  If we find a case which gets here with vector operand copy of an IMPLICIT_DEF, we most likely have an earlier missed optimization anyways.  (The most recent case of this was e6c7a3a, found by Craig during review of this patch.)  There might be others, and if so, we'll revisit them individually as regressions are reported.

Differential Revision: https://reviews.llvm.org/D127996
2022-06-17 09:58:11 -07:00
Joe Nash 75378d432f [AMDGPU] NFC. Change comment format on gfx11 interp and ldsdir intrinsics 2022-06-17 12:28:26 -04:00
isuckatcs 92bf652d40 [Static Analyzer] Small array binding policy
If a lazyCompoundVal to a struct is bound to the store, there is a policy which decides
whether a copy gets created instead.

This patch introduces a similar policy for arrays, which is required to model structured
binding to arrays without false negatives.

Differential Revision: https://reviews.llvm.org/D128064
2022-06-17 18:56:13 +02:00
Michael Jones ad709a752d [libc][obvious] fix sign warning in file_writer
In the sign writer, a size_t was being compared to an int. This patch
casts the size_t to an int so that the comparison doesn't cause a sign
comparison warning.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D127984
2022-06-17 09:48:04 -07:00
Nikolas Klauser fb3477a4da [libc++] Unwrap reverse_iterator<reverse_iterator<Iter>> in __unwrap_iter
Simplify the implementation of `std::copy` and `std::move` by using `__unwrap_iter` and `__rewrap_iter` to unwrap and rewrap `reverse_iterator<reverse_iterator<Iter>>` instead of specializing `__copy_impl` and `__move_impl`.

Reviewed By: ldionne, #libc

Spies: wenlei, libcxx-commits

Differential Revision: https://reviews.llvm.org/D127049
2022-06-17 18:47:18 +02:00
Martin Sebor 5fb67e32f8 [InstCombine] Fold memcmp of constant arrays and variable size
The memcmp simplifier is limited to folding to constants calls with constant
arrays and constant sizes.  This change adds the ability to simplify
memcmp(A, B, N) calls with constant A and B and variable N to the pseudocode
equivalent of

N <= Pos ? 0 : (A < B ? -1 : B < A ? +1 : 0)

where Pos is the offset of the first mismatch between A and B.

Differential Revision: https://reviews.llvm.org/D127766
2022-06-17 10:35:35 -06:00
isuckatcs fc6b2281bf [Static Analyzer][CFG] Introducing the source array in the CFG of DecompositionDecl
For DecompositionDecl, the array, which is being decomposed was not present in the
CFG, which lead to the liveness analysis falsely detecting it as a dead symbol.

Differential Revision: https://reviews.llvm.org/D127993
2022-06-17 18:34:34 +02:00