Commit Graph

409235 Commits

Author SHA1 Message Date
Simon Pilgrim e3e8799beb [AST] ASTContext::mergeTypes - pull out repeated getAs<> calls. NFC.
Avoids static-analyzer null dereference warnings.
2022-01-06 16:04:36 +00:00
Matt Arsenault 4fc18de335 AMDGPU: Clear NoPHIs property in SIOptimizeVGPRLiveRanges
Fixes verifier error when writing MIR tests that didn't have phis to
begin with.
2022-01-06 11:01:51 -05:00
Matthias Springer 15c7e3ee15 [mlir][linalg][bufferize][NFC] Use RewritePatterns instead of custom traversal
This change simplifies BufferizableOpInterface and other functions. Overall, the API will get smaller: Functions related to custom IR traversal are deleted entirely. This will makes it easier to write BufferizableOpInterface implementations.

This is also in preparation of unifying Comprehensive Bufferize and core bufferization. While Comprehensive Bufferize could theoretically maintain its own IR traversal, there is no reason to do so, because all bufferize implementations in BufferizableOpInterface have to support partial bufferization anyway. And we can share a larger part of the code base between the two bufferizations.

Differential Revision: https://reviews.llvm.org/D116448
2022-01-07 00:56:54 +09:00
David Goldman f558acf492 Reland "[clang][ObjC] Add fix it for missing methods in impl"
This reverts commit 37be74885946f18dbeb70343ad659924c61d2549/
relands https://reviews.llvm.org/D116417 now that the internal
issue has been fixed.
2022-01-06 10:55:02 -05:00
Jan Svoboda d5ba066cb6 [clang][lex] NFC: Move some HeaderSearch functions to .cpp file 2022-01-06 16:32:02 +01:00
Matthias Springer 2975407bd4 [mlir][linalg][bufferize][NFC] Pass BufferizationState as const reference
This is mostly for documentation purposes: Passing the object as a const reference signifies that analysis decisions cannot be changed after the analysis.

Differential Revision: https://reviews.llvm.org/D116742
2022-01-07 00:18:46 +09:00
Nikolas Klauser f2277e60f4 [libc++][NFC] Reformat <__filesystem/operations.h>
Reformat `<__filesystem/operations.h>`

Reviewed By: Quuxplusone, #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D116234
2022-01-06 16:15:41 +01:00
Simon Pilgrim 5bbcff6181 [MemCpyOptimizer] hasUndefContents - only look for underlying object if we've found an alloca
Provides an early-out if we fail to find an AllocaInst, and avoids a static analyzer warning about null dereferencing.
2022-01-06 15:15:03 +00:00
Simon Pilgrim 8399fa673b [MemCpyOptimizer] Use auto* for cast<> results (style). NFC. 2022-01-06 15:15:03 +00:00
Matthias Springer cd84cf90e9 [mlir][linalg][bufferize][NFC] Do not cache bufferized function types
This does not work if BufferizationState is passed around as a const reference in most places.

Differential Revision: https://reviews.llvm.org/D116741
2022-01-07 00:04:57 +09:00
Vy Nguyen fb9bfb2c59 [lld][macho][nfc] Make tests less britle by not expecting ordering in symbol table dump.
(parial)fixes PR/53026

Differential Revision: https://reviews.llvm.org/D116718
2022-01-06 09:45:44 -05:00
Alexey Bataev 700997aef8 [SLP][NFC]Fix comment, NFC. 2022-01-06 06:38:29 -08:00
Alexey Bataev bf5a688252 [SLP][NFC]Add a test for the extra shuffle after alternate node, NFC. 2022-01-06 06:34:58 -08:00
Nikita Popov bec726f5d2 [Verifier] Enforce elementtype attr for inline asm indirect constraints
This enforces the LangRef change from D116531 in the Verifier, now
that clang and tests have been updated.
2022-01-06 15:22:00 +01:00
Simon Pilgrim 6638303869 [LoopFlatten] checkOverflow - use cast<> instead of dyn_cast<> to avoid dereference of nullptr.
Fix static analysis warning by using cast<> instead of dyn_cast<> as both isa<> and isGuaranteedToExecuteForEveryIteration expect a non-null Instruction pointer.
2022-01-06 14:13:50 +00:00
Nikita Popov eddd5be1df [BitCode] Autoupgrade inline asm elementtype attribute
This is the autoupgrade part of D116531. If old bitcode is missing
the elementtype attribute for indirect inline asm constraints,
automatically add it. As usual, this only works when upgrading
in typed mode, we haven't figured out upgrade in opaque mode yet.
2022-01-06 15:13:01 +01:00
Nicolas Vasilache 2c4a56c418 [mlir][Linalg] NFC - Modernize padding pattern
Differential Revision: https://reviews.llvm.org/D116739
2022-01-06 08:59:35 -05:00
Fanbo Meng 43c5e61b55 [SystemZ][z/OS][libcxx]:Fix fopen64 undeclared error in 32 bit mode
z/OS doesn't support fopen64() functions. Modify the preprocessor directive for z/OS to use fopen() instead.

