Commit Graph

385195 Commits

Author SHA1 Message Date
Simon Pilgrim aeff03d2df [InstCombine] Regenerate 2010-11-23-Distributed.ll tests 2021-04-09 16:40:18 +01:00
Matheus Izvekov 1819222860 [clang] tests: cleanup, update and add some new ones
This reworks a small set of tests, as preparatory work for implementing
P2266.
* Run for more standard versions, including c++2b.
* Normalize file names and run commands.
* Adds some extra tests.

New Coroutine tests taken from Aaron Puchert's D68845.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D99225
2021-04-09 17:24:08 +02:00
Simon Pilgrim d8bc4de3cf [X86] Fold cmpeq/ne(or(X,Y),X) --> cmpeq/ne(and(~X,Y),0) on non-BMI targets (PR44136)
Followup to D100177, enable the fold for non-BMI targets as well.
2021-04-09 16:11:11 +01:00
Paul Robinson b7578f9d5a [RGT] Tweak test so assertion is always executed
Any given Windows system will have only one "system" encoding for
UTF-16 (BE or LE), so the assert for the other one would always
show up as rotten.  Use a common assertion for both paths to avoid
this.
2021-04-09 08:10:45 -07:00
Frederik Gossen e413b86a2c [MLIR][Shape] Combine `cstr_eq` only if they share shape operands
Differential Revision: https://reviews.llvm.org/D100198
2021-04-09 16:54:54 +02:00
Simon Pilgrim 245036950a [X86][BMI] Fold cmpeq/ne(or(X,Y),X) --> cmpeq/ne(and(~X,Y),0) (PR44136)
I've initially just enabled this for BMI which has the ANDN instruction for i32/i64 - the i16/i8 cases give an idea of what'd we get when we enable it in all cases (I'll do this as a later commit).

Additionally, the i16/i8 cases could be freely promoted to i32 (as the args are already zeroext) and we could then make use of ANDN + the free cmp0 there as well - this has come up in PR48768 and PR49028 so I'm going to look at this soon.

https://alive2.llvm.org/ce/z/QVWHP_
https://alive2.llvm.org/ce/z/pLngT-

Vector cases do not appear to benefit from this as we end up with having to generate the zero vector as well - this is one of the reasons I didn't try to tie this into hasAndNot/hasAndNotCompare.

Differential Revision: https://reviews.llvm.org/D100177
2021-04-09 15:52:03 +01:00
jasonliu f3d7536b24 [libc++] Fix abs and div overload issue for compilers on AIX
Summary:
AIX system's stdlib.h provide different overload of abs and div
depending on compiler versions.

For example, std::div(long, long) and std::abs(long) are not available
from OS's stdlib.h when building with clang, but they are available
when building with xlclang compiler.

Therefore, we need to provide those extra overloads in libc++'s stdlib.h
when OS's stdlib.h does not.

Differential Revision: https://reviews.llvm.org/D99767
2021-04-09 14:47:13 +00:00
Yaxun (Sam) Liu f9264ac0fd [HIP] Workaround ICE compiling SemaChecking.cpp with gcc 5
Change-Id: I6c6213bc6b90365bfb78636ce7fb0700a58807cf
2021-04-09 10:40:07 -04:00
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