Commit Graph

383357 Commits

Author SHA1 Message Date
Jonas Devlieghere cdac60107d [lldb] Update assert.test to be less strict
Be less strict when checking for the assert substring.
2021-03-19 14:31:56 -07:00
Arthur Eubanks a1ab5627f0 Revert "[NewPM] Verify LoopAnalysisResults after a loop pass"
This reverts commit 94c269baf5.

Still causes too large of compile time regression in normal debug
builds. Will put under expensive checks instead.
2021-03-19 14:31:08 -07:00
Jonas Devlieghere e089b5e9e1 [lldb] Call os_log_fault on lldb_assert
Call `os_log_fault` when an lldb assert fails. We piggyback off
`LLVM_SUPPORT_XCODE_SIGNPOSTS`, which also depends on `os_log`, to avoid
having to introduce another CMake check and corresponding define.

This patch also adds a small test using lldb-test that verifies we abort
with a "regular" assertion when asserts are enabled.

Differential revision: https://reviews.llvm.org/D98987
2021-03-19 14:23:50 -07:00
Ella Ma 0de3d1c814 [llvm] Add assertions for the smart pointers with the possibility to be null in ModuleLazyLoaderCache::operator()
Split from D91844.

The return value of function `ModuleLazyLoaderCache::operator()` in file llvm/tools/llvm-link/llvm-link.cpp. According to the bug report of my static analyzer, the std::function variable `ModuleLazyLoaderCache::createLazyModule` points to function `loadFile`, which may return `nullptr` when error. And the pointer is dereferenced without a check.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D97258
2021-03-19 13:52:34 -07:00
Stella Laurenzo 436c6c9c20 NFC: Break up the mlir python bindings into individual sources.
* IRModules.cpp -> (IRCore.cpp, IRAffine.cpp, IRAttributes.cpp, IRTypes.cpp).
* The individual pieces now compile in the 5-15s range whereas IRModules.cpp was starting to approach a minute (didn't capture a before time).
* More fine grained splitting is possible, but this represents the most obvious.

Differential Revision: https://reviews.llvm.org/D98978
2021-03-19 13:33:51 -07:00
Arthur Eubanks 94c269baf5 [NewPM] Verify LoopAnalysisResults after a loop pass
All loop passes should preserve all analyses in LoopAnalysisResults. Add
    checks for those.

    Note that due to PR44815, we don't check LAR's ScalarEvolution.
    Apparently calling SE.verify() can change its results.

    Only verify MSSA when VerifyMemorySSA, normally it's very expensive.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D98820
2021-03-19 13:26:45 -07:00
Butygin a531bbd9ad [MLIR] Test pattern benefit sorting between operation specific and operation agnostic patterns.
Previously low benefit op-specific patterns never had a chance to match
even if high benefit op-agnostic pattern failed to match.

This was already fixed upstream, this commit just adds testscase

Differential Revision: https://reviews.llvm.org/D98513
2021-03-19 23:11:56 +03:00
Benjamin Kramer 6327a7cfd7 [mlir][Linalg] Make LLVM_DEBUG region bigger to avoid warnings in Release builds
Transforms.cpp:586:16: error: unused variable 'v' [-Werror,-Wunused-variable]
    for (Value v : operands)
               ^
2021-03-19 20:56:59 +01:00
Benjamin Kramer 19d2c65ddd [CodeGen] Don't crash on for loops with cond variables and no increment
This looks like an oversight from a875721d8a, creating IR that refers
to `for.inc` even if it doesn't exist.

Differential Revision: https://reviews.llvm.org/D98980
2021-03-19 20:43:52 +01:00
Jim Ingham 9d081a7ffe Revert "Make the stop-on-sharedlibrary-events setting work."
This reverts commit 9406d43138.

I messed up a test, and when I got it right it was failing.  The changed logic
doesn't work quite right (now the async callback called at sync time is
forcing us to stop.  I need to be a little more careful about that.
2021-03-19 12:38:41 -07:00
Jim Ingham e8e07b3a5e Revert "Skip all the tests for Windows."
This reverts commit a8d62fc8ff.
2021-03-19 12:38:23 -07:00
Sanjay Patel 2fc47afed2 [SLP] remove unnecessary characters in test; NFC
Glitch that crept in with 62f9c3358b
2021-03-19 15:09:53 -04:00
Sanjay Patel 62f9c3358b [SLP] add tests for min/max reductions that use intrinsics; NFC 2021-03-19 15:06:16 -04:00
Jim Ingham a8d62fc8ff Skip all the tests for Windows. 2021-03-19 12:05:16 -07:00
Jim Ingham 9406d43138 Make the stop-on-sharedlibrary-events setting work.
We weren't taking into account the "m_should_stop" setting that the
synchronous breakpoint callback had already set when we did PerformAction
in the StopInfoBreakpoint.  So we didn't obey its instructions when it
told us to stop.  Fixed that and added some tests both for when we
just have the setting, and when we have the setting AND other breakpoints
at the shared library load notification breakpoint address.

Differential Revision: https://reviews.llvm.org/D98914
2021-03-19 12:02:16 -07:00
Louis Dionne 976eba51d0 [libc++] NFCI: Remove dead code in the Lit configuration
I was trying to fix something else and I stumbled upon several methods
that are not used anymore in target_info.py.

Differential Revision: https://reviews.llvm.org/D98896
2021-03-19 12:01:30 -07:00
Arnamoy Bhattacharyya e27654f737 [Flang][OpenMP] Add more sema checks for ordered construct
This patch fixes a bug to allow ordered construct within a non-worksharing loop, also adds more sema checks.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D98733
2021-03-19 14:56:40 -04:00
Craig Topper 1066dcb550 [AArch64] Fix LowerMGATHER to return the chain result for floating point gathers.
Found by adding asserts to LegalizeDAG to make sure custom legalized
results had the right types.

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D98968
2021-03-19 11:53:46 -07:00
Rob Suderman 47286fc530 [mlir][tosa] Add tosa.cast to linalg lowering
Handles lowering from the tosa CastOp to the equivalent linalg lowering. It
includes support for interchange between bool, int, and floating point.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D98828
2021-03-19 11:48:37 -07:00
Rob Suderman 1b7498120d [mlir][tosa] Add tosa.logical_* to linalg lowerings
Adds lowerings for logical_* boolean operations. Each of these ops only operate
on booleans allowing simple lowerings.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D98910
2021-03-19 11:30:42 -07:00
David Green a2e0312cda [ARM] Tone down the MVE scalarization overhead
The scalarization overhead was set deliberately high for MVE, whilst the
codegen was new. It helps protect us against the negative ramifications
of mixing scalar and vector instructions. This decreases that,
especially for floating point where the cost of extracting/inserting
lane elements can be low. For integer the cost is still fairly high due
to the cross-register-bank copy, but is no longer n^2 in the length of
the vector.

In general, this will decrease the cost of scalarizing floats and long
integer vectors. i64 increase in cost, having a high cost before and
after this patch. For floats this allows up to start doing things like
vectorizing fdiv instructions, even if they are scalarized.

Differential Revision: https://reviews.llvm.org/D98245
2021-03-19 18:30:11 +00:00
Stella Laurenzo d4cba4a188 [mlir][linalg] Add structured op builders from python opdsl.
* Makes the wrapped functions of the `@linalg_structured_op` decorator callable such that they emit IR imperatively when invoked.
* There are numerous TODOs that I will keep working through to achieve generality.
* Will true up exception handling tests as the feature progresses (for things that are actually errors once everything is implemented).
* Includes the addition of an `isinstance` method on concrete types in the Python API.

Differential Revision: https://reviews.llvm.org/D98754
2021-03-19 11:20:36 -07:00
Vy Nguyen 6c1ae8f2dc [lld-macho][nfc] Fixed typo in comment
Missed this one from https://reviews.llvm.org/D97007?id=331759#inline-930034

Differential Revision: https://reviews.llvm.org/D98973
2021-03-19 14:19:36 -04:00
Philip Reames 5698537f81 Update basic deref API to account for possiblity of free [NFC]
This patch is plumbing to support work towards the goal outlined in the recent llvm-dev post "[llvm-dev] RFC: Decomposing deref(N) into deref(N) + nofree".

The point of this change is purely to simplify iteration on other pieces on way to making the switch. Rebuilding with a change to Value.h is slow and painful, so I want to get the API change landed. Once that's done, I plan to more closely audit each caller, add the inference rules in their own patch, then post a patch with the langref changes and test diffs. The value of the command line flag is that we can exercise the inference logic in standalone patches without needing the whole switch ready to go just yet.

Differential Revision: https://reviews.llvm.org/D98908
2021-03-19 11:17:19 -07:00
Vy Nguyen 66f340051a [lld-macho] Define __mh_*_header synthetic symbols.
Bug: https://bugs.llvm.org/show_bug.cgi?id=49290

    Differential Revision: https://reviews.llvm.org/D97007
2021-03-19 14:14:40 -04:00
Jonas Devlieghere 6c52d4fd4c [lldb] Make the API, Shell and Unit tests independent lit test suites
Make the API, Shell and Unit tests independent lit test suites. This
allows us to specify different dependencies and skip rebuilding all the
unit test (which is particularly expensive) when running check-lldb-api
or check-lldb-shell.

This does not change the autogenerated targets such as
check-lldb-shell-driver or the top level check-lldb target, which all
continue to work as before.

Differential revision: https://reviews.llvm.org/D98842
2021-03-19 11:13:46 -07:00
Alexey Bataev 14ae0cf0f5 [Cost]Canonicalize the cost for logical or/and reductions.
The generic cost of logical or/and reductions should be cost of bitcast
<ReduxWidth x i1> to iReduxWidth + cmp eq|ne iReduxWidth.

Differential Revision: https://reviews.llvm.org/D97961
2021-03-19 11:01:58 -07:00
Bjorn Pettersson 5737010a79 [LangRef] Describe memory layout for vectors types
There are a couple of caveats when it comes to how vectors are
stored to memory, and thereby also how bitcast between vector
and integer types work, in LLVM IR. Specially in relation to
endianess. This patch is an attempt to document such things.

Reviewed By: nlopes

Differential Revision: https://reviews.llvm.org/D94964
2021-03-19 19:00:37 +01:00
Craig Topper 5d315691c4 [RISCV] Add missing bitcasts to the results of lowerINSERT_SUBVECTOR and lowerEXTRACT_SUBVECTOR when handling mask vectors.
Found by adding asserts to LegalizeDAG to catch incorrect result
types being returned.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D98964
2021-03-19 10:54:33 -07:00
Craig Topper 95998b898c [Hexagon] Return an i64 for result 0 from LowerREADCYCLECOUNTER instead of an i32.
As far as I can tell, the node coming in has an i64 result so the
return should have the same type. The HexagonISD node used for
this has a type profile that says the result is i64.

Found while trying to add assserts to LegalizeDAG to catch
result type mismatches.

Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D98962
2021-03-19 10:54:33 -07:00
Jianzhou Zhao fbc1f48daf [dfsan] Turn on testing origin tracking at atomics.ll 2021-03-19 17:53:13 +00:00
Andrei Elovikov 92205cb27f [NFC][VPlan] Guard print routines with "#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)"
Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D98897
2021-03-19 10:50:12 -07:00
Andrei Elovikov 93a9d2de8f [VPlan] Add plain text (not DOT's digraph) dumps
I foresee two uses for this:
1) It's easier to use those in debugger.
2) Once we start implementing more VPlan-to-VPlan transformations (especially
   inner loop massaging stuff), using the vectorized LLVM IR as CHECK targets in
   LIT test would become too obscure. I can imagine that we'd want to CHECK
   against VPlan dumps after multiple transformations instead. That would be
   easier with plain text dumps than with DOT format.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D96628
