Commit Graph

385187 Commits

Author SHA1 Message Date
Sanjay Patel 84cdccc9dc [InstCombine] try to eliminate an instruction in min/max -> abs fold
As suggested in the review thread for 5094e12 and seen in the
motivating example from https://llvm.org/PR49885, it's not
clear if we have a way to create the optimal code without
this heuristic.
2021-04-09 10:34:03 -04:00
Sanjay Patel 1667fbe650 [InstCombine] add test with multiple uses of min/max negated operand; NFC 2021-04-09 10:34:02 -04:00
Soumi Manna 5d7cb79416 RISCVABIInfo::classifyArgumentType: Fix static analyzer warnings with uninitialized variables warnings - NFCI
Differential Revision: https://reviews.llvm.org/D100172
2021-04-09 15:23:32 +01:00
Simon Pilgrim 68d62fe068 [X86] Add zeroext attributes to i8/i16 and/or/xor overflow tests
Matches original c/c++ test cases
2021-04-09 15:01:10 +01:00
Kadir Cetinkaya b9b708eef8
[clangd] Log a message when gRPC support is off, but remote-index is configured
Before this change clangd would emit a diagnostic whenever remote-index
was configured but binary didn't have grpc support.

This can be annoying when projects are configuring remote-index through their
configs but developers have a clangd binary without the support.

Differential Revision: https://reviews.llvm.org/D100103
2021-04-09 15:52:51 +02:00
Paul C. Anagnostopoulos 175b8819f2 [TableGen] [docs] Change title of tblgen.rst to fix man page filename 2021-04-09 09:37:56 -04:00
Yaxun (Sam) Liu 25942d7c49 [AMDGPU] Allow relaxed/consume memory order for atomic inc/dec
Reviewed by: Jon Chesterfield

