Commit Graph

373739 Commits

Author SHA1 Message Date
Tue Ly 3b487d51e2 [libc] Add implementation of hypot.
Refactor src/math/hypotf.cpp and test/src/math/hypotf_test.cpp and reuse them for hypot and hypot_test

Differential Revision: https://reviews.llvm.org/D91831
2020-12-03 11:08:20 -05:00
Nico Weber c00516d520 Try to fix tests on Windows after 0cbf61be8b 2020-12-03 10:55:05 -05:00
Ahmed Bougacha f77c948d56 [Triple][MachO] Define "arm64e", an AArch64 subarch for Pointer Auth.
This also teaches MachO writers/readers about the MachO cpu subtype,
beyond the minimal subtype reader support present at the moment.

This also defines a preprocessor macro to allow users to distinguish
__arm64__ from __arm64e__.

arm64e defaults to an "apple-a12" CPU, which supports v8.3a, allowing
pointer-authentication codegen.
It also currently defaults to ios14 and macos11.

Differential Revision: https://reviews.llvm.org/D87095
2020-12-03 07:53:59 -08:00
Baptiste Saleil 45ec3a37b0 [PowerPC] Fix for excessive ACC copies due to PHI nodes
When using accumulators in loops, they are passed around in PHI nodes of unprimed
accumulators, causing the generation of additional prime/unprime instructions.
This patch detects these cases and changes these PHI nodes to primed accumulator
PHI nodes. We also add IR and MIR test cases for several PHI node cases.

Differential Revision: https://reviews.llvm.org/D91391
2020-12-03 09:51:23 -06:00
Nathan James aa1155634f
[ASTMatchers][NFC] Made variadic operator funcs static
Fix naming style while were here too.
2020-12-03 15:47:54 +00:00
Yonghong Song 286daafd65 [BPF] support atomic instructions
Implement fetch_<op>/fetch_and_<op>/exchange/compare-and-exchange
instructions for BPF.  Specially, the following gcc intrinsics
are implemented.
  __sync_fetch_and_add (32, 64)
  __sync_fetch_and_sub (32, 64)
  __sync_fetch_and_and (32, 64)
  __sync_fetch_and_or  (32, 64)
  __sync_fetch_and_xor (32, 64)
  __sync_lock_test_and_set (32, 64)
  __sync_val_compare_and_swap (32, 64)

For __sync_fetch_and_sub, internally, it is implemented as
a negation followed by __sync_fetch_and_add.
For __sync_lock_test_and_set, despite its name, it actually
does an atomic exchange and return the old content.
  https://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html

For intrinsics like __sync_{add,sub}_and_fetch and
__sync_bool_compare_and_swap, the compiler is able to generate
codes using __sync_fetch_and_{add,sub} and __sync_val_compare_and_swap.

Similar to xadd, atomic xadd, xor and xxor (atomic_<op>)
instructions are added for atomic operations which do not
have return values. LLVM will check the return value for
__sync_fetch_and_{add,and,or,xor}.
If the return value is used, instructions atomic_fetch_<op>
will be used. Otherwise, atomic_<op> instructions will be used.

All new instructions only support 64bit and 32bit with alu32 mode.
old xadd instruction still supports 32bit without alu32 mode.

For encoding, please take a look at test atomics_2.ll.

Differential Revision: https://reviews.llvm.org/D72184
2020-12-03 07:38:00 -08:00
Adam Czachorowski 517828a31b [clangd] Bundle code completion items when the include paths differ, but resolve to the same file.
This can happen when, for example, merging results from an external
index that generates IncludeHeaders with full URI rather than just
literal include.

Differential Revision: https://reviews.llvm.org/D92494
2020-12-03 16:33:15 +01:00
dfukalov 2ce38b3f03 [NFC] Reduce include files dependency.
1. Removed #include "...AliasAnalysis.h" in other headers and modules.
2. Cleaned up includes in AliasAnalysis.h.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D92489
2020-12-03 18:25:05 +03:00
Paul C. Anagnostopoulos 415fab6f67 [TableGen] Eliminate the 'code' type
Update the documentation.

Rework various backends that relied on the code type.