2021-03-19 10:50:12 -07:00
Craig Topper 85f3f6b3cc [RISCV] Lower scalable vector masked loads to intrinsics to match fixed vectors and reduce isel patterns.
Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D98840
2021-03-19 10:39:35 -07:00
thomasraoux 3587728ed5 [mlir] Fix cuda integration test failure 2021-03-19 10:33:55 -07:00
Fraser Cormack d399b82e2a [RISCV] Maintain fixed-length info when optimizing BUILD_VECTORs
I'm not sure how I failed to notice this before, but when optimizing
dominant-element BUILD_VECTORs we would lower via the scalable container type,
which lost us the information about the fixed length of the vector types. By
lowering via the fixed-length type we can preserve that information and
eliminate redundant vsetvli instructions.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D98938
2021-03-19 17:21:06 +00:00
Emily Shi 6ca178cd78 [asan] specify c++ version in tests to fix compile error
If we don't specify the c++ version in these tests, it could cause compile errors because the compiler could default to an older c++

rdar://75247244

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D98913
2021-03-19 10:08:18 -07:00
Philip Reames 00d0315a7c [SCEV] Factor out a lambda for strict condition splitting [NFC] 2021-03-19 10:07:12 -07:00
Fraser Cormack 3bffa2c2aa [RISCV] Add missing CHECKs to vector test
Since the "LMUL-MAX=2" output for some test functions differed between
RV32 and RV64, the update_llc_test_checks script failed to emit a
unified LMULMAX2 check for them. I'm not sure why it didn't warn about
this.

