Commit Graph

426083 Commits

Author SHA1 Message Date
Zequan Wu bf1e96d620 [MicrosoftDemangle] Set error to true when returning nullptr. 2022-06-08 17:18:09 -07:00
Michael Eisel 44978a234b [lld/mac] Write output sections in parallel
This reduces linking time by ~8% for my project (1.19s -> 0.53s for
writeSections()). writeTo is const, which bodes well for it being
parallelizable, and I've looked through the different overridden versions and
can't see any race conditions. It produces the same byte-for-byte output for my
project.

Differential Revision: https://reviews.llvm.org/D126800
2022-06-08 20:11:50 -04:00
Jim Ingham aaaf8e4c40 Add help text for "breakpoint name", describing the feature more fully.
https://reviews.llvm.org/D127038
2022-06-08 16:55:53 -07:00
Alexander Yermolovich 1c6dc43de9 [BOLT]DWARF] Eagerly write out loclists
Taking advantage of us being able to re-write .debug_info to reduce memory
footprint loclists. Writing out loc-list as they are added, similar to how
we handle ranges.

Collected on clang-14
trunk
4:41.20 real,   389.50 user,    59.50 sys,      0 amem, 38412532 mmem
4:30.08 real,   376.10 user,    63.75 sys,      0 amem, 38477844 mmem
4:25.58 real,   373.76 user,    54.71 sys,      0 amem, 38439660 mmem
diff
4:34.66 real,   392.83 user,    57.73 sys,      0 amem, 38382560 mmem
4:35.96 real,   377.70 user,    58.62 sys,      0 amem, 38255840 mmem
4:27.61 real,    390.18 user,    57.02 sys,      0 amem, 38223224 mmem

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D126999
2022-06-08 16:52:59 -07:00
Nico Weber f4da30ba68 [gn build] (manually) port 0e9a01dcac (libcxx module.modulemap gen) 2022-06-08 19:51:07 -04:00
Lang Hames 3fcd3669e3 [ORC] Add an output stream operator for SymbolStringPool.
Handy for checking string pool state, e.g. when debugging dangling-pool-entry
errors.
2022-06-08 16:49:51 -07:00
Craig Topper 209c07d486 [RISCV] Add debug message that should have been in D126843.
For consistency with the other messages in this file.
2022-06-08 16:46:22 -07:00
Zequan Wu d6710023e3 [LLDB][NativePDB] Fix several crashes when parsing debug info.
1. If array element type is a tag decl, complete it.
2. Fix few places where `asTag` should be used instead of `asClass()`.
3. Handle the case that `PdbAstBuilder::CreateFunctionDecl` return nullptr mainly due to an existing workaround (`m_cxx_record_map`).
4. `FindMembersSize` should never return error as this would cause early exiting in `CVTypeVisitor::visitFieldListMemberStream` and then cause assertion failure.
5. In some pdbs from C++ runtime libraries have S_LPROC32 followed directly by S_LOCAL and the local variable location is a S_DEFRANGE_FRAMEPOINTER_REL. There is no information about base frame register in this case, ignoring it by returning RegisterId::NONE.
6. Add a TODO when S_DEFRANGE_SUBFIELD_REGISTER describes the variable location of a pointer type. For now, just ignoring it if the variable is pointer.
2022-06-08 16:41:23 -07:00
Jose Manuel Monsalve Diaz d6f6cd5cd5 [docs][clang] Fixing minor typo
Changing "tot the" to "to the"
2022-06-08 23:35:11 +00:00
Wei Yi Tee a1b2b7d979 [clang][dataflow] Remove IndirectionValue class, moving PointeeLoc field into PointerValue and ReferenceValue
This patch precedes a future patch to make PointeeLoc for PointerValue possibly empty (for nullptr), by using a pointer instead of a reference type.
ReferenceValue should maintain a non-empty PointeeLoc reference.

Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D127312
2022-06-09 01:29:16 +02:00
Kevin Athey 0777be69fb [MSAN] print out the only possible invalid parameter (EINVAL is returned)
One more round attempting to figure what is wrong.

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

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D127359
2022-06-08 16:23:04 -07:00
Matheus Izvekov cfda534b99
[NFC] clang: add test for PR55886
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D127361
2022-06-09 01:20:58 +02:00
Jonas Devlieghere ce825e4674
[lldb] Add assertState function to the API test suite
Add a function to make it easier to debug a test failure caused by an
unexpected state.

Currently, tests are using assertEqual which results in a cryptic error
message: "AssertionError: 5 != 10". Even when a test provides a message
to make it clear why a particular state is expected, you still have to
figure out which of the two was the expected state, and what the other
value corresponds to.

We have a function in lldbutil that helps you convert the state number
into a user readable string. This patch adds a wrapper around
assertEqual specifically for comparing states and reporting better error
messages.

The aforementioned error message now looks like this: "AssertionError:
stopped (5) != exited (10)". If the user provided a message, that
continues to get printed as well.

Differential revision: https://reviews.llvm.org/D127355
2022-06-08 16:16:38 -07:00
owenca 5ead1f13a2 [clang-format] Remove braces of else blocks that embody an if block
Fixes #55663.

Differential Revision: https://reviews.llvm.org/D127260
2022-06-08 16:05:20 -07:00
Louis Dionne 0e9a01dcac [libc++] Fix modules builds when features are removed
When some headers are not available because we removed features like
localization or threads, the compiler should not try to include these
headers when building modules. To avoid that from happening, add a
requires-declaration that is never satisfied when the configuration
in use doesn't support a header.

rdar://93777687

Differential Revision: https://reviews.llvm.org/D127127
2022-06-08 18:48:25 -04:00
Alex Brachet 6504b15992 [libc][NFC] Mark some methods constexpr
gcc is complaining that these methods are being called
from a function that is marked constexpr but these
aren't.
2022-06-08 22:41:09 +00:00
Huan Nguyen db313a00b6 [BOLT][NFC] Replace stdio with raw_ostream in CallGraph
Replacing stdio functions, e.g., fopen, fprintf, with raw_ostream.

Test Plan:
```
ninja check-bolt
```

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D126826
2022-06-08 15:38:04 -07:00
Jonas Devlieghere c9b55eb807
[lldb] Update TestModuleLoadedNotifys.py for macOS Ventura
On macOS Ventura and later, dyld and the main binary will be loaded
again when dyld moves itself into the shared cache. Update the test
accordingly.

Differential revision: https://reviews.llvm.org/D127331
2022-06-08 15:33:33 -07:00
Chelsea Cassanova 0f02dd34f2 [lldb/Commands] Prevent crash due to reading memory from page zero.
Adds a check to ensure that a process exists before attempting to get
its ABI to prevent lldb from crashing due to trying to read from page zero.

Differential revision: https://reviews.llvm.org/D127016
2022-06-08 18:10:41 -04:00
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