Commit Graph

370401 Commits

Author SHA1 Message Date
Jay Foad 50ee22d791 [AMDGPU] Fix double space in disassembly of SDWA instructions with vcc
Differential Revision: https://reviews.llvm.org/D90317
2020-10-28 21:39:39 +00:00
Jay Foad b3dac4ee24 [TableGen] Treat reg as isolated in reg$foo (but not in ${foo}reg)
D9844 fixed a problem where the ss suffix in the AsmString "cmp${cc}ss"
was recognised as the X86 SS register, by only recognising a token as a
register name if it is "isolated", i.e. surrounded by separator
characters.

In the AMDGPU backend there are many operands like $clamp which expand
to an optional string " clamp" including the preceding space, so we want
to have AsmStrings including sequences like "vcc$clamp" where vcc is a
register name.

This patch relaxes the rules for an isolated token, to say that it's OK
if the token is immediately followed by a '$'.

Differential Revision: https://reviews.llvm.org/D90315
2020-10-28 21:39:39 +00:00
Florian Hahn 772aaa6023 [AArch64] Improve lowering of insert_vector_elt with 0.0 consts.
When moving +0.0 into a float vector, we can use to vi*gpr variants of
INS.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D90176
2020-10-28 21:35:33 +00:00
Austin Kerbow 8b127a8661 [AMDGPU] Fix inserting combined s_nop in bundles
Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D90334
2020-10-28 14:34:04 -07:00
Philip Reames 4e4abd16a7 [Deref] Use maximum trip count instead of exact trip count
When trying to prove that a memory access touches only dereferenceable memory across all iterations of a loop, use the maximum exit count rather than an exact one.  In many cases we can't prove exact exit counts whereas we can prove an upper bound.

The test included is for a single exit loop with a min(C,V) exit count, but the true motivation is support for multiple exits loops.  It's just really hard to write a test case for multiple exits because the vectorizer (the primary user of this API), bails far before this.  For multiple exits, this allows a mix of analyzeable and unanalyzable exits when only analyzeable exits are needed to prove deref.
2020-10-28 14:33:30 -07:00
Richard Smith 09abecef7b PR48002: Fix injection of elaborated-type-specifiers within local
classes into the enclosing block scope.

We weren't properly detecting whether the name would be injected into a
block scope in the case where it was lexically declared in a local
class.
2020-10-28 14:29:45 -07:00
Sean Silva 1ce7040359 [mlir] Properly handle recursive bufferization for scf.for/scf.if
This fixes a subtle issue, described in the comment starting with
"Clone the op without the regions and inline the regions from the old op",
which prevented this conversion from working on non-trivial examples.

Differential Revision: https://reviews.llvm.org/D90203
2020-10-28 14:16:56 -07:00
Michael Park 35d2269111 [libc++] Re-apply the switch-based std::variant implementation
This commit is a mass re-application of the following commits:

  7d15ece79c
  e0ec7a0206
  02197f7e50
  a175a96517

Those were temporarily reverted in 057028ed39, and never re-applied.
Re-committed by @ldionne (author edited for credit).

Differential Revision: https://reviews.llvm.org/D90168
2020-10-28 17:09:11 -04:00
Louis Dionne 2488e44429 [llvm-lit] Improve the error message when make_paths_relative() fails
Previously, if make_paths_relative() failed due to some reason, it would
happily keep going and set the ${out_pathlist} to the standard output
of the command, which would be the empty string if the command failed.

This can lead to issues that are difficult to diagnose, since the calling
code will usually try to keep going with a variable that was set to the
empty string.

Differential Revision: https://reviews.llvm.org/D89985
2020-10-28 17:06:18 -04:00
LLVM GN Syncbot 818bd31906 [gn build] Port 23ed570af1 2020-10-28 20:46:36 +00:00
Alexander Belyaev 67760bb2d6 [mlir] Use OpBuilderDAG for MemRefReinterpretCastOp. 2020-10-28 21:42:14 +01:00
Duncan P. N. Exon Smith 23ed570af1 Split out llvm/Support/FileSystem/UniqueID.h and clang/Basic/FileEntry.h, NFC
Split `FileEntry` and `FileEntryRef` out into a new file
`clang/Basic/FileEntry.h`. This allows current users of a
forward-declared `FileEntry` to transition to `FileEntryRef` without
adding more includers of `FileManager.h`.

Also split `UniqueID` out to llvm/Support/FileSystem/UniqueID.h, so
`FileEntry.h` doesn't need to include all of `FileSystem.h` for just
that type.

