Commit Graph

399260 Commits

Author SHA1 Message Date
Nico Weber 646299d183 [Support] Convert BinaryStream class zoo to 64-bit offsets
Most PDB fields on disk are 32-bit but describe the file in terms of MSF
blocks, which are 4 kiB by default.

So PDB files can be a bit larger than 4 GiB, and much larger if you create them
with a block size > 4 kiB.

This is a first (necessary, but by far not not sufficient) step towards
supporting such PDB files.  Now we don't truncate in-memory file offsets (which
are in terms of bytes, not in terms of blocks).

No effective behavior change. lld-link will still error out if it were to
produce PDBs > 4 GiB.

Differential Revision: https://reviews.llvm.org/D109923
2021-09-16 19:14:52 -04:00
peter klausler d9195d6603 [flang] More precise checks for NULL() operands
Improve checking for NULL() and NULL(MOLD=) when used as
variables and expressions outside the few contexts where
a disassociated pointer can be valid.  There were both
inappropriate errors and missing checks.

Differential Revision: https://reviews.llvm.org/D109905
2021-09-16 15:52:45 -07:00
Daniil Suchkov 0e36288318 [LoopPredication] Report changes correctly when attempting loop exit predication
To make the IR easier to analyze, this pass makes some minor transformations.
After that, even if it doesn't decide to optimize anything, it can't report that
it changed nothing and preserved all the analyses.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D109855
2021-09-16 22:49:55 +00:00
Daniil Suchkov 5f2b7879f1 NFC. Add tests exposing missing analysis invalidation in LoopPredication. 2021-09-16 22:49:55 +00:00
Jon Roelofs 4b19e7dfae [LoopIdiomRecognize][Remarks] Track loop-strided store to/from blocks
Differential revision: https://reviews.llvm.org/D109929
2021-09-16 15:46:26 -07:00
Mitch Phillips 65feb9f444 [symbolizer] Change libcxx paths in buildscript.
D107799 changed the paths from lib/libcxx(abi)?.a to
lib/<triple>/libcxx(abi)?.a. The build script needs to know to pick up
the files from the triple subfolder instead.

See https://lab.llvm.org/buildbot/#/builders/37/builds/6764 for buildbot log failure.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D109924
2021-09-16 15:11:09 -07:00
MaheshRavishankar 04a66f8d2b Fixing vector add pattern that incorrectly returns success.
The pattern is returning success even if it does no work leading to pattern application running up to the max iteration count and failing.

Reviewed By: nicolasvasilache, mravishankar

Differential Revision: https://reviews.llvm.org/D109791
2021-09-16 14:48:09 -07:00
Aart Bik 233b42a8bb [mlir][sparse] remove unused TENSOR environment
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D109919
2021-09-16 14:32:09 -07:00
Richard Howell e6020b2a42 [clang][NFC] refactor GlobalMethodPool to encapsulate its map
This refactor changes the GlobalMethodPool to a class that contains
the DenseMap of methods. This is to allow for the addition of a
separate DenseSet in a follow-up diff that will handle method
de-duplication when inserting methods into the global method pool.

Changes:
  - the `GlobalMethods` pair becomes `GlobalMethodPool::Lists`
  - the `GlobalMethodPool` becomes a class containing the `DenseMap` of methods
  - pass through methods are added to maintain most of the existing code without changing `MethodPool` -> `MethodPool.Methods` everywhere

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D109898
2021-09-16 14:02:14 -07:00
William Muir 2aa8474210 [Bazel] Use posix definitions for FreeBSD
Presently, definitions default to those for Linux which are not defined for FreeBSD (HAVE_LSEEK64, HAVE_MALLINFO, etc.).  Patch sets os_defines to posix definitions under FreeBSD.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D109913
2021-09-16 13:57:49 -07:00
Augusto Noronha 8fb8601102 Revert "[lldb] Skip TestAppleSimulatorOSType if json parsing fails"
This reverts commit 47dd1f6428.
After discussing with Jim Ingham, we agreed to leave the test as-is
so we can catch any CI problems instead of silently skipping the test.
2021-09-16 17:49:59 -03:00
Vedant Kumar 79e48f3c7c Revert "[MachCore] Report arm64 thread exception state"
This reverts commit 7eb67748f9. It causes
TestMachCore.MachCoreTestCase to fail.
2021-09-16 13:43:35 -07:00
Vedant Kumar 7eb67748f9 [MachCore] Report arm64 thread exception state
A MachO userspace corefile may contain LC_THREAD commands which specify
thread exception state.

