Commit Graph

421597 Commits

Author SHA1 Message Date
Aaron Ballman 37a47aacba Speculatively fix build bot
This should address the issue in:
https://lab.llvm.org/buildbot/#/builders/77/builds/16683
2022-04-20 12:32:57 -04:00
Craig Topper e3f6c2d288 [InstCombine] Don't look through bitcast from vector in collectInsertionElements.
We're making a recursive call here and everything in the function
assumes we're looking at scalars. This would be violated if we
looked through a bitcast from vectors.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D124015
2022-04-20 09:15:32 -07:00
Craig Topper 11db0bb64d [InstCombine] Pre-commit test for D124015
Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D124016
2022-04-20 09:15:32 -07:00
chenglin.bi 1fae4b492d [InstCombine] Fold mul nuw+lshr to a single multiplication when the latter is a factor
if c is divisible by (1 << ShAmtC), we can fold this pattern:
lshr (mul nuw x, c), ShAmtC -> mul nuw x, (c >> ShAmtC)

https://alive2.llvm.org/ce/z/ox4wAt

Fix https://github.com/llvm/llvm-project/issues/54824

Reviewed By: spatel, lebedev.ri, craig.topper

Differential Revision: https://reviews.llvm.org/D123453
2022-04-21 00:13:36 +08:00
Aaron Ballman e0ee080574 Speculatively fix build bots
This should address the issue found in:
https://lab.llvm.org/buildbot/#/builders/215/builds/4610
2022-04-20 12:05:33 -04:00
Aaron Ballman 7661d3bc9d Speculatively fix build bots
This should address the issues found by:
https://lab.llvm.org/buildbot/#/builders/105/builds/24292
2022-04-20 12:02:16 -04:00
Aaron Ballman 4f843f9a9e Removing some ancient, unused testing functionality
This was last touched 13 years ago in
7a1095f243
and is no longer being maintained.
2022-04-20 11:57:25 -04:00
Paul Robinson dfdb2cc0fb [PS5][NFC] Fix a test with a misplaced -x option 2022-04-20 08:56:50 -07:00
Aaron Ballman ef50d817b6 Speculatively fix build bots
This should address build failures found in:

https://lab.llvm.org/buildbot/#/builders/217/builds/3610
https://lab.llvm.org/buildbot/#/builders/215/builds/4609
https://lab.llvm.org/buildbot/#/builders/68/builds/31012
2022-04-20 11:48:06 -04:00
Jun Zhang 9f075c3d84
Revert "[Clang][Sema] Fix invalid redefinition error in if/switch/for statement"
This reverts commit be0905a333.
This patch broke build addressed in https://github.com/llvm/llvm-project/issues/54968
Signed-off-by: Jun Zhang <jun@junz.org>
2022-04-20 23:45:44 +08:00
Arthur Eubanks 19884d62c4 [clang-format] Don't skip PP lines if original line was a PP line when trying to merge lines
Fixes a crash introduced in D123737 where LastNonComment would be null.

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D124036
2022-04-20 08:42:30 -07:00
Siva Chandra Reddy 945e0220fd [libc] Add GNU extention functions fread_unlocked and fwrite_unlocked.
POSIX locking and unlocking functions flockfile and funlockfile have
also been added. The locking is not recursive yet. A future patch will
make the underlying lock a recursive lock.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D123986
2022-04-20 15:39:27 +00:00
Aaron Ballman 009048ab31 Update the developer policy to mention release notes
As a project, Clang has gotten negative public feedback about our lack
of communicating changes to users. There are comments on places like
Hacker News or Reddit where users have (rightfully) been confused as to
what changes happen in a given release, leading to misinformation like
Clang not adding support for C++20 features:
https://news.ycombinator.com/item?id=28761464.

This documents the expectation that changes which impact users should
have release notes, and it's normal for code reviewers to ask an author
to add a release note for a given change.

This addresses: https://github.com/llvm/llvm-project/issues/54965

RFC: https://discourse.llvm.org/t/rfc-update-developer-policy-on-release-notes/61856

