Commit graph

420400 commits

Author SHA1 Message Date
Jonas Devlieghere ee2d9b8723
[lldb] Add Python bindings to print stack traces on crashes.
As noticed in D87637, when LLDB crashes, we only print stack traces if
LLDB is directly executed, not when used via Python bindings. Enabling
this by default may be undesirable (libraries shouldn't be messing with
signal handlers), so make this an explicit opt-in.

I "commandeered" this patch from Jordan Rupprecht who put this up for
review originally.

Differential revision: https://reviews.llvm.org/D91835
2022-04-07 11:21:02 -07:00
Alex Brachet 50de659adc [clang] Use -triple, not -target for %clang_cc1 2022-04-07 18:19:54 +00:00
Alex Brachet 3329dae5cb [clang] Fix macos build broken after D120989 2022-04-07 18:17:29 +00:00
Nathan James d0fcbb3783
[clang-tidy] Fix invalid fix-it for cppcoreguidelines-prefer-member-initializer
Fixes https://github.com/llvm/llvm-project/issues/53515.

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D118927
2022-04-07 19:13:50 +01:00
Daniel Grumberg 1015592251 [clang][extract-api][NFC] Use dedicated API to check for macro equality
Differential Revision: https://reviews.llvm.org/D123295
2022-04-07 19:08:17 +01:00
natashaknk fac9f45e05 [tosa][mlir] Add dynamic width/height support for depthwise convolution in tosa-to-linalg
In addition, fixed a small bug with padding incorrectly inferring output shape for dynaic inputs in convolution

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D121872
2022-04-07 10:50:06 -07:00
Augie Fackler f3c702fbd1 InstCombineCalls: fix annotateAnyAllocCallSite to report changes
Spotted during review of D123052.

Differential Revision: https://reviews.llvm.org/D123232
2022-04-07 13:49:09 -04:00
Simon Pilgrim 005066fd45 [X86] Add PR35202 test case for commuted cmp merging
Test coverage for Issue #34550
2022-04-07 18:39:18 +01:00
Pavel Samolysov b4ac84901e [clang][NFC] Extract EmitAssemblyHelper::shouldEmitRegularLTOSummary
The code to check if the regular LTO summary should be emitted and to
add the corresponding module flags was duplicated in the
'EmitAssemblyHelper::EmitAssemblyWithLegacyPassManager' and
'EmitAssemblyHelper::RunOptimizationPipeline' methods.

In order to eliminate these code duplications, the
'EmitAssemblyHelper::shouldEmitRegularLTOSummary' method has been
extracted. The method returns a bool value, the value is 'true' if the
module summary should be emitted. The patch keeps the setting of the
module flags inline.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D123026
2022-04-07 10:38:46 -07:00
Mark de Wever 82427685ea [libc++][format] Use a helper constant.
The code accidentally uses a hard-coded value. Use a constant to make
sure the same value is used at both places.
2022-04-07 19:25:13 +02:00
Zixu Wang 4048aad85a [clang][ExtractAPI] Fix declaration fragments for ObjC methods
Objective-C methods selector parts should be considered as identifiers.

Depends on D123259

Differential Revision: https://reviews.llvm.org/D123261
2022-04-07 10:22:41 -07:00
Arthur Eubanks 17fdaccccf [CaptureTracking] Ignore ephemeral values when determining pointer escapeness
Ephemeral values cannot cause a pointer to escape.

No change in compile time:
https://llvm-compile-time-tracker.com/compare.php?from=4371710085ba1c376a094948b806ddd3b88319de&to=c5ddbcc4866f38026737762ee8d7b9b00395d4f4&stat=instructions

This partially fixes some regressions caused by more calls to `__builtin_assume` (D122397).

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D123162
2022-04-07 10:11:14 -07:00
Simon Pilgrim 26d974dc3a [X86] Add PR19752 test case
Test coverage for Issue #20126
2022-04-07 18:08:59 +01:00
Karl Meakin 784b9d468a [AArch64] Update tests with the update_llc_test_checks.py script (NFC)
Reviewed By: Kmeakin

Differential Revision: https://reviews.llvm.org/D123317
2022-04-07 18:06:15 +01:00
Lei Zhang 7becf0f6cd [mlir][vector] Fold extract(broadcast) of same rank
This case is handled in neither the folding or canonicalization
patterns. The folding pattern cannot generate new broadcast ops,
so it should be handled by the canonicalization pattern.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D123307
2022-04-07 12:59:54 -04:00
Daniel Grumberg aebe5fc6e7 [clang][extract-api] Process only APIs declared in inputs
We should only process APIs declared in the command line inputs to avoid
drowning the ExtractAPI output with symbols the user doesn't care about.
This is achieved by keeping track of the provided input files and
checking that the associated Decl or Macro is declared in one of those files.

Differential Revision: https://reviews.llvm.org/D123148
2022-04-07 17:49:05 +01:00
Augie Fackler d6a7da5ae3 MemoryBuiltins: only claim an allocator family on builtin functions
This lines up with other parts of the codebase that only use special
knowledge about allocator functions if they're builtins.