This patch also takes the opportunity to add unified RV32/RV64 checks to
help shorten the test file when the output for LMULMAX1 and LMULMAX2 is
identical but differs between the two ISAs.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D98944
2021-03-19 16:52:16 +00:00
Fraser Cormack 550292ecb1 [RISCV] Fix missing scalable->fixed-length vector conversion
Returning the scalable-vector container type would present problems when
the fixed-length INSERT_VECTOR_ELT was used by later operations.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D98776
2021-03-19 16:49:47 +00:00
Martin Storsjö 7a154c3230 [libcxx] [test] Account for differences in a trailing slash in weakly_canonical
This seems to be a documented quirk in libc++'s implementation of
weakly_canonical (in a comment in the weakly_canonical test).
Together with a difference between windows and posix regarding whether
paths can go through nonexistent dirs, this results in a difference in
a trailing slash.

Just document this as expected, and degrade the comment from fixme to
a note, as MS STL and libstdc++ behave in the same way.

Differential Revision: https://reviews.llvm.org/D98642
2021-03-19 18:49:05 +02:00
Martin Storsjö cfa65f77cb [cmake] Enable Clang warnings about redundant semicolons
This matches what GCC warns about when -pedantic is enabled.

This should avoid such redundant semicolons creeping into the codebase.

