Commit Graph

397106 Commits

Author SHA1 Message Date
Arthur Eubanks fde0eb1f9a [NFC] A couple more removeAttribute() cleanups 2021-08-18 11:15:20 -07:00
Arthur Eubanks 2fc075948c [NFC] Remove some unnecessary AttributeList methods
These rely on methods I'm trying to cleanup.
2021-08-18 11:15:20 -07:00
Christopher Tetreault 2afb9394a7 [hwasan] Flag stack safety check as requiring aarch64
Reviewed By: fmayer

Differential Revision: https://reviews.llvm.org/D108241
2021-08-18 11:14:01 -07:00
Craig Topper 3f9b37ccb1 [RISCV] Remove sext_inreg+add/sub/mul/shl isel patterns.
Let the sext_inreg be selected to sext.w. Remove unneeded sext.w
during PostProcessISelDAG.

This gives opportunities for some other isel patterns to match
like the ADDIPair or matching mul with immediate to shXadd.

This becomes possible after D107658 started selecting W instructions
based on users. The sext.w will be considered a W user so isel
will often select a W instruction for the sext.w input and we can
just remove the sext.w. Otherwise we can combine the sext.w with
a ADD/SUB/MUL/SLLI to create a new W instruction in parallel
to the the original instruction.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D107708
2021-08-18 11:07:11 -07:00
Jessica Paquette 791006fb8c [GlobalISel] Implement lowering for G_ISNAN + use it in AArch64
GlobalISel equivalent to `TargetLowering::expandISNAN`.

Use it in AArch64 and add a testcase.

Differential Revision: https://reviews.llvm.org/D108227
2021-08-18 10:54:25 -07:00
Han Zhu 687f046c97 [NFC][loop-idiom] Rename Stores to IgnoredInsts; Fix a typo
When dealing with memmove, we also add the load instruction to the ignored
instructions list passed to `mayLoopAccessLocation`. Renaming "Stores" to
"IgnoredInsts" to be more precise.

Differential Revision: https://reviews.llvm.org/D108275
2021-08-18 10:52:16 -07:00
Jessica Paquette d9873711cb [GlobalISel] Add IRTranslator support for G_ISNAN
Translate the `@llvm.isnan` intrinsic to G_ISNAN when we see it.

This is pretty much the same as the associated SelectionDAGBuilder code. Main
difference is that we don't expand it here. It makes more sense to do that
during legalization in GlobalISel. GlobalISel will just legalize the generated
illegal types.

Differential Revision: https://reviews.llvm.org/D108226
2021-08-18 10:48:10 -07:00
Jinsong Ji 66e2772e42 [InstrProfiling] Support relative CountersPtr for PlatformOther
D104556 change the CountersPtr to be relative, however, it did not
update the pointer initialization in  __llvm_profile_register_function,
so the platform (eg:AIX) that use __llvm_profile_register_function is now totaly
broken, any PGO code will SEGV.

This patch update the code to reflect that the Data->CountersPtr is now
relative.

Reviewed By: MaskRay, davidxl

Differential Revision: https://reviews.llvm.org/D108304
2021-08-18 17:45:39 +00:00
Craig Topper 6d7ea597ef [RISCV] Insert sext_inreg when type legalizing add/sub/mul with constant LHS.
We already do this for non-constants RHS. This just removes the
special case. I believe the special case may have been needed
because the ANY_EXTEND of a constant used to create zero extended
constants, but we recently changed that to produce sign extended
constants.

D107658 is needed to prevent some regressions.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D107697
2021-08-18 10:44:25 -07:00
Jessica Paquette 0a2b1ba33a [GlobalISel] Add G_ISNAN
Add a generic opcode equivalent to the `llvm.isnan` intrinsic +
MachineVerifier support for it.

We need an opcode here because we may want target-specific lowering later on.

Differential Revision: https://reviews.llvm.org/D108222
2021-08-18 10:42:05 -07:00
Michael Kruse e8c8407aca [Polly] Break early when the result is known. NFC. 2021-08-18 12:41:04 -05:00
Craig Topper 20e6265873 [RISCV] Improve constant materialization for stores of i16 or i32 negative constants.
DAGCombiner::visitStore can clear the upper bits of constants
used by stores. This leads prevents them from being recognized as
sign extended negative values making them more expensive to
materialize.