Differential Revision: https://reviews.llvm.org/D123053
2022-04-07 12:38:45 -04:00
Augie Fackler b916414096 BuildLibCalls: also set allocsize() attributes
This is part of being able to get rid of two more columns in
MemoryBuiltins.cpp's large table. We'll have two more changes before
we can finish the job.

Differential Revision: https://reviews.llvm.org/D119582
2022-04-07 12:38:44 -04:00
Augie Fackler f120be6c86 InstCombineCalls: when adding an align attribute, never reduce it
Sometimes we can infer an align from an allocalign but the function
already promised it'd be more-aligned than the allocalign and there's an
existing align that we shouldn't reduce. Make sure we handle that
correctly.

Differential Revision: https://reviews.llvm.org/D121642
2022-04-07 12:38:44 -04:00
Augie Fackler 5f09498a11 MemoryBuiltins: also check function definition for allocalign
This got changed to use hasAttrSomewhere() during review, and I didn't
notice until today when I was writing some tests for another part of
this system that using hasAttrSomewhere only checked the callsite for
allocalign, rather than both the callsite and the definition. This fixes
that by introducing a helper method.

Differential Revision: https://reviews.llvm.org/D121641
2022-04-07 12:38:44 -04:00
Augie Fackler ca051a46fb InstCombineCalls: infer return alignment from allocalign attributes
This exposes a couple of lingering bugs, which will be fixed in
the next two commits.

Differential Revision: https://reviews.llvm.org/D123052
2022-04-07 12:38:44 -04:00
Fangrui Song 2edd903c05 [crt][test] Fix dso_handle.cpp for Linux systems which default to PIE 2022-04-07 09:37:59 -07:00
chenglin.bi f72b3a506b [x86] Replace getNodeIfExists to doesNodeExist when only check node exist
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D123224
2022-04-08 00:33:05 +08:00
Craig Topper d98bea87ef [RISCV] Add more .vx patterns for VLMax integer setccs.
This patch synchronizes the structure of the templates with those
in RISCVInstrInfoVVLPatterns.td so that we get patterns with .vx
on the left hand side.

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D123255
2022-04-07 09:17:43 -07:00
Zixu Wang fe2c77a006 [clang][ExtractAPI] Fix appendSpace in DeclarationFragments
There is a bug in `DeclarationFragments::appendSpace` where the space
character is added to a local copy of the last fragment.

Differential Revision: https://reviews.llvm.org/D123259
2022-04-07 09:17:30 -07:00
Craig Topper 82662b753d [RISCV] Add swapped patterns to VPatIntegerSetCCVL_VIPlus1.
This matches VPatIntegerSetCCVL_VI_Swappable. But as noted in the
FIXME this may only be needed due to lack of canonicalization on
VP_SETCC.

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D123239
2022-04-07 09:17:08 -07:00
Paul Walker a88e8374db [SVE] Add more gather/scatter tests to highlight bugs in their generated code. 2022-04-07 17:13:48 +01:00
Siva Chandra Reddy 2ce09e680a [libc] Add a linux Thread class in __support/threads.
This change is essentially a mechanical change which moves the thread
creation and join implementations from src/threads/linux to
src/__support/threads/linux/thread.h. The idea being that, in future, a
pthread implementation can reuse the common thread implementations in
src/__support/threads.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D123287
2022-04-07 16:13:21 +00:00
Arthur Eubanks 0a77e63322 [libcxx] Add flag to disable __builtin_assume in _LIBCPP_ASSERT
Introduce _LIBCPP_ASSERTIONS_DISABLE_ASSUME which makes _LIBCPP_ASSERT
not call __builtin_assume when _LIBCPP_ENABLE_ASSERTIONS == 0.

Calling __builtin_assume was introduced in D122397.

__builtin_assume is generally supposed to improve optimizations, but can
cause regressions when LLVM has trouble handling the calls to
`llvm.assume()` (see comments in D122397).

Reviewed By: philnik

Differential Revision: https://reviews.llvm.org/D123175
2022-04-07 09:00:31 -07:00
Changpeng Fang 6733590db2 AMDGPU: Set implicit kernarg size to be of 256 bytes for code object version 5
Summary:
  If implicitarg_ptr intrinsic is not used, set implicit kernarg size to 0, otherwise
set it to 256 bytes for code object version 5 (and beyond).

Reviewers: arsenm

Differential Revision: https://reviews.llvm.org/D123262
2022-04-07 08:35:23 -07:00
Simon Pilgrim cf3a09369a [X86] Enable fast variable per-lane shuffle tuning on all Ryzen targets (PR44795)
rGa3b8695bf592 enabled this for znver3, but AMD SoG, Agner and uops.info all agree that even znver1 has a fast per-lane shuffle op (VPSHUFB), but cross-lane shuffles seem to be slow (PERMPS etc.)

Fixes #44140

Differential Revision: https://reviews.llvm.org/D123306
2022-04-07 16:00:52 +01:00
Sam McCall b2a7f1c390 Remove a few effectively-unused FileEntry APIs. NFC
- isValid: FileManager only ever returns valid FileEntries (see next point)