Differential Revision: https://reviews.llvm.org/D123957
2022-04-20 11:36:30 -04:00
Paul Robinson a5c847e8cf [PS4][NFC] Rename classes to align with prevailing practice
Rename classes Assemble -> Assembler, Link -> Linker,
for consistency with names other toolchains use.
2022-04-20 08:35:52 -07:00
Siva Chandra Reddy e6d56802f8 [libc][docs] Update the fuzzing doc to better reflect the current state.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D123923
2022-04-20 15:33:20 +00:00
Aaron Ballman 7d644e1215 [C11/C2x] Change the behavior of the implicit function declaration warning
C89 had a questionable feature where the compiler would implicitly
declare a function that the user called but was never previously
declared. The resulting function would be globally declared as
extern int func(); -- a function without a prototype which accepts zero
or more arguments.

C99 removed support for this questionable feature due to severe
security concerns. However, there was no deprecation period; C89 had
the feature, C99 didn't. So Clang (and GCC) both supported the
functionality as an extension in C99 and later modes.

C2x no longer supports that function signature as it now requires all
functions to have a prototype, and given the known security issues with
the feature, continuing to support it as an extension is not tenable.

This patch changes the diagnostic behavior for the
-Wimplicit-function-declaration warning group depending on the language
mode in effect. We continue to warn by default in C89 mode (due to the
feature being dangerous to use). However, because this feature will not
be supported in C2x mode, we've diagnosed it as being invalid for so
long, the security concerns with the feature, and the trivial
workaround for users (declare the function), we now default the
extension warning to an error in C99-C17 mode. This still gives users
an easy workaround if they are extensively using the extension in those
modes (they can disable the warning or use -Wno-error to downgrade the
error), but the new diagnostic makes it more clear that this feature is
not supported and should be avoided. In C2x mode, we no longer allow an
implicit function to be defined and treat the situation the same as any
other lookup failure.

Differential Revision: https://reviews.llvm.org/D122983
2022-04-20 11:30:12 -04:00
Sanjay Patel bf09a925f2 [InstCombine] remove likely redundant ValueTracking-based folds for shifts
This is not expected to have a functional difference as discussed in the
post-commit comments for 8a9c70fc01. All of the motivating tests for
the older fold still optimize as expected because other code can infer
the 'nuw'.
2022-04-20 11:28:31 -04:00
Matt Arsenault 9209a51918 MachineModuleInfo: Move AddrLabelSymbols to AsmPrinter
This was tracking global state only used by the AsmPrinter, which can
store its own module global state.
2022-04-20 11:21:40 -04:00
Fabian Wolff cce79514ff [clang-tidy] Reduce false positives for `bugprone-infinite-loop` with dependent expressions
Fixes https://github.com/llvm/llvm-project/issues/51423.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D113499
2022-04-20 17:17:54 +02:00
Matt Arsenault 3659780d58 MachineModuleInfo: Remove UsesMorestackAddr
This is x86 specific, and adds statefulness to
MachineModuleInfo. Instead of explicitly tracking this, infer if we
need to declare the symbol based on the reference previously inserted.

This produces a small change in the output due to the move from
AsmPrinter::doFinalization to X86's emitEndOfAsmFile. This will now be
moved relative to other end of file fields, which I'm assuming doesn't
matter (e.g. the __morestack_addr declaration is now after the
.note.GNU-split-stack part)

This also produces another small change in code if the module happened
to define/declare __morestack_addr, but I assume that's invalid and
doesn't really matter.
2022-04-20 11:10:20 -04:00
Fabian Wolff fb3b3f76bf [clang-tidy] Fix `readability-container-size-empty` check for smart pointers
Fixes https://github.com/llvm/llvm-project/issues/51118.

Reviewed By: Sockke

Differential Revision: https://reviews.llvm.org/D115124
2022-04-20 17:03:30 +02:00
Fabian Wolff f25935a000 [clang-tidy] Fix `altera-struct-pack-align` check for empty structs
Fixes https://github.com/llvm/llvm-project/issues/50962.

Reviewed By: whisperity, aaron.ballman

Differential Revision: https://reviews.llvm.org/D114292
2022-04-20 16:55:29 +02:00
Matt Arsenault d7938b1a81 MachineModuleInfo: Move HasSplitStack handling to AsmPrinter
This is used to emit one field in doFinalization for the module. We
can accumulate this when emitting all individual functions directly in
the AsmPrinter, rather than accumulating additional state in
MachineModuleInfo.