For arm64* only (for now), report a human-readable version of this state
as the thread stop reason, instead of 'SIGSTOP'.

As a follow-up, similar functionality can be implemented for x86 cores
by translating the trapno/err exception registers.

rdar://82898146

Differential Revision: https://reviews.llvm.org/D109795
2021-09-16 13:35:06 -07:00
Alex Langford a65f6aafe2 [lldb] Refactor and rename CPlusPlusLanguage::FindAlternateFunctionManglings
I have 2 goals with this change:
1. Disambiguate between CPlusPlus::FindAlternateFunctionManglings and
   IRExecutionUnit::FindBestAlternateMangledName. These are named very
   similar things, they try to do very similar things, but their
   approaches are different. This change should make it clear that one
   is generating possible alternate manglings (through some
   heuristics-based approach) and the other is finding alternate
   manglings (through searching the SymbolFile for potential matches).
2. Change GenerateAlternateFunctionManglings from a static method in
   CPlusPlusLanguage to a virtual method in Language. This will allow us
   to remove a direct use of CPlusPlusLanguage in IRExecutionUnit,
   further pushing it to be more general. This change doesn't meet this
   goal completely but allows for it to happen later.

Though this doesn't remove IRExecutionUnit's dependency on
CPlusPlusLanguage, it does bring us closer to that goal.

Differential Revision: https://reviews.llvm.org/D109785
2021-09-16 13:13:07 -07:00
Jacob Lambert 4c1023b4b7 [AMDGPU] NFC: Fixing small spelling errors in AMDGPU header files
Nonfunctional commit fixing several minor spelling errors in llvm/lib/Target/AMDGPU header files.
Testing workflow as a new contributor.

Differential Revision: https://reviews.llvm.org/D109733
2021-09-16 13:03:09 -07:00
Philip Reames df7c2bcf4e precommit tests for D109457 2021-09-16 12:43:22 -07:00
Augusto Noronha 47dd1f6428 [lldb] Skip TestAppleSimulatorOSType if json parsing fails
xcodebuild, which is invoked by the apple_simulator_test decorator, may
may return a successful status even if it was unable to run due to the
authorization agent denying it. This causes the TestAppleSimulatorOSType
to run when it shouldn't, and throw an excpection when parsing the JSON
that lists the simulators available. Wrap the json parsing in a
try/except block and if it fails, skip the ttest.

Differential Revision: https://reviews.llvm.org/D109336
2021-09-16 16:38:20 -03:00
Fangrui Song 45a8608d7b [OpenMP] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off build after D109635 2021-09-16 12:36:45 -07:00
Teresa Johnson 88cb3e2cb6 [MemProf] Don't instrument stack accesses unless requested
Skip stack accesses unless requested, as the memory profiler runtime
does not currently look at or report accesses for these addresses.

Differential Revision: https://reviews.llvm.org/D109868
2021-09-16 12:21:51 -07:00
Philip Reames f79ce5875f autogen a SCEV test for ease of update 2021-09-16 12:19:30 -07:00
Nikita Popov 0fc624f029 [IR] Return AAMDNodes from Instruction::getMetadata() (NFC)
getMetadata() currently uses a weird API where it populates a
structure passed to it, and optionally merges into it. Instead,
we can return the AAMDNodes and provide a separate merge() API.
This makes usages more compact.

Differential Revision: https://reviews.llvm.org/D109852
2021-09-16 21:06:57 +02:00
Amy Huang a2fd05ada9 Temporarily revert "[LLD] Remove global state in lld/COFF" and "[lld] Add test to
check for timer output"

Seems to be causing a number of asan test failures.

This reverts commit b4fa71eed3
and e03c7e367a.
2021-09-16 11:58:11 -07:00
Aaron Green 5de8c7f138 [fuzzer][fuchsia] Close exception channel before exiting.
On Fuchsia, killing or exiting a process that has a thread listening to its own process's debugger exception channel can hang. Zircon may kill all the threads, send a synthetic exceptions to debugger, and wait for the debugger to have received them. This means the thread listening to the debug exception channel may be killed even as Zircon is waiting for that thread to drain the exception channel, and the process can become stuck in a half-dead state.