Differential Revision: https://reviews.llvm.org/D92269
2020-12-03 10:19:11 -05:00
Kazushi (Jam) Marukawa 1365718778 [VE] Add vsll, vsrl, vsla, vsra, and vsfa intrinsic instructions
Add vsll, vsrl, vsla, vsra, and vsfa intrinsic instructions and
regression tests.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D92550
2020-12-03 23:19:58 +09:00
Nico Weber 0cbf61be8b [mac/arm] Fix rtti codegen tests when running on an arm mac
shouldRTTIBeUnique() returns false for iOS64CXXABI, which causes
RTTI objects to be emitted hidden. Update two tests that didn't
expect this to happen for the default triple.

Also rename iOS64CXXABI to AppleARM64CXXABI, since it's used for
arm64-apple-macos triples too.

Part of PR46644.

Differential Revision: https://reviews.llvm.org/D91904
2020-12-03 09:11:03 -05:00
Haruki Imai b2391d5f0d [MLIR] Normalize the results of normalizable operations
Memrefs with affine_map in the results of normalizable operation were
not normalized by `--normalize-memrefs` option. This patch normalizes
them.

Differential Revision: https://reviews.llvm.org/D88719
2020-12-03 19:34:07 +05:30
Nico Weber 68f2ff59d1 clang/darwin: Don't use response files with ld64
This morally reverts D82777 -- turns out that ld64 crashes with many
response files, so we must stop passing them to it until the crash is
fixed.

Differential Revision: https://reviews.llvm.org/D92357
2020-12-03 09:00:10 -05:00
Ilya Golovenko 2d539d7854 [clangd] Relation slabs should not be accounted when computing backing storage size
Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D92484
2020-12-03 16:56:53 +03:00
Jay Foad 0f32e81407 [TableGen] Remove unused class RecordValResolver. NFC.
Differential Revision: https://reviews.llvm.org/D92477
2020-12-03 13:36:58 +00:00
Nico Weber 3422f3cc6e Reland "[mac/lld] Implement -why_load".
The problem was that `sym` became replaced in the call
to make<ObjFile> and referring to it afer that read memory that now
stored a different kind of symbol (a Defined instead of a LazySymbol).
Since this happens only once per archive, just copy the symbol to the
stack before make<ObjFile> and read the copy instead.

Originally reviewed at https://reviews.llvm.org/D92496
2020-12-03 08:35:12 -05:00
Martin Storsjö d3fef7a7c2 [compiler-rt] Fix building the aarch64 out-of-line atomics assembly for non-ELF platforms
Move the two different definitions of FUNC_ALIGN out of the ELF
specific block. Add the missing CFI_END in
END_COMPILERRT_OUTLINE_FUNCTION, to go with the corresponding CFI_START
in DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED.

Differential Revision: https://reviews.llvm.org/D92549
2020-12-03 15:31:06 +02:00
Kazushi (Jam) Marukawa 7d30df7b59 [VE] Add standard include path and library path for C++
We have a plan to add libcxx and libcxxabi for VE.  In order to do so,
we need to compile cxx source code with bootstarapped header files.
This patch adds such expected path to make clang++ work, at least
not crash at the startup.  Add regression test for that, also.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D92386
2020-12-03 22:22:56 +09:00
Joe Ellis 78c0ea54a2 [DAGCombine] Fix TypeSize warning in DAGCombine::visitLIFETIME_END
Bail out early if we encounter a scalable store.

Reviewed By: peterwaller-arm

Differential Revision: https://reviews.llvm.org/D92392
2020-12-03 12:12:41 +00:00
Evgeniy Brevnov 5c6dc7b882 [NFC][Tests] Added one additional test case for NaryRessociation pass.
New tes cases added. Change var names to avoid the following warning from  update_test_checks.py:

WARNING: Change IR value name 'tmp5' to prevent possible conflict with scripted FileCheck name.

Reviewed By: ebrevnov

Differential Revision: https://reviews.llvm.org/D92566
2020-12-03 19:11:08 +07:00
Haojian Wu a59e504a61 [clangd] Fix a nullptr-access crash in canonicalRenameDecl. 2020-12-03 12:59:00 +01:00
Evgeniy Brevnov 485cd4c52e [NFC][Tests] Auto generate checks for llvm/test/Transforms/NaryReassociate/pr24301.ll using update_test_checks.py
Generate checks with update_test_checks.py in order to simplify upcoming updates.

