Commit Graph

427231 Commits

Author SHA1 Message Date
Kazu Hirata 4271a1ff33 [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 10:17:22 -07:00
Jacques Pienaar eca86cb2ed [mlir] Start migrating more dialects to prefixed form
Marked all dialects that could be (reasonably) easily flipped to _Both
prefix. Updating the accessors to prefixed form will happen in follow
up, this was to flush out conflicts and to mark all dialects explicitly
as I plan to flip OpBase default to _Prefixed to avoid needing to
migrate new dialects.

Except for Standalone example which got flipped to _Prefixed.

Differential Revision: https://reviews.llvm.org/D128027
2022-06-18 10:10:31 -07:00
Simon Pilgrim 37185ceac9 [Object] Make IsLittleEndian check constexpr to silence static analyzer dead code warnings.
The "ELFT::TargetEndianness == support::little" check is known at compile time
2022-06-18 17:35:54 +01:00
Simon Pilgrim ac3f967382 [X86] canonicalizeShuffleWithBinOps - merge shuffles across binops if either source op is a known splat
The shuffle of a splat (with no undefs) should always be removed
2022-06-18 17:14:00 +01:00
Kazu Hirata b254d67160 [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 08:32:54 -07:00
Nikolas Klauser 3766992291 [libc++] Add Implemented Papers section
Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D127674
2022-06-18 17:29:31 +02:00
Nikolas Klauser 55cb62f34a [libc++] Enable -Wweak-vtables
This makes Clang scream at us if there is a class without a key function.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D127900
2022-06-18 17:27:33 +02:00
Guillaume Chatelet 17e68156f6 [NFC][Alignment] Remove dead code 2022-06-18 15:00:55 +00:00
Simon Pilgrim f42f2b7005 [X86] canonicalizeShuffleWithBinOps - merge unary shuffles across binops if either source op is a foldable load
This mostly handles folding of constants that have already become loads, but we expose some generic load cases as well.

This also exposes the chance to merge unary shuffles across X86ISD::ANDNP nodes with different scalar widths
2022-06-18 15:58:54 +01:00
Yuki Okushi 7eb046624f
Prefer `getCurrentFileOrBufferName` in `FrontendAction::EndSourceFile`
`getCurrentFile` here causes an assertion on some condition.
`getCurrentFileOrBufferName` is preferrable instead.

llvm#55950

Differential Revision: https://reviews.llvm.org/D127509
2022-06-18 23:48:30 +09:00
Kazu Hirata 4533e6aab8 [AsmParser] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
2022-06-18 07:46:03 -07:00
Kazu Hirata 621f58e716 [Target, CodeGen] Use isImm(), isReg(), etc (NFC) 2022-06-18 07:41:04 -07:00
Simon Pilgrim d915b3e485 [X86] Regenerate sar_fold.ll to show all instructions 2022-06-18 15:21:41 +01:00
Simon Pilgrim 91e2956232 [X86] Use X86 instead of X32 for i686 check prefixes
We try to reserve X32 check prefixes for gnux32 triple tests
2022-06-18 15:16:15 +01:00
Simon Pilgrim 3c9123af9f [X86] isShuffleFoldableLoad - ensure the load has one use.
We'll only fold the load if has one use. Makes no difference to existing tests but will be necessary for an upcoming patch to improve load folding as part of canonicalizeShuffleWithBinOps.
2022-06-18 14:51:55 +01:00
Jun Zhang cd64a427ef
Reland "[CodeGen] Keep track info of lazy-emitted symbols in ModuleBuilder"
This reverts commits:
d3ddc251ac
d90eecff5c

It turned out there're some options turned on that leaks the memory
intentionally, which fires the asan builds after the patch being
applied. The issue has been fixed in
7bc00ce5cd, so reland it.

Below is the original commit message:

The intent of this patch is to selectively carry some states over to
the Builder so we won't lose the information of the previous symbols.

This used to be several downstream patches of Cling, it aims to fix
errors in Clang Interpreter when trying to use inline functions.
Before this patch:

clang-repl> inline int foo() { return 42;}
clang-repl> int x = foo();

JIT session error: Symbols not found: [ _Z3foov ]
error: Failed to materialize symbols:
{ (main, { x, $.incr_module_1.__inits.0, __orc_init_func.incr_module_1 }) }

Co-authored-by: Axel Naumann <Axel.Naumann@cern.ch>
Signed-off-by: Jun Zhang <jun@junz.org>
2022-06-18 20:27:21 +08:00
Simon Pilgrim 3ea1422362 [CodeGen] Add back setOperationAction/setLoadExtAction/setLibcallName single opcode variants
The work to add ArrayRef helpers (D122557, D123467 etc.) to the TargetLowering::set* methods resulted in all the single opcode calls to these methods being cast to single element ArrayRef on the fly - resulting in a scary >5x increase in build time (identified with vcperf) on MSVC release builds of most of the TargetLowering/ISelLowering files.

This patch adds the back the single opcode variants to various set*Action calls to avoid this issue for now, and updates the ArrayRef helpers to wrap them - I'm still investigating whether the single element ArrayRef build times can be improved.
2022-06-18 13:02:05 +01:00
Pavel Iliin 6e070c3c91 [NFC] Specifing clang namespace for builtins. 2022-06-18 10:44:25 +01:00
Konstantin Varlamov d417710c3a [libc++][ranges][NFC] Fix a format error on the ranges status page. 2022-06-18 02:22:26 -07:00
Matthias Springer 99260e9583 [mlir][bufferization] Set emitAccessorPrefix dialect flag
Generate get/set accessors on all bufferization ops. Also update all internal uses.

Differential Revision: https://reviews.llvm.org/D128057
2022-06-18 10:26:29 +02:00
Benjamin Kramer 745a4caaeb [mlir] Fix an msvc warning
Float16bits.cpp(148): warning C4067: unexpected tokens following preprocessor directive - expected a newline
2022-06-18 10:07:51 +02:00
Siva Chandra be6af89f85 [libc] Add TLS image initialization to aarch64 startup code.
The TLS loader test has been enabled for aarch64.
Handling of PT_TLS' filesz and memsz for x86_64 has also been fixed.

Reviewed By: jeffbailey

Differential Revision: https://reviews.llvm.org/D128032
2022-06-17 22:50:14 -07:00
Han-Kuan Chen e29133629b [MachineCopyPropagation][RISCV] Fix D125335 accidentally change control flow.
D125335 makes regsOverlap skip following control flow, which is not entended
in the original code.

Differential Revision: https://reviews.llvm.org/D128039
2022-06-17 21:40:08 -07:00
Han-Kuan Chen dbfb00a930 [MachineCopyPropagation][RISCV] Add test case showing failure for MachineCopyPropagation. NFC
This is a pre-commit test cases for D128039.

Differential Revision: https://reviews.llvm.org/D128040
2022-06-17 21:39:53 -07:00
NAKAMURA Takumi 0716b3ec09 [Bazel] Rename generated *_main.cpp to [tool-name]-driver.cpp which CMake uses.
Fixup to llvmorg-15-init-12347-gf06abbb39380
The difference of basename affects its emitted object file.

FIXME: Each rule's name is left as origin.
2022-06-18 13:35:23 +09:00
Chris Bieneman 0f6ab346fd bzero->memset - Fix Windows bots
How does Windows not have bzero? How did I break this while working on
a Windows-specific component of LLVM?

The world may never know...
2022-06-17 21:41:58 -05:00
Chris Bieneman 2af61e620e [DirectX] Add DirectX target object writer
This is the last piece to bring together writing DXContainer files
containing DXIL through the DirectX backend.

While this change only has one test, all of the tests under
llvm/test/tools/dxil-dis also exercise this code. With this change the
output object file type for the dxil target is now DXContainer. Each of
the existing tests will generate DXContainer files, and the dxil-dis
tests additionally verify that the DXContainers generated are
well-formed and can be parsed by the DirectXShaderCompiler tools.

Depends on D127153 and D127165

Differential Revision: https://reviews.llvm.org/D127166
2022-06-17 21:33:08 -05:00
LLVM GN Syncbot 7022e6d0f2 [gn build] Port 3adc908b26 2022-06-18 02:23:50 +00:00
Chris Bieneman 3adc908b26 [DirectX][MC] Add MC support for DXContainer
DXContainer files resemble traditional object files in that they are
comprised of parts which resemble sections. Adding DXContainer as an
object file format in the MC layer will allow emitting DXContainer
objects through the normal object emission pipeline.

Differential Revision: https://reviews.llvm.org/D127165
2022-06-17 21:19:32 -05:00
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