Commit Graph

426364 Commits

Author SHA1 Message Date
bixia1 ff96d434d0 [mlir][sparse] Fix a problem introduced by the PR for reading complex number.
The problem is in function isValid.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D127349
2022-06-08 15:01:50 -07:00
Craig Topper 4bcfc41846 [SelectionDAG] Teach computeKnownBits that a nsw self multiply produce a positive value.
This matches what we do in IR. For the RISC-V test case, this allows
us to use -8 for the AND mask instead of materializing a constant in a register.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D127335
2022-06-08 14:55:58 -07:00
Sam McCall 94b2ca18c1 [pseudo] GC GSS nodes, reuse them with a freelist
Most GSS nodes have short effective lifetimes, keeping them around until the
end of the parse is wasteful. Mark and sweep them every 20 tokens.

When parsing clangd/AST.cpp, this reduces the GSS memory from 1MB to 20kB.
We pay ~5% performance for this according to the glrParse benchmark.
(Parsing more tokens between GCs doesn't seem to improve this further).

Compared to the refcounting approach in https://reviews.llvm.org/D126337, this
is simpler (at least the complexity is better isolated) and has >2x less
overhead. It doesn't provide death handlers (for error-handling) but we have
an alternative solution in mind.

Differential Revision: https://reviews.llvm.org/D126723
2022-06-08 23:39:59 +02:00
Sam McCall bbc58c5e9b [pseudo] Restore accidentally removed debug print 2022-06-08 23:39:34 +02:00
Sam McCall 93bcff8aa8 [pseudo] Invert rows/columns of LRTable storage for speedup. NFC
There are more states than symbols.
This means first partioning the action list by state leaves us with a smaller
range to binary search over. This improves find() a lot and glrParse() by 7%.
The tradeoff is storing more smaller ranges increases the size of the offsets
array, overall grammar memory is +1% (337->340KB).

Before:
glrParse    188795975 ns    188778003 ns           77 bytes_per_second=1.98068M/s
After:
glrParse    175936203 ns    175916873 ns           81 bytes_per_second=2.12548M/s

Differential Revision: https://reviews.llvm.org/D127006
2022-06-08 23:35:14 +02:00
Mircea Trofin b8c39eb275 Fix FunctionPropertiesAnalysis updating callsite in 1-BB loop
If the callsite is in a single BB loop, we need to exclude the BB from
the successor set (in which it'd be a member), because that set forms a
boundary at which we stop traversing the CFG, when re-ingesting BBs
after inlining; but after inlining, the callsite BB's new successors
should be visited.

Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D127178
2022-06-08 14:32:00 -07:00
Florian Mayer f6b1bfb7d5 [ELF] Support 'G' in .eh_frame
Reviewed By: MaskRay, eugenis

Differential Revision: https://reviews.llvm.org/D127148
2022-06-08 14:28:58 -07:00
Florian Mayer a2695c3fe1 [DWARF] Support 'G' in dwarf parser
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D127171
2022-06-08 14:27:51 -07:00
Jin Xin Ng a3a7826d82 [mlgo] Disable accounting upon ForceStop
Once ForceStop is set to true, we only return positive inlining advice when it is mandatory; There is no need for further node/edge accounting.

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D127245
2022-06-08 14:26:06 -07:00
Andrew Turner ccae01cbce [compiler-rt] Fix Mmap on FreeBSD AArch64
On FreeBSD AArch64 safestack needs to use __syscall to handle 64 bit arguments

Reviewed by: MaskRay, vitalybuka

Differential Revision: https://reviews.llvm.org/D125901
2022-06-08 17:22:33 -04:00
Andrew Turner ad3faddaa6 [compiler-rt] Fix the longjmp sp slot on FreeBSD AArch64
The stack pointer is stored in the second slot in the jump buffer on
AArch64. Use the correct slot value to read this rather than the
following register.

Reviewed by: melver

Differential Revision: https://reviews.llvm.org/D125762
2022-06-08 17:22:27 -04:00
Andrew Turner b3c1442c6c [compiler-rt] Add the FreeBSD AArch64 shadow offset
As with 64 bit x86 use an offset in middle of the address space scaled up
to work with the full 48 bit space.

Reviewed by: MaskRay

Differential Revision: https://reviews.llvm.org/D125757
2022-06-08 17:22:16 -04:00
Andrew Turner 9496e39b4a [compiler-rt] Add the common FreeBSD AArch64 support
Reviewed by: vitalybuka

Differential Revision: https://reviews.llvm.org/D125756
2022-06-08 17:22:01 -04:00
Kevin Athey d97d930d92 [MSAN] send output to stderr in test: pthread_getaffinity_np.
Must send output to stderr to view it.
This will be rolled back when diagnosis is complete.

Depends on: https://reviews.llvm.org/D127320

Differential Revision: https://reviews.llvm.org/D127346
2022-06-08 14:16:08 -07:00
Nathan Lanza dd2f290918 Add llvm's Support lib to the psuedoCXX library
This is failing to find `EnableABIBreakingCheck` at link time. Add
Support to provide it here.

Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D127269
2022-06-08 17:12:02 -04:00
Kevin Athey d50dc33d29 [MSAN] Add comment regarding why pthread_getaffinity_np is not supported on Android.
Depends on: https://reviews.llvm.org/D127264

Reviewed By: vitalybuka, fmayer

Differential Revision: https://reviews.llvm.org/D127327
2022-06-08 13:53:59 -07:00
Florian Mayer 0d54a874ee Revert "[DWARF] Support 'G' in dwarf parser"
This reverts commit 4c71c3386c.
2022-06-08 13:53:00 -07:00
Florian Mayer 6fb4fe7285 Revert "[ELF] Support 'G' in .eh_frame"
This reverts commit 40f34fe4a8.
2022-06-08 13:52:38 -07:00
Florian Mayer 40f34fe4a8 [ELF] Support 'G' in .eh_frame
Reviewed By: MaskRay, eugenis

Differential Revision: https://reviews.llvm.org/D127148
2022-06-08 13:40:20 -07:00
bixia1 5b1c5fc53a [mlir][sparse] Add complex number reading from files.
Support complex numbers for Matrix Market Exchange Formats. Add a test case.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D127138
2022-06-08 13:33:35 -07:00
Keith Smiley 427ba2bcce
[llvm-cov] Assume repeat architectures for universal binaries
In the case you pass multiple universal binaries to llvm-cov, assume
that if only 1 architecture is passed, it should be used for all the
passed binaries.

This makes it easier to use multiple multi-arch binaries, since it's
likely very rare that your architectures mismatch significantly if you
also have multiple binaries in a single llvm-cov invocation. If the
architecture is invalid for any of the passed binaries, it will still
fail later.

Differential Revision: https://reviews.llvm.org/D121667
2022-06-08 13:22:57 -07:00
Simon Pilgrim 14d50df272 [AMDGPU] Regenerate combine-cond-add-sub.ll 2022-06-08 21:10:12 +01:00
Aaron Ballman f0a6a57330 Switch links to use https consistently
The WG14 website was recently updated to support SSL, and we might as
well make use of that.
2022-06-08 15:53:55 -04:00
Aaron Ballman b685426970 Add missing entries for Annex F and Annex H to the C status page 2022-06-08 15:53:54 -04:00
Florian Mayer 4c71c3386c [DWARF] Support 'G' in dwarf parser
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D127171
2022-06-08 12:39:53 -07:00
Florian Mayer 0593ce5f0b [MC] Add 'G' to augmentation string for MTE instrumented functions
This was agreed on in
https://lists.llvm.org/pipermail/llvm-dev/2020-May/141345.html

The thread proposed two options
* add a character to augmentation string and handle in libuwind
* use a separate personality function.

It was determined that this is the simpler and better option.

This is part of ARM's Aarch64 ABI:
https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst#id22

The next step after this is teaching libunwind to untag when this
augmentation character is set.

Reviewed By: MaskRay, eugenis

Differential Revision: https://reviews.llvm.org/D127007
2022-06-08 12:36:32 -07:00
Paul Kirth 56eb8dcf1e [compiler-rt][test] Restore original symbolize_stack test
In D126580 we updated the test to reflect that there should always
be a full trace. However, some executions do not have symbolizer
information, so we will restore the original test until we can formulate
a more robust test.

Reviewed By: leonardchan

Differential Revision: https://reviews.llvm.org/D127334
2022-06-08 19:15:52 +00:00
Sunho Kim 5d5183b198 [JITLink][ELF][AArch64] Implement R_AARCH64_PREL32 and R_AARCH64_PREL64.
This patch implements R_AARCH64_PREL64 and R_AARCH64_PREL32 relocations that is
used in eh frame pointers. The test case utlizes obj2yaml tool to create an
artifical eh frame that generates related relocation types.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D127058
2022-06-08 12:14:05 -07:00
Hongtao Yu 7d293744a8 [CSSPGO][Preinliner] Set default value of sample-profile-inline-limit-max to 3000
The default value of sample-profile-inline-limit-max is defined as 10000 in sampleprofile.cpp. This is too big for cspreinliner which works with assembly size instead of IR size. The value 3000 turns out to be a good tradeoff. Compared to the value 10000, 3000 gives as good performance and code size, but lower build time.

Reviewed By: wenlei, wlei

Differential Revision: https://reviews.llvm.org/D127330
2022-06-08 12:10:11 -07:00
Leonard Chan 060907dd00 Revert "Reland "[NFC][compiler-rt][asan] Unify asan and lsan allocator settings""
This reverts commit b37d84aa8d.

This broke aarch64 asan builders for fuchsia. I accidentally changed the allocator
settings for fuchsia on aarch64 because the new asan allocator settings use:

```
// AArch64/SANITIZER_CAN_USE_ALLOCATOR64 is only for 42-bit VMA
// so no need to different values for different VMA.
const uptr kAllocatorSpace =  0x10000000000ULL;
const uptr kAllocatorSize  =  0x10000000000ULL;  // 3T.
typedef DefaultSizeClassMap SizeClassMap;
```

rather than reaching the final `#else` which would use fuchsia's lsan config.
2022-06-08 11:56:33 -07:00
Danila Malyutin ed6c309d4b [APFloat] Fix truncation of certain subnormal numbers
Certain subnormals would be incorrectly rounded away from zero.

Fixes #55838

Differential Revision: https://reviews.llvm.org/D127140
2022-06-08 21:54:35 +03:00
Kai Nacke d897a14c2e [SystemZ] Fix check for zero size when lowering memcmp.
During lowering of memcmp/bcmp, the check for a size of 0 is done
in 2 different ways. In rare cases this can lead to a crash in
SystemZSelectionDAGInfo::EmitTargetCodeForMemcmp(). The root cause
is that SelectionDAGBuilder::visitMemCmpBCmpCall() checks for a
constant int value which is not yet evaluated. When the value is
turned into a SDValue, then the evaluation is done and results in
a ConstantSDNode. But EmitTargetCodeForMemcmp() expects the special
case of 0 length to be handled, which results in an assertion.

The fix is to turn the value into a SDValue, so that both functions
use the same check.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D126900
2022-06-08 14:52:13 -04:00
Jonas Devlieghere 4636b93044
[lldb] Improve error reporting from TestAppleSimulatorOSType.py
When we can't find a simulator, report the platform and architecture in
the error message.
2022-06-08 11:47:26 -07:00
Arjun P 4bf9cbc408 [MLIR][Presburger] subtract: improve redundant constraint detection
When constraints in the two operands make each other redundant, prefer constraints of the second because this affects the number of sets in the output at each level; reducing these can help prevent exponential blowup.

This is accomplished by adding extra overloads to Simplex::detectRedundant that only scan a subrange of the constraints for redundancy.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D127237
2022-06-08 14:44:31 -04:00
Louis Dionne f28e48f3ef [cmake] Don't try creating an executable when detecting the linker
On most platforms, the linker detection command that we run ends up being
something like `clang++ -Wl,-v` or `clang++ -Wl,--version`. This usually
fails with a missing reference to `_main` because we don't have any input
file. However, when compiling for a target that is implicitly freestanding,
the invocation actually succeeds and a dummy `a.out` file is created in
the current working directory. This is extremely annoying because it
creates a `a.out` file at the root of the monorepo when running CMake
configuration from the root.

Differential Revision: https://reviews.llvm.org/D125827
2022-06-08 14:36:54 -04:00
Leonard Chan 033af5a537 [compiler-rt][hwasan] Check address tagging mode in InitializeOsSupport on Fuchsia
Differential Revision: https://reviews.llvm.org/D127262
2022-06-08 11:34:50 -07:00
Jonas Devlieghere fc43703481
[lldb] Use objc_getRealizedClassList_trylock on macOS Ventura and later
In order to avoid stranding the Objective-C runtime lock, we switched
from objc_copyRealizedClassList to its non locking variant
objc_copyRealizedClassList_nolock. Not taking the lock was relatively
safe because we run this expression on one thread only, but it was still
possible that someone was in the middle of modifying this list while we
were trying to read it. Worst case that would result in a crash in the
inferior without side-effects and we'd unwind and try again later.

With the introduction of macOS Ventura, we can use
objc_getRealizedClassList_trylock instead. It has semantics similar to
objc_copyRealizedClassList_nolock, but instead of not locking at all,
the function returns if the lock is already taken, which avoids the
aforementioned crash without stranding the Objective-C runtime lock.
Because LLDB gets to allocate the underlying memory we also avoid
stranding the malloc lock.

rdar://89373233

Differential revision: https://reviews.llvm.org/D127252
2022-06-08 11:34:27 -07:00
wren romano 0371ddf9ad [mlir] Refactoring the tablegen Tensor types
Reduces repetition in tablegen files for defining various tensor types.  In particular the goal is to reduce the repetition when defining new tensor types (e.g., D126994).

Reviewed By: aartbik, rriddle

Differential Revision: https://reviews.llvm.org/D127039
2022-06-08 11:33:48 -07:00
Wei Yi Tee 49ed5bf519 [clang][dataflow] Enable use of synthetic properties on all Value instances.
This patch moves the implementation of synthetic properties from the StructValue class into the Value base class so that it can be used across all Value instances.

Reviewed By: gribozavr2, ymandel, sgatev, xazax.hun

Differential Revision: https://reviews.llvm.org/D127196
2022-06-08 20:20:26 +02:00
Kevin Athey 7b1aa20a76 [MSAN] Add result printing for failed call in pthread_getaffinity_np.
Will be reverted when test failure is diagnosed.

Depends on: https://reviews.llvm.org/D127185

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D127320
2022-06-08 11:14:24 -07:00
Ben Langmuir 835fcf2aa5 [clang][deps] Make order of module dependencies deterministic
This fixes the underlying module dependencies, which had a
non-deterministic order, which was also visible in the order of calls to
DependencyConsumer methods. This was not directly observable in
the clang-scan-deps utility, because it was previously seeing a sorted
order from std::map in DependencyScanningTool. However, the underlying
API previously created a likely issue for any other clients. Note: if
you only apply the change from DependencyScanningTool, you can see the
issue in clang-scan-deps, and existing tests will fail
non-deterministicaly.

Differential Revision: https://reviews.llvm.org/D127243
2022-06-08 11:09:17 -07:00
Ben Langmuir 7a72dca74a [clang][deps] Set -disable-free for module compilations
The command-line arguments for module builds are cc1 commands, so they
do not implicitly set -disable-free like a driver invocation, and
Tooling will disable it for the scanning instance itself. Set
-disable-free explicitly so that separate invocations for building
modules will not pay for freeing memory unnecessarily.

Differential Revision: https://reviews.llvm.org/D127229
2022-06-08 11:09:17 -07:00
Joe Nash 40f35cef89 [AMDGPU] gfx11 VOP3P instruction MC support
Includes dpp versions of VOP3P instructions.

Patch 18/N for upstreaming of AMDGPU gfx11 architecture

Depends on D126917

Reviewed By: rampitec, #amdgpu

Differential Revision: https://reviews.llvm.org/D126978
2022-06-08 13:32:01 -04:00
Christopher Di Bella 288c1bff96 [clang][driver] adds `-print-diagnostics`
Prints a list of all the warnings that Clang offers.

Differential Revision: https://reviews.llvm.org/D126796
2022-06-08 17:55:31 +00:00
Hongtao Yu ab34ab2b87 [PseudoProbe] Use callee name as callsite identfier for MCDecodedPseudoProbeInlineTree.
The callsite identifier used in pseudo probe encoding and decoding is consisted of a function name and the callsite probe id. For encoding, i.e., `MCPseudoProbeInlineTree`, the function name is callee function name. However for decoding, i.e., `MCDecodedPseudoProbeInlineTree`, the caller function name is used actually. This results in multiple callees that are inlined at the same callsite, likely via indirect call promotion, sharing the same decoded inline frame. While it is not a problem for profile generation, it confuses probe re-encoding in Bolt.

In Bolt, we decode pseudo probes first and build `MCDecodedPseudoProbeInlineTree`. The decoded tree is used for final re-encoding. Here comes the problem. Two inlinees from the same callsite share the same decoded inline frame. During re-encoding, the frame name (whatever inlinee comes first) will be used and encoded in the bolted binary. This will cause wrong inline contexts  in the profile generated on the bolted binary.

The fix is a no-op to pre-bolt profile generation. Some of the bolt tests are not yet upstreamed, thus I'm not adding a bolt test here.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D126434
2022-06-08 10:54:40 -07:00
bixia1 6c6eddb617 [mlir] Lower complex.power and complex.rsqrt to standard dialect.
Add conversion tests and correctness tests.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D127255
2022-06-08 10:53:53 -07:00
dime10 4f55ed5a1e Add Python bindings for the OpaqueType
Implement the C-API and Python bindings for the builtin opaque type, which was previously missing.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D127303
2022-06-08 19:51:00 +02:00
Jose Manuel Monsalve Diaz 28aa7d1884 [docs][clang] Minor typo fix
Changing "iamge" to "image"
2022-06-08 17:41:04 +00:00
Thomas Lively aff679a48c [WebAssembly] Implement remaining relaxed SIMD instructions
Add codegen, intrinsics, and builtins for the i16x8.relaxed_q15mulr_s,
i16x8.dot_i8x16_i7x16_s, and i32x4.dot_i8x16_i7x16_add_s instructions. These are
the last instructions from the relaxed SIMD proposal[1] that had not been
implemented.

[1]:
https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md.

Differential Revision: https://reviews.llvm.org/D127170
2022-06-08 10:32:10 -07:00
Steve Merritt fe9923f2be [CodeView] Fix incorrect CodeView encoding of signed integer constants
Add proper CodeView encoding for positive constant integer values greater than
127.  In addition, use the two byte encoding form for positive values less
than LF_NUMERIC.

Differential Revision: https://reviews.llvm.org/D126968
2022-06-08 13:25:36 -04:00