Commit Graph

367581 Commits

Author SHA1 Message Date
Manoel Roemmer c816ee13ad [OpenMP][VE plugin] Fixing failure to build VE plugin with consolidated error handling in libomptarget
The libomptarget VE plugin [[
http://lab.llvm.org:8014/builders/clang-ve-ninja/builds/8937/steps/build-unified-tree/logs/stdio
| fails zu build ]] after ae95ceeb8f .

Differential Revision: https://reviews.llvm.org/D88476
2020-09-29 17:38:01 +02:00
Kostya Kortchinsky e456df77c2 [scudo][standalone] Fix Primary's ReleaseToOS test
Said test was flaking on Fuchsia for non-obvious reasons, and only
for ASan variants (the release was returning 0).

It turned out that the templating was off, `true` being promoted to
a `s32` and used as the minimum interval argument. This meant that in
some circumstances, the normal release would occur, and the forced
release would have nothing to release, hence the 0 byte released.

The symbols are giving it away (note the 1):
```
scudo::SizeClassAllocator64<scudo::FixedSizeClassMap<scudo::DefaultSizeClassConfig>,24ul,1,2147483647,false>::releaseToOS(void)
```

This also probably means that there was no MTE version of that test!

Differential Revision: https://reviews.llvm.org/D88457
2020-09-29 08:26:38 -07:00
Cameron McInally 01c95f7942 [SVE] Fix typo in CHECK lines for sve-fixed-length-int-reduce.ll 2020-09-29 10:12:58 -05:00
Sanjay Patel ee34d9b210 [InstCombine] use redirect of input file in regression tests; NFC
This is a repeat of 1880092722 from 2009. We should have less risk
of hitting bugs at this point because we auto-generate positive CHECK
lines only, but this makes things consistent.

Copying the original commit msg:
"Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename."
2020-09-29 11:06:25 -04:00
Valentin Clement 51323fe2b8 [mlir][openacc] Add init operation
This patch introduces the init operation that represents the init executable directive
from the OpenACC 3.0 specifications.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D88254
2020-09-29 10:59:02 -04:00
Simon Pilgrim 7a55989dc4 [InstCombine] Add some basic trunc(lshr(zext(x),c)) tests
Copied from the sext equivalents
2020-09-29 15:49:57 +01:00
Valentin Clement cc3b8e730e [mlir][openacc] Add wait operation
This patch introduce the wait operation that represent the OpenACC wait directive.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D88125
2020-09-29 10:39:33 -04:00
Tadeo Kondrak 4fb303f340 [clangd] Improve PopulateSwitch tweak to work on non-empty switches
Improve the recently-added PopulateSwitch tweak to work on non-empty switches.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D88434
2020-09-29 16:37:51 +02:00
Simon Pilgrim 89a8a0c910 [InstCombine] Inherit exact flags on extended shifts in trunc (lshr (sext A), C) --> (ashr A, C)
This was missed in D88475
2020-09-29 15:32:09 +01:00
Alex Zinenko 64c0c9f015 [mlir] Expose Dialect class and registration/loading to C API
- Add a minimalist C API for mlir::Dialect.
- Allow one to query the context about registered and loaded dialects.
- Add API for loading dialects.
- Provide functions to register the Standard dialect.

When used naively, this will require to separately register each dialect. When
we have more than one exposed, we can add variadic macros that expand to
individual calls.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D88162
2020-09-29 16:30:08 +02:00
Simon Pilgrim 042f22bda5 [InstCombine] Add exact shift tests missed in D88475
I missed the post-LGTM comment from @lebedev.ri
2020-09-29 15:24:59 +01:00
Chris Hamilton d9ee935679 [Sema] Address-space sensitive check for unbounded arrays (v2)
Check applied to unbounded (incomplete) arrays and pointers to spot
cases where the computed address is beyond the largest possible
addressable extent of the array, based on the address space in which the
array is delcared, or which the pointer refers to.

Check helps to avoid cases of nonsense pointer math and array indexing
which could lead to linker failures or runtime exceptions.  Of
particular interest when building for embedded systems with small
address spaces.

This is version 2 of this patch -- version 1 had some testing issues
due to a sign error in existing code.  That error is corrected and
lit test for this chagne is extended to verify the fix.