This situation is "weird" as it only arises when a process is trying to debug itself. Unfortunately, this is exactly the scenario for libFuzzer on Fuchsia: FuzzerUtilFuchsia spawns a crash-handling thread that acts like a debugger in order to be able to rewrite the crashed threads stack and resume them into libFuzzer's usual POSIX signal handlers. In practice, approximately 25% of fuzzers appear to hang on exit, after generating output and artifacts. These processes hang around until the platform is torn done, which is typically a ClusterFuzz VM. Thus, real-world impact has been somewhat mitigated. The issue should still be resolved for local users, though.

This change improves the behavior of exit() in libFuzzer by adding an atexit handler which closes an event shared with the crash handling thread. This signals to the crash handler that it should close the exception channel and be joined before the process actually exits.

Reviewed By: charco

Differential Revision: https://reviews.llvm.org/D109258
2021-09-16 11:57:12 -07:00
Rob Suderman 8662a2f208 [mlir][tosa] Relax ranked constraint on quantization builder
TosaOp defintion had an artificial constraint that the input/output types
needed to be ranked to invoke the quantization builder. This is correct as an
unranked tensor could still be quantized.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D109863
2021-09-16 11:43:47 -07:00
Amy Huang e03c7e367a [lld] Add test to check for timer output
This test checks that timers are working and printing as expected.

I also seem to have changed the order of the timers in my globals refactoring
patch, so I fixed it here.

Differential Revision: https://reviews.llvm.org/D109904
2021-09-16 11:36:46 -07:00
Artem Belevich 6b20ea6963 [CUDA] Pass ExecConfig through BuildCallToMemberFunction
Otherwise, we fail to compile calls to CUDA kernels that are static members.

Differential Revision: https://reviews.llvm.org/D108787
2021-09-16 11:18:12 -07:00
Jake Egan 22f01cd4fc [AIX][ZOS] Disable LIT tests on AIX and z/OS due to lack of Objective-C support
AIX and z/OS lack Objective-C support, so mark these tests as unsupported for AIX and z/OS.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D109060
2021-09-16 14:04:42 -04:00
Craig Topper 73e5b9ea90 [RISCV] Select (srl (sext_inreg X, i32), uimm5) to SRAIW if only lower 32 bits are used.
SimplifyDemandedBits can turn srl into sra if the bits being shifted
in aren't demanded. This patch can recover the original sra in some cases.

I've renamed the tablegen class for detecting W users since the "overflowing operator"
term I originally borrowed from Operator.h does not include srl.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D109162
2021-09-16 11:03:35 -07:00
Amy Huang b4fa71eed3 [LLD] Remove global state in lld/COFF
This patch removes globals from the lldCOFF library, by moving globals
into a context class (COFFLinkingContext) and passing it around wherever
it's needed.

See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html for
context about removing globals from LLD.

I also haven't moved the `driver` or `config` variables yet.

Differential Revision: https://reviews.llvm.org/D109634
2021-09-16 11:00:23 -07:00
Jonas Devlieghere c96d45700f [lldb] Remove SBExecutionContext::reset (NFC)
This is a protected function that's not implemented.
2021-09-16 11:00:12 -07:00
Vang Thao 106959acc1 [AMDGPU] Inline non-kernel functions using extern lds
In https://reviews.llvm.org/D100481, forceful inline of all non-kernel
functions using lds was disabled since AMDGPULowerModuleLDS pass now handles
static lds. However that pass does not handle extern lds so non-kernel
functions using extern lds must sill be inline.

Reviewed By: hsmhsm, arsenm

Differential Revision: https://reviews.llvm.org/D109773
2021-09-16 10:58:51 -07:00
Arthur Eubanks d49cb5b303 [SimplifyCFG] Add bonus when seeing vector ops to branch fold to common dest
This makes some tests in vector-reductions-logical.ll more stable when
applying D108837.

The cost of branching is higher when vector ops are involved due to
potential SLP transformations.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D108935
2021-09-16 10:50:36 -07:00
Saleem Abdulrasool f1e8ceb305 docs: correct SPHNIX document reference
The trailing `>` was missing, which resulted in the reference not being
processed properly.
2021-09-16 17:43:59 +00:00
Dávid Bolvanský a4a426c9e0 [InstCombine] Added llvm.powi optimizations
If power is even:
powi(-x, p) -> powi(x, p)
powi(fabs(x), p) -> powi(x, p)
powi(copysign(x, y), p) -> powi(x, p)
2021-09-16 19:42:21 +02:00
Dávid Bolvanský c0afb00924 [NFC] Added tests for llvm.powi optimizations 2021-09-16 19:42:21 +02:00
Wenlei He 446e21623c [llvm-profgen] Use context-sensitive byte size cost for preinliner decisions by default
Turn on `use-context-cost-for-preinliner` to use context-sensitive byte size cost for preinliner decisions by default.