Reviewed By: #libc, abhina.sreeskantharajan, muiez, ldionne

Differential Revision: https://reviews.llvm.org/D111226
2022-01-06 08:57:56 -05:00
Arjun P ef8351598e [MLIR] Simplex::findPivotRow: silence spurious coverity warning
Initialize some variables to zero to avoid a warning about them possibly being
used uninitialized. In actuality, they will never be used before initialization.
2022-01-06 19:18:30 +05:30
Nikita Popov ddd9ec667a [LICM] Update comments related to escape check (NFC)
The comments here were outdated and a bit confusing without the
knowledge that we're only guarding against reads on unwind.
2022-01-06 14:45:48 +01:00
Arjun P 0f925339e5 [MLIR] Simplex::normalizeRow: assert gcd is non-zero before dividing 2022-01-06 19:10:47 +05:30
Nikita Popov 41a522779d [LICM] Check for noalias call instead of alloc like fn
When determining whether the memory is local to the function (and
we can thus introduce spurious writes without thread-safety issues),
check for a noalias call rather than the hardcoded list of memory
allocation functions. Noalias calls are the more general way to
determine allocation functions, as long as we're only interested
in the property that the returned value is distinct from any other
accessible memory.

Differential Revision: https://reviews.llvm.org/D116728
2022-01-06 14:38:19 +01:00
Nikita Popov f430c1eb64 [Tests] Add elementtype attribute to indirect inline asm operands (NFC)
This updates LLVM tests for D116531 by adding elementtype attributes
to operands that correspond to indirect asm constraints.
2022-01-06 14:23:51 +01:00
Sander de Smalen 9cbe000df2 [LV] Load/store/reduction type must be sized, assert it.
This addresses a suggestion by @nikic on D115356.
2022-01-06 12:35:27 +00:00
Peixin-Qiao 8eb74626fa [flang][OpenMP] Add some semantic checks for threadprivate and declare target directives
This supports the following checks for THREADPRIVATE Directive:
```
[5.1] 2.21.2 THREADPRIVATE Directive
A threadprivate variable must not appear in any clause except the
copyin, copyprivate, schedule, num_threads, thread_limit, and if clauses.
```

This supports the following checks for DECLARE TARGET Directive:
```
[5.1] 2.14.7 Declare Target Directive
A threadprivate variable cannot appear in the directive.
```

Besides, procedure name and the entity with PARAMETER attribute cannot
be in the threadprivate directive. The main program name and module name
cannot be in the threadprivate directive and declare target directive.
There is no clear description or restriction about the entity with
PARAMETER attribute in OpenMP 5.1 Specification, and a warning is given.

Reviewed By: kiranchandramohan, shraiysh, NimishMishra

Differential Revision: https://reviews.llvm.org/D114941
2022-01-06 20:00:16 +08:00
Florian Hahn 86d113a8b8
[SCEVExpand] Do not create redundant 'or false' for pred expansion.
This patch updates SCEVExpander::expandUnionPredicate to not create
redundant 'or false, x' instructions. While those are trivially
foldable, they can be easily avoided and hinder code that checks the
size/cost of the generated checks before further folds.

I am planning on look into a few other similar improvements to code
generated by SCEVExpander.

I remember a while ago @lebedev.ri working on doing some trivial folds
like that in IRBuilder itself, but there where concerns that such
changes may subtly break existing code.