This patch uses the hasAllNBitUsers method from D107658 to make
a negative constant if none of the users care about the upper bits.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D108052
2021-08-18 10:25:12 -07:00
Craig Topper d9ba1a9c5c [RISCV] Teach isel to select ADDW/SUBW/MULW/SLLIW when only the lower 32-bits are used.
We normally select these when the root node is a sext_inreg, but
SimplifyDemandedBits can sometimes bypass the sext_inreg for some
users. This can create situation where sext_inreg+add/sub/mul/shl
is selected to a W instruction, and then the add/sub/mul/shl is
separately selected to a non-W instruction with the same inputs.

This patch tries to detect when it would still be ok to use a W
instruction without the sext_inreg by checking the direct users.
This can allow the W instruction to CSE with one created for a
sext_inreg+add/sub/mul/shl. To minimize complexity and cost of
checking, we make no attempt to determine if the CSE will happen
and just always use a W instruction when we can.

Differential Revision: https://reviews.llvm.org/D107658
2021-08-18 10:22:00 -07:00
Simon Pilgrim 6cc11090a1 [X86] avx512bw-intrinsics-upgrade.ll - cleanup whitespace and use nounwind to avoid unnecessary cfi tags. NFCI. 2021-08-18 17:53:55 +01:00
Craig Topper f70238914a [RISCV] Add zext.h/zext.w to RISCVTTIImpl::getIntImmCostInst.
If we have these instructions, we don't need to hoist the immediate
for an AND that would match them.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D107783
2021-08-18 09:40:40 -07:00
Arthur Eubanks 7557d6c896 [NFC] Cleanup calls to CallBase::getAttribute() 2021-08-18 09:39:33 -07:00
Florian Mayer 164e09de2e [hwasan] Default -hwasan-use-stack-safety to off.
This very occasionally causes to an assertion failure in the compiler.
Turning off until we can get to the bottom of this.

Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D108282
2021-08-18 17:21:32 +01:00
Kazu Hirata e0ff1e9659 [Bitcode] Remove unused declaration writeGlobalVariableMetadataAttachment (NFC)
The declaration was introduced without a corresponding definition on
May 31, 2016 in commit cceae7feda.
2021-08-18 09:16:05 -07:00
David Sherwood 219d4518fc [Analysis][AArch64] Make fixed-width ordered reductions slightly more expensive
For tight loops like this:

  float r = 0;
  for (int i = 0; i < n; i++) {
    r += a[i];
  }

it's better not to vectorise at -O3 using fixed-width ordered reductions
on AArch64 targets. Although the resulting number of instructions in the
generated code ends up being comparable to not vectorising at all, there
may be additional costs on some CPUs, for example perhaps the scheduling
is worse. It makes sense to deter vectorisation in tight loops.

Differential Revision: https://reviews.llvm.org/D108292
2021-08-18 17:01:56 +01:00
Joseph Huber 13d8f000d7 [OpenMP][NFC] Improve debug message for shared memory
Summary:
Make the debug message for HeapToShared more helpful by showing the
actual call.
2021-08-18 11:56:09 -04:00
Louis Dionne ebc01bbc7a [libc++] Skip logic for detecting C11 features when using_if_exists is supported
In the future, we'll want to rely exclusively on using_if_exists for this
job, but for now, only rely on it when the compiler supports that attribute.
That removes the possibility for getting the logic wrong.

Differential Revision: https://reviews.llvm.org/D108297
2021-08-18 11:53:34 -04:00
Louis Dionne ec574f5da4 [libc++] Split off tests for aligned_alloc & friends into separate test files
This allows testing the rest of those headers on most platforms, instead
of XFAILing the whole test just because of a few functions.

As a fly-by fix, remove std/utilities/time/date.time/ctime.pass.cpp,
which was a duplicate of std/language.support/support.runtime/ctime.pass.cpp.