Differential Revision: https://reviews.llvm.org/D100144
2021-04-09 09:23:41 -04:00
Momchil Velikov acf3279a03 For non-null pointer checks, do not descend through out-of-bounds GEPs
In LazyValueInfoImpl::isNonNullAtEndOfBlock we populate a set of
pointers, known to be non-null at the end of a block (e.g. because we
did a load through them). We then infer that any pointer, based on an
element of this set is non-null as well ("based" here meaning a
non-null pointer is the underlying object). This is incorrect, even if
the base pointer was non-null, the value of a GEP, that lacks the
inbounds` attribute, may be null.

This issue appeared as miscompilation of the following test case:

int puts(const char *);

typedef struct iter {
  int *val;
} iter_t;

static long distance(iter_t first, iter_t last) {
  long r = 0;
  for (; first.val != last.val; first.val++)
    ++r;
  return r;
}

int main() {
  int arr[2] = {0};
  iter_t i, j;
  i.val = arr;
  j.val = arr + 1;
  if (distance(i, j) >= 2)
    puts("failed");
  else
    puts("passed");
}

This fixes PR49662.

Differential Revision: https://reviews.llvm.org/D99642
2021-04-09 14:09:23 +01:00
Jay Foad a4ced03d34 [AMDGPU] SIFoldOperands: eagerly delete dead copies
This is cheap to implement, means less work for future passes like
MachineDCE, and slightly improves the folding in some cases.

Differential Revision: https://reviews.llvm.org/D100117
2021-04-09 13:52:54 +01:00
Simon Pilgrim 5b23e38d9c [X86] Adjust PR44136 tests to add cmpne coverage as well
Alive2: https://alive2.llvm.org/ce/z/pLngT-
2021-04-09 13:42:18 +01:00
Nathan Sidwell 9249826426 [clang] Tiny format fix
Misindented close brace.

Differential Revision: https://reviews.llvm.org/D100129
2021-04-09 05:19:51 -07:00
Thomas Preud'homme 0494b6b676 [PowerPC, test] Fix use of undef FileCheck var
LLVM test CodeGen/PowerPC/ctrloops-softfloat.ll tries to check for the
absence of sequences of instructions with several CHECK-NOT with one of
those directives using a variable defined in another. However CHECK-NOT
are checked independently so that is using a variable defined in a
pattern that should not occur in the input.

This commit changes occurence of the variable for the regex used in its
definition, thereby making each CHECK-NOT independent.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D99881
2021-04-09 12:55:02 +01:00
Thomas Preud'homme bb69173ae5 [PowerPC, test] Fix use of undef FileCheck var
Commit 6ad3d05b68 disables the definition
of CSR that a follow-up CHECK-NOT directive depends on. This commit
replaces the undefined CSR variable use by the regex used to define it.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D99870
2021-04-09 12:54:35 +01:00
Adam Czachorowski 3b4936ba29 [clangd] Add --check-lines to restrict --check to specific lines
This will allow us to add code completion, which is too expensive at
every token, to --check too.

Differential Revision: https://reviews.llvm.org/D98970
2021-04-09 13:47:20 +02:00
Thomas Preud'homme 494ba60bb7 [PowerPC, test] Fix use of undef FileCheck var
Commit 6646033e6e removed the definition
of variable RESULT used in two CHECK-NOT directives in LLVM test
CodeGen/PowerPC/ppc64-i128-abi.ll. This commit replaces the uses by the
regex that was used to define that variable.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D99868
2021-04-09 12:09:48 +01:00
Sven van Haastregt af67deb005 [OpenCL] Simplify InsertOCLBuiltinDeclarationsFromTable
- Use a range-based for loop.  This will help a later patch to skip
   prototypes that use an unavailable return type or argument type.

 - Replace a dyn_cast with a cast, as we are only dealing with
   FunctionProtoType Types here.
2021-04-09 11:54:15 +01:00
Simon Pilgrim 99b46a6c5b [X86] Add PR44136 test coverage 2021-04-09 11:42:10 +01:00
Sebastian Neubauer cc7add5298 [AMDGPU] Use SIInstrFlags for flat variants. NFC
Use SIInstrFlags to differentiate between the different
variants of flat instructions (flat, global and scratch).
This should make it easier to bundle the immediate offset logic in a
single place and implement restrictions and bug workarounds.

Fixed version of D99587, which does not rely on the address space.

Differential Revision: https://reviews.llvm.org/D99743
2021-04-09 12:28:36 +02:00
dfukalov c1a88e007b [AA][NFC] Convert AliasResult to class containing offset for PartialAlias case.
Add an ability to store `Offset` between partially aliased location. Use this
storage within returned `ResultAlias` instead of caching it in `AAQueryInfo`.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D98718
2021-04-09 13:26:09 +03:00
Frederik Gossen 74d33052dd [MLIR][Shape] Add convenience builder for `shape.assuming_all`
Differential Revision: https://reviews.llvm.org/D100105
2021-04-09 12:17:34 +02:00
dfukalov d066079728 [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset.
Main reason is preparation to transform AliasResult to class that contains
offset for PartialAlias case.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D98027
2021-04-09 12:54:22 +03:00
Simon Pilgrim 3ae0a405fc [X86] combineHorizOpWithShuffle - peek through one use bitcasts when decoding shuffles.
Checking for one use, peek through bitcasts of the horizop args to allows us to merge shuffles of different widths through the horizop.
2021-04-09 10:51:04 +01:00
Frederik Gossen 79d12ded53 [MLIR][Shape] Canonicalize `assuming_all` when all operands are `cstr_eq` ops
Differential Revision: https://reviews.llvm.org/D100104
2021-04-09 11:49:29 +02:00
Benjamin Kramer 735eac7c0b [FunctionAttrs] Force old pm in test so it doens't behave differently depending on the configuration setting for this flag 2021-04-09 11:46:19 +02:00
Max Kazantsev baf17e2cc9 [NFC] Move statictic increment out of helper 2021-04-09 16:32:35 +07:00
Sebastian Neubauer ba217b4655 [RegisterScavenging] Add asserts for better errors
These cases were failing before, but with cryptic asserts.
Add asserts in the RegScavenger that fail earlier with better
messages. NFC

Differential Revision: https://reviews.llvm.org/D100109
2021-04-09 11:23:36 +02:00
Sebastian Neubauer 36138db116 [AMDGPU] IsFlatScratch/Global -> FlatScratch/Global
Remove 'Is' from IsFlatScratch/Global. NFC

Differential Revision: https://reviews.llvm.org/D100108
2021-04-09 11:20:31 +02:00
Max Kazantsev 275f3a2540 [GVN][NFC] Factor out load elimination logic via PRE for reuse 2021-04-09 16:12:25 +07:00
Frederik Gossen 538254e8e0 [MLIR] Do not yield values from an assuming op that are never used
Differential Revision: https://reviews.llvm.org/D100042
2021-04-09 11:06:41 +02:00
Jim Lin 7eaa2810c4 [RISCV][NFC] Replace explicit type i64 with riscv customized SDTypeProfile.
New SDTypeProfile can be reused for other word operation patterns without explicit i64 type in the future.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D100097
2021-04-09 17:06:17 +08:00
Thomas Preud'homme 623475248a [test, LoopVectorize] Fix use of var defined in CHECK-NOT
LLVM test Transforms/LoopVectorize/pr34681.ll tries to check for the
absence of a sequence of instructions with several CHECK-NOT with one of
those directives using a variable defined in another. However CHECK-NOT
are checked independently so that is using a variable defined in a
pattern that should not occur in the input.

This commit only checks for the absence of icmp ne 1 which rules out the
presence of the whole sequence and does not involve an undefined
variable.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D99582
2021-04-09 10:01:57 +01:00
Alexander Belyaev 39ae25fb8c [lldb] Update object.test after 'nosync' inference was enabled.
https://reviews.llvm.org/D99769
2021-04-09 10:04:15 +02:00
Alexander Belyaev 8bc08c5517 [lldb] Update UUID after https://reviews.llvm.org/D99978. 2021-04-09 10:03:20 +02:00
Chen Zheng 4b54345e47 [NFC][PowerPC] add test cases for reverse memory op transformation 2021-04-09 03:38:39 -04:00
Jim Lin 6169f1537c [RISCV][NFC] Fix formatting 2021-04-09 14:41:09 +08:00
Max Kazantsev 65d09bcb07 [Test] Add two more tests on PRE with guards 2021-04-09 13:20:23 +07:00
Serguei Katkov f6e3b4fe58 [GreedyRA ORE] Re-factor computeNumberOfSplillsReloads.
Replace if-else to if-continue usage.
This simplifies further extension of the collected stats.
2021-04-09 12:44:11 +07:00
MaheshRavishankar f4eb681dc3 [mlir][Linalg] Drop unit-trip loops of reductions only if other reduction loops exists.
Recent change enable dropping unit-trip loops of "reduction" iterator
type as well. This is fine as long as there is one other "reduction"
iterator in the operation. Without this the initialized value (value
of `out`) is not read which leads to a correctness issue.

Also fix a bug in the `fill` -> `tensor_reshape` folding. The `out`
operand of the `fill` needs to be reshaped to get the `out` operand of
the generated `fill` operation.

Differential Revision: https://reviews.llvm.org/D100145
2021-04-08 22:31:29 -07:00
zoecarver 097d77d611 [libcxx] Allow shared_ptr's unique_ptr converting constructor to support array types.
Refs: https://bugs.llvm.org/show_bug.cgi?id=32147

Differential Revision: https://reviews.llvm.org/D80882
2021-04-08 22:04:57 -07:00
Arthur Eubanks 4c89bcadf6 [LICM] Hoist loads with invariant.group metadata
Previously loading the vtable used in calling a virtual method in a loop
was not hoisted out of the loop. This fixes that.

canSinkOrHoistInst() itself doesn't check that the load operands are
loop invariant, callers also check that separately.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D99784
2021-04-08 21:57:37 -07:00
Esme-Yi 79cade52ed [debug-info][NFC] Set -mtriple to avoid the test failure under other targets. 2021-04-09 04:53:59 +00:00
Serguei Katkov d2e15a83a6 [RS4GC] Cleanup meetBDVState. NFC.
meetBDVState looks pretty difficult to read and follow.
This is purely NFC but doing several things:

1) Combine meet and meetBDVState
2) Move the function to be a member of BDVState
3) Make BDVState be a mutable object
4) Convert switch to sequence of ifs
5) Adds comments.

Reviewers: reames, dantrushin
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D99064
2021-04-09 10:20:25 +07:00
Yang Fan ca55f05116
[clang][SourceManager] Fix -Wparentheses warning (NFC)
GCC warning:
```
/llvm-project/clang/lib/Basic/SourceManager.cpp: In instantiation of ‘constexpr T likelyhasbetween(T, unsigned char, unsigned char) [with T = long unsigned int]’:
/llvm-project/clang/lib/Basic/SourceManager.cpp:1292:52:   required from here
/llvm-project/clang/lib/Basic/SourceManager.cpp:1264:48: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
 1264 |           (x & ~static_cast<T>(0) / 255 * 127) +
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 1265 |               (~static_cast<T>(0) / 255 * (127 - (m - 1)))) &
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2021-04-09 10:22:56 +08:00
Jim Lin 49c79e3b56 [RISCV][NFC] Add explicit type i64 to RV64 only patterns.
Add explicit type i64 to RV64 only patterns to stop emitting unneeded i32 patterns.

