Commit Graph

378697 Commits

Author SHA1 Message Date
Fangrui Song 98768bab19 [test] Fix unuses FileCheck prefixes in clang/test/Modules 2021-02-01 19:46:23 -08:00
Fangrui Song 0fa61304d2 [LoopVectorize] Relax a FCmpInst assert to dyn_cast after D95690
The instruction may be `icmp eq i32`. Noticed in an internal Halide+wasm JIT test.
2021-02-01 19:28:45 -08:00
Matt Arsenault 41877b82f0 AMDGPU: Fix dbg_value handling when forming soft clause bundles
DBG_VALUES placed between memory instructions would change
codegen. Skip over these and re-insert them after the bundle instead
of giving up on bundling.
2021-02-01 22:16:35 -05:00
MaheshRavishankar 342d4662e1 [mlir] Add custom directive hooks for printing mixed integer or value operands.
Add printer and parser hooks for a custom directive that allows
parsing and printing of idioms that can represent a list of values
each of which is either an integer or an SSA value. For example in

`subview %source[%offset_0, 1] [4, %size_1] [%stride_0, 3]`

each of the list (which represents offset, size and strides) is a mix
of either statically know integer values or dynamically computed SSA
values. Since this is used in many places adding a custom directive to
parse/print this idiom allows using assembly format on operations
which use this idiom.

Differential Revision: https://reviews.llvm.org/D95773
2021-02-01 19:03:49 -08:00
Mircea Trofin 87f8a08ce3 [Utils] Add a switch controlling prefix warnings in UpdateTestChecks
The switch controls both unused prefix warnings, and warnings about
functions which differ under different runs for a prefix, and, thus, end
up not having asserts for that prefix.

(If the latter case spans to all functions, then the former case kicks
in)

The switch is on by default, and can be disabled.

Differential Revision: https://reviews.llvm.org/D95829
2021-02-01 18:04:18 -08:00
Atmn Patel b545667d0a [OpenMP][Libomptarget] Remove possible harmful copy constructor call for RTLsTy
From https://bugs.llvm.org/show_bug.cgi?id=48973, we know that
`std::call_once(PM->RTLs.initFlag, &RTLsTy::LoadRTLs, PM->RTLs)` causes compile
time problems in libstdc++v3 5.3.1. This is because there was a defect in the
standard regarding the `call_once` (LWG 2442). This was fixed in libstdc++ soon
thereafter, but there are likely other standard libraries where this will fail.

By matching this function call with the other one, we fix this bug.

Differential Revision: https://reviews.llvm.org/D95769
2021-02-01 20:13:03 -05:00
Philip Reames 46e764a628 [x86] introduce no_callee_saved_registers attribute
This is directly analogous to the existing no_caller_saved_registers, but with the opposite intention.  A function or call so marked shifts the responsibility of spilling the usual CSRs to it's caller.

An indirect call site and callee which don't agree on the attribute is ill defined.

The motivation for this change is that being able to prune callee saves (without modifying other details of the calling convention) is sometimes useful when generating stubs and adapters.  There's no intention to expose this as a source language feature; this is expected to be used by frontends to implement adapters where warranted.

Some specific examples of use cases:
* GC compatible compiled code wants to call an externally defined library function without needing to track pointer values through CSRs.
* debug enabled code wants to call precompiled library which doesn't provide enough information to track CSRs while preserving debug quality in caller.
* adapter stub entering hand written assembler which doesn't follow normal calling conventions.
2021-02-01 16:19:14 -08:00
Jonas Devlieghere fbd5507178 [lldb] Use the host architecture in TestAppleSimulatorOSType.py 2021-02-01 16:18:31 -08:00
Rahman Lavaee f1ff6d210a [obj2yaml, yaml2obj] Use Hex64 for BBAddressMap fields.
This patch let the yaml encoding use Hex64 values for NumBlocks, BB AddressOffset, BB Size, and BB Metadata.
Additionally, it changes the decoded values in elf2yaml to uint64_t to match DataExtractor::getULEB128 return type.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D95767
2021-02-01 15:37:30 -08:00
Eric Schweitz 5918690255 [flang][NFC] Rename complex type.
This change renames the CplxType class to ComplexType.
2021-02-01 15:31:48 -08:00
Philip Reames 9d09db941f [NFC][X86] Use CallBase interface to simplify code 2021-02-01 15:24:41 -08:00
Philip Reames bb6c23b1f5 [NFC][X86] Avoid redundant work inspecting callee 2021-02-01 15:24:41 -08:00
Petr Hosek df3e39f60b [InstrProfiling] Use !associated metadata for counters, data and values
C identifier name input sections such as __llvm_prf_* are GC roots so
they cannot be discarded. In LLD, the SHF_LINK_ORDER flag overrides the
C identifier name semantics.

