Commit Graph

403242 Commits

Author SHA1 Message Date
Simon Pilgrim 6102e5d56b [CostModel][X86] Remove old TODO comment
BMI (TZCNT) scalar handling was added at rGa2db388dce77c2f23f2009d7363a0b63bb54523c
2021-10-29 17:28:45 +01:00
Sanjay Patel e0ee027a77 [InstCombine] regenerate test checks; NFC 2021-10-29 12:22:34 -04:00
Mike Rice 72c373644f [OpenMP] Add triple to run lines to avoid message differences
Diagnostics with function types can show calling conventions on some platforms.
Just choose one to prevent that.
2021-10-29 09:20:40 -07:00
Arthur Eubanks 177a703710 [llvm-reduce] Actually skip invalid candidates in operands-to-args
This was checked while counting but not actually when doing the reduction, resulting in crashes.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D112766
2021-10-29 09:14:18 -07:00
Joe Loser 2d83392a88
[libc++] Mark LWG3211 as complete: default constructor of tuple<> should be trivial
`libc++` has had the guarantee of the default constructor of `tuple<>` being
trivial since 405570dc7a. Now, the
standard mandates it as of LWG3211. So, move the file out of
`libcxx/test/libcxx` and into `libcxx/test/std` since it's no longer
`libc++`-specific. Rename it to be `.compile.pass.cpp` instead of
`.pass.cpp` while we're at it.

Reviewed By: ldionne, Quuxplusone, Mordante, #libc

Differential Revision: https://reviews.llvm.org/D112743
2021-10-29 12:08:51 -04:00
Ahmed Taei 813fa79c15 Don't drop in_bounds when vector-transfer-collapse-inner-most-dims
When operand is a subview we don't infer in_bounds and some default cases (e.g case in the tests) will crash with `operand is NULL` when converting to LLVM

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D112772
2021-10-29 09:07:57 -07:00
Nikita Popov 36b22f7845 [BasicAA] Add range test with nsw (NFC) 2021-10-29 18:00:25 +02:00
Steven Wan 57cb84f5a2 Point replay file to non-existent dummy
Operating systems such as AIX allow open and read on directories, passing in a direcotry as the replay file triggers `Invalid remark format` instead of `Could not open remarks file: Is a directory`. This patch substitutes the directory with a non-existent filename. The current filecheck should still work as-is.

Reviewed By: modimo, Whitney

Differential Revision: https://reviews.llvm.org/D112745
2021-10-29 11:58:40 -04:00
Kirill Bobyrev f47564ea87
[clangd] IncludeCleaner: Skip non self-contained headers
Headers without include guards might have side effects or can be the files we
don't want to consider (e.g. tablegen ".inc" files). Skip them when translating
headers to the HeaderIDs that we will consider as unused.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D112695
2021-10-29 17:57:31 +02:00
Siva Chandra Reddy 6c3f53c7ba [libc][NFC] Move test related pieces from FPUtil to util/UnitTest.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D112673
2021-10-29 15:37:30 +00:00
Dmitry Vyukov d31b2dc235 tsan: add debugging code for ptrace test failures
Debugging of crashes on powerpc after commit:
c80604f7a3 ("tsan: remove real func check from interceptors")
Somehow replacing if with DCHECK leads to strange failures in:
SanitizerCommon-tsan-powerpc64le-Linux :: Linux/ptrace.cpp
https://lab.llvm.org/buildbot/#/builders/105
https://lab.llvm.org/buildbot/#/builders/121
https://lab.llvm.org/buildbot/#/builders/57

The hypothesis is that something writes out-of-bounds
into pt_regs on stack and that corrupts internal tsan state.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112703
2021-10-29 17:37:02 +02:00
Mircea Trofin d6790a0a3c [NFC] ProfileSummary: const most of the fields.
This simplifies readability / maintainability.
2021-10-29 08:36:08 -07:00
Tobias Gysi 6638112b42 [mlir][linalg] Add padding pass to strategy passes.
Add a strategy pass that pads and hoists after tiling and fusion.

Depends On D112412

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D112480
2021-10-29 15:30:42 +00:00
Quinn Pham 9668e19e0c [docs] Inclusive language: replace master with main
[NFC] As part of using inclusive language within the llvm
project and be consistent with the renamed branch,
replace master with main.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D112746
2021-10-29 10:21:27 -05:00
Tobias Gysi d0ec4a8ed9 [mlir][linalg] Add pad and hoist test pass.
Adding a padding and hoisting pattern, a test pass, and tests. The patch prepares the split of tiling/fusion and padding.