Move the special case behavior predicate into MachineFrameInfo to
share it. This now promotes it to generic behavior. I'm assuming this
is fine because no other target implements adjustForSegmentedStacks,
or has tests using the split-stack attribute.
2022-04-20 10:54:29 -04:00
Matthias Springer 8544523dcb [mlir][tensor] Promote extract(from_elements(...)) to folding pattern
Differential Revision: https://reviews.llvm.org/D123617
2022-04-20 23:47:42 +09:00
Benjamin Kramer ff087d705c [bazel] Port f26c41e8dd 2022-04-20 16:15:16 +02:00
Simon Pilgrim 1226d276b4 [X86][AVX512] Rename avx512popcntdq intrinsics tests files to match *-builtins.c naming convention 2022-04-20 15:12:12 +01:00
Simon Pilgrim 72d4e3dc2d [X86][AVX] Add i386 test coverage to avx2 intrinsic tests 2022-04-20 15:12:12 +01:00
Simon Pilgrim 0140a672a6 [X86][AVX] Add i386 test coverage to avx-vnni intrinsic tests 2022-04-20 15:12:12 +01:00
Simon Pilgrim 2c176f2f1e [X86][AVX] Add i386 test coverage to avx intrinsic tests 2022-04-20 15:12:11 +01:00
Nikita Popov d727505e40 [SimplifyCFG] Remove one-use limitation in FoldCondBranchOnPHI()
BlockIsSimpleEnoughToThreadThrough() already checks that the phi
(and all other instructions) are not used outside the block, so
this one-use check is not necessary for legality. I also don't
see any reason why it would be necessary for profitability (in
fact, those extra uses will be replaced with constants, which
should be generally profitable).
2022-04-20 15:56:20 +02:00
Matt Arsenault 53d88581f1 llvm-reduce: Clone properties of blocks
getSuccProbability was private for some reason, saying to go through
MachineBranchProbabilityInfo. There doesn't seem to be much point to
that, as that wrapper directly calls this.

Like other areas, some of these fields aren't handled by the MIR
printer/parser so aren't tested.
2022-04-20 09:47:45 -04:00
Jay Foad 879ac41089 [AMDGPU] Fix crash in SIOptimizeExecMaskingPreRA
When folding a COPY of exec into another COPY, the call to
TII->isOperandLegal would crash because COPYs don't have defined
register classes for their operands.

Differential Revision: https://reviews.llvm.org/D122737
2022-04-20 14:42:48 +01:00
Alex Bradbury bea5e88bcf [clang][Sema] Fix typo in checkBuiltinArgument helper
The checkBuiltinArgument helper takes an integer ArgIndex and is
documented as performing normal type-checking on that argument. However,
it mistakenly hardcodes the argument index to zero when retrieving the
argument from the call expression.

This hadn't been noticed previously as all in-tree uses typecheck the
0th argument anyway.
2022-04-20 14:42:41 +01:00
Haojian Wu 95f0f69441 [clangd] Handle the new Using TemplateName.
Add supports in FindTarget and IncludeCleaner. This would
improve AST-based features on a tempalte which is found via a using
declaration. For example, go-to-def on `vect^or<int> v;` gives us the
location of `using std::vector`, which was not previously.

Base on https://reviews.llvm.org/D123127

Differential Revision: https://reviews.llvm.org/D123212
2022-04-20 15:42:24 +02:00
Nikita Popov 37b1515b0a [SimplifyCFG] Add additional threading tests (NFC) 2022-04-20 15:40:44 +02:00
Alexey Bataev 5f7ac15912 Revert "[DAG]Introduce llvm::processShuffleMasks and use it for shuffles in DAG Type Legalizer."
This reverts commit 2f49163b33 to fix
a buildbot failure. Reported in https://lab.llvm.org/buildbot#builders/105/builds/24284
2022-04-20 06:35:55 -07:00
Corentin Jabot 69dd89fdcb [Clang] Fix references to captured variables in dependant context.
D119136 changed how captures are handled in a lambda call operator
declaration, but did not properly handled dependant context,
which led to crash when refering to init-captures in
a trailing return type.

We fix that bug by making transformations more symetric with parsing,
ie. we first create the call operator, then transform the capture,
then compute the type of the lambda call operaror.