Originally reviewed/accepted by: aaron.ballman
Original revision: https://reviews.llvm.org/D86796

Reviewed By: ebevhan

Differential Revision: https://reviews.llvm.org/D88174
2020-09-29 16:14:48 +02:00
Krzysztof Parzyszek db04bec5f1 [SDAG] Do not convert undef to 0 when folding CONCAT/BUILD_VECTOR
Differential Revision: https://reviews.llvm.org/D88273
2020-09-29 09:12:26 -05:00
Simon Pilgrim 14ff38e235 [InstCombine] visitTrunc - trunc (lshr (sext A), C) --> (ashr A, C) non-uniform support
This came from @lebedev.ri's suggestion to use m_SpecificInt_ICMP for D88429 - since I was going to change the m_APInt to m_Constant for that patch I thought I would do it for the only other user of the APInt first.

I've added a ConstantExpr::getUMin helper - its trivial to add UMAX/SMIN/SMAX but thought I'd wait until we have use cases.

Differential Revision: https://reviews.llvm.org/D88475
2020-09-29 15:01:16 +01:00
Valentin Clement ecc9978071 [mlir][openacc] Add update operation
This patch introduce the update operation that represent the OpenACC update directive.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D88102
2020-09-29 09:57:57 -04:00
Nicolas Vasilache 6b649570cb [mlir][Linalg] Refactor Linalg op initTensors support - NFC
Manually-defined named ops do not currently support `init_tensors` or return values and may never support them. Add extra interface to the StructuredOpInterface so that we can still write op-agnostic transformations based on StructuredOpInterface.

This is an NFC extension in preparation for tiling on tensors.

Differential Revision: https://reviews.llvm.org/D88481
2020-09-29 09:56:38 -04:00
Dominik Montada 113114a5da [GlobalISel] fix widenScalarUnmerge if widen type is not a multiple of destination type
Fix creation of illegal unmerge when widen was requested to a type which
is not a multiple of the destination type. E.g. when trying to widen
an s48 unmerge to s64 the existing code would create an illegal unmerge
from s64 to s48.

Instead, create further unmerges to a GCD type, then use this to remerge
these intermediate results to the actual destinations.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D88422
2020-09-29 15:52:20 +02:00
Nicolas Vasilache 074ab233ed [mlir][Linalg] Refactor Linalg creation of loops to allow passing iterArgs - NFC
This revision changes the signatures of helper function that Linalg uses to create loops so that they can also take iterArgs.
iterArgs are asserted empty to ensure no functional change.
This is a mechanical change in preparation of tiling on linalg on tensors to avoid  polluting the implementation with an NFC change.

Differential Revision: https://reviews.llvm.org/D88480
2020-09-29 09:51:11 -04:00
Daniel Kiss f34ae1b9de [AArch64] Add v8.5 Branch Target Identification support.
The .note.gnu.property must be in the assembly file to indicate the
support for BTI otherwise BTI will be disabled for the whole library.
__unw_getcontext and libunwind::Registers_arm64::jumpto() may be called
indirectly therefore they should start with a landing pad.

Reviewed By: tamas.petz, #libunwind, compnerd

Differential Revision: https://reviews.llvm.org/D77786
2020-09-29 15:51:01 +02:00
Mirko Brkusanin 8b08fa0103 Revert "[AMDGPU] Reorganize GCN subtarget features for unaligned access"
This reverts commit f5cd7ec9f3.

Certain rocPRIM/rocThrust/hipCUB tests were failing because of this change.
2020-09-29 15:33:34 +02:00
Andrzej Warzynski 6199219bbd [mlir] Fix shared libs build
The following change causes the shared libraries build
(BUILD_SHARED_LIBS=On) to fail:
  * https://reviews.llvm.org/D88351
This patch will fix that.