Differential Revision: https://reviews.llvm.org/D108295
2021-08-18 11:52:40 -04:00
Arthur Eubanks 3af250ff1e Add some Function method definitions accidentally removed
In cc327bd523.
2021-08-18 08:28:57 -07:00
Joseph Huber 58f9326487 [OpenMP] Change AAKernelInfo to ignore non-kernels
Currently, AAKernelInfo will fail on an assertion if we attempt to run
it on a kernel without the init / deinit runtime calls. However, this
occurs for global constructors on the device. This will cause OpenMPOpt
to crash whenever global constructors are present. This patch removes
this assertion and just gives up instead.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D108258
2021-08-18 11:24:29 -04:00
Joseph Huber edb8acdc6e [Libomptarget] Correctly default to Generic if exec_mode is not present
Currently, the runtime returns an error when the `exec_mode` global is
not present. The expected behvaiour is that the region will default to
Generic. This prevents global constructors from being called because
they do not contain execution mode globals.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D108255
2021-08-18 11:24:28 -04:00
Vyacheslav Zakharin 1ffbe8c04f [clang-offload-wrapper] Disabled ELF offload notes embedding by default.
This change-set puts 93d08acaac functionality
under -add-omp-offload-notes switch that is OFF by default.
CUDA toolchain is not able to handle ELF images with LLVMOMPOFFLOAD
notes for unknown reason (see https://reviews.llvm.org/D99551#2950272).
I disable the ELF notes embedding until the CUDA issue is triaged and resolved.

Differential Revision: https://reviews.llvm.org/D108246
2021-08-18 08:18:03 -07:00
William S. Moses 8c2ff7b69e [MLIR] Correct linkage of lowered globalop
LLVM considers global variables marked as externals to be defined within the module if it is initialized (including to an undef). Other external globals are considered as being defined externally and imported into the current translation unit. Lowering of MLIR Global Ops does not properly propagate undefined initializers, resulting in a global which is expected to be defined within the current TU, not being defined.

Differential Revision: https://reviews.llvm.org/D108252
2021-08-18 11:09:43 -04:00
Maryam Benimmar 7151a8aada [PowerPC][AIX] llvm-readobj: Convert some errors to warnings.
Report warnings rather than errors, so that llvm-readobj doesn't bail
out on malformed inputs.

Differential Revision: https://reviews.llvm.org/D106783
2021-08-18 11:04:08 -04:00
Butygin ddc3d51d58 [mlir][spirv] Add (InBounds)PtrAccessChain ops
Differential Revision: https://reviews.llvm.org/D108070
2021-08-18 17:59:21 +03:00
Bing1 Yu ffe58de393 [X86] [AMX] Fix the test case failure caused by D107544.
The issue can be duplicated when EXPENSIVE_CHECKS is specified for llvm
build. Thank Simon report this issue at
https://bugs.llvm.org/show_bug.cgi?id=51513. We need return correct
value for the changed IR.

Reviewed By: RKSimon, LuoYuanke

Differential Revision: https://reviews.llvm.org/D108269
2021-08-18 22:27:22 +08:00
LLVM GN Syncbot 0dfce025c4 [gn build] Port 38812f4ac1 2021-08-18 14:02:48 +00:00
Arthur O'Dwyer 0fb189952c [libc++] Implement structured binding for std::ranges::subrange.
The `get` half of this machinery was already implemented, but the `tuple_size`
and `tuple_element` parts were hiding in [ranges.syn] and therefore missed.

Differential Revision: https://reviews.llvm.org/D108054
2021-08-18 10:01:45 -04:00
Arthur O'Dwyer 38812f4ac1 [libc++] [P1614] Implement std::compare_three_way_result.
Differential Revision: https://reviews.llvm.org/D103581
2021-08-18 10:01:24 -04:00
Aaron Ballman 9f27364377 Use a more general test here.
The interesting bit about that triple isn't the architecture, it's the
fact that ps4 implies C99 as the standard rather than a newer C mode.
Specify the language standard rather than the triple so the test is a
bit more general.
2021-08-18 09:32:05 -04:00
Nico Weber dfcad31b22 Simplify a .mailmap entry
The old entry mapped the email address `<compnerd@compnerd.org>` to user name
`Saleem Abdulrasool` and email address `<compnerd@compnerd.org>`. Since the two
addresses are identical, that's a needless detail.

The new entry just maps email address `<compnerd@compnerd.org>` to user name
`Saleem Abdulrasool`.

No behavior change.

Differential Revision: https://reviews.llvm.org/D108079
2021-08-18 09:16:16 -04:00
Corentin Jabot 2715c4da50 Do not emit diagnostics for invalid unicode characters in preprocessing mode
This amends 4e80636db7 with a fix for
https://lab.llvm.org/buildbot/#/builders/139/builds/8943
2021-08-18 09:12:36 -04:00
Alexander Potapenko 7338be0e6e [tsan] Disable Trace.MemoryAccessSize on Mac
According to comments at https://reviews.llvm.org/D107911,
Trace.MemoryAccessSize fails on Mac buildbots.
Because this test is newly introduced, and is the only user of the code
added in that patch, disable the test on Mac till the problem is
resolved.

Differential Revision: https://reviews.llvm.org/D108294
2021-08-18 15:09:36 +02:00
Louis Dionne 0166690401 [libc++] Remove workarounds for the lack of deduction guides in C++17
All supported compilers have supported deduction guides in C++17 for a
while, so this isn't necessary anymore.

Differential Revision: https://reviews.llvm.org/D108213
2021-08-18 08:57:25 -04:00
Louis Dionne 6f6175d1c6 [libc++][NFC] Fix copy-paste errors in tests
The test precision_type.pass.cpp was a duplicate of precision.pass.cpp,
so it is removed. atomic_flag_test.pass.cpp was a duplicate of
atomic_flag_test_and_set.pass.cpp, so instead I wrote a proper
test for it. Those duplicate tests were detected with

     find libcxx ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD
2021-08-18 08:54:18 -04:00
Louis Dionne ed7c81d172 [libc++] Convert test-suite workarounds for some C11 features to XFAILs
Instead of trying to sniff out what features are supported by the
library being tested, the way we normally handle these things is with
Lit annotations. This should not be treated differently.

Differential Revision: https://reviews.llvm.org/D108209
2021-08-18 08:28:11 -04:00
Roman Lebedev df1033d8db
[NFC][X86][Codegen] Add exhaustive test coverage for PR50971
Produced via https://godbolt.org/z/5hEdGY5x3
2021-08-18 15:02:52 +03:00
Corentin Jabot 4e80636db7 Implement P1949
This adds the Unicode 13 data for XID_Start and XID_Continue.
The definition of valid identifier is changed in all C++ modes
as P1949 (https://wg21.link/p1949) was accepted by WG21 as a defect
report.
2021-08-18 07:33:14 -04:00
Simon Pilgrim f22e5869a0 [Sema] CheckObjCBridgeNSCast - fix dead code warning. NFCI.
Target is only ever non-null when we find an existing type, so move its declaration inside that case, and remove the dead code where Target was always null.
2021-08-18 11:53:27 +01:00
LLVM GN Syncbot 26da53f5b6 [gn build] Port 45ac5f5441 2021-08-18 10:43:22 +00:00
Lang Hames 45ac5f5441 Revert "[ORC-RT][ORC] Introduce ELF/*nix Platform and runtime support."
This reverts commit e256445bff.

This commit broke some of the bots (see e.g.
https://lab.llvm.org/buildbot/#/builders/112/builds/8599). Reverting while I
investigate.
2021-08-18 20:42:23 +10:00
David Spickett 6c7956ea49 [compiler-rt][fuzzer] Explain why fuzzer-flags test is unsupported on AArch64
See https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4d1c6335455aeeda9de8a5eb58998f919ea35a1e
for the specific change that fixes the issue.
2021-08-18 10:10:19 +00:00
Nikhil Gupta 8ea60cf1de Adding an Nvidia representative to security group
Adding Nikhil Gupta as an Nvidia representative to the llvm security
group.

Differential Revision: https://reviews.llvm.org/D106906
2021-08-18 12:08:11 +02:00
Qiu Chaofan 2e5e33807e Pre-commit frem test in PowerPC 2021-08-18 17:52:53 +08:00
Qiu Chaofan 1d06a39d6e Fix a typo around 'builtin' 2021-08-18 17:42:12 +08:00
Justas Janickas 0d0628b2d2 [OpenCL] C++ for OpenCL version 2021 introduced to command line.
Introduces language standard `lang_openclcpp2021` and allows
`clc++2021` as a version flag for `-cl-std` in command line.
Defines macros related to C++ for OpenCL version 2021.

C++ for OpenCL version 2021 has been proposed in an RFC:
https://lists.llvm.org/pipermail/cfe-dev/2021-August/068593.html

Differential Revision: https://reviews.llvm.org/D108038
2021-08-18 10:08:59 +01:00