This is a more accurate proxy of inline cost than profile size. We tested on our large workload that it delivers measureable CPU improvement.

Differential Revision: https://reviews.llvm.org/D109893
2021-09-16 10:36:12 -07:00
Corentin Jabot afb6223bc5 Support Unicode 14 identifiers
This update the UAX tables to support new Unicode 14 identifiers.
2021-09-16 13:21:27 -04:00
Fangrui Song c5f480fcbe [OpenMP] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off build after D109635 2021-09-16 10:19:35 -07:00
Aaron Ballman aefb81a33a Removing some spurious whitespace; NFC 2021-09-16 13:14:08 -04:00
Aart Bik 860cbeb159 [mlir][sparse] add more asserts to sparse support lib
We are having issues running the integration test of the sparse compiler
on AArch64 (crashing in the lib). This revision adds more assertions.

Reviewed By: jsetoain

Differential Revision: https://reviews.llvm.org/D109861
2021-09-16 10:13:29 -07:00
Sjoerd Meijer 2a1ac2e318 [FuncSpec] Add force flag to test case to trigger the transform. NFC. 2021-09-16 17:48:13 +01:00
Nicolas Vasilache ee2e414dde [mlir][Linalg] Cleanup doc and improve logging and readability in ComprehensiveBufferize.cpp - NFC 2021-09-16 16:41:47 +00:00
cchen 976d474bec [OpenMP] Support construct trait set for Clang
This patch supports construct trait set selector by using the existed
declare variant infrastructure inside `OMPContext` and simd selector is
currently not supported. The goal of this patch is to pass the declare variant
test inside sollve test suite.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D109635
2021-09-16 11:34:31 -05:00
Alfonso Gregory a2c319fdc6 [LLVM][CMake][NFC] Resolve FIXME: Rename LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project
This way, we do not need to set LLVM_CMAKE_PATH to LLVM_CMAKE_DIR when (NOT LLVM_CONFIG_FOUND)

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D107717
2021-09-16 18:29:57 +02:00
Nehal J Wani 1613ab8a4a [libcxx][libcxxabi] CMAKE_REQUIRED_FLAGS is a string, not a list
When `libcxx` or `libcxxabi` is built with `-DLLVM_USE_SANITIZER=MemoryWithOrigins`
**and** `-DLIBCXX[ABI]_USE_COMPILER_RT=ON`, all of the `LIBCXX[ABI]_SUPPORTS_*_FLAG`
checks fail, since the value of `CMAKE_REQUIRED_FLAGS` is not set correctly.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=51774

Reviewed By: #libc, #libc_abi, compnerd, ldionne

Differential Revision: https://reviews.llvm.org/D109342
2021-09-16 18:26:29 +02:00
Matthew Voss 003fed8269 [test] Fix test failure in Clang :: Lexer/char-escapes-delimited.c
Specify the C and C++ standards explicitly for this test. This avoids
failures for drivers that default to older standards.

Differential Revision: https://reviews.llvm.org/D109857
2021-09-16 09:20:05 -07:00
Arnold Schwaighofer f670c5aeee Add a new frontend flag `-fswift-async-fp={auto|always|never}`
Summary:
Introduce a new frontend flag `-fswift-async-fp={auto|always|never}`
that controls how code generation sets the Swift extended async frame
info bit. There are three possibilities:

* `auto`: which determines how to set the bit based on deployment target, either
statically or dynamically via `swift_async_extendedFramePointerFlags`.
* `always`: default, always set the bit statically, regardless of deployment
target.
* `never`: never set the bit, regardless of deployment target.

Differential Revision: https://reviews.llvm.org/D109451
2021-09-16 08:48:51 -07:00
Kazu Hirata cfc7402419 [llvm] Use drop_begin (NFC) 2021-09-16 08:46:26 -07:00
Michael Liao ffa5c3a555 Fix warning on `llvm-else-after-return`. NFC. 2021-09-16 11:25:43 -04:00
Erich Keane 720766a50c Remove trailing whitespace in ASTReaderDecl.cpp 2021-09-16 08:23:28 -07:00