Commit Graph

433504 Commits

Author SHA1 Message Date
Daniel Grumberg 57c9780d60 [clang][ExtractAPI] Record availability information on all platforms
Currently ExtractAPI only emits availability information for the
current platform. This makes it easy for clients to get all availability
information for a given symbol in one invocation as opposed to having to invoke
clang once per-platform and then merge the symbol-graphs.

Differential Revision: https://reviews.llvm.org/D130918
2022-08-19 14:54:52 -07:00
Nico Weber 89aaae57ea Revert "[NFC] Precommit test for D132255."
This reverts commit 01e3a37695.
Breaks tests on mac and win, see comments on https://reviews.llvm.org/D132255
2022-08-19 17:53:36 -04:00
Guillaume Chatelet f00567eceb [libc][NFC] Move blockstore out of the CPP folder 2022-08-19 21:51:53 +00:00
Philip Reames cf3654ccc6 [RISCV] Add test coverage for 64 bit splat constants 2022-08-19 14:43:35 -07:00
Guillaume Chatelet e2d7975843 [libc][NFC] Use STL case for bitset and simplify implementation 2022-08-19 21:39:14 +00:00
eahcmrh 9e1a4ce0b5 [clang-tidy] Fix for bugprone-sizeof-expression PR57167
This addresses a change in behavior of the bugprone-sizeof-expression
checker after upstream commit 15f3cd6bfc, which cleaned up
ElaboratedType sugaring in the AST.  This restores (mostly) the
beahvior of the checker prior to that commit, which may or may not have
been consistent with the intent of the checker, but at least gave a
tolerable level of what users would consider false positives.

Bug: https://github.com/llvm/llvm-project/issues/57167

Reviewed By: mizvekov, aaron.ballman

Differential Revision: https://reviews.llvm.org/D131926

Change-Id: Ibe5aad77ad00977134aa7fa67efbbd6bd725fd79
2022-08-19 23:29:32 +02:00
Guillaume Chatelet d769cd8cdc [reland][libc][NFC] Use STL case for bit 2022-08-19 21:26:26 +00:00
Eli Friedman 8f826fe723 Fix reverse-iteration buildbot.
A couple of instances of iterating over maps snuck in while the bot was
down; fix them to use maps with deterministic iteration.
2022-08-19 14:21:05 -07:00
Guillaume Chatelet 175560fc21 Revert "[libc][NFC] Use STL case for bit"
This reverts commit 7ba14b8611.
2022-08-19 21:17:48 +00:00
Guillaume Chatelet 7ba14b8611 [libc][NFC] Use STL case for bit 2022-08-19 21:10:27 +00:00
Craig Topper 6227b7ae31 [RISCV] Move xori creation for scalar setccs to lowering.
This patch enables expansion or custom lowering for some integer
condition codes so that any xori that is needed is created before
the last DAG combine to enable optimization.

I've seen cases where we end up with
(or (xori (setcc), 1), (xori (setcc), 1)) which we would ideally
convert to (xori (and (setcc), (setcc)), 1). This patch doesn't
accomplish that yet, but it should allow us to add DAG
combines as follow ups. Example https://godbolt.org/z/Y4qnvsq1b

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D131729
2022-08-19 13:51:53 -07:00
Peter Klausler d0e03bf06b [flang] Add a placeholder argument for a format descriptor on IO calls
Author: vdonaldson

Differential Revision: https://reviews.llvm.org/D132259
2022-08-19 13:39:17 -07:00
Arthur Eubanks 309d453866 [llvm-reduce] Move most debugging output behind --verbose
This should cut down on the visual noise when reducing. Still keep output when we run a pass or when we successfully reduce.

Notably, this also suppresses redirecting the test output to stdout/stderr.

Reviewed By: regehr

Differential Revision: https://reviews.llvm.org/D131922
2022-08-19 13:25:42 -07:00
Mingming Liu 945a306501 [AArch64] Change aarch64_neon_pmull{,64} intrinsic ISel through a new
SDNode.

How:
1) Add AArch64ISD::PMULL SDNode, and extend aarch64_neon_pmull intrinsic
   tablegen pattern for this SDNode.