Differential Revision: https://reviews.llvm.org/D89761
2020-10-28 16:38:32 -04:00
Dávid Bolvanský 49cddb90f6 [MemLoc] Adjust memccpy support in MemoryLocation::getForArgument
Use LocationSize::upperBound instead of precise since we only know an upper bound on the number of bytes read/written.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D89885
2020-10-28 21:26:10 +01:00
Alexander Belyaev 7a996027b9 [mlir] Convert memref_reshape to memref_reinterpret_cast.
Differential Revision: https://reviews.llvm.org/D90235
2020-10-28 21:15:32 +01:00
Adrian Prantl 0b2b50a5d2 [DebugInfo] Expose Fortran array debug info attributes through DIBuilder.
The support of a few debug info attributes specifically for Fortran
arrays have been added to LLVM recently, but there's no way to take
advantage of them through DIBuilder. This patch extends
DIBuilder::createArrayType to enable the settings of those attributes.

Patch by Chih-Ping Chen!

Differential Review: https://reviews.llvm.org/D90323
2020-10-28 13:13:35 -07:00
Alok Kumar Sharma a6dd01afa3 [DebugInfo] Support for DW_TAG_generic_subrange
This is needed to support fortran assumed rank arrays which
have runtime rank.

  Summary:
Fortran assumed rank arrays have dynamic rank. DWARF TAG
DW_TAG_generic_subrange is needed to support that.

  Testing:
unit test cases added (hand-written)
check llvm
check debug-info

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D89218
2020-10-29 01:34:15 +05:30
Arthur Eubanks 3b2256a41b [test] Make bt_order_by_weight in switch.ll more robust
Branch weights are not represented internally linearly with the value in
    the IR. In its current state the test happened to pass, but the branch
    weights for 0,3,6 and 2,5,8,9 were not actually equal.

    $ opt -passes='print<branch-prob>'

    shows that the sum of the branch probabilities going to bb0 and bb2 were not the same.

    Printing analysis results of BPI for function 'bt_order_by_weight':
    ---- Branch Probabilities ----
      edge entry -> bb0 probability is 0x00000003 / 0x80000000 = 0.00%
      edge entry -> bb2 probability is 0x00000004 / 0x80000000 = 0.00%

    with this change:

    Printing analysis results of BPI for function 'bt_order_by_weight':
    ---- Branch Probabilities ----
      edge entry -> bb0 probability is 0x00000004 / 0x80000000 = 0.00%
      edge entry -> bb2 probability is 0x00000004 / 0x80000000 = 0.00%

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D90273
2020-10-28 12:56:23 -07:00
Shilei Tian 0661328d7e [Clang][OpenMP] Added the support for target data nowait
Previously we added support for target nowait, but target data nowait
has not been supported yet. In this patch, target data nowait will also be
wrapped into a task.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D90099
2020-10-28 15:53:30 -04:00
Florian Hahn ba78cae20f [AArch64] Use DUP for BUILD_VECTOR with few different elements.
If most elements of BUILD_VECTOR are the same, with a few different
elements, it is better to use DUP  for the common elements and
INSERT_VECTOR_ELT for the different elements.

Currently this transform is guarded quite restrictively to only trigger
in clearly beneficial cases.

With D90176, the lowering for patterns originating from code like
` float32x4_t y = {a,a,a,0};` (common in 3D apps) are lowered even
better (unnecessary fmov is removed).

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D90233
2020-10-28 19:48:20 +00:00
YAMAMOTO Takashi acd7be74ca [libc++] Fix a few warnings
Found during a NuttX porting effort.
But these changes are not directly relevant to NuttX.

Differential Revision: https://reviews.llvm.org/D90139
2020-10-28 15:41:10 -04:00
Mircea Trofin 6fa35541a0 [NFC][ThinLTO] Change command line passing to EmbedBitcodeInModule
Changing to pass by ref - less null checks to worry about.

Differential Revision: https://reviews.llvm.org/D90330
2020-10-28 12:33:39 -07:00
Aditya Nandakumar bed8394047 [GISel]: Few InsertVecElt combines
https://reviews.llvm.org/D88060

This adds the following combines
1) build_vector formation from insert_vec_elts
2) insert_vec_elts (build_vector) -> build_vector
2020-10-28 12:27:07 -07:00
Louis Dionne 63aeadb484 [libc++] Refactor tests to remove uses of std::rand()
This allows running these tests on systems that do not support std::rand().
2020-10-28 15:22:51 -04:00
Sam McCall 0e94836989 [clangd] Go-to-definition from non-renaming alias is unambiguous.
It's not helpful to show the alias itself as an option.
This fixes a regression accepted in f24649b77d.