Reviewed By: mkazantsev

Differential Revision: https://reviews.llvm.org/D92561
2020-12-03 18:22:14 +07:00
Georgii Rymar 50de7d5504 [llvm-readelf/obj] - Report unique warnings in getSymbolForReloc() helper.
Use `reportUniqueWarning` instead of `reportWarning` and refine the
interface of the helper.

Differential revision: https://reviews.llvm.org/D92556
2020-12-03 14:13:26 +03:00
Tim Northover 152df3add1 arm64: count Triple::aarch64_32 as an aarch64 target and enable leaf frame pointers 2020-12-03 11:09:44 +00:00
Jon Chesterfield ae9d96a656 [libomptarget][amdgpu] Address compiler warnings, drive by fixes
[libomptarget][amdgpu] Address compiler warnings, drive by fixes

Initialize some variables, remove unused ones.
Changes the debug printing condition to align with the aomp test suite.

Differential Revision: https://reviews.llvm.org/D92559
2020-12-03 11:09:12 +00:00
Georgii Rymar 351f736368 [llvm-readelf] - Report unique warnings when dumping hash symbols/histogram.
This converts 2 more places to use `reportUniqueWarning` and adds tests.

Differential revision: https://reviews.llvm.org/D92551
2020-12-03 14:05:04 +03:00
Max Kazantsev 4bd35cdc3a Revert "[IndVars] ICmpInst should not prevent IV widening"
This reverts commit 0c9c6ddf17.

We are seeing some failures with this patch locally. Not clear
if it's causing them or just triggering a problem in another
place. Reverting while investigating.
2020-12-03 18:01:41 +07:00
Julian Gross 8aeca73702 [MLIR] Added support for dynamic shaped allocas to promote-buffers-to-stack pass.
Extended promote buffers to stack pass to support dynamically shaped allocas.
The conversion is limited by the rank of the underlying tensor.
An option is added to the pass to adjust the given rank.