Differential Revision: https://reviews.llvm.org/D98941
2021-03-19 18:49:05 +02:00
Jay Foad 87248e852b [AMDGPU] Rationalize some check prefixes and use more common prefixes. NFC. 2021-03-19 16:48:33 +00:00
Jay Foad 5df52f7708 [AMDGPU] Remove weird target triples from tests. NFC. 2021-03-19 16:48:32 +00:00
Markus Böck aafc3f7be8 [Driver] Add -print-runtime-dir
This patch adds a new command line option to clang which outputs the directory containing clangs runtime libraries to stdout.

The primary use case for this command line flag is for build systems using clang-cl. Build systems when using clang-cl invoke the linker, that is either link or lld-link in this case, directly instead of invoking the compiler for the linking process as is common with the other drivers. This leads to issues when runtime libraries of clang, such as sanitizers or profiling, have to be linked in as the compiler cannot communicate the link directory to the linker.

Using this flag, build systems would be capable of getting the directory containing all of clang's runtime libraries and add it to the linker path.

Differential Revision: https://reviews.llvm.org/D98868
2021-03-19 17:48:03 +01:00
David Spickett 3aa6a4cb39 [libcxx][Arm] Move buildbot flags into cmake files
Reviewed By: #libc, Mordante, curdeius

Differential Revision: https://reviews.llvm.org/D98771
2021-03-19 16:45:09 +00:00
Nicolas Vasilache 5b2d8503d1 [mlir][Linalg] NFC - Expose helper function `substituteMin`. 2021-03-19 16:26:52 +00:00
Jianzhou Zhao 1fe042041c [dfsan] Add origin ABI wrappers
supported: dl_get_tls_static_info, calloc, clock_gettime,
dfsan_set_write_callback, dl_iterato_phdr, dlopen, memcpy,
memmove, memset, pread, read, strcat, strdup, strncpy

This is a part of https://reviews.llvm.org/D95835.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D98790
2021-03-19 16:23:25 +00:00
Paul Robinson fb4f6057a6 [RGT] Recode more unreachable assertions and tautologies
Count iterations of zero-trip loops and assert the count is zero,
rather than asserting inside the loop.
Unreachable functions should use llvm_unreachable.
Remove tautological 'if' statements, even when they're following a
pattern of checks.

Found by the Rotten Green Tests project.
2021-03-19 09:17:22 -07:00
Simon Pilgrim 9d2df96407 [DAG] computeKnownBits - add ISD::MULHS/MULHU/SMUL_LOHI/UMUL_LOHI handling
Reuse the existing KnownBits multiplication code to handle the 'extend + multiply + extract high bits' pattern for multiply-high ops.

Noticed while looking at the codegen for D88785 / D98587 - the patch helps division-by-constant expansion code in particular, which suggests that we might have some further KnownBits div/rem cases we could handle - but this was far easier to implement.

Differential Revision: https://reviews.llvm.org/D98857
2021-03-19 16:02:31 +00:00