It can reduce the isel table size.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D100089
2021-04-09 09:37:04 +08:00
Alex Orlov f47a4c0713 [lld] Fixed CodeView GuidAdapter::format to handle GUID bytes in the right order.
This fixes https://bugs.llvm.org/show_bug.cgi?id=41712 bug.

Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D99978
2021-04-09 05:29:14 +04:00
Rob Suderman ceeb5b0f87 [mlir][tosa] Add tosa.max_pool2d lowering to linalg int max pooling additions
Lowerings tosa.max_pool2d to linalg equivalent operations. Includes
adding max pooling operations for linalg, with corresponding tests.

Differential Revision: https://reviews.llvm.org/D99824
2021-04-08 18:17:16 -07:00
Duncan P. N. Exon Smith 4a84b03ece ADT: Sink the guts of StringMapEntry::Create into StringMapEntryBase
Sink the interesting parts of StringMapEntry::Create into a new function
StringMapEntryBase::allocateWithKey that's only templated on the
allocator, taking the entry size and alignment as parameters.

As dblaikie pointed out in the review, it'd be interesting as a
follow-up to make this more generic and maybe sink at least some of it
into a source file; I haven't done that yet myself, but I left behind an
encouraging comment.

Differential Revision: https://reviews.llvm.org/D95654
2021-04-08 17:57:47 -07:00
David Blaikie eb8a28e2cf DebugInfo: Include inline namespaces in template specialization parameter names
This ensures these types have distinct names if they are distinct types
(eg: if one is an instantiation with a type in one inline namespace, and
another from a type with the same simple name, but in a different inline
namespace).
2021-04-08 17:37:55 -07:00
David Blaikie 8294019633 Use default ref capture to avoid unused capture warning on assert-used variable 2021-04-08 17:37:55 -07:00
Weiwei Li 12ffc26067 [mlir][spirv] Define spv.ImageDrefGather operation
This patch doesn't support the optional operands of ImageDrefGather. The support of optional operands will be implemented later.

co-authered-by: Alan Liu <alanliu.yf@gmail.com>

Differential Revision: https://reviews.llvm.org/D100128
2021-04-08 20:15:54 -04:00