The !associated metadata may be attached to a global object declaration
with a single argument that references another global object, and it
gets lowered to SHF_LINK_ORDER flag. When a function symbol is discarded
by the linker, setting up !associated metadata allows linker to discard
counters, data and values associated with that function symbol.

Note that !associated metadata is only supported by ELF, it does not have
any effect on non-ELF targets.

Differential Revision: https://reviews.llvm.org/D76802
2021-02-01 15:01:43 -08:00
Patrick Oppenlander 93345e825a [llvm-objcopy] -O binary: consider SHT_NOBITS sections to be empty
This is consistent with BFD objcopy.

Previously llvm objcopy would allocate space for SHT_NOBITS sections
often resulting in enormous binary files.

New test case (binary-paddr.test %t6).

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D95569
2021-02-01 15:01:25 -08:00
Stanislav Mekhanoshin 8e661d3d9c [AMDGPU] Set s-memtime-inst feature from clang
Differential Revision: https://reviews.llvm.org/D95733
2021-02-01 14:20:43 -08:00
Hongtao Yu 224fee8219 [CSSPGO] Tweaking inlining with pseudo probes.
Fixing up a couple places where `getCallSiteIdentifier` is needed to support pseudo-probe-based callsites.

Also fixing an issue in the extbinary profile reader where the metadata section is not fully scanned based on the number of profiles loaded only for the current module.

Reviewed By: wmi, wenlei

Differential Revision: https://reviews.llvm.org/D95791
2021-02-01 13:56:40 -08:00
Björn Schäpers 772eb24e00 [clang-format] Add option to control the spaces in a line comment
Differential Revision: https://reviews.llvm.org/D92257
2021-02-01 22:48:50 +01:00
Weiwei Li 35f746c17f [mlir][spirv] Add support for OpImageType
Support OpImageType in SPIRV Dialect.

This change doesn't support operand AccessQualifier since
it is optinal and only enables under Kernel capability.

co-authored-by: Alan Liu <alanliu.yf@gmail.com>

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D95580
2021-02-01 16:44:31 -05:00
Philip Reames 73ef96c49c [tests] highlight cornercase w/deref hoisting from D95815
The main point of committing this early is to have a negative test in tree.  Nothing fails in the current tests if we implement this (currently unsound) optimization.
2021-02-01 13:32:39 -08:00
Stephen Kelly 68b0595ccb NFC: Re-generate out-of-date matchers docs 2021-02-01 21:25:29 +00:00
Sanjay Patel bbed5f2f8a [LoopVectorize] improve IR fast-math-flags propagation in reductions
This is another step (see D95452) towards correcting fast-math-flags
bugs in vector reductions.

There are multiple bugs visible in the test diffs, and this is still
not working as it should. We still use function attributes (rather
than FMF) to drive part of the logic, but we are not checking for
the correct FP function attributes.