Reviewed By: reames, lebedev.ri

Differential Revision: https://reviews.llvm.org/D116696
2022-01-06 11:52:19 +00:00
Andrew Ng d4d9de362b [CMake] Support passing arguments to build tool for external projects
Add CMake variable LLVM_EXTERNAL_PROJECT_BUILD_TOOL_ARGS to allow
arguments to be passed to the native tool used in CMake --build
invocations for external projects.

Can be used to pass extra arguments for enhanced versions of build
tools, e.g. distributed build options.

Differential Revision: https://reviews.llvm.org/D115815
2022-01-06 11:09:39 +00:00
David Green ba927f66c0 [AArch64] Regenerate arith overflow test, and add a few more select tests. NFC 2022-01-06 11:02:14 +00:00
Prashant Kumar df29318e66 [MLIR] Add division normalization by GCD in `getDivRepr` fn.
This commits adds division normalization in  the `getDivRepr` function which extracts
 the gcd from the dividend and divisor and normalizes them.

Signed-off-by: Prashant Kumar <pk5561@gmail.com>

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D115595
2022-01-06 16:18:50 +05:30
Nikita Popov 0fa174398b [LICM] Add test for noalias call (NFC)
Add a test with a noalias call that is not a known allocation
function.
2022-01-06 11:46:27 +01:00
Markus Böck 560972052a [mlir][LLVM] Implement mapping of phi source values of `llvm.invoke`
This patch allows the usage of the normalDestOperands and unwindDestOperands operands of llvm.invoke and have them be correctly mapped to phis in the successor when exported to LLVM IR.

Differential Revision: https://reviews.llvm.org/D116706
2022-01-06 11:27:14 +01:00
Chuanqi Xu bbce75e352 Update Bug report URL to Github Issues
Although we moved to Github Issues. The bug report message refers to
Bugzilla still. This patch tries to update these URLs.

Reviewed By: MaskRay, Quuxplusone, jhenderson, libunwind, libc++

Differential Revision: https://reviews.llvm.org/D116351
2022-01-06 17:33:25 +08:00
Alex Zinenko 95ddbed9b7 [mlir] Split out Python bindings for dialects into separate libs
Historically, the bindings for the Linalg dialect were included into the
"core" bindings library because they depended on the C++ implementation
of the "core" bindings. The other dialects followed the pattern. Now
that this dependency is gone, split out each dialect into a separate
Python extension library.

Depends On D116649, D116605

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D116662
2022-01-06 10:31:14 +01:00
Fangrui Song 6e4bbbfcc8 [ELF] Enforce double-dash form for --color-diagnostics/--rsp-quoting/--symbol-ordering-file
They are LLD-specific and by convention we enforce the double-dash form to avoid
collision with short options (e.g. weird `-c olor-diagnostics` interpretation in
GNU ld). They are rarely used and to the best of my investigation the undesired
single-dash forms are not used in the wild.
2022-01-06 01:02:14 -08:00
Nikita Popov c41aa41957 [ConstFold] Add missing check for inbounds gep
If the gep is not inbounds, then the gep might compute a null
value even if the base pointer is non-null.
2022-01-06 09:59:40 +01:00
Nikita Popov 37c9171764 [ConstantFold] Add test for invalid non-inbounds gep icmp fold
The gep evaluated to null in this case, and as such is not ne null.
2022-01-06 09:59:40 +01:00
Matthias Springer 18e08fbd01 [mlir][linalg][bufferize] Fix tiled_loop bufferization
Until now, bufferization assumed that the yieleded tensor of a linalg.tiled_loop is an output tensor. This is not necessarily the case.

Differential Revision: https://reviews.llvm.org/D116685
2022-01-06 17:51:33 +09:00
Jim Lin 9c0ac101d7 [M68k][test][NFC] Add missing tests for arith inst with size byte or word 2022-01-06 16:40:40 +08:00
Fangrui Song bfc2f4b122 [ELF] Update help messages to prefer canonical name for some long options
And improve the help message for --pop-state.
2022-01-06 00:43:46 -08:00
Matthias Springer 0e5f258452 [mlir][linalg][bufferize][NFC] Simplify InsertSliceOp bufferization
No need to keep track of equivalent extract_slice / insert_slice tensors during bufferization. Just emit a copy, it will fold away.