2) For aarch64_neon_pmull64, canonicalize i64 operands to v1i64 vectors
   during legalization.
3) For {aarch64_neon_pmull, aarch64_neon_pmull64}, combine intrinsic to
   SDNode.

Why
1) Adding the SDNode makes it easier to canonicalize i64 inputs (required by
   aarch64_neon_pmull64) to vector inputs. Vector inputs carries lane
   information, which helps dag-combiner to combine nodes (e.g. rewrite to a
   better node to prepare for instruction selection) and instruction-selection
   to emit instructions that use higher-half inputs in place
   (i.e., no need to move lane 1 content to lane 0).
2) Using the SDNode for aarch64_neon_pmull64 is NFC, yet without this we
   have to move the definition of {PMULLv1i64, PMULLv2i64} out of its
   current group of records without gains.

Test cases are commented with what is being tested in
`aarch64-pmull2.ll` and `pmull-ldr-merge.ll` under directory
`llvm/test/CodeGen/AArch64`.

Differential Revision: https://reviews.llvm.org/D131047
2022-08-19 13:17:13 -07:00
Mingming Liu 3e6d1a6f54 [NFC][AArch64] Precommit test to optimize instruction selection for aarch64_neon_pmull64 intrinsic.
Differential Revision: https://reviews.llvm.org/D131045
2022-08-19 13:17:13 -07:00
Siva Chandra Reddy 4d97766316 [libc] Install startup files with the install-libc target.
Differential Revision: https://reviews.llvm.org/D132212
2022-08-19 20:15:16 +00:00
Martin Storsjö 8a002ab99e [libcxx] [test] Fix the transitive_includes test on Windows
Look for both kinds of slashes in include paths output from the
compiler.

Use "diff -w" to do a whitespace insensitive comparison, to ignore
differences in line endings (the python script writes to stdout
in text mode, with crlf newlines).

Differential Revision: https://reviews.llvm.org/D129428
2022-08-19 23:12:54 +03:00
Philip Reames 1c1ecee8da [RISCV] Add cost model coverage of store of constant [nfc] 2022-08-19 13:11:53 -07:00
Wei Yi Tee b0befe3ac1 [clang][dataflow] Mark `getDeclCtx` function in dataflow `Environment` `const`.
Differential Revision: https://reviews.llvm.org/D132229
2022-08-19 20:07:21 +00:00
Rainer Orth 8847d9a242 Reland "[mlir][test] Fix IR/AttributeTest.cpp compilation on Solaris"
The `IR/AttributeTest.cpp` test fails to compile on Solaris:
```
/vol/llvm/src/llvm-project/local/mlir/unittests/IR/AttributeTest.cpp:223:36: error: no matching function for call to 'allocate'
      AttrT::get(type, "resource", UnmanagedAsmResourceBlob::allocate(data));
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/vol/llvm/src/llvm-project/local/mlir/unittests/IR/AttributeTest.cpp:237:3: note: in instantiation of function template specialization 'checkNativeAccess<mlir::detail::DenseResourceElementsAttrBase<int8_t>, char>' requested here
  checkNativeAccess<AttrT, T>(builder.getContext(), llvm::makeArrayRef(data),
  ^
/vol/llvm/src/llvm-project/local/mlir/unittests/IR/AttributeTest.cpp:258:3: note: in instantiation of function template specialization 'checkNativeIntAccess<mlir::detail::DenseResourceElementsAttrBase<int8_t>, char>' requested here
  checkNativeIntAccess<DenseI8ResourceElementsAttr, int8_t>(builder, 8);
  ^
/vol/llvm/src/llvm-project/local/mlir/include/mlir/IR/AsmState.h:221:3: note: candidate template ignored: requirement '!std::is_same<char, char>::value' was not satisfied [with T = char]
  allocate(ArrayRef<T> data, bool dataIsMutable = false) {
  ^
/vol/llvm/src/llvm-project/local/mlir/include/mlir/IR/AsmState.h:214:26: note: candidate function not viable: requires at least 2 arguments, but 1 was provided
  static AsmResourceBlob allocate(ArrayRef<char> data, size_t align,
                         ^
```
Because `char` is `signed` by default on Solaris and `int8_t` is
`char`. `std::is_same<int8_t, char>` is `true` unlike elsewhere, rejecting
the one-arg `allocate` overload.