- construction from outside FileManager (both FileEntry and DirectoryEntry).
  It's not possible to create a useful FileEntry this way, there are no setters.
  This was only used in FileEntryTest, added a friend to enable this.
  A real constructor is cleaner but requires larger changes to FileManager.

Differential Revision: https://reviews.llvm.org/D123197
2022-04-07 16:45:47 +02:00
Alex Zinenko dbf35b71c7 [mlir] specify dialect names in doc generation
In several cases, a doc is being generated from a .td file that includes
files containing other dialects. Specify the dialect for which the
documentation is being generated explicitly.
2022-04-07 16:37:46 +02:00
Nikita Popov e22af03a79 [Sink] Don't sink non-willreturn calls (PR51188)
Fixes https://github.com/llvm/llvm-project/issues/51188.
2022-04-07 16:35:05 +02:00
Nikita Popov 7d45274263 [Sink] Add willreturn test
Explicitly test the nounwind/willreturn combinations.
2022-04-07 16:35:05 +02:00
Simon Pilgrim afa1ae9e0c [InstCombine] SimplifyDemandedUseBits - allow and(srem(X,Pow2),C) -> and(X,C) to work on vector types
Replace m_ConstantInt with m_APInt to match uniform (no-undef) vector remainder amounts.
2022-04-07 15:24:45 +01:00
Arjun P 00b293e83f [MLIR][Presburger] refactor subtraction to be non-recursive
Subtraction was previously implemented recursively. This refactors it to be
non-recursive to avoid issues with potential stack overflows.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D123248
2022-04-07 15:20:19 +01:00
Louis Dionne b7042b73a3 [libc++] Add back-deployment testing on arm64 macs
Differential Revision: https://reviews.llvm.org/D123081
2022-04-07 10:15:40 -04:00
Alexey Bataev 8e066b86a7 Add missing template keywords
GCC 14 warns about these.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D121047
2022-04-07 07:08:44 -07:00
Nico Weber e22a60b1c8 Revert "Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"""
This reverts commit 2aca33baf1.
Broke tests on several bots, see comments on https://reviews.llvm.org/D120305
2022-04-07 10:07:07 -04:00
Dmitry Preobrazhensky 1f6aa90386 [AMDGPU][MC][GFX10] Added syntactic sugar for s_waitcnt_depctr operand
Added the following helpers:

    depctr_hold_cnt(...)
    depctr_sa_sdst(...)
    depctr_va_vdst(...)
    depctr_va_sdst(...)
    depctr_va_ssrc(...)
    depctr_va_vcc(...)
    depctr_vm_vsrc(...)

Differential Revision: https://reviews.llvm.org/D123022
2022-04-07 17:03:44 +03:00
Simon Pilgrim cde66d5ed1 [InstCombine] Regenerate and(srem(X,Pow2),C) test and add vector coverage 2022-04-07 14:58:50 +01:00
Ties Stuij edeceb8647 remove dead code in parseRegisterList checking for ARM::RA_AUTH_CODE
Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D122577
2022-04-07 14:53:46 +01:00
Simon Pilgrim 5909c67883 [InstCombine] SimplifyDemandedUseBits - add TODO to remove shl node if we only demand known sign bits of the shift source
Similar to what we already perform for ashr/lshr
2022-04-07 14:35:11 +01:00
Simon Pilgrim 5e90224839 [InstCombine] SimplifyDemandedUseBits - remove lshr node if we only demand known sign bit
This is a lshr equivalent to D122340 - if we don't demand any of the additional sign bits introduced by the ashr, the lshr can be treated as an ashr and we can remove the shift entirely if we only demand already known sign bits.

Another step towards PR21929

https://alive2.llvm.org/ce/z/6f3kjq

Differential Revision: https://reviews.llvm.org/D123118
2022-04-07 14:33:31 +01:00
LLVM GN Syncbot 1c1d477ce3 [gn build] Port 1306b1025c 2022-04-07 13:18:45 +00:00
Nikolas Klauser 1306b1025c [libc++][ranges] Implement ranges::count{, _if}
Reviewed By: var-const, Mordante, ldionne, #libc

Spies: tcanens, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D121523
2022-04-07 15:18:14 +02:00
Jez Ng da6b6b3c82 [lld-macho][nfc] Factor out findSymbolAtOffset
Our compact unwind handling code currently has some logic to locate a
symbol at a given offset in an InputSection. The EH frame code will need
to do something similar, so let's factor out the code.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D123301
2022-04-07 09:13:39 -04:00
Simon Pilgrim dc15bedfb9 Fix MSVC "not all control paths return a value" warning 2022-04-07 14:01:15 +01:00
Simon Pilgrim a1df2ef5cb [X86] Ensure ZN3Tuning inherits from ZN2Tuning instead of ZNTuning
At the moment ZN2Tuning is just a copy of ZNTuning, but we should try to keep a clean inheritance.
2022-04-07 14:01:15 +01:00