Note: The analysis still keeps track of equivalent tensors to make the correct inplace bufferization decisions.

Differential Revision: https://reviews.llvm.org/D116684
2022-01-06 17:35:45 +09:00
Nikita Popov e8b98a5216 [CodeGen] Emit elementtype attributes for indirect inline asm constraints
This implements the clang side of D116531. The elementtype
attribute is added for all indirect constraints (*) and tests are
updated accordingly.

Differential Revision: https://reviews.llvm.org/D116666
2022-01-06 09:29:22 +01:00
Martin Storsjö 1919720fdd [lldb] [debugserver] Simplify handling of arch specific files
There are no duplicates among the include files, and all the
source files are wrapped in architecture ifdefs, so there's no harm
in including all of them, always.

This fixes builds if TARGET_TRIPLE is set to something else than the
build architecture.

This also allows building for multiple architectures at once by
setting CMAKE_OSX_ARCHITECTURES.

Differential Revision: https://reviews.llvm.org/D116625
2022-01-06 10:23:04 +02:00
Nikita Popov 32808cfb24 [IR] Track users of comdats
Track all GlobalObjects that reference a given comdat, which allows
determining whether a function in a comdat is dead without scanning
the whole module.

In particular, this makes filterDeadComdatFunctions() have complexity
O(#DeadFunctions) rather than O(#SymbolsInModule), which addresses
half of the compile-time issue exposed by D115545.

Differential Revision: https://reviews.llvm.org/D115864
2022-01-06 09:13:58 +01:00
mydeveloperday 49d311874e [clang-format] Missing space after cast in a macro
https://github.com/llvm/llvm-project/issues/52979

Though SpaceAfterCStyleCast is set to true, clang-format 13 does not add a space after (void *) here:

```
```

This patch addresses that

Fixes: #52979

Reviewed By: curdeius, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D116592
2022-01-06 08:07:03 +00:00
Lang Hames 118e953b18 Re-apply "[JITLink] Update JITLink to use ExecutorAddr rather... " with fixes.
This re-applies 133f86e954, which was reverted in
c5965a411c while I investigated bot failures.

The original failure contained an arithmetic conversion think-o (on line 419 of
EHFrameSupport.cpp) that could cause failures on 32-bit platforms. The issue
should be fixed in this patch.
2022-01-06 17:22:21 +11:00
Vitaly Buka 6396a44361 Revert "SIGSEGV in Sanitizer INTERCEPTOR of strstr function."
Breaks Asan on Fuchsia's and ubsan with gcc.

This reverts commit 685c94c6cb.
2022-01-05 21:28:01 -08:00
Christudasan Devadasan 50b5b367c1 [AMDGPU] Iterate LoweredEndCf in the reverse order
The function that optimally inserts the exec mask
restore operations by combining the blocks currently
visits the lowered END_CF pseudos in the forward
direction as it iterates the setvector in the order
the entries are inserted in it.

Due to the absence of BranchFolding at -O0, the
irregularly placed BBs cause the forward traversal
to incorrectly place two unconditional branches in
certain BBs while combining them, especially when
an intervening block later gets optimized away in
subsequent iterations.

It is avoided by reverse iterating the setvector.
The blocks at the bottom of a function will get
optimized first before processing those at the top.

Fixes: SWDEV-315215

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D116273
2022-01-06 00:27:11 -05:00
David Blaikie 31b79b86ee Revert "Remove unused variable (-Wunused)"
Patch that removed the use of this variable was  reverted in
8ade3d43a3

This reverts commit 3988a06d86.
2022-01-05 20:43:30 -08:00
David Blaikie 811b60f0b9 llvm-dwarfdump: Speed up type unit lookup using the TUIndex or a cache
Use the TUIndex in a DWP file if present, otherwise (in .o, .dwo, and
non-split linked executables) cache a DenseMap for lookup of type units.
2022-01-05 20:41:07 -08:00
David Blaikie 33529ba0cb llvm-dwarfdump --summarize-types: skip compilation units
Important for DWARFv5 debug info which might contain type units in the
debug_info section, which made summarize-types fairly ineffective/lost
amongst the noise of CUs being dumped.
2022-01-05 20:36:04 -08:00