platform/upstream/llvm.git
2 years ago[flang][test] Remove RUN COMMAND/EXPECTED OUTPUT/INPUT markers from other directories
Fangrui Song [Thu, 30 Jun 2022 05:10:59 +0000 (22:10 -0700)]
[flang][test] Remove RUN COMMAND/EXPECTED OUTPUT/INPUT markers from other directories

2 years ago[flang][test] Remove RUN LINES?/EXPECTED OUTPUT.*/INPUT markers from test/Driver
Fangrui Song [Thu, 30 Jun 2022 05:08:02 +0000 (22:08 -0700)]
[flang][test] Remove RUN LINES?/EXPECTED OUTPUT.*/INPUT markers from test/Driver

Follow-up to D128763.

2 years agoUse value_or instead of getValueOr. NFC
Fangrui Song [Thu, 30 Jun 2022 04:55:02 +0000 (21:55 -0700)]
Use value_or instead of getValueOr. NFC

2 years ago[lldb] Fix unused variable warning in TraceHTR (NFC)
Kevin Cadieux [Thu, 30 Jun 2022 04:29:18 +0000 (21:29 -0700)]
[lldb] Fix unused variable warning in TraceHTR (NFC)

A warning was recently introduced in [D128576](https://reviews.llvm.org/D128576) due to now unused lambda `function_name_from_load_address`. This warning causes build failures when treating warnings as errors. This change expands the comment to also include the definition of this lambda, fixing the warning.

Error:
```
[3809/6000] Building CXX object tools/lldb/source/Plugins/TraceExporter/common/CMakeFiles/lldbPluginTraceExporterCommon.dir/TraceHTR.cpp.o
FAILED: tools/lldb/source/Plugins/TraceExporter/common/CMakeFiles/lldbPluginTraceExporterCommon.dir/TraceHTR.cpp.o
/usr/bin/clang++ -DHAVE_ROUND -DLLDB_CONFIGURATION_DEBUG -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/__w/1/b/llvm/Debug/tools/lldb/source/Plugins/TraceExporter/common -I/__w/1/llvm-project/lldb/source/Plugins/TraceExporter/common -I/__w/1/llvm-project/lldb/include -I/__w/1/b/llvm/Debug/tools/lldb/include -I/__w/1/b/llvm/Debug/include -I/__w/1/llvm-project/llvm/include -I/__w/1/llvm-project/llvm/../clang/include -I/__w/1/b/llvm/Debug/tools/lldb/../clang/include -I/__w/1/llvm-project/lldb/source -I/__w/1/b/llvm/Debug/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -g  -fno-exceptions -gsplit-dwarf -std=c++14 -MD -MT tools/lldb/source/Plugins/TraceExporter/common/CMakeFiles/lldbPluginTraceExporterCommon.dir/TraceHTR.cpp.o -MF tools/lldb/source/Plugins/TraceExporter/common/CMakeFiles/lldbPluginTraceExporterCommon.dir/TraceHTR.cpp.o.d -o tools/lldb/source/Plugins/TraceExporter/common/CMakeFiles/lldbPluginTraceExporterCommon.dir/TraceHTR.cpp.o -c /__w/1/llvm-project/lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp
/__w/1/llvm-project/lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp:136:8: error: unused variable 'function_name_from_load_address' [-Werror,-Wunused-variable]
  auto function_name_from_load_address =
```

Reviewed By: wallace

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

2 years ago[lld-macho] Initial support for Linker Optimization Hints
Daniel Bertalan [Fri, 17 Jun 2022 15:21:59 +0000 (17:21 +0200)]
[lld-macho] Initial support for Linker Optimization Hints

Linker optimization hints mark a sequence of instructions used for
synthesizing an address, like ADRP+ADD. If the referenced symbol ends up
close enough, it can be replaced by a faster sequence of instructions
like ADR+NOP.

This commit adds support for 2 of the 7 defined ARM64 optimization
hints:
- LOH_ARM64_ADRP_ADD, which transforms a pair of ADRP+ADD into ADR+NOP
  if the referenced address is within +/- 1 MiB
- LOH_ARM64_ADRP_ADRP, which transforms two ADRP instructions into
  ADR+NOP if they reference the same page

These two kinds already cover more than 50% of all LOHs in
chromium_framework.

Differential Review: https://reviews.llvm.org/D128093

2 years ago[MC] Skip lower-case integer suffixes
Keegan Saunders [Thu, 30 Jun 2022 03:55:05 +0000 (20:55 -0700)]
[MC] Skip lower-case integer suffixes

`mov x0, 1024u` is permitted in binutils but rejected by the integrated
assembler. Support the case. This is especially important when using the C
pre-processor with the assembler: some shared code between C and assembler may
use lower-cased suffices.

Reviewed By: MaskRay

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

2 years ago[Coroutines] Add REQUIRES clause to skip unsupported targets
Chuanqi Xu [Thu, 30 Jun 2022 03:37:28 +0000 (11:37 +0800)]
[Coroutines] Add REQUIRES clause to skip unsupported targets

2 years ago[Driver] Always use --as-needed with libunwind
Petr Hosek [Wed, 29 Jun 2022 17:57:51 +0000 (17:57 +0000)]
[Driver] Always use --as-needed with libunwind

With libgcc, we follow the behavior of GCC for backwards compatibility,
only using --as-needed in the non-C++ mode.

With libunwind, there are no backward compatibility requirements so we
can always use --as-needed on all supported platforms.

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

2 years ago[WebAssembly] Don't set musttail for coroutines when tail-call is not
Chuanqi Xu [Wed, 29 Jun 2022 04:48:48 +0000 (12:48 +0800)]
[WebAssembly] Don't set musttail for coroutines when tail-call is not
enabled

The C++20 Coroutines couldn't be compiled to WebAssembly due to an
optimization named symmetric transfer requires the support for musttail
calls but WebAssembly doesn't support it yet.

This patch tries to fix the problem by adding a supportsTailCalls
method to TargetTransformImpl to skip the symmetric transfer when
tail-call feature is not supported.

Reviewed By: tlively

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

2 years ago[greedyalloc] Return early when there is no register to allocate.
Luo, Yuanke [Wed, 29 Jun 2022 11:13:16 +0000 (19:13 +0800)]
[greedyalloc] Return early when there is no register to allocate.

In X86 we split greddy register allocation into 2 passes. The 1st pass
is to allocate tile register, and the 2nd pass is to allocate the rest
of virtual register. In most cases there is no tile register, so the 1st
pass is unnecessary. To improve the compiling time, we check if there is
any register need to be allocated by invoking callback
`ShouldAllocateClass`. If there is no register to be allocated, just
return false in the pass. This would improve the 1st greed RA pass for
normal cases.

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

2 years ago[RISCV][NFC] Move static global variables into static variable in function.
Kito Cheng [Thu, 30 Jun 2022 02:28:21 +0000 (10:28 +0800)]
[RISCV][NFC] Move static global variables into static variable in function.

It's violate coding guideline in LLVM coding standard[1], because the  the initialization order is nondeterministic and that might increase the launch time of programs.

However these variables are only used to cache query result, so we can move these variables into the function,, that which resolve both issue: 1. initialized in deterministic order, 2. Initialized that when the first time used.

[1] https://llvm.org/docs/CodingStandards.html#do-not-use-static-constructors

Reviewed By: MaskRay

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

2 years ago[ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx...
Fangrui Song [Thu, 30 Jun 2022 01:53:38 +0000 (18:53 -0700)]
[ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC

2 years ago[InstCombine] Use known bits to determine exact int->fp cast
zhongyunde [Thu, 30 Jun 2022 01:43:43 +0000 (09:43 +0800)]
[InstCombine] Use known bits to determine exact int->fp cast

Reviewed By: spatel, nikic

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

2 years ago[clang][BPF] Update comment to include TYPE_MATCH
Daniel Müller [Thu, 30 Jun 2022 01:31:02 +0000 (18:31 -0700)]
[clang][BPF] Update comment to include TYPE_MATCH

D126838 added support for the TYPE_MATCH compile-once run-everywhere
relocation to LLVM proper. On the clang side no changes are necessary,
other than the adjustment of a comment to mention this relocation as well.
This change takes care of that.

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

2 years ago[mlir][sparse] auto-insertion of conversion to resolve cycles
Aart Bik [Wed, 29 Jun 2022 19:33:01 +0000 (12:33 -0700)]
[mlir][sparse] auto-insertion of conversion to resolve cycles

When the iteration graph is cyclic (even after several attempts using less and less constraints), the current sparse compiler bails out, and no rewriting hapens. However, this revision adds some new logic where the sparse compiler tries to find a single input sparse tensor that breaks the cycle, and then adds a proper sparse conversion operation. This way, more incoming kernels can be handled!

Note, the resulting code is not optimal (although it keeps more or less proper "sparse" complexity), and more improvements should be added (especially when the kernel directly yields without computation, such as the transpose example). However, handling is better than not handling ;-)

Reviewed By: bixia

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

2 years ago[BPF] Introduce support for type match relocations
Daniel Müller [Thu, 30 Jun 2022 01:20:37 +0000 (18:20 -0700)]
[BPF] Introduce support for type match relocations

Among others, BPF currently supports the type-exists CO-RE relocation
(e.g., see D83878 & D83242). Its intention, as the name tries to convey,
is to be used for checking existence of a type in a target.
While that check is useful and has its place, we would also like to
be able to perform stricter type queries: instead of just checking mere
existence, we want to make sure that members match up in composite
types, that enum variants are present, etc. We refer to this as "type
match".

This change proposes the addition of a new relocation variant/value that
we intend to use for establishing this match relation.

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

2 years agoRevert "[Debuginfo][DWARF][NFC] Refactor DwarfStringPoolEntryRef."
Vitaly Buka [Thu, 30 Jun 2022 00:52:47 +0000 (17:52 -0700)]
Revert "[Debuginfo][DWARF][NFC] Refactor DwarfStringPoolEntryRef."

Breaks msan bot, see D126883

This reverts commit 77df3be0dee415713cf5c79543f00532674f428b.

2 years ago[ELF] Move whyExtract/backwardReferences from LinkerDriver to Ctx. NFC
Fangrui Song [Thu, 30 Jun 2022 00:34:30 +0000 (17:34 -0700)]
[ELF] Move whyExtract/backwardReferences from LinkerDriver to Ctx. NFC

Ctx was recently added as a more suitable place for such singletons.

2 years ago[CodeView] Call llvm::codeview::visitMemberRecordStream with the deserialized CVType...
Zequan Wu [Thu, 30 Jun 2022 00:09:40 +0000 (17:09 -0700)]
[CodeView] Call llvm::codeview::visitMemberRecordStream with the deserialized CVType whose kind is FieldListRecord.

llvm::codeview::visitMemberRecordStream expects to receive an array ref that's FieldListRecord's Data not a CVType's data which has 4 more bytes preceeding. The first 2 bytes indicate the size of the FieldListRecord, and following 2 bytes is always 0x1203. Inside llvm::codeview::visitMemberRecordStream, it iterates to the data to check if first two bytes matching some type record kinds. If the size coincidentally matches one type kind, it will start parsing from there and causing crash.

2 years ago[clangd] Also mark output arguments of operator call expressions
Christian Kandeler [Thu, 30 Jun 2022 00:12:36 +0000 (20:12 -0400)]
[clangd] Also mark output arguments of operator call expressions

There's no reason that arguments to e.g. lambda calls should be treated
differently than those to "real" functions.

Reviewed By: nridge

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

2 years ago[lldb] Use assertState in even more tests (NFC)
Jonas Devlieghere [Thu, 30 Jun 2022 00:01:36 +0000 (17:01 -0700)]
[lldb] Use assertState in even more tests (NFC)

Followup to D127355 and D127378, converting more instances of
assertEqual to assertState.

2 years ago[BOLT] Respect shouldPrint in dump-dot-all
Amir Ayupov [Thu, 30 Jun 2022 00:01:02 +0000 (17:01 -0700)]
[BOLT] Respect shouldPrint in dump-dot-all

Don't dump dot CFG graph for functions that should not be printed.

Reviewed By: rafauler, maksfb

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

2 years ago[lldb] Skip instead of XFAIL TestGdbRemote_vContThreads on Darwin
Jonas Devlieghere [Wed, 29 Jun 2022 23:34:28 +0000 (16:34 -0700)]
[lldb] Skip instead of XFAIL TestGdbRemote_vContThreads on Darwin

The two XFAILed tests started timing out after D126983. Given that they
were XFAILed anyway I didn't investigate and just skipped them.

2 years ago[Lex] Make sure to notify `MultipleIncludeOpt` for "read tokens" during fast dependen...
Argyrios Kyrtzidis [Tue, 28 Jun 2022 23:54:42 +0000 (16:54 -0700)]
[Lex] Make sure to notify `MultipleIncludeOpt` for "read tokens" during fast dependency directive lexing

Otherwise a header may be erroneously marked as having a header macro guard and won't get re-included.

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

2 years ago[Polly][MatMul] Abandon dependence analysis.
Michael Kruse [Wed, 29 Jun 2022 21:44:57 +0000 (16:44 -0500)]
[Polly][MatMul] Abandon dependence analysis.

The copy statements inserted by the matrix-multiplication optimization
introduce new dependencies between the copy statements and other
statements. As a result, the DependenceInfo must be recomputed.

Not recomputing them caused IslAstInfo to deduce that some loops are
parallel but cause race conditions when accessing the packed arrays.
As a result, matrix-matrix multiplication currently cannot be
parallelized.

Also see discussion at https://reviews.llvm.org/D125202

2 years ago[lldb] Skip TestAppleSimulatorOSType is simulator isn't available
Jonas Devlieghere [Wed, 29 Jun 2022 22:10:14 +0000 (15:10 -0700)]
[lldb] Skip TestAppleSimulatorOSType is simulator isn't available

Skip TestAppleSimulatorOSType is simulator isn't available for the given
platform.

2 years ago[lldb] XFAIL TestVSCode_breakpointEvents.py on Ventura
Jonas Devlieghere [Wed, 29 Jun 2022 21:58:16 +0000 (14:58 -0700)]
[lldb] XFAIL TestVSCode_breakpointEvents.py on Ventura

TestVSCode_breakpointEvents.py is failing on macOS Ventura because we
receive 3 breakpoint events instead of one. This is likely the result of
dyld moving into the shared cache.

2 years ago[ODRHash diagnostics] Fix typos. NFC.
Volodymyr Sapsai [Wed, 29 Jun 2022 21:59:21 +0000 (14:59 -0700)]
[ODRHash diagnostics] Fix typos. NFC.

2 years ago[ThinLTO][test] Add tests for emitting files in-process
Jin Xin Ng [Tue, 28 Jun 2022 23:27:09 +0000 (16:27 -0700)]
[ThinLTO][test] Add tests for emitting files in-process

Completes D127777 by adding llvm-side tests for emitting index and imports files from in-process ThinLTO

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

2 years agoRevert "[Driver] Always use --as-needed with libunwind"
Petr Hosek [Wed, 29 Jun 2022 21:41:47 +0000 (21:41 +0000)]
Revert "[Driver] Always use --as-needed with libunwind"

This reverts commit 2483b3a9679ed2d92abbdbae6927e022903acc70 since
it broke clang-armv7-vfpv3-full-2stage builder:

  https://lab.llvm.org/buildbot#builders/190/builds/887

2 years ago[BOLT] Fix EH trampoline backout code
Maksim Panchenko [Fri, 24 Jun 2022 23:51:46 +0000 (16:51 -0700)]
[BOLT] Fix EH trampoline backout code

When SplitFunctions pass adds a trampoline code for exception landing
pads (limited to shared objects), it may increase the size of the hot
fragment making it larger than the whole function pre-split. When this
happens, the pass reverts the splitting action by restoring the original
block order and marking all blocks hot.

However, if createEHTrampolines() added new blocks to the CFG and
modified invoke instructions, simply restoring the original block layout
will not suffice as the new CFG has more blocks.

For proper backout of the split, modify the original layout by merging
in trampoline blocks immediately before their matching targets. As a
result, the number of blocks increases, but the number of instructions
and the function size remains the same as pre-split.

Add an assertion for the number of blocks when updating a function
layout.

Reviewed By: rafauler

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

2 years ago[test] Add REQUIRES: zlib to zdebug.yaml
Fangrui Song [Wed, 29 Jun 2022 21:33:21 +0000 (14:33 -0700)]
[test] Add REQUIRES: zlib to zdebug.yaml

2 years agoFix the eh-filter.ll test.
Stefan Pintilie [Wed, 29 Jun 2022 21:13:57 +0000 (16:13 -0500)]
Fix the eh-filter.ll test.

Forgot to add that this test requires asserts.

2 years ago[mlir][LLVMIR] Apply SubElementTypeInterface on suitable types
Min-Yih Hsu [Thu, 19 May 2022 19:07:18 +0000 (12:07 -0700)]
[mlir][LLVMIR] Apply SubElementTypeInterface on suitable types

This feature is tested by unit test since not many places in the codebase
use SubElementTypeInterface.

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

2 years ago[mlir] Prevent SubElementInterface from going into infinite recursion
Min-Yih Hsu [Sat, 21 May 2022 04:52:49 +0000 (21:52 -0700)]
[mlir] Prevent SubElementInterface from going into infinite recursion

Since only mutable types and attributes can go into infinite recursion
inside SubElementInterface::walkSubElement, and there are only a few of
them (mutable types and attributes), we introduce new traits for Type
and Attribute: TypeTrait::IsMutable and AttributeTrait::IsMutable,
respectively. They indicate whether a type or attribute is mutable.
Such traits are required if the ImplType defines a `mutate` function.

Then, inside SubElementInterface, we use a set to record visited mutable
types and attributes that have been visited before.

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

2 years ago[pseudo] Fix bugs/inconsistencies in forest dump.
Sam McCall [Wed, 29 Jun 2022 11:37:55 +0000 (13:37 +0200)]
[pseudo] Fix bugs/inconsistencies in forest dump.

- when printing a shared node for the second time, don't print its children
  (This keeps output proportional to the size of the structure)
- when printing a shared node for the second time, print its type only, not rule
  (for consistency with above: don't dump details of nodes twice)
- don't abbreviate shared nodes, to ensure we can prune the tree there

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

2 years ago[GlobalMerge] Ensure that the MustKeepGlobalVariables has all globals from each landi...
Stefan Pintilie [Wed, 29 Jun 2022 19:33:08 +0000 (14:33 -0500)]
[GlobalMerge] Ensure that the MustKeepGlobalVariables has all globals from each landingpad clause.

The filter clause in the landingpad may not have a GlobalVariable operand.
It may instead have a ConstantArray of operands and each operand within this
ConstantArray should also be checked to see if it is a GlobalVariable.

This patch add the check for the ConstantArray as well as a debug message that
outputs the contents of MustKeepGlobalVariables.

Reviewed By: lei, amyk, scui

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

2 years ago[Fix/Build] Fixing missing dependency for bazel.
rdzhabarov [Wed, 29 Jun 2022 20:43:40 +0000 (20:43 +0000)]
[Fix/Build] Fixing missing dependency for bazel.

2 years ago[Driver] Always use --as-needed with libunwind
Petr Hosek [Wed, 29 Jun 2022 17:57:51 +0000 (17:57 +0000)]
[Driver] Always use --as-needed with libunwind

With libgcc, we follow the behavior of GCC for backwards compatibility,
only using --as-needed in the non-C++ mode.

With libunwind, there are no backward compatibility requirements so we
can always use --as-needed on all supported platforms.

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

2 years ago[AMDGPU] New AMDGPUInsertDelayAlu pass
Jay Foad [Tue, 21 Jun 2022 10:46:28 +0000 (11:46 +0100)]
[AMDGPU] New AMDGPUInsertDelayAlu pass

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

2 years ago[lld-macho] Emit REBASE_OPCODE_ADD_ADDR_IMM_SCALED if possible
Daniel Bertalan [Wed, 29 Jun 2022 09:33:41 +0000 (11:33 +0200)]
[lld-macho] Emit REBASE_OPCODE_ADD_ADDR_IMM_SCALED if possible

An ADD_ADDR rebase opcode's argument can be encoded as an immediate if
the offset is less than 15 * word size. This change reduces the size of
chromium_framework by 100+ KiB.

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

2 years ago[ODRHash diagnostics] Move repetetive code at lambda calls into lambdas themselves...
Volodymyr Sapsai [Thu, 23 Jun 2022 01:08:05 +0000 (18:08 -0700)]
[ODRHash diagnostics] Move repetetive code at lambda calls into lambdas themselves. NFC.

It helps to avoid copy-paste mistakes and makes custom code paths more
noticeable.

Not funnelling all diagnostic through `ODRDiagDeclError` because plan to
break down `err_module_odr_violation_mismatch_decl_diff` into smaller
pieces instead of making it bigger and bigger.

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

2 years ago[Clang] Mark consteval as supported in Clang 15 [NFC]
Corentin Jabot [Wed, 29 Jun 2022 20:21:33 +0000 (22:21 +0200)]
[Clang] Mark consteval as supported in Clang 15 [NFC]

Support was completed by D119646.

2 years ago[AMDGPU] Generate checks for clamp.ll and add GFX11
Jay Foad [Tue, 28 Jun 2022 14:14:00 +0000 (15:14 +0100)]
[AMDGPU] Generate checks for clamp.ll and add GFX11

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

2 years ago[clang][dataflow] Delete SourceLocationsLattice
Sam Estep [Wed, 29 Jun 2022 20:13:56 +0000 (20:13 +0000)]
[clang][dataflow] Delete SourceLocationsLattice

This patch deletes the now-unused `SourceLocationsLattice` class, along with its containing files and surrounding helper functions and tests.

Reviewed By: xazax.hun, ymandel, sgatev, gribozavr2

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

2 years ago[gn] Manual port a7d6c3effe93954ecad634eebbcc59fc6856c3d9
Zequan Wu [Wed, 29 Jun 2022 20:11:04 +0000 (13:11 -0700)]
[gn] Manual port a7d6c3effe93954ecad634eebbcc59fc6856c3d9

2 years ago[clang][dataflow] Use NoopLattice in optional model
Sam Estep [Wed, 29 Jun 2022 20:10:31 +0000 (20:10 +0000)]
[clang][dataflow] Use NoopLattice in optional model

Followup to D128352. This patch pulls the `NoopLattice` class out from the `NoopAnalysis.h` test file into its own `NoopLattice.h` source file, and uses it to replace usage of `SourceLocationsLattice` in `UncheckedOptionalAccessModel`.

Reviewed By: ymandel, sgatev, gribozavr2, xazax.hun

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

2 years agoFix miscompile with [[no_unique_address]] struct fields.
Richard Smith [Wed, 29 Jun 2022 20:06:42 +0000 (13:06 -0700)]
Fix miscompile with [[no_unique_address]] struct fields.

If a zero-sized field has a non-trivial initializer, it should prevent
the overall struct initialization from being folded to a constant during
IR generation. Don't just ignore zero-sized fields entirely in IR
constant emission.

2 years agoRepair tautological condition.
Richard Smith [Fri, 6 May 2022 21:22:24 +0000 (14:22 -0700)]
Repair tautological condition.

Fixes #49725.

2 years ago[BOLT] Add option to randomize function split point
Fabian Parzefall [Wed, 29 Jun 2022 20:01:46 +0000 (13:01 -0700)]
[BOLT] Add option to randomize function split point

For test purposes, we want to split functions at a random split point
to be able to test different layouts without relying on the profile.
This patch introduces an option, that randomly chooses a split point
to partition blocks of a function into hot and cold regions.

Reviewed By: Amir, yota9

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

2 years ago[Fix] Fix compilation warning on unused var.
rdzhabarov [Wed, 29 Jun 2022 19:47:57 +0000 (19:47 +0000)]
[Fix] Fix compilation warning on unused var.

2 years ago[clang][dataflow] Use diagnosis API in optional checker
Sam Estep [Wed, 29 Jun 2022 19:19:58 +0000 (19:19 +0000)]
[clang][dataflow] Use diagnosis API in optional checker

Followup to D127898. This patch updates `bugprone-unchecked-optional-access` to use the new `diagnoseCFG` function instead of just looking at the exit block.

A followup to this will update the optional model itself to use a noop lattice rather than redundantly computing the diagnostics in both phases of the analysis.

Reviewed By: ymandel, sgatev, gribozavr2, xazax.hun

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

2 years agoRevert "[clang][dataflow] Use diagnosis API in optional checker"
Sam Estep [Wed, 29 Jun 2022 19:34:44 +0000 (19:34 +0000)]
Revert "[clang][dataflow] Use diagnosis API in optional checker"

This reverts commit cafb8b4ff2c38f81e65f97193eb1d8d16c581522.

2 years agoRevert "[clang][dataflow] Use NoopLattice in optional model"
Sam Estep [Wed, 29 Jun 2022 19:34:30 +0000 (19:34 +0000)]
Revert "[clang][dataflow] Use NoopLattice in optional model"

This reverts commit 335c05f5d19fecd5c0972ac801e58248d772a78e.

2 years ago[LoopUnrollRuntime] Invalidate SCEV for exit phi in ConnectProlog.
Florian Hahn [Wed, 29 Jun 2022 19:28:42 +0000 (20:28 +0100)]
[LoopUnrollRuntime] Invalidate SCEV for exit phi in ConnectProlog.

ConnectProlog adds new incoming values to exit phi nodes which can
change the SCEV for the phi after 20d798bd47ec51.

Fix is analog to cfc741bc0e029.

Fixes #56286.

2 years ago[LLDB] Allow API tests to override -gdwarf on Windows
Muhammad Omair Javaid [Wed, 29 Jun 2022 09:24:26 +0000 (13:24 +0400)]
[LLDB] Allow API tests to override -gdwarf on Windows

This patch fixes LLDB API tests MakeFile.rules to allow overriding of
debug symbol flags when compiling tests for Windows.
Previously windows tests were forced to emit only dwarf debug symbols
as majority of the tests rely on dwarf debug info. After this patch
any test can override debug symbol flag by setting DEBUG_INFO_FLAG
variable in its make file.

2 years ago[mlir] Update the pass crash reproducer documentation
River Riddle [Wed, 29 Jun 2022 19:23:00 +0000 (12:23 -0700)]
[mlir] Update the pass crash reproducer documentation

The reproducer is now encoded using an external resource, instead
of a comment at the top of the file.

2 years agoFix inline-record.test for Arm/Windows
Muhammad Omair Javaid [Wed, 29 Jun 2022 09:44:28 +0000 (13:44 +0400)]
Fix inline-record.test for Arm/Windows

This patch fixes inline-record.test to run on multiple platforms
including Arm/Windows. Test is fixed to expect any value for id
fields of functions and blocks returned by 'image lookup' command.
This field can be any value as it is internally generated id.

2 years ago[clang][dataflow] Use NoopLattice in optional model
Sam Estep [Wed, 29 Jun 2022 19:20:46 +0000 (19:20 +0000)]
[clang][dataflow] Use NoopLattice in optional model

Followup to D128352. This patch pulls the `NoopLattice` class out from the `NoopAnalysis.h` test file into its own `NoopLattice.h` source file, and uses it to replace usage of `SourceLocationsLattice` in `UncheckedOptionalAccessModel`.

Reviewed By: ymandel, sgatev, gribozavr2, xazax.hun

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

2 years ago[clang][dataflow] Use diagnosis API in optional checker
Sam Estep [Wed, 29 Jun 2022 19:19:58 +0000 (19:19 +0000)]
[clang][dataflow] Use diagnosis API in optional checker

Followup to D127898. This patch updates `bugprone-unchecked-optional-access` to use the new `diagnoseCFG` function instead of just looking at the exit block.

A followup to this will update the optional model itself to use a noop lattice rather than redundantly computing the diagnostics in both phases of the analysis.

Reviewed By: ymandel, sgatev, gribozavr2, xazax.hun

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

2 years ago[clang][dataflow] Add API to separate analysis from diagnosis
Sam Estep [Wed, 29 Jun 2022 19:18:10 +0000 (19:18 +0000)]
[clang][dataflow] Add API to separate analysis from diagnosis

This patch adds an optional `PostVisitStmt` parameter to the `runTypeErasedDataflowAnalysis` function, which does one more pass over all statements in the CFG after a fixpoint is reached. It then defines a `diagnose` method for the optional model in a new `UncheckedOptionalAccessDiagnosis` class, but only integrates that into the tests and not the actual optional check for `clang-tidy`. That will be done in a followup patch.

The primary motivation is to separate the implementation of the unchecked optional access check into two parts, to allow for further refactoring of just the model part later, while leaving the checking part alone. Currently there is duplication between the `transferUnwrapCall` and `diagnoseUnwrapCall` functions, but that will be dealt with in the followup.

Because diagnostics are now all gathered into one collection rather than being populated at each program point like when computing a fixpoint, this patch removes the usage of `Pair` and `UnorderedElementsAre` from the optional model tests, and instead modifies all their expectations to simply check the stringified set of diagnostics against a single string, either `"safe"` or some concatenation of `"unsafe: input.cc:y:x"`. This is not ideal as it loses any connection to the `/*[[check]]*/` annotations in the source strings, but it does still retain the source locations from the diagnostic strings themselves.

Reviewed By: sgatev, gribozavr2, xazax.hun

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

2 years ago[mlir] Refactor pass crash reproducer generation to be an assembly resource
River Riddle [Tue, 28 Jun 2022 20:39:15 +0000 (13:39 -0700)]
[mlir] Refactor pass crash reproducer generation to be an assembly resource

We currently generate reproducer configurations using a comment placed at
the top of the generated .mlir file. This is kind of hacky given that comments
have no semantic context in the source file and can easily be dropped. This
strategy also wouldn't work if/when we have a bitcode format. This commit
switches to using an external assembly resource, which is verifiable/can
work with a hypothetical bitcode naturally/and removes the awkward processing
from mlir-opt for splicing comments and re-applying command line options. With
the removal of command line munging, this opens up new possibilities for
executing reproducers in memory.

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

2 years ago[mlir] Allow for attaching external resources to .mlir files
River Riddle [Tue, 28 Jun 2022 20:25:24 +0000 (13:25 -0700)]
[mlir] Allow for attaching external resources to .mlir files

This commit enables support for providing and processing external
resources within MLIR assembly formats. This is a mechanism with which
dialects, and external clients, may attach additional information when
printing IR without that information being encoded in the IR itself.
External resources are not uniqued within the MLIR context, are not
attached directly to any operation, and are solely intended to live and be
processed outside of the immediate IR. There are many potential uses of this
functionality, for example MLIR's pass crash reproducer could utilize this to
attach the pass resource executing when a crash occurs. Other types of
uses may be embedding large amounts of binary data, such as weights in ML
applications, that shouldn't be copied directly into the MLIR context, but
need to be kept adjacent to the IR.

External resources are encoded using a key-value pair nested within a
dictionary anchored by name either on a dialect, or an externally registered
entity. The key is an identifier used to disambiguate the data. The value
may be stored in various limited forms, but general encodings use a string
(human readable) or blob format (binary). Within the textual format, an
example may be of the form:

```mlir
{-#
  // The `dialect_resources` section within the file-level metadata
  // dictionary is used to contain any dialect resource entries.
  dialect_resources: {
    // Here is a dictionary anchored on "foo_dialect", which is a dialect
    // namespace.
    foo_dialect: {
      // `some_dialect_resource` is a key to be interpreted by the dialect,
      // and used to initialize/configure/etc.
      some_dialect_resource: "Some important resource value"
    }
  },
  // The `external_resources` section within the file-level metadata
  // dictionary is used to contain any non-dialect resource entries.
  external_resources: {
    // Here is a dictionary anchored on "mlir_reproducer", which is an
    // external entity representing MLIR's crash reproducer functionality.
    mlir_reproducer: {
      // `pipeline` is an entry that holds a crash reproducer pipeline
      // resource.
      pipeline: "func.func(canonicalize,cse)"
    }
  }
```

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

2 years ago[RISCV] Pre-commit tests for D128843. NFC
Craig Topper [Wed, 29 Jun 2022 18:20:30 +0000 (11:20 -0700)]
[RISCV] Pre-commit tests for D128843. NFC

2 years ago[OpenMP] Add variant extension that applies to declarations
Joseph Huber [Wed, 29 Jun 2022 18:53:45 +0000 (14:53 -0400)]
[OpenMP] Add variant extension that applies to declarations

This patch adds a new extension to the `omp begin / end declare variant`
support that causes it to apply to function declarations as well. This
is explicitly not done in the standard, but can be useful in some
situations so we should provide it as an extension. This will allow us
to uniquely bind and overload existing definitions with a simple
declaration using variants.

Reviewed By: jdoerfert

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

2 years agoAMDGPU: Add gfx11 feature to force initializing 16 input SGPRs
Matt Arsenault [Mon, 24 Jan 2022 16:35:34 +0000 (11:35 -0500)]
AMDGPU: Add gfx11 feature to force initializing 16 input SGPRs

The total user+system SGPR count needs to be padded out to 16 if fewer
inputs are enabled.

2 years ago[LinkerWrapper] Change wrapping to include jumps for other variables
Joseph Huber [Wed, 29 Jun 2022 18:39:42 +0000 (14:39 -0400)]
[LinkerWrapper] Change wrapping to include jumps for other variables

Summary:
We don't currently support other variable types, like managed or
surface. This patch simply adds code that checks the flags and does
nothing. This prevents us from registering a surface as a variable as we
do now. In the future, registering these will require adding the flags
to the entry struct.

2 years ago[flang][runtime] Emit "0.0E+0" for (1PG0.0) editing of 0.0
Peter Klausler [Mon, 27 Jun 2022 21:22:31 +0000 (14:22 -0700)]
[flang][runtime] Emit "0.0E+0" for (1PG0.0) editing of 0.0

When a scale factor is in effect, respect it for G0.0 output editing.

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

2 years ago[Clang][Preprocessor] Fix inconsistent `FLT_EVAL_METHOD` when compiling vs preprocessing
Egor Zhdan [Wed, 29 Jun 2022 12:35:54 +0000 (13:35 +0100)]
[Clang][Preprocessor] Fix inconsistent `FLT_EVAL_METHOD` when compiling vs preprocessing

When running `clang -E -Ofast` on macOS, the `__FLT_EVAL_METHOD__` macro is `0`, which causes the following typedef to be emitted into the preprocessed source: `typedef float float_t`.

However, when running `clang -c -Ofast`, `__FLT_EVAL_METHOD__` is `-1`, and `typedef long double float_t` is emitted.

This causes build errors for certain projects, which are not reproducible when compiling from preprocessed source.

The issue is that `__FLT_EVAL_METHOD__` is configured in `Sema::Sema` which is not executed when running in `-E` mode.

This change moves that logic into the preprocessor initialization method, which is invoked correctly in `-E` mode.

rdar://96134605
rdar://92748429

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

2 years ago[flang] Better error recovery for bad submodules
Peter Klausler [Thu, 23 Jun 2022 00:42:57 +0000 (17:42 -0700)]
[flang] Better error recovery for bad submodules

When a submodule appears in a source file and the compiler can't find the
named ancestor module (and submodule, if one appears), crashes may occur
later due to the absence of a scope.  For better resilience, a dummy
ancestral scope should be generated within which the submodule scope
can be created.

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

2 years ago[flang] Fix lowering issue with character temp
Valentin Clement [Wed, 29 Jun 2022 18:06:11 +0000 (20:06 +0200)]
[flang] Fix lowering issue with character temp

- Add verifiers that determine if an Op requires type parameters or
  not and checks that the correct number of parameters is specified.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2 years agoFix CombineContractBroadcast folding reduction iterators.
Benoit Jacob [Tue, 28 Jun 2022 16:50:39 +0000 (16:50 +0000)]
Fix CombineContractBroadcast folding reduction iterators.

Fix CombineContractBroadcast folding reduction iterators.

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

2 years ago[lldb] Attempt to fix TestStepThroughTrampoline on windows
Pavel Labath [Wed, 29 Jun 2022 17:59:24 +0000 (19:59 +0200)]
[lldb] Attempt to fix TestStepThroughTrampoline on windows

2 years ago[llvm-objcopy] Remove support for legacy .zdebug sections
Fangrui Song [Wed, 29 Jun 2022 17:42:54 +0000 (10:42 -0700)]
[llvm-objcopy] Remove support for legacy .zdebug sections

clang 14 removed -gz=zlib-gnu support and ld.lld removed linker input support
for zlib-gnu in D126793. Now let's remove zlib-gnu from llvm-objcopy.

* .zdebug* sections are no longer recognized as debug sections. --strip* don't remove them.
  They are copied like other opaque sections
* --decompress-debug-sections does not uncompress .zdebug* sections
* --compress-debug-sections=zlib-gnu is not supported

It is very rare but in case a user has object files using .zdebug . They can use
llvm-objcopy<15 or GNU objcopy for uncompression.
--compress-debug-sections=zlib-gnu is unlikely ever used by anyone, so I do not
add a custom diagnostic.

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

2 years agoRevert "[RISCV] Avoid changing etype for splat of 0 or -1"
Philip Reames [Wed, 29 Jun 2022 17:24:38 +0000 (10:24 -0700)]
Revert "[RISCV] Avoid changing etype for splat of 0 or -1"

This reverts commit 755c84c62cda80b0acf51ccc5653fc6d64536f7e.  A bug was reported on the original review thread (https://reviews.llvm.org/D128006), and on inspection this patch is simply wrong.  It needs to be checking for VLInBytes, not MaxVL.  These happen to be the same when using AVL=VLMAX (which is quite common), but this does not fold when AVL != VLMAX.

2 years ago[UnrollRuntime] Invalidate SCEVs for modified phis in ConnectEpilog.
Florian Hahn [Wed, 29 Jun 2022 17:26:00 +0000 (18:26 +0100)]
[UnrollRuntime] Invalidate SCEVs for modified phis in ConnectEpilog.

ConnectEpilog adds new incoming values to exit phi nodes which can
change the SCEV for the phi after 20d798bd47ec51.

Fix is analog to cfc741bc0e029.

Fixes #56282.

2 years ago[flang] Fix folding of LEN(f(...))
Peter Klausler [Thu, 16 Jun 2022 18:41:09 +0000 (11:41 -0700)]
[flang] Fix folding of LEN(f(...))

LEN(f(...)), where "f" is a non-intrinsic function, should not be folded
to anything else unless the result is a known constant value.  While there
are conceivable cases in which we could do better (e.g., an internal function
whose length is a host-associated INTENT(IN) dummy argument), there are
other cases that we're getting wrong.

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

2 years ago[clang-format] Fix incorrect isspace input (NFC)
Kevin Cadieux [Wed, 29 Jun 2022 16:06:46 +0000 (09:06 -0700)]
[clang-format] Fix incorrect isspace input (NFC)

This change fixes a clang-format unit test failure introduced by [D124748](https://reviews.llvm.org/D124748). The `countLeadingWhitespace` function was calling `isspace` with values that could fall outside the valid input range. The valid input range for `isspace` is unsigned 0-255. Values outside this range produce undefined behavior, which on Windows manifests as an assertion being raised in the debug runtime libraries. `countLeadingWhitespace` was calling `isspace` with a signed char that could produce a negative value if the underlying byte's value was 128 or above, which can happen for non-ASCII encodings. The fix is to use `StringRef`'s `bytes_begin` and `bytes_end` iterators to read the values as unsigned chars instead.

This bug can be reproduced by building the `check-clang-unit` target with a DEBUG configuration under Windows. This change is already covered by existing unit tests.

Reviewed By: MyDeveloperDay

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

2 years ago[llvm-ar] Add --output to specify output directory
Fangrui Song [Wed, 29 Jun 2022 17:00:42 +0000 (10:00 -0700)]
[llvm-ar] Add --output to specify output directory

From binutils 2.34 onwards, ar supports --output to specify a directory
where archive members should be extracted to. Port this feature.

Reviewed By: jhenderson

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

2 years ago[InstCombine] Relax test to avoid Darwin failure.
Martin Sebor [Wed, 29 Jun 2022 16:46:43 +0000 (10:46 -0600)]
[InstCombine] Relax test to avoid Darwin failure.

Avoid testing folding of atoi calls with out-of-bounds pointers.

2 years ago[InstCombine] add fold for (ShiftC >> X) >u C
Sanjay Patel [Wed, 29 Jun 2022 15:38:48 +0000 (11:38 -0400)]
[InstCombine] add fold for (ShiftC >> X) >u C

This is the 'ugt' sibling to:
0399473de886595d

Decrement the input compare constant (and implicitly
decrement the new compare constant):
https://alive2.llvm.org/ce/z/iELmct

2 years ago[InstCombine] add tests for (pow2 >> X) <u C; NFC
Sanjay Patel [Wed, 29 Jun 2022 14:43:55 +0000 (10:43 -0400)]
[InstCombine] add tests for (pow2 >> X) <u C; NFC

Adapted from af5e64df728f498ea9c6

2 years ago[Clang] Rename StringLiteral::isAscii() => isOrdinary() [NFC]
Corentin Jabot [Tue, 28 Jun 2022 21:48:48 +0000 (23:48 +0200)]
[Clang] Rename StringLiteral::isAscii() => isOrdinary() [NFC]

"Ascii" StringLiteral instances are actually narrow strings
that are UTF-8 encoded and do not have an encoding prefix.
(UTF8 StringLiteral are also UTF-8 encoded strings, but with
the u8 prefix.

To avoid possible confusion both with actuall ASCII strings,
and with future works extending the set of literal encodings
supported by clang, this rename StringLiteral::isAscii() to
isOrdinary(), matching C++ standard terminology.

Reviewed By: aaron.ballman

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

2 years ago[trace] Make events first class items in the trace cursor and rework errors
Walter Erquinigo [Fri, 24 Jun 2022 21:02:47 +0000 (14:02 -0700)]
[trace] Make events first class items in the trace cursor and rework errors

We want to include events with metadata, like context switches, and this
requires the API to handle events with payloads (e.g. information about
such context switches). Besides this, we want to support multiple
similar events between two consecutive instructions, like multiple
context switches. However, the current implementation is not good for this because
we are defining events as bitmask enums associated with specific
instructions. Thus, we need to decouple instructions from events and
make events actual items in the trace, just like instructions and
errors.

- Add accessors in the TraceCursor to know if an item is an event or not
- Modify from the TraceDumper all the way to DecodedThread to support
- Renamed the paused event to disabled.
- Improved the tsc handling logic. I was using an API for getting the tsc from libipt, but that was an overkill that should be used when not processing events manually, but as we are already processing events, we can more easily get the tscs.
event items. Fortunately this simplified many things
- As part of this refactor, I also fixed and long stating issue, which is that some non decoding errors were being inserted in the decoded thread. I changed this so that TraceIntelPT::Decode returns an error if the decoder couldn't be set up proplerly. Then, errors within a trace are actual anomalies found in between instrutions.

All test pass

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

2 years ago[RISCV] Select (srl (and X, C2) as (slli (srliw X, C3), C3-C).
Craig Topper [Wed, 29 Jun 2022 15:51:10 +0000 (08:51 -0700)]
[RISCV] Select (srl (and X, C2) as (slli (srliw X, C3), C3-C).

If C2 has 32 leading zeros and C3 trailing zeros.

2 years agoAMDGPU: Make packed 32-bit instructions rematerializable
Matt Arsenault [Sat, 25 Jun 2022 14:25:11 +0000 (10:25 -0400)]
AMDGPU: Make packed 32-bit instructions rematerializable

2 years agoAMDGPU: Make 16-bit pk instructions rematerializable
Matt Arsenault [Sat, 25 Jun 2022 17:24:31 +0000 (13:24 -0400)]
AMDGPU: Make 16-bit pk instructions rematerializable

2 years agoAMDGPU: Add rematerialize tests for 16-bit pk instructions
Matt Arsenault [Sat, 25 Jun 2022 16:56:51 +0000 (12:56 -0400)]
AMDGPU: Add rematerialize tests for 16-bit pk instructions

2 years ago[lldb] [test] Avoid relying on signos in other fork tests
Michał Górny [Wed, 29 Jun 2022 15:47:53 +0000 (17:47 +0200)]
[lldb] [test] Avoid relying on signos in other fork tests

Sponsored by: The FreeBSD Foundation

2 years ago[LV] Add test case showing dead recipe blocking region merging.
Florian Hahn [Wed, 29 Jun 2022 15:34:11 +0000 (16:34 +0100)]
[LV] Add test case showing dead recipe blocking region merging.

2 years agoAMDGPU: Mark more instructions as rematerializable
Matt Arsenault [Sat, 25 Jun 2022 15:39:59 +0000 (11:39 -0400)]
AMDGPU: Mark more instructions as rematerializable

D106023 excluded 16-bit instructions from rematerialization, with the
justification that we can't rematerialize instructions that preserve
the high bits (plus the instructions which do are a confusing mess
between different subtargets). This doesn't make sense to me as a
problem since cases where we would rely on the high bit behavior would
still need to be represented as a register value constraint with a
tied operand. It's not a hidden side effect and should still be
rematerializable.

2 years agoAMDGPU: Add more rematerialization tests for 16-bit instructions
Matt Arsenault [Sat, 25 Jun 2022 13:53:31 +0000 (09:53 -0400)]
AMDGPU: Add more rematerialization tests for 16-bit instructions

2 years ago[VectorCombine] Avoid ConstantExpr::get() (NFC)
Nikita Popov [Wed, 29 Jun 2022 15:17:20 +0000 (17:17 +0200)]
[VectorCombine] Avoid ConstantExpr::get() (NFC)

Use IRBuilder APIs instead, which will still constant fold.

2 years agoRevert "[libc][test] Remove dependency on sstream in algorithm_test.cpp"
Guillaume Chatelet [Wed, 29 Jun 2022 15:12:24 +0000 (15:12 +0000)]
Revert "[libc][test] Remove dependency on sstream in algorithm_test.cpp"

This reverts commit 292b281caf8c3750cc0796b971af2ca24236a926.

2 years ago[libc][test] Remove dependency on sstream in algorithm_test.cpp
Guillaume Chatelet [Wed, 29 Jun 2022 12:28:00 +0000 (12:28 +0000)]
[libc][test] Remove dependency on sstream in algorithm_test.cpp

Bots have been failing in full build mode because ´#include <sstream>´ would pull pthread which is not possible when code is compiled with ´-freestanding´.

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

2 years ago[mlir][Tensor] Improve documentation of verification behavior of InsertSliceOp.
Nicolas Vasilache [Wed, 29 Jun 2022 14:51:41 +0000 (07:51 -0700)]
[mlir][Tensor] Improve documentation of verification behavior of InsertSliceOp.

2 years ago[JumpThreading] Avoid ConstantExpr::get() (NFCI)
Nikita Popov [Wed, 29 Jun 2022 14:41:38 +0000 (16:41 +0200)]
[JumpThreading] Avoid ConstantExpr::get() (NFCI)

This code requires the result to be an UndefValue/ConstantInt
anyway (checked by getKnownConstant), so we are only interested
in the case where this folds.

2 years ago[mlir][Tensor][NFC] Better document rank-reducing behavior of ExtractSliceOp and...
Nicolas Vasilache [Wed, 29 Jun 2022 11:16:49 +0000 (04:16 -0700)]
[mlir][Tensor][NFC] Better document rank-reducing behavior of ExtractSliceOp and cleanup

2 years ago[PowerPC] Fix signatures for vec_replace_unaligned builtin
Lei Huang [Tue, 21 Jun 2022 16:54:40 +0000 (11:54 -0500)]
[PowerPC] Fix signatures for vec_replace_unaligned builtin

``vec_replace_unaligned`` is meant to return vuc to emphasize that elements
are being inserted on unnatural boundaries.

Reviewed By: amyk, quinnp

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

2 years agoAMDGPU: Use isMeta flags on pseudoinstructions
Matt Arsenault [Mon, 6 Jun 2022 21:19:03 +0000 (17:19 -0400)]
AMDGPU: Use isMeta flags on pseudoinstructions