Fixed by renaming the two overloads to avoid the ambiguity.

Tested on `amd64-pc-solaris2.11` ,`sparcv9-sun-solaris2.11`, and
`x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D131148
2022-08-19 21:59:57 +02:00
Philip Reames 59960e8db9 [RISCV] Factor out getVectorImmCost cost after 0e7ed3 [nfc] 2022-08-19 12:53:54 -07:00
Aaron Ballman cda093681b Update coding standards for constexpr if statements; NFC
We currently suggest that users not use an else clause after a return
statement in a prior if branch. e.g.,

if (foo)
  return 1;
else // Should remove this else clause
  return 10;

however, this suggestion is incorrect for a constexpr if statement
because one of the two branches will be a discarded statement and thus
can impact template instantiation behavior. This updates the coding
standard to make it clear that it's okay to have a return after an else
in a constexpr if statement.

I think this is an NFC change to the intent of the rule, which is why
I've not started an RFC for the changes.

Differential Revision: https://reviews.llvm.org/D132232
2022-08-19 15:53:19 -04:00
Nick Desaulniers e412bac912 [MachineVerifier] add checks for INLINEASM_BR
Test for a case we observed after the initial implementation of D129997
landed, in which case we observed a crash while building the ppc64le
Linux kernel. In that case, we had one block with two exits, both to the
same successor. Removing one of the exits corrupted the
successor/predecessor lists.

So when we have an INLINEASM_BR, check a few things for each indirect
target:
1. that it exists.
2. that it is listed in our successors.
3. that its predecessor list contains the parent MBB of INLINEASM_BR.

This would have caught the regression discovered after D129997 landed,
after the pass that was problematic (early-tailduplication) rather than
getting a stack trace in a later pass (regalloc) that doesn't understand
the anomaly and crashes.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D130290
2022-08-19 12:52:26 -07:00
Erich Keane 95d94a6775 Revert "Re-apply "Deferred Concept Instantiation Implementation"""
This reverts commit d483730d8c.

This allegedly breaks a significant part of facebooks internal build.
Reverting while we wait for them to provide a reproducer of this from
@wlei.
2022-08-19 12:47:34 -07:00
Alex Bradbury bc53832080 [clang][RISCV] Fix incorrect ABI lowering for inherited structs under hard-float ABIs
The hard float ABIs have a rule that if a flattened struct contains
either a single fp value, or an int+fp, or fp+fp then it may be passed
in a pair of registers (if sufficient GPRs+FPRs are available).
detectFPCCEligibleStruct and the helper it calls,
detectFPCCEligibleStructHelper examine the type of the argument/return
value to determine if it complies with the requirements for this ABI
rule.

As reported in bug #57084, this logic produces incorrect results for C++
structs that inherit from other structs. This is because only the fields
of the struct were examined, but enumerating RD->fields misses any
fields in inherited C++ structs. This patch corrects that issue by
adding appropriate logic to enumerate any included base structs.

Differential Revision: https://reviews.llvm.org/D131677
2022-08-19 20:31:06 +01:00
Bill Wendling ac6a0cdc2e [X86][AArch64][NFC] Simplify querying used argument registers
Registers used for arguments are listed as "live-ins" into the starting
basic block. This means we don't have to go through a potentially
expensive search through all possible argument registers when we only
care about used argument registers.

Differential Revision: https://reviews.llvm.org/D132181
2022-08-19 11:39:05 -07:00
jeff 20cf170e68 [InferAddressSpaces] [AMDGPU] Add inference for flat_atomic intrinsics
Certain address space dependent optimizations, like SeperateConstOffsetFromGEP, assume agreement between the address space of the recursive uses and the address space of the def. If this assumption is invalid, then optimizations may or may not be correct depending on properties of an address space for a given target, the address spaces of recursive uses, and the optimization being done.

This patch infers the previous address space for flat_atomic ptr arguments. As a result, the address spaces of the uses in flat_atomic cases will agree with the address space in recursive defs. If this results in non-flat address space, then isel may infer a different intrinsic. For example, if the result is a flat_atomic using global address space, then it will be lowered to the corresponding global_atomic intrinsic.

Change-Id: Ifcd981709dc2ea94d4acbcb84efe7176593ec8c7
2022-08-19 11:37:20 -07:00
Denis Antrushin 01e3a37695 [NFC] Precommit test for D132255. 2022-08-20 01:36:05 +07:00
Michael Buch 1dc8fcff0e Revert "[lldb] [gdb-remote] Include PID in vCont packets if multiprocess" - Part 2
This reverts commit ccb9d4d4ad.

Reverts the associated tests
2022-08-19 19:31:14 +01:00
Simon Pilgrim a7441289e2 [X86] Fix znver1 256-bit ALU/Logic/Blend uop counts
ymm instructions are double pumped on znver1 - noticed while trying to review size-latency costkinds numbers for D132216

Matches AMD 17h SOG / Agner / uops.info
2022-08-19 19:09:39 +01:00
Mats Petersson 72e599197c [Flang]Fix another way to crash SimplifyIntrinsics
Under some conditions, the defining op may be NULL, so
accept that rahter than try to use it and crash!

Adds test to prevent regression

Fixes github issue #57201

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D132238
2022-08-19 19:00:30 +01:00
Chris Bieneman 4579a0224c [NFC] Fix warning in asserts build
When asserts are enabled a warning for implicit conversion from 64-bit to
32-bit integer occurs here.
2022-08-19 17:48:22 -05:00
Philip Reames e7fda46300 [RISCV] Correct costs for vector ceil/floor/trunc/round
Add vector costs for ceil/floor/trunc/round. As can be seen in the tests, the prior default costs were a significant under estimate of the actual code generated.

These costs are computed by simply generating code with the current backend, and then counting the number of instructions. I discount one vsetvli, and ignore the return.

Differential Revision: https://reviews.llvm.org/D131967
2022-08-19 10:37:39 -07:00
Michael Buch 5517401f93 Revert "[lldb] [gdb-remote] Include PID in vCont packets if multiprocess"
This reverts commit ccb9d4d4ad.

https://reviews.llvm.org/D131758

Differential Revision: https://reviews.llvm.org/D132250
2022-08-19 18:05:41 +01:00
Saleem Abdulrasool 73a9dfcee2 MC: make section classification a bit more thorough
This does *NOT* change the emitted section flags in any way.  This only
impacts the internal classification of sections.

Extend the section classification in LLVM for ELF targets.  This has one
important change: we now classify sections as text by default rather
than readonly.  This matches the behaviour for GAS better.

Ensure that any section that has a writable attribute set is not treated
as readonly.  We also special case any section named `.debug_` which is
reserved for DWARF as metadata.  In the case none of the attributes are
set (or because no attributes were provided), consult the section name
for classification.  We match the well known names and classify the
section accordingly.  Any remaining section is now classified as text.

This change allows us to classify sections in the MC layer more
precisely which is needed for subsequent changes for handling target
specific behaviour.

Differential Revision: https://reviews.llvm.org/D131270
Reviewed By: @echristo
2022-08-19 16:45:41 +00:00
Simon Pilgrim e41dd02052 Fix MSVC "not all control paths return a value" warning 2022-08-19 17:37:37 +01:00
Sanjay Patel 7f1262a322 [EarlyCSE][ConstantFolding] do not constant fold atan2(+/-0.0, +/-0.0)
These may raise an error (set errno) as discussed in the post-commit
comments for D127964, so we can't fold away the call and potentially
alter that behavior.
2022-08-19 12:27:29 -04:00
Adrian Prantl fe0f72d5c5 Revert "[lldb] [test] Add synchronization to TestContinue"
This reverts commit 7aadecae40.

I'm reverting this commit because it appears to break the green dragon
incremental LLDB bot.

https://reviews.llvm.org/D131758

See LLDB Incremental buildbot: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/46215/execution/node/70/log/
2022-08-19 09:23:18 -07:00
Adrian Prantl 00c4852561 Revert "[lldb] [test] Disable new CommunicationTests on Windows"
This reverts commit d38985a36b.
because I'm also reverting D131758.
2022-08-19 09:23:17 -07:00
Sanjay Patel 4bff1037bb [EarlyCSE][ConstantFolding] add tests for atan2 with zero args; NFC 2022-08-19 12:18:53 -04:00
Adrian Prantl 2d48b403f6 Fix UB in DIExpression::appendOffset()
The absolute value of 0x8000000000000000 does not fit into an int64_t
and UBSan tells us that by crashing.

rdar://98799670

Differential Revision: https://reviews.llvm.org/D132194
2022-08-19 09:16:59 -07:00
Craig Topper 1a60e003df [RISCV] Use Triple::isRISCV/isRISCV32/isRISCV64 helps in some places. NFC
Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D132197
2022-08-19 09:11:22 -07:00
isuckatcs a47ec1b797 [analyzer][NFC] Be more descriptive when we replay without inlining
This patch adds a ProgramPointTag to the EpsilonPoint created
before we replay a call without inlining.

Differential Revision: https://reviews.llvm.org/D132246
2022-08-19 18:05:52 +02:00
Denis Fatkulin ee648c0ce0 [clang][index] Index unresolved member expression as reference
Unresolved member expressions aren't indexed as references.

Example code:

```
struct Foo {
  template <typename T> void bar(T t);
};
template <typename T> void test(Foo F, T t) {
  F.bar(t); // Not indexed
}
```

Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D131091
2022-08-19 19:02:42 +03:00
Craig Topper 961838cc13 [RISCV] Add passthru operand to RISCVISD::SETCC_VL.
Use it to the fix a bug in the fceil/ffloor lowerings. We were
setting the passthru to IMPLICIT_DEF before and using a mask
agnostic policy. This means where the incoming bits in
the mask were 0 they could be anything in the outgoing mask. We
want those bits in the outgoing mask to be 0. This means we need to
pass the input mask as the passthru.

This generates worse code because we are unable to allocate the
v0 register to the output due to an earlyclobber constraint. We
probably need a special TIED pseudoinstruction and probably custom
isel since you can't use V0 twice in the input pattern.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D132058
2022-08-19 08:53:44 -07:00
Craig Topper c9a41fe60a [RISCV] Prefer vnsrl.wi v8, v8, 0 over vnsrl.wx v8, v8, x0.
I have a couple data points that some microarchitectures prefer
the immediate 0 over x0. Does anyone know of microarchitectures
where the opposite is true?

Unfortunately, this is different than the vncvt.x.x.w alias
from the spec. Perhaps the alias was poorly chosen if x0 isn't
as optimal as immediate 0 on all microarchitectures.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D132041
2022-08-19 08:40:17 -07:00
Alexey Bataev c167028684 [SLP]Delay vectorization of postponable values for instructions with no users.
SLP vectorizer tries to find the reductions starting the operands of the
instructions with no-users/void returns/etc. But such operands can be
postponable instructions, like Cmp, InsertElement or InsertValue. Such
operands still must be postponed, vectorizer should not try to vectorize
them immediately.

Differential Revision: https://reviews.llvm.org/D131965
2022-08-19 08:39:16 -07:00
Guillaume Chatelet 7799b5c0e6 [reland][NFC][libc] rearrange aarch64 memset code to better match new implementation
Differential Revision: https://reviews.llvm.org/D132121
2022-08-19 15:31:45 +00:00
Christopher Bate 20ae22ba33 [mlir][Affine] Add affine.delinearize_index operation
This change adds a new AffineDelinearizeIndexOp to the affine dialect.
 The operation accepts an index type as well as a basis (array of index
 values) representing how the index should be decomposed into a
 multi-index. The decomposition obeys a canonical semantic that treats
 the final basis element as "fastest varying" and the first basis element
 as "slowest varying". A naive lowering of the operation using a sequence
 of AffineApplyOps is given.

RFC was discussed on discourse here: https://discourse.llvm.org/t/rfc-tensor-extracting-slices-from-tensor-collapse-shape/64034

Reviewed By: bondhugula, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D131997
2022-08-19 09:24:14 -06:00
Alexey Bataev 0e7ed32c71 [SLP]Cost for a constant buildvector.
In many cases constant buildvector results in a vector load from a
constant/data pool. Need to consider this cost too.

Differential Revision: https://reviews.llvm.org/D126885
2022-08-19 08:02:42 -07:00