Depends On D112255

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D112412
2021-10-29 15:08:16 +00:00
Jez Ng 6c2f26a159 [lld-macho] -all_load and -ObjC should not affect LC_LINKER_OPTION flags
In particular, they should not cause archives to be eagerly loaded. This
matches ld64's behavior.

Fixes PR52246.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D112756
2021-10-29 11:00:28 -04:00
Jez Ng a271f2410f [lld-macho][nfc] Canonicalize all pointers to InputSections early on
Having to remember to call `canonical()` all over the place is
error-prone; let's do it in a centralized location instead. It also
appears to improve performance slightly.

             base           diff           difference (95% CI)
  sys_time   0.984 ± 0.009  0.983 ± 0.014  [  -0.8% ..   +0.6%]
  user_time  6.508 ± 0.035  6.475 ± 0.036  [  -0.8% ..   -0.2%]
  wall_time  5.321 ± 0.034  5.300 ± 0.033  [  -0.7% ..   -0.1%]
  samples    36             23

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D112687
2021-10-29 11:00:28 -04:00
Bradley Smith 86972f1114 [AArch64][SVE] Use TargetFrameIndex in more SVE load/store addressing modes
Add support for generating TargetFrameIndex in complex patterns for
indexed addressing modes in SVE. Additionally, add missing load/stores
to getMemOpInfo and getLoadStoreImmIdx.

Differential Revision: https://reviews.llvm.org/D112617
2021-10-29 14:44:16 +00:00
Dmitry Vyukov 014c6b0736 sanitizer_common: fix ParseUnixMemoryProfile test linking on Mac
The ParseUnixMemoryProfile function is defined only for a subset
of platforms. Define the test for the same set of platforms.

Also disable the test for 32-bit platforms b/c the pointer
values used in the test are 64-bit and don't fit into 32-bit uptr.

Reported-by: Jan Svoboda (jansvoboda11)

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112815
2021-10-29 16:26:24 +02:00
Jay Foad 56f03d25b4 [IR] Remove createReplacementInstr. NFC.
It is unused since D112791.

Differential Revision: https://reviews.llvm.org/D112795
2021-10-29 15:03:19 +01:00
Jay Foad 1b758925ad [IR] Merge createReplacementInstr into ConstantExpr::getAsInstruction
createReplacementInstr was a trivial wrapper around
ConstantExpr::getAsInstruction, which also inserted the new instruction
into a basic block. Implement this directly in getAsInstruction by
adding an InsertBefore parameter and change all callers to use it. NFC.

A follow-up patch will remove createReplacementInstr.

Differential Revision: https://reviews.llvm.org/D112791
2021-10-29 15:02:58 +01:00
Jay Foad 21a1d4cf71 [AMDGPU] Change numBitsSigned for simplicity and document it. NFC.
Change numBitsSigned to return the minimum size of a signed integer that
can hold the value. This is different by one from the previous result
but is more consistent with numBitsUnsigned. Update all callers. All
callers are now more consistent between the signed and unsigned cases,
and some callers get simpler, especially the ones that deal with
quantities like numBitsSigned(LHS) + numBitsSigned(RHS).

Differential Revision: https://reviews.llvm.org/D112813
2021-10-29 14:22:06 +01:00
Adrian Kuegel 9fb1086b94 [mlir][python] Add a __contains__ method to the python bindings for DictionaryAttr.
This makes it easier to check in python whether a certain attribute is there.

Differential Revision: https://reviews.llvm.org/D112814
2021-10-29 15:19:16 +02:00
Pavel Labath 5015f25089 [lldb/test] Fix TestSourceManager for eee887e0
I'm removing the extra trace commands as they're not compatible with
windows, and there's no immediate replacement available.
2021-10-29 14:56:23 +02:00
Louis Dionne 2912f53699 Officially deprecate LLVM_ENABLE_PROJECTS for libc++, libc++abi and libunwind
This updates the LLVM wide documentation for building LLVM and the runtimes
and adds a CMake warning when folks specify libcxx, libcxxabi or libunwind
in LLVM_ENABLE_PROJECTS, pointing them to the updated instructions for
building the runtimes.