Differential Revision: https://reviews.llvm.org/D88484
2020-09-29 14:31:14 +01:00
Jay Foad 781edd501c [SDag] Verify DAG divergence after dumping. NFC.
When debugging, it's useful to be able to see the DAG that has just
failed divergence verification.
2020-09-29 14:05:07 +01:00
Jay Foad d6b04f3937 [SDag] Refactor and simplify divergence calculation and checking. NFC. 2020-09-29 14:05:07 +01:00
Jonas Paulsson 75a5febe31 [SystemZ] Don't emit PC-relative memory accesses to unaligned symbols.
In the presence of packed structures (#pragma pack(1)) where elements are
referenced through pointers, there will be stores/loads with alignment values
matching the default alignments for the element types while the elements are
in fact unaligned. Strictly speaking this is incorrect source code, but is
unfortunately part of existing code and therefore now addressed.

This patch improves the pattern predicate for PC-relative loads and stores by
not only checking the alignment value of the instruction, but also making
sure that the symbol (and element) itself is aligned.

Fixes https://bugs.llvm.org/show_bug.cgi?id=44405

Review: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D87510
2020-09-29 14:51:13 +02:00
Stephan Herhut edeff6e642 [mlir][GPU] Improve constant sinking in kernel outlining
The previous implementation did not support sinking simple expressions. In particular,
it is often beneficial to sink dim operations.

Differential Revision: https://reviews.llvm.org/D88439
2020-09-29 14:46:15 +02:00
Florian Hahn 7bae2bc5a8 [LoopUtils] Only verify SE in builds with assertions.
Follow up to 60b852092c.
2020-09-29 13:39:23 +01:00
Hans Wennborg a59be54e61 [sanitizer] Don't build gmock for tests (follow-up to 82827244).
A use of gmock was briefly added in a90229d6, but was soon removed in
82827244. This also removes it from the cmake files.
2020-09-29 14:34:05 +02:00
Alexey Bader 9263931fcc [SYCL] Assume SYCL device functions are convergent
SYCL device compiler (similar to other SPMD compilers) assumes that
functions are convergent by default to avoid invalid transformations.
This attribute can be removed if compiler can prove that function does
not have convergent operations.

Reviewed By: Naghasan

Differential Revision: https://reviews.llvm.org/D87282
2020-09-29 15:23:50 +03:00
Daniel Kiss c5a4900e1a [AArch64] Add BTI to CFI jumptables.
With branch protection the jump to the jump table entries requires a landing pad.

Reviewed By: eugenis, tamas.petz

Differential Revision: https://reviews.llvm.org/D81251
2020-09-29 13:50:23 +02:00
David Stenberg e6f332ef1e [IndVarSimplify] Fix Modified status for removal of overflow intrinsics
When removing an overflow intrinsic the Changed status in SimplifyIndvar
was not set, leading to the IndVarSimplify pass returning an incorrect
status.

This was caught using the check introduced by D80916.

As pointed out in the code review, a similar bug may exist for
eliminateTrunc().

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D85971
2020-09-29 13:20:59 +02:00
Vitaly Buka 4aa6abe4ef [msan] Fix llvm.abs.v intrinsic
The last argument of the intrinsic is a boolean
flag to control INT_MIN handling and does
not affect msan metadata.
2020-09-29 03:52:27 -07:00
Vitaly Buka 1fd9a146d3 [msan] Add test for vector abs intrinsic 2020-09-29 03:52:27 -07:00
sstefan1 cb9cfa0d2f [OpenMPOpt][Fix] Only initialize ICV initial values once.
Reviewers: jdoerfert, ggeorgakoudis

Differential Revision: https://reviews.llvm.org/D88441
2020-09-29 12:22:58 +02:00
Simon Pilgrim 324df2661b [InstCombine] Add trunc(lshr(sext(x),c)) non-uniform vector tests 2020-09-29 10:56:15 +01:00
Florian Hahn 60b852092c [LoopDeletion] Forget loop before setting values to undef
After D71539, we need to forget the loop before setting the incoming
values of phi nodes in exit blocks, because we are looking through those
phi nodes now and the SCEV expression could depend on the loop phi. If
we update the phi nodes before forgetting the loop, we miss those users
during invalidation.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D88167
2020-09-29 10:38:44 +01:00
Max Kazantsev 9100bd772d [SCEV][NFC] Introduce isBasicBlockEntryGuardedByCond
Currently, we have `isLoopEntryGuardedByCond` method in SCEV, which
checks that some fact is true if we enter the loop. In fact, this is just a
particular case of more general concept `isBasicBlockEntryGuardedByCond`
applied to given loop's header. In fact, the logic if this code is largely
independent on the given loop and only cares code above it.

This patch makes this generalization. Now we can query it for any block,
and `isBasicBlockEntryGuardedByCond` is just a particular case.

Differential Revision: https://reviews.llvm.org/D87828
Reviewed By: fhahn
2020-09-29 15:53:45 +07:00
Tres Popp eb9f7c28e5 Revert "OpaquePtr: Add type to sret attribute"
This reverts commit 55c4ff91bd.

Issues were introduced as discussed in https://reviews.llvm.org/D88241
where this change made previous bugs in the linker and BitCodeWriter
visible.
2020-09-29 10:31:04 +02:00
Serguei Katkov 297ec61130 [IsKnownNonZero] Handle the case with non-constant phi nodes
Handle the case when all inputs of phi are proven to be non zero.

Constants are checked in beginning of this method before check for depth of recursion,
so it is a partial case of non-constant phi.

Recursion depth is already handled by the function.

Reviewers: aqjune, nikic, efriedma
Reviewed By: nikic
Subscribers: dantrushin, hiraditya, jdoerfert, llvm-commits
Differential Revision: https://reviews.llvm.org/D88276
2020-09-29 15:22:10 +07:00
Florian Hahn b76df593eb Revert "Recommit "[SCCP] Do not replace deref'able ptr with un-deref'able one.""
Looks like there is still another remaining issue:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/22273/steps/build%20libcxx%2Fmsan/logs/stdio

This reverts commit 86a20d9e34.
2020-09-29 09:18:19 +01:00
Florian Hahn 86a20d9e34 Recommit "[SCCP] Do not replace deref'able ptr with un-deref'able one."
This version includes an small fix allowing function pointers to be
unconditionally replaced for now.

This reverts commit 4c5e4aa89b.
2020-09-29 09:10:27 +01:00
Sam Parker 4c19b89b25 [NFC][ARM] Comments and lambdas
Add some comments in LowOverheadLoops and make some lambda variables
explicit arguments instead of capturing.
2020-09-29 08:41:53 +01:00
Ellis Hoag 98ef7e29b0 This reduces code duplication between CGObjCMac.cpp and Mangle.cpp
for generating the mangled name of an Objective-C method.

This has no intended functionality change.

https://reviews.llvm.org/D88329
2020-09-29 02:26:51 -04:00
Dmitry Antipov bc868da0e7 [Driver] Filter out <libdir>/gcc and <libdir>/gcc-cross if they do not exists
Differential Revision: https://reviews.llvm.org/D87901
2020-09-29 09:18:50 +03:00
Craig Topper 82da0cabb9 [X86] Add computeKnownBits support for PEXT.
The number of zeros in the mask provides a lower bound on the number
of leading zeros in the result.
2020-09-28 22:54:07 -07:00
Craig Topper a4b1fdec91 [X86] Add known bits test for PEXT. NFC 2020-09-28 22:54:07 -07:00
Johannes Doerfert 4fc69ab002 Revert "[OpenMP][FIX] Verify compatible types for declare variant calls"
This reverts commit c942095790.

One of the tests broke, revert to investigate.
2020-09-29 00:37:11 -05:00
Arthur Eubanks da036b4514 [Docs][NewPM] Add note about required passes
Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D88342
2020-09-28 21:45:14 -07:00
Max Kazantsev e862e78b63 [NFC] Use assert instead of checking the guaranteed condition
From preconditions it is known that either A dominates B or
B dominates A. If A does not dominate B, we do not really need
to check it. Assert should be enough. Should save some compile
time.
2020-09-29 11:38:45 +07:00
Max Kazantsev d266fd960e [IndVars] Remove exiting conditions that are trivially true/false
When removing exiting loop conditions, we only consider checks for
which we know the exact exit count. We could also eliminate checks for
which the condition is always true/false.

Differential Revision: https://reviews.llvm.org/D87344
Reviewed By: lebedev.ri, reames
2020-09-29 11:35:32 +07:00
Johannes Doerfert c942095790 [OpenMP][FIX] Verify compatible types for declare variant calls
Especially for templates we need to check at some point if the base
function matches the specialization we might call instead. Before this
lead to the replacement of `std::sqrt(int(2))` calls with one that
converts the argument to a `std::complex<int>`, clearly not the desired
behavior.

Reported as PR47655

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D88384
2020-09-28 23:26:21 -05:00