Note that FMF may not be propagated optimally on selects (example
in https://llvm.org/PR35607 ). That's why I'm proposing to union the
FMF of a fcmp+select pair and avoid regressions on existing vectorizer
tests.

Differential Revision: https://reviews.llvm.org/D95690
2021-02-01 16:21:36 -05:00
Mehdi Amini 68f66f37d7 Revert "[libc++][format] Add basic_format_parse_context."
This reverts commit 35a57f39b5.

A build is broken during clang bootstrap with:

In file included from ../libcxx/src/format.cpp:9:
/tmp/ci-nGNyLRM9V3/include/c++/v1/format:153:16: error: no member named 'is_constant_evaluated' in namespace 'std::__1'
    if (_VSTD::is_constant_evaluated() && __id >= __num_args_)
        ~~~~~~~^
1 error generated.
2021-02-01 21:18:11 +00:00
Mehdi Amini 32ef6d89f4 Avoid string comparisons on the fast path of MLIR Identifier lookup (NFC)
Differential Revision: https://reviews.llvm.org/D95770
2021-02-01 21:05:07 +00:00
Florian Hahn 0b28d756af
[ConstraintElimination] Add support for EQ predicates.
A == B map to A >= B && A <= B
(https://alive2.llvm.org/ce/z/_dwxKn).

This extends the constraint construction to return a list of
constraints, which can be used to properly de-compose nested AND & OR.
2021-02-01 20:48:31 +00:00
Lei Zhang 75347ba1fa Revert "[mlir][spirv] Add support for OpImageType"
This reverts commit 21f1462106.
2021-02-01 15:02:34 -05:00
Lei Zhang 21f1462106 [mlir][spirv] Add support for OpImageType
Support OpImageType in SPIRV Dialect.

This change doesn't support operand AccessQualifier since
it is optinal and only enables under Kernel capability.

co-authored-by: Alan Liu <alanliu.yf@gmail.com>

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D95580
2021-02-01 15:01:31 -05:00
AndreyChurbanov d7b12004bd [OpenMP] libomp: implement nteams-var and teams-thread-limit-var ICVs
The change includes OMP_NUM_TEAMS, OMP_TEAMS_THREAD_LIMIT env variables,
omp_set_num_teams, omp_get_max_teams, omp_set_teams_thread_limit,
omp_get_teams_thread_limit routines.

Differential Revision: https://reviews.llvm.org/D95003
2021-02-01 22:54:11 +03:00
Philip Reames 2a53d9a6e7 [Loads] Plumb through TLI argument [NFC]
This is a (rather delayed) follow up to commit 0129cd5.  This commit is entirely NFC, the semantic change to leverage the new information will be submitted separate with a test case.
2021-02-01 11:45:30 -08:00
Hanhan Wang b3f611bfe7 [mlir][Linalg] Replace SimplePad with PadTensor in hoist-padding
This is the last revision to migrate using SimplePadOp to PadTensorOp, and the
SimplePadOp is removed in the patch. Update a bit in SliceAnalysis because the
PadTensorOp takes a region different from SimplePadOp. This is not covered by
LinalgOp because it is not a structured op.

Also, remove a duplicated comment from cpp file, which is already described in a
header file. And update the pseudo-mlir in the comment.

This is as same as D95615 but fixing one dep in CMakeLists.txt

Different from D95671, the fix was applied to run target.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D95785
2021-02-01 11:38:43 -08:00
Wouter van Oortmerssen 0d9b17d0ef [WebAssembly] fixed wasm64 data segment init exp not 64-bit
As defined in the spec:
https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md

Differential Revision: https://reviews.llvm.org/D95651
2021-02-01 11:32:50 -08:00
Michael Holman 8bfef78722 [ConstantHoisting] Fix bug where constant materialization could insert into EH pad
If the incoming block to a phi node is an EH pad, then we will
materialize into an EH pad, which is not supposed to happen. To fix
this, I added a check to see if incoming block of a phi node is an EH
pad before using it as the insertion point.

Differential Revision: https://reviews.llvm.org/D95019
2021-02-01 11:23:56 -08:00
Mark de Wever 35a57f39b5 [libc++][format] Add basic_format_parse_context.
Implements parts of:
- P0645 Text Formatting

Depends on D92214

Reviewed By: ldionne, curdeius, #libc

Differential Revision: https://reviews.llvm.org/D93166
2021-02-01 20:19:20 +01:00
Michael Jones c73c23f2a9 [libc][NFC] Add a death test API adaptation macro
Fuchsia's zxtest has a slightly different death test definition, and
this macro makes our death test API work on Fuchsia.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D95648
2021-02-01 19:19:04 +00:00
David Green 5b2626ea87 [ARM] Flatten identity shuffles through vqdmulh nodes
Given a shuffle(vqdmulh(shuffle, shuffle), we can flatter the shuffles
out if they become an identity mask. This can come up during lane
interleaving, when we do that better.

Differential Revision: https://reviews.llvm.org/D94034
2021-02-01 19:14:20 +00:00
Arthur Eubanks 7739f9ff97 [NewPM][Unswitch] Add option to disable -O3 non-trivial unswitching
Some benchmarks regress with non-trivial unswitching, so add an option
to opt-out of performing non-trivial unswitching while investigating.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D95796
2021-02-01 11:11:59 -08:00
Craig Topper c691fe14da [X86] Accept 64-bit GPRs for vextractps when using a register that requires EVEX.
This is consistent with the VEX version. It also fixes a sorting
issue in the matching table that caused the EVEX version to be
prioritized over VEX in intel syntax.

Fixes issue [2] from PR48991.
2021-02-01 11:01:32 -08:00
Haowei Wu 771b359654 [elfabi] Fix tests which failed on different timezones
This patch fixes elfabi tests on machines using a GMT+X timezone
settings.

Differential Revision: https://reviews.llvm.org/D95641
2021-02-01 10:58:55 -08:00
Melanie Blower 08d46d5059 [clang][PATCH] Fix bug 48848 assertion related to recoverFromMSUnqualifiedLookup
Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D95482
2021-02-01 10:56:47 -08:00
Sanjay Patel 0ce2920f17 [InstCombine] try to narrow min/max intrinsics with constant operand
The constant trunc/ext may not be the optimal pre-condition,
but I think that handles the common cases.

Example of Alive2 proof:
https://alive2.llvm.org/ce/z/sREeLC

This is another step towards canonicalizing to the intrinsics.
Narrowing was identified as source of potential regression for
abs(), so we need to handle this for min/max - see:
https://llvm.org/PR48816

If this is not enough, we could process intrinsics in
the trunc-driven matching in canEvaluateTruncated().
2021-02-01 13:44:13 -05:00
Sanjay Patel d23b68a879 [InstCombine] add tests for min/max with extend and constant operand; NFC 2021-02-01 13:44:13 -05:00
Michael Jones cb2e2d5068 [libc] Small adjustments to fenv tests
Some libcs define non-standard FE_* macros and include them in
FE_ALL_EXCEPT. This change adjusts the fenv tests so that the
non-standard FE_* macros do not interfere when compiled with
fenv.h from another libc.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D95650
2021-02-01 18:40:32 +00:00
Mircea Trofin c4d6f2707a [NFC] Disallow unused prefixes under clang/test/Driver
Differential Revision: https://reviews.llvm.org/D95660
2021-02-01 10:34:38 -08:00
Valentin Clement 3f46c209f1 [flang][directive] Enforce basic semantic check for all clauses
This patch is a follow up to D94821 to ensure the correct behavior of the
general directive structure checker.
This patch add the generation of the Enter function declaration for clauses in
the TableGen backend.
This helps to ensure each clauses declared in the TableGen file has at least
a basic check.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D95108
2021-02-01 13:33:30 -05:00
Simon Pilgrim e9514429a0 [X86][AVX] Add 'OK' tests cases for PR48877 2021-02-01 18:17:41 +00:00
Simon Pilgrim e640b209b2 [X86][SSE] LowerScalarImmediateShift - use APInt::getLowBitsSet for vXi8 ISD::SRL mask generation. NFCI.
Match what we do for ISD::SHL
2021-02-01 18:17:40 +00:00
Shilei Tian f0129cc35e [OpenMP] Disable tests if FileCheck is not available in in-tree building
FileCheck is required for OpenMP tests. The current detection can fail
if building OpenMP in-tree when user sets `LLVM_INSTALL_TOOLCHAIN_ONLY=ON`. As a
result, CMake will raise an error and the compilation will be broken. This patch
fixed the issue. When `FileCheck` is not a target, tests will just be skipped.

Reviewed By: jdoerfert, JonChesterfield

Differential Revision: https://reviews.llvm.org/D95689
2021-02-01 13:14:55 -05:00
Mark de Wever 3ffc53ba16 [libc++] Implements concept default_initializable.
Implements:
- LWG3149 DefaultConstructible should require default initialization

Implements parts of:
 - P0898R3 Standard Library Concepts
 - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D91986

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D93461
2021-02-01 19:13:24 +01:00
Jessica Paquette cf2be5e3bb [AArch64][GlobalISel] Emit G_ASSERT_ZEXT in assignValueToReg
When we have a zeroext parameter, emit G_ASSERT_ZEXT.

Add a check that we actually emit it.

This is a 0.1% code size win on CTMark/7zip and CTMark/consumer-typeset at -Os.

Differential Revision: https://reviews.llvm.org/D95567
2021-02-01 10:01:52 -08:00
Teresa Johnson 7f2e0879b5 [LTO] Move part of gold devirt test to v1.16 directory
Part of the gold test added in 1487747e99
relies on more recent fixes to gold that fix the plugin behavior with
--export-dynamic-symbol and --dynamic-list. Extract those parts of the
new test into a v1.16 test.
2021-02-01 09:53:11 -08:00
Craig Topper 72b31ad4b8 [RISCV] Add scalable vector support for floating point FMA instructions
A follow up patch will add support for commuting operands or
changing opcode to vfmacc and friends.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D95662
2021-02-01 09:52:43 -08:00