This ensures captures exist and have the right type when
we parse a trailing requires-clause / return type.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D124012
2022-04-20 15:35:20 +02:00
Matt Arsenault 26d575eb08 LocalStackSlotAllocation: Combine debug printing statements 2022-04-20 09:31:14 -04:00
Matt Arsenault 4575f35ea1 LocalStackSlotAllocation: Stop creating unused virtual register 2022-04-20 09:31:14 -04:00
Matt Arsenault 67aa8ed547 llvm-reduce: Fix sources with executable permission 2022-04-20 09:31:13 -04:00
Nico Weber 59bd20526c [gn build] (manually) port f26c41e8dd (lib/clang/Support) 2022-04-20 09:28:04 -04:00
Nico Weber 7d2cc882d5 [compiler-rt][sanitizers] build ubsan, asan etc libraries with Mac Catalyst support
Like D118875, but for ubsan, asan, etc.

With this, I can successfully run:

    bin/clang++ -target x86_64-apple-ios14.0-macabi foo.cc \
        -isysroot $(xcrun -show-sdk-path) -fsanitize=undefined

with a locally built libclang_rt.ubsan_osx_dynamic.dylib.

Differential Revision: https://reviews.llvm.org/D124059
2022-04-20 09:22:25 -04:00
Simon Pilgrim 9d3bdabfae [X86] Add multiuse all_of test case for D123652 2022-04-20 14:19:41 +01:00
gysit 407b351da2 [mlir][linalg] Add ods-gen helper to simplify the build methods.
Add a helper used to implement the build methods generated by ods-gen. The change reduces code size and compilation time since all structured op builders use the same build method. The change reduces the LinalgOps.cpp compilation time from 10.2s to 9.8s (debug build).

Depends On D123987

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D124003
2022-04-20 13:14:38 +00:00
Kito Cheng f26c41e8dd [RISCV] Moving RVV intrinsic type related util to clang/Support
We add a new clang library called `clangSupport` for putting those utils which can be used in clang table-gen and other clang component.

We tried to put that into `llvm/Support`, but actually those stuffs only used in clang* and clang-tblgen, so I think that might be better to create `clang/Support`

* clang will used that in https://reviews.llvm.org/D111617.

Reviewed By: khchen, MaskRay, aaron.ballman

Differential Revision: https://reviews.llvm.org/D121984
2022-04-20 21:13:13 +08:00
gysit 17721b6915 [mlir][linalg] Avoid template methods for parsing and printing.
The revision avoids template methods for parsing and printing that are replicated for every named operation. Instead, the new methods take a regionBuilder argument. The revision reduces the compile time of LinalgOps.cpp from 11.2 to 10.2 seconds (debug build).

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D123987
2022-04-20 13:06:31 +00:00
Alexey Bataev 2f49163b33 [DAG]Introduce llvm::processShuffleMasks and use it for shuffles in DAG Type Legalizer.
We can process the long shuffles (working across several actual
vector registers) in the best way if we take the actual register
represantion into account. We can build more correct representation of
register shuffles, improve number of recognised buildvector sequences.
Also, same function can be used to improve the cost model for the
shuffles. in future patches.

Part of D100486

Differential Revision: https://reviews.llvm.org/D115653
2022-04-20 05:32:56 -07:00
Uday Bondhugula d7565de6cc [MLIR] NFC. Drop trailing white space in GPU async ops print
NFC. Drop trailing end of line white space in GPU async ops' printer
whenever the list of async deps is empty.

Reviewed By: mehdi_amini, rriddle

Differential Revision: https://reviews.llvm.org/D123754
2022-04-20 17:56:53 +05:30
Joseph Huber ee74abaad7 [OpenMP] Add triple to the linker wrapper job
Summary:
I forgot to add the triple to the linker wrapper job, so we were still
generating code for the unintended platforms.
2022-04-20 08:23:43 -04:00
Uday Bondhugula d423fc3724 Add RegionBranchOpInterface on affine.for op
Add RegionBranchOpInterface on affine.for op so that transforms relying
on RegionBranchOpInterface can support affine.for. E.g.:
buffer-deallocation pass.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D123568
2022-04-20 17:46:07 +05:30