Differential Revision: https://reviews.llvm.org/D89238
2020-10-28 20:17:35 +01:00
Mircea Trofin f0a98ad820 [NFC] Use Register in RegisterPressure APIs
Some related changes as well.

Differential Revision: https://reviews.llvm.org/D90268
2020-10-28 12:14:08 -07:00
Valentin Clement c89b645755 [openmp][openacc] Check for duplicate clauses for directive
Check for duplicate clauses associated with directive. Clauses can appear only once
in the 4 lists associated with each directive (allowedClauses, allowedOnceClauses,
allowedExclusiveClauses, requiredClauses). Duplicates were already present (removed with this
patch) or were introduce in new patches by mistake (D89861).

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D90241
2020-10-28 15:12:38 -04:00
Anton Afanasyev fcd54b82e8 [SLP][Test] Precommit test case for PR47629. NFC. 2020-10-28 22:09:36 +03:00
Vedant Kumar 158f336043 [lldb] Delete lldb/utils/test
These utilities aren't useful any more -- delete them as a cleanup.

Discussion:
http://lists.llvm.org/pipermail/lldb-dev/2020-October/016536.html
2020-10-28 12:06:02 -07:00
Vedant Kumar 2ce36ebca5 [DebugInfo] Shorten legacy [s|z]ext dwarf expressions
Take advantage of the emitConstu helper to emit slightly shorter dwarf
expressions to implement legacy [s|z]ext operations.
2020-10-28 12:06:02 -07:00
Vedant Kumar 9905346221 [DebugInfo] Fix legacy ZExt emission when FromBits >= 64 (PR47927)
Fix an out-of-bounds shift in emitLegacyZExt by using a slightly more
complicated dwarf expression to create the zext mask.

This addresses a UBSan diagnostic seen when compiling compiler-rt
(llvm.org/PR47927).

rdar://70307714

Differential Revision: https://reviews.llvm.org/D89838
2020-10-28 12:06:02 -07:00
Kazuaki Ishizaki 41b09f4eff [mlir] NFC: fix trivial typos
fix typos in comments and documents

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D90089
2020-10-29 04:05:22 +09:00
Vitaly Buka 220293da53 [NFC][TSAN] Logs to debug test script on bot 2020-10-28 11:40:16 -07:00
Sanjay Patel 7c395f31a6 [CostModel][x86] remove cost-kind predicate for intrinsic costs
We model cost as number of instructions / uops, so it does not
make sense to treat size/blended costs any differently than
throughput.
2020-10-28 14:33:37 -04:00
Nick Desaulniers cdff3bd932 [clang][ToolChains] explicitly return LangOptions::StackProtectorMode
Make the virtual method Toolchain::GetDefaultStackProtectorLevel()
return an explict enum value rather than an integral constant. This
makes the code subjectively easier to read, and should help prevent bugs
that may (or may never) arise from changing the enum values. Previously,
these were just kept in sync via a comment, which is brittle. The trade
off is including a additional header in a few new places. It is not
necessary, but in my opinion helps the readability.

Split off from https://reviews.llvm.org/D90194 to help cut down on lines
changed in code review.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D90271
2020-10-28 11:20:30 -07:00
Baptiste Saleil 40dd4d5233 [Clang][PowerPC] Add __vector_pair and __vector_quad types
Define the __vector_pair and __vector_quad types that are used to manipulate
the new accumulator registers introduced by MMA on PowerPC. Because these two
types are specific to PowerPC, they are defined in a separate new file so it
will be easier to add other PowerPC specific types if we need to in the future.

Differential Revision: https://reviews.llvm.org/D81508
2020-10-28 13:19:20 -05:00
Sanjay Patel 9df32c9044 [CostModel] remove cost-kind predicate for funnel shift costs
Completing the series of FIXME removals for special-case intrinsics:
50dfa19cc7
f2c25c7079
c963bde015
01ea93d85d

This one looks quite different than the others. The size/blended
cost is still potentially very far off from the throughput cost,
but this is hopefully not worse on the whole. It looks like the
underlying costs for the expanded shift/logic have their own
cost-kind limitations. Also, we are not asking the target if
it has a legal funnel shift op, so we just assume that the
intrinsic gets expanded.
2020-10-28 14:02:34 -04:00
Sam McCall 87f03e13ce [clangd] Don't offer to expand auto in structured binding declarations.
auto must be used for the code to parse.