Differential Revision: https://reviews.llvm.org/D91969
2020-12-03 11:47:49 +01:00
Gabor Marton 1e14588d0f [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs
http://lists.llvm.org/pipermail/cfe-dev/2020-November/067252.html

Differential Revision: https://reviews.llvm.org/D92101
2020-12-03 11:35:47 +01:00
Sven van Haastregt 7ec6188921 [OpenCL] Add some more kernel argument tests
Differential Revision: https://reviews.llvm.org/D92406
2020-12-03 10:21:29 +00:00
Marek Kurdej fe21c86ee7 [clang-format] De-duplicate includes with leading or trailing whitespace.
This fixes PR46555 (https://bugs.llvm.org/show_bug.cgi?id=46555).

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D88296
2020-12-03 10:59:46 +01:00
Marek Kurdej 6627a3c287 [c++2b] Add option -std=c++2b to enable support for potential C++2b features.
Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D92547
2020-12-03 10:27:47 +01:00
Christian Sigg 48f7ca1879 Fix forward for rGd9adde5ae216: adding missing dependency.
Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D92552
2020-12-03 10:16:57 +01:00
Kazushi (Jam) Marukawa b91238173d [VE] Add veqv and vseq intrinsic instructions
Add veqv and vseq intrinsic instructions and regression tests.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D92527
2020-12-03 17:39:24 +09:00
Marek Kurdej 590bbfe0d8 [libc++] [docs] Add C++2b (to be C++23) status page.
Also:
* Fix header line in all status tables.
* Use C++20 instead of C++2a.

Reviewed By: ldionne, #libc, miscco

Differential Revision: https://reviews.llvm.org/D92306
2020-12-03 09:22:06 +01:00
Christian Sigg d9adde5ae2 [mlir][gpu] Move gpu.wait ops from async.execute regions to its dependencies.
This can prevent unnecessary host synchronization.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D90346
2020-12-03 08:52:28 +01:00
Yuanfang Chen a36f8fb021
[NFC] Add proper triple for arc.ll test 2020-12-02 23:31:06 -08:00
Yonghong Song 61a06c071d BPF: add a test for selectiondag alias analysis w.r.t. lifetime
This adds a test for the bug
  https://bugs.llvm.org/show_bug.cgi?id=47591

Previously, selection dag has a bug which may incorrectly
assume no alias when crossing a lifetime boundary and this
may generate incorrect code as demonstrated in the above bug.

It looks the bug is fixed by https://reviews.llvm.org/D91833.
Basically, when comparing two potential memory access dag nodes,
  a store and a lifetime.start,
with the same frame index.
Previously, it may be decided no alias. With the above fix,
these two will be considered aliasing which will prevent
incorrect code scheduling.

Differential Revision: https://reviews.llvm.org/D92451
2020-12-02 22:27:17 -08:00
modimo c1ba991e8d [NFC] Fix typo 2020-12-02 22:23:57 -08:00
Fangrui Song 1d6ebdfb66 Switch from llvm::is_trivially_copyable to std::is_trivially_copyable
GCC<5 did not support std::is_trivially_copyable. Now LLVM builds require 5.1
we can migrate to std::is_trivially_copyable.

The Optional.h change made MSVC choke
(https://buildkite.com/llvm-project/premerge-checks/builds/18587#cd1bb616-ffdc-4581-9795-b42c284196de)
so I leave it out for now.

Differential Revision: https://reviews.llvm.org/D92514
2020-12-02 22:02:48 -08:00
Jianzhou Zhao bd726d2796 [dfsan] Rename ShadowTy/ZeroShadow with prefix Primitive
This is a child diff of D92261.

After supporting field/index-level shadow, the existing shadow with type
i16 works for only primitive types.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D92459
2020-12-03 05:31:01 +00:00
Pushpinder Singh afc09c6fe4 [libomptarget][AMDGPU] Remove MaxParallelLevel
Removes MaxParallelLevel references from rtl.cpp and drops
resulting dead code.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D92463
2020-12-03 00:27:03 -05:00
Craig Topper 1ccd36161d [RISCV] Add additional half precision fnmadd/fnmsub tests with an fneg on the second operand instead of the first.
This matches the float/double tests added in defe11866a
2020-12-02 21:13:42 -08:00
Craig Topper e52a91e156 [RISCV] Add f16 to isFMAFasterThanFMulAndFAdd now that the Zfh extension is supported 2020-12-02 20:31:43 -08:00
QingShan Zhang 9bf0fea372 [PowerPC] Add the hw sqrt test for vector type v4f32/v2f64
PowerPC ISA support the input test for vector type v4f32 and v2f64.
Replace the software compare with hw test will improve the perf.

Reviewed By: ChenZheng

Differential Revision: https://reviews.llvm.org/D90914
2020-12-03 03:19:18 +00:00
Kazu Hirata 7a4af2a8e7 [SelectionDAG] Use is_contained (NFC) 2020-12-02 19:09:45 -08:00
Qiu Chaofan 222da77a82 [NFC] [Clang] Move ppc64le f128 vaargs OpenMP test
This case for long-double semantics mismatch on OpenMP references
%clang, which should be located in Driver directory.
2020-12-03 10:50:42 +08:00
Vitaly Buka 20a2b1bf6b [NFC][sanitizer] Another attempt to fix test on arm 2020-12-02 18:36:02 -08:00
Craig Topper 8b403243a8 [RISCV] Initialize MergeBaseOffsetOptPass so it will work with print-before/after-all.
If its not in the PassRegistry it's not recognized as
a pass when we print before/after. Happened to notice while
I was working on a new pass.
2020-12-02 18:04:22 -08:00
Richard Smith c4fb7720ce PR48339: Improve diagnostics for invalid dependent unqualified function calls.
Fix bogus diagnostics that would get confused and think a "no viable
fuctions" case was an "undeclared identifiers" case, resulting in an
incorrect diagnostic preceding the correct one. Use overload resolution
to determine which function we should select when we can find call
candidates from a dependent base class. Make the diagnostics for a call
that could call a function from a dependent base class more specific,
and use a different diagnostic message for the case where the call
target is instead declared later in the same class. Plus some minor
diagnostic wording improvements.
2020-12-02 17:54:55 -08:00