Commit Graph

424247 Commits

Author SHA1 Message Date
Jay Foad
6bec3e9303 [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf
Most clients only used these methods because they wanted to be able to
extend or truncate to the same bit width (which is a no-op). Now that
the standard zext, sext and trunc allow this, there is no reason to use
the OrSelf versions.

The OrSelf versions additionally have the strange behaviour of allowing
extending to a *smaller* width, or truncating to a *larger* width, which
are also treated as no-ops. A small amount of client code relied on this
(ConstantRange::castOp and MicrosoftCXXNameMangler::mangleNumber) and
needed rewriting.

Differential Revision: https://reviews.llvm.org/D125557
2022-05-19 11:23:13 +01:00
Ivan Kosarev
70ace420c1 [AMDGPU][NFC] Fix FileCheck directives in phi-vgpr-input-moveimm.mir.
Discovered with D125604.

Reviewed By: #amdgpu, arsenm

Differential Revision: https://reviews.llvm.org/D125900
2022-05-19 11:20:08 +01:00
Kirill Bobyrev
4f5a4215bf
[clangd] Update the test after diagnostic message change 2022-05-19 12:03:31 +02:00
Kirill Bobyrev
43c0f90dd6
[clangd] NFC: Clarify the Include Cleaner warning 2022-05-19 11:59:00 +02:00
Lian Wang
530bab1f93 [RISCV][SelectionDAG] Support VECREDUCE_ADD mask operation
Re-landed D125206

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125206
2022-05-19 09:53:33 +00:00
Konrad Kleine
c0f5beef2f [release] Add cmake as an extra tarball and not bundle it
Revert "Add cmake/ to release tarballs via concatenation"

This reverts commit 3a33664e88.

Revert "Add cmake to source release tarballs"

This reverts commit 32a0482a65.

Reviewed By: tstellar, aaronpuchert

Differential Revision: https://reviews.llvm.org/D125798
2022-05-19 11:12:54 +02:00
Alex Bradbury
2f8c067bef [WebAssembly][NFC] Fix errant tabs in test case in last commit
[4e8b2ac](https://reviews.llvm.org/rG4e8b2ac7c019) contained unintended
tabs. This commit fixes that.
2022-05-19 10:10:20 +01:00
Guillaume Chatelet
94d6dd9057 [libc] Apply no-builtin everywhere, remove unnecessary flags
Some functions like `stpncpy` are implemented in terms of `memset` but are not
currently using `-fno-builtin-memset`. This is somewhat hidden by the fact that
we use `-ffreestanding` globally and that `-ffreestanding` implies
`-fno-builtin` for Clang.

This patch also removes `-mllvm -combiner-global-alias-analysis` that is Clang
specific and that does not bring substantial gains on modern processors.

Also we keep `-mllvm --tail-merge-threshold=0` for aarch64 in CMakeLists.txt
but we omit it in the Bazel config. This is because Bazel consumes the source
files directly and so it can use PGO to take optimal decisions locally.

Differential Revision: https://reviews.llvm.org/D125894
2022-05-19 09:08:42 +00:00
Alex Bradbury
4e8b2ac7c0 [WebAssembly] Fix bug where -no-type-check failed to completely disable the typechecker
Related to <https://github.com/llvm/llvm-project/issues/55566>.
Committing directly (per LLVM's code review policy) as this is a trivial
fix.
2022-05-19 10:06:02 +01:00
LLVM GN Syncbot
3948962b45 [gn build] Port 4df795bff7 2022-05-19 08:04:45 +00:00
Sam McCall
481691572d [Serialization] Add missing includes for CHAR_BIT 2022-05-19 10:04:25 +02:00
Lian Wang
f035068bb3 [LegalizeVectorTypes][VP] Add widen and split support for VP_SETCC
Reviewed By: craig.topper, frasercrmck

Differential Revision: https://reviews.llvm.org/D125446
2022-05-19 07:42:39 +00:00
Daniel Kiss
d3a6f57391 [libunwind] Remove -Wsign-conversion warning
Reland after dependent change reland.
2022-05-19 09:41:42 +02:00
Sam McCall
4df795bff7 [Serialization] Delta-encode consecutive SourceLocations in TypeLoc
Much of the size of PCH/PCM files comes from stored SourceLocations.
These are encoded using (almost) their raw value, VBR-encoded. Absolute
SourceLocations can be relatively large numbers, so this commonly takes
20-30 bits per location.

We can reduce this by exploiting redundancy: many "nearby" SourceLocations are
stored differing only slightly and can be delta-encoded.
Randam-access loading of AST nodes constrains how long these sequences
can be, but we can do it at least within a node that always gets
deserialized as an atomic unit.

TypeLoc is implemented in this patch as it's a relatively small change
that shows most of the API.
This saves ~3.5% of PCH size, I have local changes applying this technique
further that save another 3%, I think it's possible to get to 10% total.

Differential Revision: https://reviews.llvm.org/D125403
2022-05-19 09:40:44 +02:00
Lian Wang
bbc6834e26 [LegalizeTypes][VP] Add integer promotions support for VP_TRUNCATE
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125739
2022-05-19 07:36:10 +00:00
Lian Wang
993070d11f [LegalizeTypes][VP][NFC] Use an if and two returns instead of ?: operator
Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D125858
2022-05-19 07:18:24 +00:00
Sam McCall
4f35ca59d0 [clangd] Suppress warning: control reaches end of function 2022-05-19 08:26:13 +02:00
Sam McCall
cd387e43bf [pseudo] Squash some warnings. NFC
Explicitly sizing Kind enum suggests that too-large values are allowed,
and that putting it in a bitfield is dangerous.

GCC doesn't like condition ? integer : enum.
2022-05-19 08:20:12 +02:00
LLVM GN Syncbot
dfd3a385d6 [gn build] Port 03ea140b3a 2022-05-19 06:13:53 +00:00
Sam McCall
07c6635901 [clang-tidy] Fix logic of assertion 2022-05-19 08:13:23 +02:00
Sam McCall
03ea140b3a Reland(3) "[clangd] Indexing of standard library"
Tracked down the crash, which was argument-evaluation-order UB
in the wrapping indexStandardLibrary().
Sorry for the churn!

This reverts commit 77533ea443.
2022-05-19 08:13:23 +02:00
Stella Laurenzo
8b7e85f4f8 [mlir][python] Add Python bindings for ml_program dialect.
Differential Revision: https://reviews.llvm.org/D125852
2022-05-18 23:08:33 -07:00
Stella Laurenzo
2bb252852c [mlir] Add GlobalOp, GlobalLoadConstOp to ml_program.
The approach I took was to define a dialect 'extern' attribute that a GlobalOp can take as a value to signify external linkage. I think this approach should compose well and should also work with wherever the OpaqueElements work goes in the future (since that is just another kind of attribute). I special cased the GlobalOp parser/printer for this case because it is significantly easier on the eyes.

In the discussion, Jeff Niu had proposed an alternative syntax for GlobalOp that I ended up not taking. I did try to implement it but a) I don't think it made anything easier to read in the common case, and b) it made the parsing/printing logic a lot more complicated (I think I would need a completely custom parser/printer to do it well). Please have a look at the common cases where the global type and initial value type match: I don't think how I have it is too bad. The less common cases seem ok to me.

I chose to only implement the direct, constant load op since that is non side effecting and there was still discussion pending on that.

Differential Revision: https://reviews.llvm.org/D124318
2022-05-18 23:08:28 -07:00
Alexander Pivovarov
b21c03854c Fix if statement in DebugInfo/GSYM/LookupResult.cpp 2022-05-18 22:45:21 -07:00
lizhijin
90ea81fcb2 [LV] Widen freeze instead of scalarizing it
This patch changes the strategy for vectorizing freeze instrucion, from
replicating multiple times to widening according to selected VF.

Fixes #54992

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D125016
2022-05-19 12:28:01 +08:00
Zi Xuan Wu (Zeson)
861489af1b [NFC][RISCV] Enable TuneNoDefaultUnroll feature to control targets which use default unroll preference
In RISCVTargetTransformInfo, enumerating the processor family is not a good way to predict.
Because it needs to enumerate many subtarget family and is hard to update if add new subtarget.
Instead, create a feature to distinguish whether targets want to use default unroll preference or not.

Keep TuneSiFive7 because it's flag to indicate subtarget family, which may used in other place.

Differential Revision: https://reviews.llvm.org/D125741
2022-05-19 12:21:49 +08:00
Med Ismail Bennani
1351a9b19e [lldb/test] Fix failures caused by a previous PExpect.launch change
This should fix the issues introduced by d71d1a9, which skipped all the
test setup commands.

This also fixes the test failures happening in TestAutosuggestion.py.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-05-18 21:12:44 -07:00
Med Ismail Bennani
fbf0c42294 Revert "[lldb/test] Make some tests as XFAIL while I investigate the issue"
This reverts commit 80589f272c.
2022-05-18 21:12:43 -07:00
Chenbing Zheng
ffaaf2498b [InstCombine] (rot X, ?) == 0/-1 --> X == 0/-1
In this patch we add a function foldICmpInstWithConstantAllowUndef
to fold integer comparisons with a constant operand: icmp Pred X, C
where X is some kind of instruction and C is AllowUndef.

We move this fold to the new function, so that it can solve undef elts in a vector.

Reviewed By: spatel, RKSimon

Differential Revision: https://reviews.llvm.org/D125220
2022-05-19 11:22:26 +08:00
Chenbing Zheng
51df77f36d [InstCombine] Allow undef vectors when foldSelectToCopysign
Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D125671
2022-05-19 10:57:49 +08:00
Jon Roelofs
d699e54ca2 Fix an or+and miscompile w/ GlobalISel
Fixes #55284
2022-05-18 19:09:47 -07:00
Med Ismail Bennani
fd25ad5122 Revert 821ee172cd
This reverts commit 821ee172cd, that
landed by mistake.
2022-05-18 19:07:47 -07:00
Med Ismail Bennani
80589f272c
[lldb/test] Make some tests as XFAIL while I investigate the issue
This is very likely to be caused by d71d1a947b.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-05-18 18:51:10 -07:00
Med Ismail Bennani
821ee172cd dyld patch
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-05-18 18:46:00 -07:00
Med Ismail Bennani
3e54ea0cfa [lldb/crashlog] Fix line entries resolution in interactive mode
This patch subtracts 1 to the pc of any frame above frame 0 to get the
previous line entry and display the right line in the debugger.

This also rephrase some old comment from `48d157dd4`.

rdar://92686666

Differential Revision: https://reviews.llvm.org/D125928

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-05-18 18:22:47 -07:00
Med Ismail Bennani
051a5ae998 [lldb/Core] Fix "sticky" long progress messages
When the terminal window is too small, lldb would wrap progress messages
accross multiple lines which would break the progress event handling
code that is supposed to clear the message once the progress is completed.

This causes the progress message to remain on the screen, sometimes partially,
which can be confusing for the user.

To fix this issue, this patch trims the progress message to the terminal
width taking into account the progress counter leading the message for
finite progress events and also the trailing `...`.

rdar://91993836

Differential Revision: https://reviews.llvm.org/D124785

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-05-18 18:22:46 -07:00
Med Ismail Bennani
d71d1a947b [lldb/Test] Add use_colors argument to the PExpect.launch wrapper
This patch adds a new `use_colors` argument to the PExpect.launch
method.

As the name suggests, it allows the user to conditionally enable color
support in the debugger, which can be helpful to test functionalities that
rely on that, like progress reporting. It defaults to False.

Differential Revision: https://reviews.llvm.org/D125915

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-05-18 18:22:46 -07:00
Med Ismail Bennani
b3718bc467 [llvm/Support] Fallback to $TERM if terminfo has no "colors" capability
It can happen on macOS that terminal doesn't report the "colors"
capability in the terminfo database, in which case `tigetnum` returns -1.

This doesn't mean however that the terminal doesn't supports color, it
just means that the capability is absent from the terminal description.

In that case, we should still fallback to the checking the $TERM
environment variable to see if it supports ANSI escapes codes.

Differential Revision: https://reviews.llvm.org/D125914

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-05-18 18:22:46 -07:00
Sheng
a5d618b393 [M68k][Disassembler] Fix decoding conflict
This diff fixes decoding conflict between these pair of instructions:

ADD(16|32)dd / ADD(16|32)dr
SUB(16|32)dd / SUB(16|32)dr
AND(16|32)dd / AND(16|32)dr
OR(16|32)dd  / OR(16|32)dr

Reviewed By: ricky26

Differential Revision: https://reviews.llvm.org/D125861
2022-05-19 09:10:50 +08:00
Mark Kettenis
3d869c88bb [Sparc] Make sure that we really don't emit quad-precision unless the "hard-quad-float" feature is available
Make sure that we really don't emit quad-precision unless the "hard-quad-float"
feature is available. Add missing replacement instruction patterns that are
needed to emit alternative code for conditional moves of quad-precision floats.

Test from koakuma.

Reviewed By: koakuma

Differential Revision: https://reviews.llvm.org/D119104
2022-05-18 20:11:58 -04:00
Damian Rouson
565f5dfa1f [flang] test conforming & non-conforming lcobound
Add a test with standard-conforming  non-conforming lcobound()
intrinsic function invocations.  Also test that several
non-conforming lcobound() invocations generate the correct error
messages.

Differential Revision: https://reviews.llvm.org/DD123747
2022-05-18 16:55:48 -07:00
Matthias Braun
8d03c49f49 Extend switch condition in optimizeSwitchPhiConst when free
In a case like:

    switch((i32)x) { case 42: phi((i64)42, ...); }

replace `(i64)42` with `zext(x)` when we can do so for free.

This fixes a part of https://github.com/llvm/llvm-project/issues/55153

Differential Revision: https://reviews.llvm.org/D124897
2022-05-18 16:23:53 -07:00
Rafael Auler
6cc741bcbf [BOLT] Testcase to repro R_X86_64_REX_GOTPCRELX bug
Add a new testcase that reproduces a bug when BOLTing current
trunk LLD bootstrapped with trunk clang. This makes it official
that we do not support this transformation but are working on
it. When the support is ready, XFAIL should be removed.

Reviewed By: maksfb, Amir, yota9

Differential Revision: https://reviews.llvm.org/D125843
2022-05-18 16:07:14 -07:00
Andrey Tretyakov
1dcda06c97 [SPIRV] Add simple tests to improve test coverage
Differential Revision: https://reviews.llvm.org/D125404
2022-05-19 01:44:38 +03:00
Michael Kruse
797fabaab2 [Analysis] Avoid virtual dtor. NFC.
Replace virtual destructor by a protected non-virtual one. Additionally also making derived structs as virtual avoids the warning from reappearing.

Also see the mailing list discussion: https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20220516/1038290.html

Reviewed By: dblaikie, YangKeao

Differential Revision: https://reviews.llvm.org/D125830
2022-05-18 17:41:17 -05:00
Nemanja Ivanovic
03ba8c83dd [Debuginfod] Fix shared libs build break after eafa053041
The commit added a dependency on LLVMSymbolize but the
CMakeLists.txt file wasn't updated. This doesn't cause
issues for static libraries builds but breaks the shared
libraries build. This just adds the missing dependency.
2022-05-18 17:33:12 -05:00
Philip Reames
615255eb09 [RISCV] Add a test case where mutation still violates strict asserts in InsertVSETVLI
This is the test which triggered my disabling of the assert in d4545e6.  The
issue it reveals is basically the same as from cc0283a6, but in the cross
block case.

We visit block1, mutate the setvli (correctly), and then visit block two and
ask whether the vadd is compatible with the block state.  Before mutation, it
wasn't.  After mutation, it is.  And thus, we have our phase 1 vs 3 difference.
2022-05-18 15:03:12 -07:00
Mariusz Borsa
77014b9a13 [Sanitizers][Darwin] Rename Apple macro SANITIZER_MAC -> SANITIZER_APPLE
Initial introduction of the new macro before obsoleting the old one - the old name was really confusing.
Also moved SANITIZER_WATCHOS and SANITIZER_TVOS definitions under common #if defined(__APPLE__) block

Differential Revision: https://reviews.llvm.org/D125816
2022-05-18 14:46:41 -07:00
Usama Hameed
dd7233bc67 [Analyzer] Remove extra space from NSErrorChecker message.
Differential Revision: https://reviews.llvm.org/D125840
2022-05-18 14:35:12 -07:00
Michael Jones
72f6dfb378 [libc][windows] fix strlcpy tests
Generally, size_t is an alias for unsigned long long. In the strlcpy
tests, the return value of strlcpy (a size_t) is compared to an unsigned
long. On Linux unsigned long and unsigned long long are both 64 bits,
but on windows unsigned long is 32 bits. Since the macros require
identical types for both sides, this caused a build failure on windows.
This patch changes the constants to be explicit size_t values.

Differential Revision: https://reviews.llvm.org/D125917
2022-05-18 14:11:53 -07:00