Joseph Huber [Wed, 6 Apr 2022 19:21:50 +0000 (15:21 -0400)]
[OpenMP] Change target memory tests to use allocators
The target allocators have been supported for NVPTX offloading for
awhile. The tests should use the allocators instead of calling the
functions manually. Also the comments indicating these being a preview
should be removed.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D123242
Mogball [Thu, 7 Apr 2022 18:22:14 +0000 (18:22 +0000)]
[mlir][ods] Fix builder gen for VariadicRegion with inferred types
Builders generated for ops with variadic regions and inferred return types were not being correctly generated (missing parameter).
Jonas Devlieghere [Thu, 7 Apr 2022 18:12:09 +0000 (11:12 -0700)]
[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
Alex Brachet [Thu, 7 Apr 2022 18:19:54 +0000 (18:19 +0000)]
[clang] Use -triple, not -target for %clang_cc1
Alex Brachet [Thu, 7 Apr 2022 18:17:29 +0000 (18:17 +0000)]
[clang] Fix macos build broken after D120989
Nathan James [Thu, 7 Apr 2022 18:13:50 +0000 (19:13 +0100)]
[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
Daniel Grumberg [Thu, 7 Apr 2022 10:17:23 +0000 (11:17 +0100)]
[clang][extract-api][NFC] Use dedicated API to check for macro equality
Differential Revision: https://reviews.llvm.org/D123295
natashaknk [Thu, 7 Apr 2022 17:22:23 +0000 (10:22 -0700)]
[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
Augie Fackler [Wed, 6 Apr 2022 15:59:30 +0000 (11:59 -0400)]
InstCombineCalls: fix annotateAnyAllocCallSite to report changes
Spotted during review of D123052.
Differential Revision: https://reviews.llvm.org/D123232
Simon Pilgrim [Thu, 7 Apr 2022 17:39:06 +0000 (18:39 +0100)]
[X86] Add PR35202 test case for commuted cmp merging
Test coverage for Issue #34550
Pavel Samolysov [Thu, 7 Apr 2022 15:43:10 +0000 (08:43 -0700)]
[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
Mark de Wever [Thu, 7 Apr 2022 17:22:14 +0000 (19:22 +0200)]
[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.
Zixu Wang [Wed, 6 Apr 2022 21:53:52 +0000 (14:53 -0700)]
[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
Arthur Eubanks [Tue, 5 Apr 2022 21:51:53 +0000 (14:51 -0700)]
[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
Simon Pilgrim [Thu, 7 Apr 2022 17:08:42 +0000 (18:08 +0100)]
[X86] Add PR19752 test case
Test coverage for Issue #20126
Karl Meakin [Wed, 6 Apr 2022 17:35:37 +0000 (18:35 +0100)]
[AArch64] Update tests with the `update_llc_test_checks.py` script (NFC)
Reviewed By: Kmeakin
Differential Revision: https://reviews.llvm.org/D123317
Lei Zhang [Thu, 7 Apr 2022 16:59:09 +0000 (12:59 -0400)]
[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
Daniel Grumberg [Tue, 5 Apr 2022 18:49:08 +0000 (19:49 +0100)]
[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
Augie Fackler [Thu, 24 Feb 2022 22:40:17 +0000 (17:40 -0500)]
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
Augie Fackler [Thu, 10 Feb 2022 22:38:12 +0000 (17:38 -0500)]
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
Augie Fackler [Mon, 14 Mar 2022 20:25:56 +0000 (16:25 -0400)]
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
Augie Fackler [Mon, 14 Mar 2022 20:55:44 +0000 (16:55 -0400)]
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
Augie Fackler [Mon, 4 Apr 2022 16:43:16 +0000 (12:43 -0400)]
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
Fangrui Song [Thu, 7 Apr 2022 16:37:59 +0000 (09:37 -0700)]
[crt][test] Fix dso_handle.cpp for Linux systems which default to PIE
chenglin.bi [Thu, 7 Apr 2022 16:33:05 +0000 (00:33 +0800)]
[x86] Replace getNodeIfExists to doesNodeExist when only check node exist
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D123224
Craig Topper [Thu, 7 Apr 2022 16:17:30 +0000 (09:17 -0700)]
[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
Zixu Wang [Wed, 6 Apr 2022 21:45:35 +0000 (14:45 -0700)]
[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
Craig Topper [Thu, 7 Apr 2022 16:05:51 +0000 (09:05 -0700)]
[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
Paul Walker [Thu, 7 Apr 2022 15:42:08 +0000 (16:42 +0100)]
[SVE] Add more gather/scatter tests to highlight bugs in their generated code.
Siva Chandra Reddy [Fri, 1 Apr 2022 06:42:14 +0000 (06:42 +0000)]
[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
Arthur Eubanks [Wed, 6 Apr 2022 02:16:39 +0000 (19:16 -0700)]
[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
Changpeng Fang [Thu, 7 Apr 2022 15:35:23 +0000 (08:35 -0700)]
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
Simon Pilgrim [Thu, 7 Apr 2022 15:00:42 +0000 (16:00 +0100)]
[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
Sam McCall [Wed, 6 Apr 2022 09:37:25 +0000 (11:37 +0200)]
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
Alex Zinenko [Thu, 7 Apr 2022 14:36:30 +0000 (16:36 +0200)]
[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.
Nikita Popov [Thu, 7 Apr 2022 14:23:56 +0000 (16:23 +0200)]
[Sink] Don't sink non-willreturn calls (PR51188)
Fixes https://github.com/llvm/llvm-project/issues/51188.
Nikita Popov [Thu, 7 Apr 2022 14:21:23 +0000 (16:21 +0200)]
[Sink] Add willreturn test
Explicitly test the nounwind/willreturn combinations.
Simon Pilgrim [Thu, 7 Apr 2022 14:13:46 +0000 (15:13 +0100)]
[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.
Arjun P [Thu, 7 Apr 2022 13:41:04 +0000 (14:41 +0100)]
[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
Louis Dionne [Mon, 4 Apr 2022 21:53:31 +0000 (17:53 -0400)]
[libc++] Add back-deployment testing on arm64 macs
Differential Revision: https://reviews.llvm.org/D123081
Alexey Bataev [Thu, 7 Apr 2022 13:18:17 +0000 (06:18 -0700)]
Add missing template keywords
GCC 14 warns about these.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D121047
Nico Weber [Thu, 7 Apr 2022 14:06:45 +0000 (10:06 -0400)]
Revert "Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"""
This reverts commit
2aca33baf15926afe2520a06b1427a9894226fd2.
Broke tests on several bots, see comments on https://reviews.llvm.org/D120305
Dmitry Preobrazhensky [Thu, 7 Apr 2022 14:02:50 +0000 (17:02 +0300)]
[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
Simon Pilgrim [Thu, 7 Apr 2022 13:58:39 +0000 (14:58 +0100)]
[InstCombine] Regenerate and(srem(X,Pow2),C) test and add vector coverage
Ties Stuij [Thu, 7 Apr 2022 13:35:30 +0000 (14:35 +0100)]
remove dead code in parseRegisterList checking for ARM::RA_AUTH_CODE
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D122577
Simon Pilgrim [Thu, 7 Apr 2022 13:35:11 +0000 (14:35 +0100)]
[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
Simon Pilgrim [Thu, 7 Apr 2022 13:33:31 +0000 (14:33 +0100)]
[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
LLVM GN Syncbot [Thu, 7 Apr 2022 13:18:45 +0000 (13:18 +0000)]
[gn build] Port
1306b1025c50
Nikolas Klauser [Thu, 7 Apr 2022 11:02:02 +0000 (13:02 +0200)]
[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
Jez Ng [Thu, 7 Apr 2022 13:05:33 +0000 (09:05 -0400)]
[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
Simon Pilgrim [Thu, 7 Apr 2022 13:01:06 +0000 (14:01 +0100)]
Fix MSVC "not all control paths return a value" warning
Simon Pilgrim [Thu, 7 Apr 2022 12:38:21 +0000 (13:38 +0100)]
[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.
Simon Pilgrim [Thu, 7 Apr 2022 12:36:37 +0000 (13:36 +0100)]
[X86] Add test case for PR44795
Nathan Sidwell [Wed, 6 Apr 2022 14:24:06 +0000 (07:24 -0700)]
[clang] Verify internal entity module mangling
Internal symbol mangling is implementation-defined. We do not mangle
any module attachment, and this adds a test to verify that.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D123220
Antonio Frighetto [Thu, 7 Apr 2022 12:20:54 +0000 (08:20 -0400)]
Fix warnings when `-Wdeprecated-enum-enum-conversion` is enabled
clang may throw the following warning:
include/clang/AST/DeclarationName.h:210:52: error: arithmetic between
different enumeration types ('clang::DeclarationName::StoredNameKind'
and 'clang::detail::DeclarationNameExtra::ExtraKind') is deprecated
when flags -Werror,-Wdeprecated-enum-enum-conversion are on.
This adds the `addEnumValues()` helper function to STLExtras.h to hide
the details of adding enumeration values together from two different
enumerations.
Nico Weber [Thu, 7 Apr 2022 12:15:33 +0000 (08:15 -0400)]
[gn build] (manually) port
3031fa88f01e
Nico Weber [Thu, 7 Apr 2022 12:13:26 +0000 (08:13 -0400)]
[gn build] (manually) port
5390606aa963
Nico Weber [Wed, 6 Apr 2022 19:55:42 +0000 (15:55 -0400)]
[lld/mac] Don't emit stabs entries for functions folded during ICF
This matches ld64, and makes dsymutil work better with lld's output.
Fixes PR54783, see there for details.
Reduces time needed to run dsymutil on Chromium Framework from 8m30s
(which is already down from 26 min with D123218) to 6m30s and removes
many lines of "could not find object file symbol for symbol" from dsymutil output
(previously: several MB of those messages, now dsymutil is completely silent).
Differential Revision: https://reviews.llvm.org/D123252
Nikolas Klauser [Wed, 6 Apr 2022 21:10:21 +0000 (23:10 +0200)]
[libc++] Remove redundant __invoke_constexpr functions
There are `constexpr` versions for the different `__invoke` functions, which seem to be identical other than begin `constexpr` since C++11 instead of being `constexpr` since C++20.
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D123003
Nikita Popov [Thu, 7 Apr 2022 11:52:19 +0000 (13:52 +0200)]
[Clang] Remove redundant -no-opaque-pointers flag in test (NFC)
This was accidentally caught in an automated replacement. This
test is testing the -opaque-pointers flag itself, so we shouldn't
add -no-opaque-pointers here (though it doesn't hurt either).
Also drop the line testing the default, as the default is now
determined by a cmake option.
Kavitha Natarajan [Mon, 7 Mar 2022 07:15:52 +0000 (12:45 +0530)]
[clang][DebugInfo] Support debug info for alias variable
clang to emit DWARF information for global alias variable as
DW_TAG_imported_declaration. This change also handles nested
(recursive) imported declarations.
Reviewed by: dblaikie, aprantl
Differential Revision: https://reviews.llvm.org/D120989
Weining Lu [Thu, 7 Apr 2022 08:07:42 +0000 (16:07 +0800)]
[LoongArch] Split asmstr to opcstr and opnstr in LAInst class definition. NFC
This change removes a lot of redundant strconcat usings.
Simon Pilgrim [Thu, 7 Apr 2022 11:13:55 +0000 (12:13 +0100)]
[bugpoint] ReduceCrashingFunctions::TestFuncs - fix dereference of null point static analyzer warning
Alias.getAliaseeObject() shouldn't be null, do use dyn_cast instead of dyn_cast_or_null
Also, remove redundant `else if (!F)` test - that is always true at the point in the if-else chain
Priyansh Singh [Thu, 7 Apr 2022 11:11:11 +0000 (07:11 -0400)]
Fix grammar and punctuation across several docs; NFC
chenglin.bi [Thu, 7 Apr 2022 11:08:59 +0000 (19:08 +0800)]
[AMDGPU] Regenerate xor3-i1-const.ll test(NFC)
Luís Marques [Thu, 7 Apr 2022 11:00:41 +0000 (12:00 +0100)]
[RISCV] Fix crash for section alignment with .option norvc
The existing code wasn't getting the subtarget info from the fragment,
so the current status of RVC would be ignored. This would cause a crash
for the new test case when the target then reported it couldn't write
the requested number of code alignment bytes.
Differential Revision: https://reviews.llvm.org/D122236
Chih-Ping Chen [Mon, 28 Mar 2022 13:45:19 +0000 (09:45 -0400)]
[DebugInfo] Use DW_ATE_signed encoding when creating a Fortran
array index type.
Kirill Bobyrev [Thu, 7 Apr 2022 10:56:56 +0000 (12:56 +0200)]
[clangd] NFC: Fix doc typos
Nikita Popov [Thu, 7 Apr 2022 10:15:37 +0000 (12:15 +0200)]
[Clang] Add -no-opaque-pointers to more tests (NFC)
This adds the flag to more tests that were not caught by the
mass-migration in
532dc62b907554b3f07f17205674aa71e76fc863.
Zi Xuan Wu [Thu, 7 Apr 2022 10:24:34 +0000 (18:24 +0800)]
[CSKY] Support bitcast operation from/to double to/from two GPRs
In soft ABI, floating num is passing in GPRs. So we need support
bitcovert from double to Hi and Lo GPRs and vice versa
Simon Pilgrim [Thu, 7 Apr 2022 10:24:56 +0000 (11:24 +0100)]
[X86] Add Issue #50412 fcmp-logic test case
Simon Pilgrim [Thu, 7 Apr 2022 10:19:54 +0000 (11:19 +0100)]
Fix "result of 32-bit shift implicitly converted to 64 bits" MSVC warning. NFC.
Benjamin Kramer [Thu, 7 Apr 2022 10:14:14 +0000 (12:14 +0200)]
Nikita Popov [Thu, 7 Apr 2022 10:03:55 +0000 (12:03 +0200)]
[OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.
The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.
Differential Revision: https://reviews.llvm.org/D123115
Nikolas Klauser [Thu, 7 Apr 2022 10:01:49 +0000 (12:01 +0200)]
[libc++][ranges] Add implicit conversion to bool test for ranges::find{, if, if_not}
Reviewed By: ldionne, var-const, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D122011
Mehdi Chinoune [Thu, 7 Apr 2022 09:11:52 +0000 (12:11 +0300)]
[lldb] Fix building standalone LLDB on Windows.
It was broken since https://reviews.llvm.org/D110172
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D122523
Lorenzo Chelini [Thu, 7 Apr 2022 09:17:21 +0000 (11:17 +0200)]
[MLIR] Standalone: Fix copy-and-paste typo (NFC)
Remove duplicate statements.
Martin Storsjö [Wed, 6 Apr 2022 20:18:55 +0000 (23:18 +0300)]
[lldb] [CMake] Disable GCC's -Wstringop-truncation warning. NFC.
This warning gives false positives about lldb's correct use of
strncpy to fill fixed length fields that don't need null termination,
in lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp, like this:
In file included from /usr/include/string.h:495,
from /usr/include/c++/9/cstring:42,
from ../include/llvm/ADT/StringRef.h:19,
from ../tools/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:10:
In function ‘char* strncpy(char*, const char*, size_t)’,
inlined from ‘lldb::offset_t CreateAllImageInfosPayload(const ProcessSP&, lldb::offset_t, lldb_private::StreamString&, lldb::SaveCoreStyle)’ at ../tools/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:6341:16:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 16 equals destination size [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
The warning could be squelched locally with
#pragma GCC diagnostic ignored "-Wstringop-truncation"
too, but Clang also interprets those GCC pragmas, and produces
a -Wunknown-warning-option warning instead. That could be remedied
by wrapping the pragma in an "#ifndef __clang__" - but that makes
things even more messy. Instead, just silence this warning entirely.
Differential Revision: https://reviews.llvm.org/D123254
Balázs Kéri [Thu, 7 Apr 2022 08:31:09 +0000 (10:31 +0200)]
[clang][ASTImporter] Not using consumeError at failed import of in-class initializer.
The error can be returned from the function, the problem written in comment before
does not exist. The same is done already in ASTImporter at various import failures.
After a declaration is created in an `ASTNodeImporter` import function
with `GetImportedOrCreateDecl`, that function registers it with
`MapImported`. At many places import errors can happen after this
and the error is returned. The same can be done in the place where
the in-class initializer is imported.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D122528
Benjamin Kramer [Thu, 7 Apr 2022 09:00:28 +0000 (11:00 +0200)]
[clang-tidy] Silence unused variable warning in release builds. NFCI.
Weining Lu [Thu, 7 Apr 2022 07:16:59 +0000 (15:16 +0800)]
[LoongArch] Improve td files indentation a little bit. NFC
Fraser Cormack [Wed, 6 Apr 2022 13:26:20 +0000 (14:26 +0100)]
[RISCV] Select unmasked integer setcc insts via ISel post-process
This patch has no effect on the generated code, whilst mitigating the
increase in ISel table size caused by the recent addition of masked
patterns.
I aim to do the same for floating-point patterns once D123051 lands,
giving us a reason to use masked floating-point patterns.
Reviewed By: arcbbb
Differential Revision: https://reviews.llvm.org/D123217
Benjamin Kramer [Thu, 7 Apr 2022 08:40:55 +0000 (10:40 +0200)]
[bazel] Port
5390606aa963
Benjamin Kramer [Thu, 7 Apr 2022 08:40:28 +0000 (10:40 +0200)]
Transforms: Remove unused include
Utils can't depend on Scalar transforms.
Florian Hahn [Thu, 7 Apr 2022 08:31:12 +0000 (10:31 +0200)]
[VPlan] Use vector.body as header name in VPlan native path.
This brings the VPlan block naming in line with the naming of the
generated basic blocks.
Fraser Cormack [Mon, 4 Apr 2022 17:19:11 +0000 (18:19 +0100)]
[RISCV][VP] Add basic RVV codegen for vp.fcmp
This patch adds the necessary infrastructure to lower vp.fcmp via
ISD::VP_SETCC to RVV instructions.
Most notably this patch adds cond-code legalization for VP_SETCC,
reusing the existing TargetLowering::LegalizeSetCCCondCode by passing in
additional SDValue parameters for the Mask and EVL. This method then
uses VP operations to legalize the condcode.
There is still a general lack of canonicalization on VP_SETCC as opposed
to SETCC which results in worse code than is theoretically possible.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D123051
Nikita Popov [Wed, 6 Apr 2022 14:21:20 +0000 (16:21 +0200)]
[lld] Remove support for legacy pass manager
This removes options for performing LTO with the legacy pass
manager in LLD. Options that explicitly enable the new pass manager
are retained as no-ops.
Differential Revision: https://reviews.llvm.org/D123219
Nikita Popov [Tue, 5 Apr 2022 12:45:51 +0000 (14:45 +0200)]
[OpaquePtr][Clang] Add CLANG_ENABLE_OPAQUE_POINTERS cmake option
This option controls whether -opaque-pointers or -no-opaque-pointers
is the default. Once opaque pointers are enabled by default, this
will provide a simple way to temporarily opt-out of the change.
Differential Revision: https://reviews.llvm.org/D123122
Valentin Clement [Thu, 7 Apr 2022 08:06:50 +0000 (10:06 +0200)]
[mlir][CSE] Remove duplicated operations with MemRead side-effect
This patch enhances the CSE pass to deal with simple cases of duplicated
operations with MemoryEffects.
It allows the CSE pass to remove safely duplicate operations with the
MemoryEffects::Read that have no other side-effecting operations in
between. Other MemoryEffects::Read operation are allowed.
The use case is pretty simple so far so we can build on top of it to add
more features.
This patch is also meant to avoid a dedicated CSE pass in FIR and was
brought together afetr discussion on https://reviews.llvm.org/D112711.
It does not currently cover the full range of use cases described in
https://reviews.llvm.org/D112711 but the idea is to gradually enhance
the MLIR CSE pass to handle common use cases that can be used by
other dialects.
This patch takes advantage of the new CSE capabilities in Fir.
Reviewed By: mehdi_amini, rriddle, schweitz
Differential Revision: https://reviews.llvm.org/D122801
Wei Xiao [Tue, 5 Apr 2022 08:00:46 +0000 (16:00 +0800)]
[x86] Improve select lowering for smin(x, 0) & smax(x, 0)
smin(x, 0):
(select (x < 0), x, 0) -> ((x >> (size_in_bits(x)-1))) & x
smax(x, 0):
(select (x > 0), x, 0) -> (~(x >> (size_in_bits(x)-1))) & x
The comparison is testing for a positive value, we have to invert the sign
bit mask, so only do that transform if the target has a bitwise 'and not'
instruction (the invert is free).
The transform is performed only when CMP has a single user to avoid
increasing total instruction number.
https://alive2.llvm.org/ce/z/euUnNm
https://alive2.llvm.org/ce/z/37339J
Differential Revision: https://reviews.llvm.org/D123109
Nikita Popov [Wed, 6 Apr 2022 12:39:20 +0000 (14:39 +0200)]
[LoopSink] Use MemorySSA with legacy pass manager
LoopSink with the legacy pass manager still uses AST, because we
can't compute MemorySSA conditionally. I think now that the legacy
pass manager will be removed soon(TM) we don't need to care about
compile-time impact here anymore. Additionally, since MemorySSA is
no longer eagerly optimized, the impact is actually not that high
anymore (~0.2% geomean regression on CTMark).
This just makes legacy PM and new PM behavior line up -- as a
followup I'll drop these options entirely and make MemorySSA use
mandatory.
Differential Revision: https://reviews.llvm.org/D123216
Balázs Kéri [Thu, 7 Apr 2022 07:00:01 +0000 (09:00 +0200)]
[clang-tidy] bugprone-signal-handler: Message improvement and code refactoring.
Another change of the code design.
Code simplified again, now there is a single place to check
a handler function and less functions for bug report emitting.
More details are added to the bug report messages.
Reviewed By: whisperity
Differential Revision: https://reviews.llvm.org/D118370
Tobias Hieta [Wed, 6 Apr 2022 15:06:37 +0000 (17:06 +0200)]
[LLD][COFF] Fix TypeServerSource matcher with more than one collision
Follow-up from
98bc304e9faded44f1d8988ffa4c5d8b50c759ec - while that
commit fixed when you had two PDBs colliding on the same Guid it didn't
fix the case where you had more than two PDBs using the same Guid.
This commit fixes that and also tests much more carefully that all
the types are correct no matter the order.
Reviewed By: aganea, saudi
Differential Revision: https://reviews.llvm.org/D123185
Stanislav Mekhanoshin [Thu, 7 Apr 2022 06:47:14 +0000 (23:47 -0700)]
[AMDGPU] Fix test difference in debug and release. NFC.
Added -disable-gisel-legality-check to couple GlobalISel tests
which have not legal instructions to avoid difference in
debug and release builds.
Jason Molenda [Thu, 7 Apr 2022 06:33:19 +0000 (23:33 -0700)]
Correct debugserver to write xmm/ymm/zmm reg values
debugserver does not call thread_set_state when changing xmm/ymm/zmm
register values, so the register contents are never updated. Fix
that. Mark the shell tests which xfail'ed these tests on darwin systems
to xfail them when the system debugserver, they will pass when using
the in-tree debugserver. When this makes it into the installed
system debugservers, we'll remove the xfails.
Differential Revision: https://reviews.llvm.org/D123269
rdar://
91258333
rdar://
31294382
Liqin Weng [Thu, 7 Apr 2022 05:45:06 +0000 (05:45 +0000)]
[RISCV] Add CMOV isel pattern for (select (setgt X, Imm), Y, Z)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D122644
Petr Hosek [Thu, 7 Apr 2022 00:37:23 +0000 (17:37 -0700)]
[CMake][Fuchsia] Include bolt
We would like to use bolt with Fuchsia toolchain.
Differential Revision: https://reviews.llvm.org/D123280
Fangrui Song [Thu, 7 Apr 2022 05:41:27 +0000 (22:41 -0700)]
[ELF] Ignore --no-add-needed
It is used by a few projects like keepassxc and mumble.
Also see https://bugzilla.redhat.com/show_bug.cgi?id=2070813 that Fedora gcc has
an (unneeded) gcc12-no-add-needed.patch which adds --no-add-needed, although
--[no-]add-needed has been deprecated in GNU ld since 2009. Adding this has low
costs and makes several folks happy.
This basically restores
8f13bef575c97db4d6c146c3bb647ac9e73a9248.
Fixes https://github.com/llvm/llvm-project/issues/54756
Fangrui Song [Thu, 7 Apr 2022 04:14:24 +0000 (21:14 -0700)]
[Driver][test] Fix csky-toolchain.c to be CLANG_DEFAULT_PIE_ON_LINUX agnostic
Jez Ng [Thu, 7 Apr 2022 04:00:41 +0000 (00:00 -0400)]
[lld-macho][nfc] Rearrange order of statements to clarify data dependencies