Differential Revision: https://reviews.llvm.org/D112724
2021-10-29 08:53:03 -04:00
Pavel Labath 8e3de91c07 [lldb/test] Fix TestFunctionStarts for eee887e0 2021-10-29 14:43:53 +02:00
Rainer Orth 2f353c040f [sanitizer_common] Fix Posix/mmap_write_exec.cpp on 32-bit Solaris
The new `Posix/mmap_write_exec.cpp` test FAILs on 32-bit Solaris/x86.  This
happens because only `mmap` is intercepted, but not `mmap64` which is used
for largefile support.

Fixed by also intercepting `mmap64`.

Tested on `amd64-pc-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D112810
2021-10-29 14:29:41 +02:00
Vladislav Vinogradov 17664a256f [mlir][NFC] Fix leak in unit test
Destroy operation created in
`OperationFormatPrintTest.CanUseVariadicFormat` test.
2021-10-29 15:24:46 +03:00
Chen Zheng 7591d21032 [PowerPC] fix a miscompile for Solaris build 2021-10-29 12:06:25 +00:00
Dmitry Vyukov af0a8b8317 sanitizer_common: bump default file max size to 256MB
I am hitting some cases where /proc/self/maps does not fit into 64MB.
256MB is lots of memory, but it's not radically more than the current 64MB.
Ideally we should read/parse these huge files incrementally,
but that's lots of work for a debugging/introspection interface.
So for now just bump the limit.

Depends on D112793.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112794
2021-10-29 14:03:26 +02:00
Dmitry Vyukov e8861fa6c3 sanitizer_common: fix crashes in parsing of memory profiles
ParseUnixMemoryProfile assumes well-formed input with \n at the end, etc.
It can over-read the input and crash on basically every line
in the case of malformed input.
ReadFileToBuffer has cap the max file size (64MB) and returns
truncated contents if the file is larger. Thus even if kernel behaves,
ParseUnixMemoryProfile crashes on too large /proc/self/smaps.
Fix input over-reading in ParseUnixMemoryProfile.

Depends on D112792.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112793
2021-10-29 14:03:12 +02:00
Dmitry Vyukov 4acad5df33 sanitizer_common: add memory profile parsing test
Depends on D112790.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112792
2021-10-29 14:02:50 +02:00
Bradley Smith bf72a469ba [AArch64][SVE] Fix build failure introduced in 13faa5f440 2021-10-29 11:57:02 +00:00
Dmitry Vyukov ae833dbb81 sanitizer_common: remove unnecessary GetMemoryProfile arg
stats_size argument is unnecessary in GetMemoryProfile and in the callback.
It just clutters code. The callback knowns how many stats to expect.

Depends on D112789.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112790
2021-10-29 13:44:34 +02:00
Dmitry Vyukov d4602f759a sanitizer_common: make parsing of smaps testable (NFC)
Move parsing of /proc/self/smaps into a separate function
so that it can be tested.

Depends on D112788.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112789
2021-10-29 13:44:28 +02:00
Dmitry Vyukov a871c34e8d sanitizer_common: fix up onprint.cpp test more
D112630 ("sanitizer_common: fix up onprint.cpp test")
added O_CREAT, but we also need O_TRUNC b/c the file
may not exist, or may exist as well.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D112788
2021-10-29 13:44:04 +02:00
Pavel Labath b42d51ba9a [lldb/test] Replace shlex.join with shlex.quote
join is only available since python-3.8, but the all the interesting
magic happens in shlex.quote, which has been around since 3.3.

Use shlex.quote, and instead provide a home-grown helper function to
handle the joining.

Differential Revision: https://reviews.llvm.org/D112802
2021-10-29 13:42:06 +02:00
David Green 11630dbbc3 [InstCombine] Fold BW/2+1 tops bits are same pattern
Match "icmp eq (trunc (lsr A, BW), (ashr (trunc A), BW-1))", which checks
the top BW/2 + 1 bits are all the same. Create "A >=s INT_MIN && A <=s
INT_MAX", which we generate as "icmp ult (add A, 2^BW-1), 2^BW" to skip
a few steps of instcombining.
https://alive2.llvm.org/ce/z/NjH6Ty
https://alive2.llvm.org/ce/z/_fEQ9P

Differential Revision: https://reviews.llvm.org/D109155
2021-10-29 12:30:20 +01:00
Eugene Zhulenev ec32d540f8 [mlir] MathApproximations: scalars shape must be 0-rank
Using [1] for representing shape of a scalar is incorrect, and will break with vectors of size 1.

- remove redundant helper functions
- fix couple of style warnings

Reviewed By: cota

Differential Revision: https://reviews.llvm.org/D112764
2021-10-29 04:02:38 -07:00
Kirill Bobyrev 32f1029124
[clangd] Track performance of IncludeCleaner
Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D112783
2021-10-29 12:59:22 +02:00
Simon Pilgrim 154c036ebb [X86] combineX86GatherScatter - only fold scale if the index isn't extended
As mentioned on D108539, when the gather indices are smaller than the pointer size, they are sign-extended BEFORE scale is applied, making the general fold unsafe.

If the index have sufficient sign-bits then folding the scale could be safe - I'll investigate this.
2021-10-29 11:48:05 +01:00
Raphael Isemann 96808c69a1 [ASTImporter] Remove redundant IsStructuralMatch overloads
Nearly all of the overloads have pretty much the same behaviour. The only
exception here is that some of them call back `GetOriginalDecl` and others
don't, but the only real user of that overload (which is LLDB) actually prefers
getting this callback.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D112796
2021-10-29 12:23:38 +02:00
Dmitry Makogon 96591a14cd [GVN] Add tests showing generation of already existent PHIs for non-local loads
When we eliminate a non-local load in a loop, we create a new PHI for the loaded value,
while there already may be the exact same PHIs in the loop.

IndVarsSimplify currently can handle this case eliminating the duplicated PHIs.

However, if the loop PHI is of type of the load and also there exists
an use of the z(s)ext'ed of it, IndVarSimplify wouldn't eliminate the duplicating PHI.
It would just replace the IV with a widened one, leaving the GVN-generated PHI as is.
2021-10-29 17:20:44 +07:00
David Green 9020e22a87 [InstCombine] Convert xor (ashr X, BW-1), C -> select(X >=s 0, C, ~C)
The sequence of instructions `xor (ashr X, BW-1), C` (or with a truncation
`xor (trunc (ashr X, BW-1)), C)` takes a value, produces all zeros or all
ones and with it optionally inverts a constant depending on whether the
original input was positive or negative. This is the same as checking if
the value is positive, and selecting between the constant and ~constant.
https://alive2.llvm.org/ce/z/NJ85qY

This is a fairly general version of a fold that helps pull saturating
arithmetic into a canonical form.

Differential Revision: https://reviews.llvm.org/D109151
2021-10-29 11:19:20 +01:00
Pavel Labath a394231819 [lldb] Remove ConstString from SymbolVendor, Trace, TraceExporter, UnwindAssembly, MemoryHistory and InstrumentationRuntime plugin names 2021-10-29 12:08:57 +02:00
Bradley Smith 13faa5f440 [AArch64][SVE] Generate SVE >1 element structured load/stores from fixed types
This adds support for SVE structured loads/stores to the relevant target
hooks, such that we can support these instructions in the InterleavedAccess
pass.

Depends on D112078

Differential Revision: https://reviews.llvm.org/D112303
2021-10-29 09:35:57 +00:00
Pavel Labath eee887e035 [lldb/test] Print build commands in trace mode
Running tests with -t prints all lldb commands being run. It makes sense
to print all the build commands as well.

Differential Revision: https://reviews.llvm.org/D112212
2021-10-29 11:33:31 +02:00
Luís Ferreira ac73f567cf [lldb] Remove forgotten FIXME on CPlusPlus formatters
The patch [1] introduced this FIXME but ended up not being removed when fixed.

[1]: f68df12fb0

Signed-off-by: Luís Ferreira <contact@lsferreira.net>

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D112586
2021-10-29 11:32:40 +02:00
Luís Ferreira 5e316012d0 [lldb] Refactor C/C++ string and char summary providers
This patch refactors C/C++ formatters to avoid repetitive code by using templates.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D112658
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-10-29 11:22:02 +02:00
Cullen Rhodes 8686626244 [Sparc] NFC: Remove unused tblgen template args
Identified in D109359.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D109712
2021-10-29 09:16:15 +00:00