Differential Revision: https://reviews.llvm.org/D89700
2020-10-28 18:55:23 +01:00
Mehdi Amini 72023442c1 Add a `mlirModuleGetBody()` accessor to the C API and bind it in Python
Getting the body of a Module is a common need which justifies a
dedicated accessor instead of forcing users to go through the
region->blocks->front unwrapping manually.

Differential Revision: https://reviews.llvm.org/D90287
2020-10-28 17:53:52 +00:00
Fangrui Song 7011a2f350 [llvm-mc] Drop unneeded dependency on CodeGen
Spot by Craig Topper.
2020-10-28 10:53:15 -07:00
Dylan McKay 88b7b76a0b [AVR][clang] Pass the address of the data section to the linker for ATmega328
This patch modifies the Clang AVR toolchain so that it always passes
the '-Tdata=0x800100' to the linker for ATmega328 devices. This matches
AVR-GCC behaviour, and also corresponds to the address of the start of
the data section in data space according to the ATmega328 datasheet.

Without this, clang does not produce a valid ATmega328 binary.

When targeting all non-ATmega328 chips, a warning will be emitted due to
the fact that proper handling for the chips data section address is
not yet implemented.

I've held off adding other microcontrollers for now, mostly because the
AVR toolchain logic is smeared across LLVM core TableGen files, and two Clang
libraries. The 'family detection' logic is also only implemented for
ATmega328 at the moment, for similar reasons.

In the future, I aim to write an RFC to llvm-dev to find a better way
for LLVM to expose target-specific details such as these to compiler
frontends.

Differential Revision: https://reviews.llvm.org/D86629
2020-10-29 06:35:15 +13:00
Tom Weaver f2f4554f88 [debuginfo-tests][dexter] add requires lldb to two tests
both deferred_globals.cpp namespace.cpp require lldb in order to run and will
fail if it's not available.

add the required lines to the top of the tests.
2020-10-28 17:33:29 +00:00
Kadir Cetinkaya 68b48339e5
[clangd] Fix a null dereference in tests. 2020-10-28 18:24:26 +01:00
Thomas Lively 5b464f2aa5 [WebAssembly] Fix incorrectly named target builtin
Rename __builtin_wasm_q15mulr_saturate_s_i8x16 to
__builtin_wasm_q15mulr_saturate_s_i16x8, fixing the implied lane interpretation
of the result.
2020-10-28 10:22:43 -07:00
Jay Foad 572289b39c [AMDGPU] Use -strict-whitespace for GFX8 and GFX9 disassembler tests 2020-10-28 17:17:20 +00:00
Heejin Ahn 98941279b9 [WebAssembly] Clang-format builtins generation (NFC)
Differential Revision: https://reviews.llvm.org/D90294
2020-10-28 10:01:21 -07:00
Thomas Lively 31e944556f [WebAssembly] Prototype extending multiplication SIMD instructions
As proposed in https://github.com/WebAssembly/simd/pull/376. This commit
implements new builtin functions and intrinsics for these instructions, but does
not yet add them to wasm_simd128.h because they have not yet been merged to the
proposal. These are the first instructions with opcodes greater than 0xff, so
this commit updates the MC layer and disassembler to handle that correctly.

Differential Revision: https://reviews.llvm.org/D90253
2020-10-28 09:38:59 -07:00
Paul C. Anagnostopoulos 9d72065cf6 [TableGen] [AMDGPU] Add !sub operator for subtraction
Use it in the AMDGPU target to eliminate !add(value1, !mul(value2, -1))

Differential Revision: https://reviews.llvm.org/D90107
2020-10-28 12:27:53 -04:00
Matt Arsenault b9c21d43bb RegAlloc: Clear isSSA
The MIR parser may infer SSA, so -run-pass=regallocgreedy would hit a
verifier error after multiple vreg defs are added.
2020-10-28 12:02:16 -04:00
Sebastian Neubauer 09c7345683 [AMDGPU] Precommit tests for D89388 and D89399, NFC 2020-10-28 16:58:55 +01:00
Fangrui Song ae73091f30 [ELF] -r: don't crash when a non-SHF_LINK_ORDER orphan is added before a SHF_LINK_ORDER orphan
Fixes https://github.com/ClangBuiltLinux/linux/issues/1186

If a non-SHF_LINK_ORDER orphan is added first, `firstIsec->flags & SHF_LINK_ORDER`
will be zero and we currently assert when calling `getLinkOrderDep`.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D90200
2020-10-28 08:56:42 -07:00