Giorgis Georgakoudis [Wed, 21 Jul 2021 07:18:38 +0000 (00:18 -0700)]
[OpenMP] Expose libomptarget function to get HW thread id
The patch exposes the libomptarget runtime function that gets the hardware thread id through the kmpc API. This is to be used in SPMDization for checking the thread id to execute regions by a single thread in a block.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/
D106323
Walter Erquinigo [Wed, 21 Jul 2021 16:49:15 +0000 (09:49 -0700)]
[trace] [intel pt] Create a "thread trace dump stats" command
When the user types that command 'thread trace dump info' and there's a running Trace session in LLDB, a raw trace in bytes should be printed; the command 'thread trace dump info all' should print the info for all the threads.
Original Author: hanbingwang
Reviewed By: clayborg, wallace
Differential Revision: https://reviews.llvm.org/
D105717
Jon Chesterfield [Wed, 21 Jul 2021 16:35:40 +0000 (17:35 +0100)]
Revert "[OpenMP][AMDGCN] Initial math headers support"
This reverts commit
968899ad9cf17579f9867dafb35c4d97bad0863f.
Jon Chesterfield [Wed, 21 Jul 2021 16:28:07 +0000 (17:28 +0100)]
[libomptarget][amdgpu][nfc] Refactor #includes
Create a hsa_api.h header that includes the ROCr headers in use
Drop some unused headers and _cplusplus macros
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/
D106455
Thomas Lively [Wed, 21 Jul 2021 16:02:12 +0000 (09:02 -0700)]
[WebAssembly] Codegen for v128.load{32,64}_zero
Replace the experimental clang builtins and LLVM intrinsics for these
instructions with normal instruction selection patterns. The wasm_simd128.h
intrinsics header was already using portable code for the corresponding
intrinsics, so now it produces the correct instructions.
Differential Revision: https://reviews.llvm.org/
D106400
Quinn Pham [Wed, 21 Jul 2021 15:47:52 +0000 (10:47 -0500)]
[PowerPC] Removing a REQUIRES line from llvm test
The test has been moved to the correct directory so this
`REQUIRES` line is not needed.
Eric Astor [Wed, 21 Jul 2021 15:46:23 +0000 (11:46 -0400)]
[ms] [llvm-ml] Restrict implicit RIP-relative addressing to named-variable references
ML64.EXE applies implicit RIP-relative addressing only to memory references that include a named-variable reference.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/
D105372
Arthur Eubanks [Tue, 20 Jul 2021 21:51:12 +0000 (14:51 -0700)]
[NewPM][Inliner] Check if deleted function is in current SCC
In weird cases, the inliner will inline internal recursive functions,
sometimes causing them to have no more uses, in which case the
inliner will mark the function to be deleted. The function is
actually deleted after the call to
updateCGAndAnalysisManagerForCGSCCPass(). In
updateCGAndAnalysisManagerForCGSCCPass(), UR.UpdatedC may be set to
the SCC containing the function to be deleted. Then the inliner calls
CG.removeDeadFunction() which can cause that SCC to be deleted, even
though it's still stored in UR.UpdatedC.
We could potentially check in the wrappers/pass managers if UR.UpdatedC
is in UR.InvalidatedSCCs before doing anything with it, but it's safer
to do this as close to possible to the call to CG.removeDeadFunction()
to avoid issues with allocating a new SCC in the same address as
the deleted one.
It's hard to find a small test case since we need to have recursive
internal functions be reachable from non-internal functions, yet they
need to become non-recursive and not referenced by other functions when
inlined.
Similar to https://reviews.llvm.org/
D106306.
Fixes PR50788.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/
D106405
Jon Roelofs [Wed, 21 Jul 2021 15:23:17 +0000 (08:23 -0700)]
[MachineVerifier] Make INSERT_SUBREG diagnostic respect operand 2 subregs
This came out of post-commit review: https://reviews.llvm.org/
D105953#inline-
1012919
Thanks uabelho!
Eric Astor [Wed, 21 Jul 2021 15:43:25 +0000 (11:43 -0400)]
[ms] [llvm-ml] Support built-in text macros
Add support for all built-in text macros supported by ML64:
@Date, @Time, @FileName, @FileCur, and @CurSeg.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/
D104965
Eric Astor [Wed, 21 Jul 2021 15:39:41 +0000 (11:39 -0400)]
[ms] [llvm-ml] Add support for numeric built-in symbols
Support @Version and @Line as built-in symbols. For now, resolves @Version to 1427 (the same as for the VS 2019 release of ML.EXE).
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/
D104964
Geoffrey Martin-Noble [Wed, 21 Jul 2021 15:37:38 +0000 (08:37 -0700)]
[Bazel] Remove deprecated td_relative_includes
This has been deprecated for a while and there are no in-tree usages.
I'm not aware of any out-of-tree usages either.
Pushpinder Singh [Wed, 21 Jul 2021 15:15:38 +0000 (16:15 +0100)]
[OpenMP][AMDGCN] Initial math headers support
With this patch, OpenMP on AMDGCN will use the math functions
provided by ROCm ocml library. Linking device code to the ocml will be
done in the next patch.
Reviewed By: JonChesterfield, jdoerfert, scchan
Differential Revision: https://reviews.llvm.org/
D104904
Peter Steinfeld [Mon, 19 Jul 2021 18:41:47 +0000 (11:41 -0700)]
[flang] Implement the runtime portion of the UNPACK intrinsic
I'd previously merged this into the fir-dev branch. This change is to
do the same thing to the main branch of llvm-project.
Differential Revision: https://reviews.llvm.org/
D106294
Uday Bondhugula [Wed, 21 Jul 2021 14:50:59 +0000 (20:20 +0530)]
[MLIR] Add folder for zero trip count affine.for
AffineForOp's folding hook is expected to fold away trivially empty
affine.for. This allows simplification to happen as part of the
canonicalizer and from wherever the folding hook is used. While more
complex analysis based zero trip count detection is available from other
passes in analysis and transforms, simple and inexpensive folding had
been missing.
Also, update/improve affine.for op documentation clarifying semantics of
the result values for zero trip count loops.
Differential Revision: https://reviews.llvm.org/
D106123
Marek Kurdej [Wed, 21 Jul 2021 13:58:17 +0000 (15:58 +0200)]
[libc++] Add `__libcpp_copysign` conditionally constexpr overloads.
This is a spin-off from D79555 review, that with this patch will be able to use `__libcpp_copysign` instead of adhoc `__copysign_constexpr` helper.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/
D106364
Uday Bondhugula [Sun, 18 Jul 2021 04:37:23 +0000 (10:07 +0530)]
[MLIR] Introduce a new rewrite driver to simplify supplied list of ops
Introduce a new rewrite driver (MultiOpPatternRewriteDriver) to rewrite
a supplied list of ops and other ops. Provide a knob to restrict
rewrites strictly to those ops or also to affected ops (but still not to
completely related ops).
This rewrite driver is commonly needed to run any simplification and
cleanup at the end of a transforms pass or transforms utility in a way
that only simplifies relevant IR. This makes it easy to write test cases
while not performing unrelated whole IR simplification that may
invalidate other state at the caller.
The introduced utility provides more freedom to developers of transforms
and transform utilities to perform focussed and local simplification. In
several cases, it provides greater efficiency as well as more
simplification when compared to repeatedly calling
`applyOpPatternsAndFold`; in other cases, it avoids the need to
undesirably call `applyPatternsAndFoldGreedily` to do unrelated
simplification in a FuncOp.
Update a few transformations that were earlier using
applyOpPatternsAndFold (SimplifyAffineStructures,
affineDataCopyGenerate, a linalg transform).
TODO:
- OpPatternRewriteDriver can be removed as it's a special case of
MultiOpPatternRewriteDriver, i.e., both can be merged.
Differential Revision: https://reviews.llvm.org/
D106232
Quinn Pham [Wed, 21 Jul 2021 14:31:35 +0000 (09:31 -0500)]
[PowerPC] Move backend test to fix non PPC bots
Moving `llvm/test/CodeGen/builtins-ppc-xlcompat-fp.ll` to
`llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-fp.ll`
David Spickett [Wed, 21 Jul 2021 14:18:39 +0000 (14:18 +0000)]
[PowerPC] Require power-pc target for new builtin test
The llvm test added in
e002d251dd34fc1855e3a17feafd358d55d92ed8
was missing a REQUIRES. Failed to run on our AArch64 only bot:
https://lab.llvm.org/buildbot/#/builders/171/builds/1262
Kerry McLaughlin [Wed, 21 Jul 2021 13:49:13 +0000 (14:49 +0100)]
Revert "[LV] Use lookThroughAnd with logical reductions"
Reverting patch due to buildbot failures.
This reverts commit
e22a59967251294ccdac6b43a06f48c1b7075240.
Simon Pilgrim [Wed, 21 Jul 2021 13:50:18 +0000 (14:50 +0100)]
[LoopVectorize] Regenerate sve-vector-reverse.ll test checks
Kazu Hirata [Wed, 21 Jul 2021 14:07:53 +0000 (07:07 -0700)]
[InstCombine] Remove CreateOverflowTuple (NFC)
The last use was removed On Jun 3, 2020 in commit
2a6c871596ce8bdd23501a96fd22f0f16d3cfcad.
Quinn Pham [Wed, 21 Jul 2021 12:46:22 +0000 (07:46 -0500)]
[PowerPC] Floating Point Builtins for XL Compat.
This patch is in a series of patches to provide
builtins for compatibility with the XL compiler.
This patch adds builtins related to floating point
operations
Reviewed By: #powerpc, nemanjai, amyk, NeHuang
Differential Revision: https://reviews.llvm.org/
D103986
Jakub Kuderski [Tue, 20 Jul 2021 21:31:14 +0000 (17:31 -0400)]
[ADT] Add initializer_list constructor to SmallDenseMap
Make it easier to initialize small maps inline. Note that DenseMap already has an initializer_list constructor.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/
D106363
Simon Pilgrim [Wed, 21 Jul 2021 13:29:20 +0000 (14:29 +0100)]
[InstCombine] Regenerate gep-custom-dl.ll test checks
Hedin Garca [Tue, 20 Jul 2021 20:25:24 +0000 (20:25 +0000)]
[libc] Include nextafter's functions to Windows's entrypoints
Incorporated the varied functions for nextafter and refactored
NextAfterTest.h to correctly define bitWidthOfType for both
Linux and Windows; by letting FloatProperties take care
of the directives' logic based on the platform being used.
This allows to successfully run nextafter's tests.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/
D106395
Sebastian Neubauer [Wed, 21 Jul 2021 13:20:10 +0000 (15:20 +0200)]
[AMDGPU] Improve killed check for vgpr optimization
The killed flag is not always set. E.g. when a variable is used in a
loop, it is never marked as killed, although it is unused in following
basic blocks. Also, we try to deprecate kill flags and not use them.
Check if the register is live in the endif block. If not, consider it
killed in the then and else blocks.
The vgpr-liverange tests have two new tests with loops
(pre-committed, so the diff is visible).
I also needed to change the subtarget to gfx10.1, otherwise calls
are not working.
Differential Revision: https://reviews.llvm.org/
D106291
Sebastian Neubauer [Wed, 21 Jul 2021 13:15:46 +0000 (15:15 +0200)]
[AMDGPU] Precommit vgpr-liverange tests
Hedin Garca [Tue, 20 Jul 2021 19:58:05 +0000 (19:58 +0000)]
[libc] Append math functions to Window's entrypoints
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/
D106391
Hedin Garca [Tue, 20 Jul 2021 19:00:19 +0000 (19:00 +0000)]
[libc] Exclude few unused bits from x86 state for Windows
Windows fenv_t does not include the MXCSR register and
the unused bits at the end of the x87 status. So we
exclude them in our struct definitions to make it
easy to read/write the state. getEnv and setEnv
were also excluded to avoid using MXCSR, but a
forthcoming patch will handle these functions.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/
D106386
Deep Majumder [Wed, 21 Jul 2021 12:49:57 +0000 (18:19 +0530)]
[analyzer] Fix for faulty namespace test in SmartPtrModelling
This patch:
- Fixes how the std-namespace test is written in SmartPtrModelling
(now accounts for functions with no Decl available)
- Adds the smart pointer checker flag check where it was missing
Differential Revision: https://reviews.llvm.org/
D106296
Kirill Bobyrev [Wed, 21 Jul 2021 12:50:40 +0000 (14:50 +0200)]
[clangd] Cleanup FuzzyFindRequest serialization and dex benchmark
* Due to the LLVM's JSON library changes (?), FuzzyFindRequest serialization is
no longer valid since arrays are serialized as llvm::json::Array already.
Hence, current implementation creates a nested array.
* YAML format is no longer the default, mention this for the benchmark.
* FIXME is no longer relevant. I ran benchmarks that showed no improvement with
priority_queue years ago.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/
D106432
Guillaume Chatelet [Wed, 21 Jul 2021 12:48:09 +0000 (12:48 +0000)]
[llvm] Add enum iteration to Sequence
This patch allows iterating typed enum via the ADT/Sequence utility.
It also changes the original design to better separate concerns:
- `StrongInt` only deals with safe `intmax_t` operations,
- `SafeIntIterator` presents the iterator and reverse iterator
interface but only deals with safe `StrongInt` internally.
- `iota_range` only deals with `SafeIntIterator` internally.
This design ensures that operations are always valid. In particular,
"Out of bounds" assertions fire when:
- the `value_type` is not representable as an `intmax_t`
- iterator operations make internal computation underflow/overflow
- the internal representation cannot be converted back to `value_type`
Differential Revision: https://reviews.llvm.org/
D106279
Simon Pilgrim [Wed, 21 Jul 2021 12:40:41 +0000 (13:40 +0100)]
[InstCombine] Add multiuse test for
D106352
David Spickett [Wed, 21 Jul 2021 12:37:28 +0000 (12:37 +0000)]
[compiler-rt][hwasan] Update register-dump-read.c test
Since
d564cfb53c71dbbbd46b6719f5fe53d70313de45 moved
__hwasan_tag_mismatch4 this test has been reporting
a frame 0 of __hwasan_tag_mismatch_v2.
This failure can be seen on our bots:
https://lab.llvm.org/buildbot/#/builders/185/builds/170
Before the change:
#0 0xaaaaba100e40 in main <...>/register-dump-read.c:21:10
After the change:
#0 0xaaaab8494bec in __hwasan_tag_mismatch_v2 <...>/hwasan/hwasan_tag_mismatch_aarch64.S:147
#1 0xaaaab84b4df8 in main <..>/register-dump-read.c:14:10
Update the test to check for a main frame as either frame
0 or frame 1.
Roman Lebedev [Wed, 21 Jul 2021 12:21:37 +0000 (15:21 +0300)]
[NFC][VectorCombine] Load widening: add a few more negative tests
Simon Pilgrim [Wed, 21 Jul 2021 10:59:08 +0000 (11:59 +0100)]
IFSStub.cpp - consistently use default case to silence 'not all control paths return' MSVC warnings. NFCI.
David Green [Wed, 21 Jul 2021 10:34:30 +0000 (11:34 +0100)]
[LV] Make use of PatternMatchers in getReductionPatternCost. NFC
Pulled out of
D106166, this modifies getReductionPatternCost to use
PatternMatchers, hopefully simplifying the code a little.
Jay Foad [Tue, 13 Jul 2021 16:03:57 +0000 (17:03 +0100)]
[AMDGPU] NFC refactoring in isel for buffer access intrinsics
Rename getBufferOffsetForMMO to updateBufferMMO and pass in the MMO to
be updated, in preparation for the bug fix in
D106284.
Call updateBufferMMO consistently for all buffer intrinsics, even the
ones that use setBufferOffsets to decompose a combined offset
expression.
Add a getIdxEn helper function.
Differential Revision: https://reviews.llvm.org/
D106354
Gabor Marton [Tue, 20 Jul 2021 15:34:02 +0000 (17:34 +0200)]
[Analyzer][solver][NFC] Add explanatory comments to trivial eq classes
Differential Revision: https://reviews.llvm.org/
D106370
Simon Tatham [Wed, 21 Jul 2021 08:17:33 +0000 (09:17 +0100)]
[clang] Introduce SourceLocation::[U]IntTy typedefs.
This is part of a patch series working towards the ability to make
SourceLocation into a 64-bit type to handle larger translation units.
NFC: this patch introduces typedefs for the integer type used by
SourceLocation and makes all the boring changes to use the typedefs
everywhere, but for the moment, they are unconditionally defined to
uint32_t.
Patch originally by Mikhail Maltsev.
Reviewed By: tmatheson
Differential Revision: https://reviews.llvm.org/
D105492
Sam McCall [Wed, 21 Jul 2021 09:31:52 +0000 (11:31 +0200)]
[clangd] Remove big PreambleData constructor. NFC
Rosie Sumpter [Thu, 15 Jul 2021 13:08:30 +0000 (14:08 +0100)]
[LoopFlatten][LoopInfo] Use Loop to identify latch compare instruction
Make getLatchCmpInst non-static and use it in LoopFlatten as a more
robust way of identifying the compare.
Differential Revision: https://reviews.llvm.org/
D106256
Sven van Haastregt [Wed, 21 Jul 2021 09:01:19 +0000 (10:01 +0100)]
[OpenCL] Add cl_khr_extended_bit_ops
Add the builtins defined by Section 40 "Extended Bit Operations" in
the OpenCL Extension Specification.
Differential Revision: https://reviews.llvm.org/
D106267
Kerry McLaughlin [Mon, 19 Jul 2021 12:32:11 +0000 (13:32 +0100)]
[LV] Use lookThroughAnd with logical reductions
If a reduction Phi has a single user which `AND`s the Phi with a type mask,
`lookThroughAnd` will return the user of the Phi and the narrower type represented
by the mask. Currently this is only used for arithmetic reductions, whereas loops
containing logical reductions will create a reduction intrinsic using the widened
type, for example:
for.body:
%phi = phi i32 [ %and, %for.body ], [ 255, %entry ]
%mask = and i32 %phi, 255
%gep = getelementptr inbounds i8, i8* %ptr, i32 %iv
%load = load i8, i8* %gep
%ext = zext i8 %load to i32
%and = and i32 %mask, %ext
...
^ this will generate an and reduction intrinsic such as the following:
call i32 @llvm.vector.reduce.and.v8i32(<8 x i32>...)
The same example for an add instruction would create an intrinsic of type i8:
call i8 @llvm.vector.reduce.add.v8i8(<8 x i8>...)
This patch changes AddReductionVar to call lookThroughAnd for other integer
reductions, allowing loops similar to the example above with reductions such
as and, or & xor to vectorize.
Reviewed By: david-arm, dmgreen
Differential Revision: https://reviews.llvm.org/
D105632
Jan Kratochvil [Wed, 21 Jul 2021 08:41:44 +0000 (10:41 +0200)]
[nfc] [lldb] Rename GetRnglist() to GetRnglistTable()
My D99653 implemented a getter GetRnglist() for m_rnglist_table.
That was confusing as the getter returns DWARFDebugRnglistTable which
contains DWARFDebugRnglist as its elements.
Cullen Rhodes [Wed, 21 Jul 2021 08:35:34 +0000 (08:35 +0000)]
[AArch64][SME] Support .arch and .arch_extension assembler directives
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/
D105566
Tim Northover [Wed, 21 Jul 2021 08:06:51 +0000 (09:06 +0100)]
ARM: don't return by popping PC if we have to adjust the stack afterwards.
In mandatory tail calling conventions we might have to deallocate stack
space used by our arguments before return. This happens after popping
CSRs, so the pop cannot be turned into the return itself in this case.
The else branch here was already a nop, so removing it as a tidy-up.
Tim Northover [Wed, 21 Jul 2021 08:05:56 +0000 (09:05 +0100)]
AArch64: support 8 & 16-bit atomic operations in GlobalISel
We have SelectionDAG patterns for 8 & 16-bit atomic operations, but they
assume the value types will have been legalized to 32-bits. So this adds
the ability to widen them to both AArch64 & generic GISel
infrastructure.
Cullen Rhodes [Wed, 21 Jul 2021 08:20:01 +0000 (08:20 +0000)]
[AArch64][SME] Add mova instructions
This patch adds the mova instruction to insert/extract an SVE vector
register to/from a ZA tile vector.
The preferred MOV aliases are also implemented.
Depends on
D105572.
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-06
Reviewed By: david-arm, CarolineConcatto
Differential Revision: https://reviews.llvm.org/
D105574
Cullen Rhodes [Wed, 21 Jul 2021 07:51:22 +0000 (07:51 +0000)]
[AArch64][SME] Add ldr and str instructions
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-06
Reviewed By: kmclaughlin
Differential Revision: https://reviews.llvm.org/
D105573
Siva Chandra Reddy [Wed, 21 Jul 2021 08:06:58 +0000 (08:06 +0000)]
[libc][Obvious] Fix few typos in FPUtil/TestHelpers.cpp
Dmitry Vyukov [Wed, 21 Jul 2021 07:10:00 +0000 (09:10 +0200)]
sanitizer_common: revert StaticSpinMutex ctor
Patch "sanitizer_common: modernize SpinMutex" added default
ctor to StaticSpinMutex. But it broke some gcc bots with:
scudo_tsd_exclusive.cpp:25:22: error: non-local variable
‘__scudo::TSD’ declared ‘__thread’ needs dynamic initialization
https://lab.llvm.org/buildbot/#/builders/105/builds/12649
Unfortunatly none of empty ctor {}, no ctor, default constexpr ctor
work for different reasons. So remove StaticSpinMutex ctor
entirely and move deleted copy ctor back to SpinMutex.
Differential Revision: https://reviews.llvm.org/
D106424
Timm Bäder [Tue, 20 Jul 2021 15:10:34 +0000 (17:10 +0200)]
[llvm][tools] Hide more unrelated LLVM tool options
Differential Revision: https://reviews.llvm.org/
D106366
Balázs Kéri [Tue, 20 Jul 2021 13:23:14 +0000 (15:23 +0200)]
[clang][analyzer] Improve report of file read at EOF condition (alpha.unix.Stream checker).
The checker warns if a stream is read that is already in end-of-file
(EOF) state.
The commit adds indication of the last location where the EOF flag is set
on the stream.
Reviewed By: Szelethus
Differential Revision: https://reviews.llvm.org/
D104925
Dmitry Vyukov [Tue, 20 Jul 2021 08:36:41 +0000 (10:36 +0200)]
sanitizer_common: modernize SpinMutex
Some minor improvements:
1. Make StaticSpinMutex non-copyable.
2. Add LIKELY to Lock.
3. Move LockSlow into the .cpp file (now that we have it).
4. The only non-trivial change: use proc_yield(1) instread of proc_yield(10)
with the proportional increase in the number of spin iterations.
Latency of the PAUSE instruction has raised from ~1 cycle to ~100 cycles
in the recent Intel CPUs. So proc_yield(10) is too aggressive backoff.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/
D106350
Mark de Wever [Wed, 21 Jul 2021 06:06:03 +0000 (08:06 +0200)]
[libc++][nfc] Adds a missing generated file.
The file was created by libcxx/utils/generate_private_header_tests.py.
Mark de Wever [Tue, 20 Jul 2021 17:26:01 +0000 (19:26 +0200)]
[lbc++][nfc] Use _LIBCPP_HIDE_FROM_ABI.
This replaces _LIBCPP_INLINE_VISIBILITY with _LIBCPP_HIDE_FROM_ABI. It's
not intended to do for other parts of libc++. This change makes it easy
to search and replace all occurrences of the patches in review.
Lang Hames [Wed, 21 Jul 2021 05:48:42 +0000 (15:48 +1000)]
[ORC][ORC-RT] Revert MachO TLV patches while I investigate more bot failures.
This reverts commit
d4abdefc998a1ee19d5edc79ec233774cbf64f6a ("[ORC-RT] Rename
macho_tlv.x86-64.s to macho_tlv.x86-64.S (uppercase suffix)", and
a7733e9556b5a6334c910f88bcd037e84e17e3fc ("Re-apply "[ORC][ORC-RT] Add initial
native-TLV support to MachOPlatform."), while I investigate failures on
ccache builders (e.g. https://lab.llvm.org/buildbot/#/builders/109/builds/18981)
Siva Chandra Reddy [Wed, 21 Jul 2021 05:49:19 +0000 (05:49 +0000)]
[libc][NFC] Adjust enabled_exceptions_test wrt FE_INEXACT.
Since exceptions like FE_DIVBYZERO can raise FE_INEXACT, we need to
ensure that we don't raise FE_DIVBYZERO (or others which can also raise
FE_INEXACT) when FE_INEXACT is enabled.
Lang Hames [Wed, 21 Jul 2021 05:24:24 +0000 (15:24 +1000)]
[ORC-RT] Rename macho_tlv.x86-64.s to macho_tlv.x86-64.S (uppercase suffix)
Uppercase .S suffixes for assembly seem to be the convention in compiler-rt.
I'm hoping this will fix the build failures on ccache builders (e.g.
https://lab.llvm.org/buildbot/#/builders/109/builds/18980)
Lang Hames [Tue, 20 Jul 2021 23:24:41 +0000 (09:24 +1000)]
Re-apply "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
Reapplies
fe1fa43f16beac1506a2e73a9f7b3c81179744eb, which was reverted in
6d8c63946cc259c0af02584b7cc690dde11dea35, with fixes:
1. Remove .subsections_via_symbols directive from macho_tlv.x86-64.s (it's
not needed here anyway).
2. Return error from pthread_key_create to the MachOPlatform to silence unused
variable warning.
Siva Chandra Reddy [Thu, 15 Jul 2021 16:57:36 +0000 (16:57 +0000)]
[libc] Add a new test matcher for tests raising floating point exceptions.
This new matcher does not use death tests to check if SIGFPE is raised.
Instead, that a SIGFPE was raised is checked using a SIGFPE signal handler.
Reviewed By: mcgrathr
Differential Revision: https://reviews.llvm.org/
D106086
Chia-hung Duan [Wed, 21 Jul 2021 03:23:06 +0000 (11:23 +0800)]
[mlir-tblgen] Support binding multi-results of NativeCodeCall
We are able to bind NativeCodeCall result as binding operation. To make
table-gen have better understanding in the form of helper function,
we need to specify the number of return values in the NativeCodeCall
template. A VoidNativeCodeCall is added for void case.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/
D102160
Tianqing Wang [Wed, 21 Jul 2021 02:21:51 +0000 (10:21 +0800)]
[X86] Update MachineLoopInfo in CMOV conversion.
If a CMOV is in a loop and is converted to branches, CMOV conversion wouldn't
add newly created basic blocks to loop info. Since the candidates is collected
based on loops, instructions in these basic blocks will be ignored.
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/
D104623
peter klausler [Wed, 21 Jul 2021 02:40:43 +0000 (19:40 -0700)]
[flang] Two tweaks to mollify buildbots
One test's expected output needs adjustment, and one new compiler
warning needs to be silenced.
Ben Shi [Wed, 21 Jul 2021 02:15:31 +0000 (10:15 +0800)]
[RISCV][test] Add tests for mul optimization in the zba extension with SH*ADD
These tests will show the following optimization by future patches.
(mul x, 11) -> (SH1ADD (SH2ADD x, x), x)
(mul x, 19) -> (SH1ADD (SH3ADD x, x), x)
(mul x, 13) -> (SH2ADD (SH1ADD x, x), x)
(mul x, 21) -> (SH2ADD (SH2ADD x, x), x)
(mul x, 37) -> (SH2ADD (SH3ADD x, x), x)
(mul x, 25) -> (SH3ADD (SH1ADD x, x), x)
(mul x, 41) -> (SH3ADD (SH2ADD x, x), x)
(mul x, 73) -> (SH3ADD (SH3ADD x, x), x)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D106031
Vitaly Buka [Wed, 21 Jul 2021 02:08:12 +0000 (19:08 -0700)]
[NFC][hwasan] Remove "pragma GCC poison"
With ifdefs they make code less readable.
Vitaly Buka [Wed, 21 Jul 2021 02:00:11 +0000 (19:00 -0700)]
[NFC][hwasan] Simplify expression
Hsiangkai Wang [Tue, 20 Jul 2021 03:36:48 +0000 (11:36 +0800)]
[Clang][RISCV] Add half-precision FP for vle16/vse16.
I missed to add half-precision FP types for vle16/vse16 in the previous
patches. Added them in this patch.
Differential Revision: https://reviews.llvm.org/
D106340
Alexander Yermolovich [Wed, 21 Jul 2021 01:16:11 +0000 (18:16 -0700)]
[DWP] Fix for Refactoring llvm-dwp in to a library
Fix build for https://reviews.llvm.org/
D106198 when -DBUILD_SHARED_LIBS=ON. Test Plan:
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/
D106414
Jacques Pienaar [Wed, 21 Jul 2021 01:15:15 +0000 (18:15 -0700)]
[mlir] Use OpTraitList to define InferTensorType. NFC
Stella Laurenzo [Tue, 20 Jul 2021 22:53:15 +0000 (15:53 -0700)]
Remove libMLIRPublicAPI DSO.
libMLIRPublicAPI.so came into existence early when the Python and C-API were being co-developed because the Python extensions need a single DSO which exports the C-API to link against. It really should never have been exported as a mondo library in the first place, which has caused no end of problems in different linking modes, etc (i.e. the CAPI tests depended on it).
This patch does a mechanical move that:
* Makes the C-API tests link directly to their respective libraries.
* Creates a libMLIRPythonCAPI as part of the Python bindings which assemble to exact DSO that they need.
This has the effect that the C-API is no longer monolithic and can be subset and used piecemeal in a modular fashion, which is necessary for downstreams to only pay for what they use. There are additional, more fundamental changes planned for how the Python API is assembled which should make it more out of tree friendly, but this minimal first step is necessary to break the fragile dependency between the C-API and Python API.
Downstream actions required:
* If using the C-API and linking against MLIRPublicAPI, you must instead link against its constituent components. As a reference, the Python API dependencies are in lib/Bindings/Python/CMakeLists.txt and approximate the full set of dependencies available.
* If you have a Python API project that was previously linking against MLIRPublicAPI (i.e. to add its own C-API DSO), you will want to `s/MLIRPublicAPI/MLIRPythonCAPI/` and all should be as it was. There are larger changes coming in this area but this part is incremental.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/
D106369
Vitaly Buka [Wed, 21 Jul 2021 00:47:01 +0000 (17:47 -0700)]
[lsan] Remove undefined ENV variables
Vitaly Buka [Wed, 21 Jul 2021 00:46:05 +0000 (17:46 -0700)]
[lsan] Remove %pull_from_device from tests
Replaced with %adb_shell cat.
Vitaly Buka [Wed, 21 Jul 2021 00:37:36 +0000 (17:37 -0700)]
[compiler-rt] Fix %device_rundir test substitution
"/" needs to be removed to avoid making absolute path.
Jon Roelofs [Wed, 14 Jul 2021 00:07:48 +0000 (17:07 -0700)]
[MachineVerifier] Diagnose invalid INSERT_SUBREGs
Differential revision: https://reviews.llvm.org/
D105953
Geoffrey Martin-Noble [Wed, 21 Jul 2021 00:22:33 +0000 (17:22 -0700)]
[Bazel] Remove copypasta from linalggen.bzl
peter klausler [Wed, 21 Jul 2021 00:22:13 +0000 (17:22 -0700)]
[flang] Remove now-unused private data member, silence warning
A field in DescriptorAddendum became unused during a recent
change but was not removed from the definition; it now elicits
a legitimate warning that's affecting some buildbots. Remove it.
LLVM GN Syncbot [Wed, 21 Jul 2021 00:19:59 +0000 (00:19 +0000)]
[gn build] Port
403e67d34d03
Alexander Yermolovich [Wed, 21 Jul 2021 00:12:21 +0000 (17:12 -0700)]
[DWP] Refactoring llvm-dwp in to a library.
This is a step1, mechanical refactor, of moving the bulk of llvm-dwp functionality in to a library. This should allow other tools, like BOLT, to re-use some of the llvm-dwp functionality.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/
D106198
Jon Roelofs [Tue, 6 Jul 2021 15:28:11 +0000 (08:28 -0700)]
[GlobalISel] Tail call memcpy/memmove/memset even in the presence of copies
Differentail revision: https://reviews.llvm.org/
D105382
Jon Roelofs [Fri, 2 Jul 2021 20:08:57 +0000 (13:08 -0700)]
[GlobalISel] Mark memcpy/memmove/memset as thisreturn
https://clang.godbolt.org/z/9az64j8W6
rdar://
77466123
Differential revision: https://reviews.llvm.org/
D105370
Hanhan Wang [Wed, 21 Jul 2021 00:03:26 +0000 (17:03 -0700)]
[mlir][Linalg] Update signatures of the callback functions.
This allows caller to use non-const functions, e.g., `getOperandNumber`, etc. It
is expected that OpOperand is not modified in a callback function.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/
D106322
Geoffrey Martin-Noble [Tue, 20 Jul 2021 23:23:33 +0000 (16:23 -0700)]
[Bazel] Remove explicit relative_to_caller_repository
This is the default and the argument is deprecated. The documentation
indicating it's the default is only since 4.0
(https://docs.bazel.build/versions/4.0.0/skylark/lib/Label.html#Label),
but looking at the code it has been the default since its introduction
in https://bazel.googlesource.com/bazel/+/
6f15335dea with Bazel 0.2.1
(https://bazel.googlesource.com/bazel/+show/0.2.1/CHANGELOG.md)
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/
D106411
Walter Erquinigo [Sat, 17 Jul 2021 02:16:03 +0000 (19:16 -0700)]
[intel pt] Add TSC timestamps
Differential Revision: https://reviews.llvm.org/
D106328
Lang Hames [Tue, 20 Jul 2021 23:22:55 +0000 (09:22 +1000)]
Revert "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
Reverts commit
fe1fa43f16beac1506a2e73a9f7b3c81179744eb while I investigate
failures on Linux.
Lang Hames [Tue, 20 Jul 2021 06:41:34 +0000 (16:41 +1000)]
[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform.
Adds code to LLVM (MachOPlatform) and the ORC runtime to support native MachO
thread local variables. Adding new TLVs to a JITDylib at runtime is supported.
On the LLVM side MachOPlatform is updated to:
1. Identify thread local variables in the LinkGraph and lower them to GOT
accesses to data in the __thread_data or __thread_bss sections.
2. Merge and report the address range of __thread_data and thread_bss sections
to the runtime.
On the ORC runtime a MachOTLVManager class introduced which records the address
range of thread data/bss sections, and creates thread-local instances from the
initial data on demand. An orc-runtime specific tlv_get_addr implementation is
included which saves all register state then calls the MachOTLVManager to get
the address of the requested variable for the current thread.
Lang Hames [Tue, 20 Jul 2021 08:16:39 +0000 (18:16 +1000)]
[JITLink][MachO] Detect MachO::S_THREAD_LOCAL_ZEROFILL sections as zero-fill.
This will be used in upcoming MachO native TLV support patches to LLVM and
the ORC runtime.
Lang Hames [Tue, 20 Jul 2021 10:28:29 +0000 (20:28 +1000)]
[JITLink] Add support for moving blocks and symbols between sections.
LinkGraph::transferBlock can be used to move a block and all associated symbols
from one section to another.
LinkGraph::mergeSections moves all blocks and sections from a source section to
a destination section.
Albion Fung [Tue, 20 Jul 2021 21:58:20 +0000 (16:58 -0500)]
[PowerPC] Implemented mtmsr, mfspr, mtspr Builtins
Implemented builtins for mtmsr, mfspr, mtspr on PowerPC;
the patch is intended for XL Compatibility.
Differential revision: https://reviews.llvm.org/
D106130
Aditya Nandakumar [Tue, 20 Jul 2021 22:44:59 +0000 (15:44 -0700)]
[NFC][AssemblyWriter] Allow AssemblyWriter::printBasicBlock() to print blocks that don't have parents.
Remove the assert in AssemblyWriter::printBasicBlock() and
in BasicBlock::isEntryBlock() that require blocks to have parents.
Instead, have BasicBlock::isEntryBlock() return false for unattached
blocks. This allows us to call these functions for blocks that are
not yet added to a module which is a useful debugging capability.
Committing for xiaoqing_wu
https://reviews.llvm.org/D106127k
Jon Roelofs [Tue, 20 Jul 2021 22:37:16 +0000 (15:37 -0700)]
[tests] Move new tests into the PowerPC folder
That way they get marked as UNSUPPORTED by LIT when the ppc backend has not
been built.
Jon Roelofs [Tue, 20 Jul 2021 18:01:54 +0000 (11:01 -0700)]
[AArch64][GlobalISel] Legalize ctpop for v2s64, v2s32, v4s32, v4s16, v8s16
https://llvm.godbolt.org/z/nTTK6M5qe
Differential revision: https://reviews.llvm.org/
D106388
Fangrui Song [Tue, 20 Jul 2021 22:27:51 +0000 (15:27 -0700)]
[ELF][test] Add -DAG
The guid of a local linkage variable has the module path encoded, so the
order between a local linkage variable and a non-local linkage variable
isn't guaranteed.
Sanjay Patel [Tue, 20 Jul 2021 22:23:20 +0000 (18:23 -0400)]
[ConstantFolding] avoid crashing on a fake math library call
https://llvm.org/PR50960
peter klausler [Tue, 20 Jul 2021 18:39:21 +0000 (11:39 -0700)]
[flang] Don't require newline at EOF in unformatted sequential runtime input
F18 was sigalling an end-of-file error condition when reading an
unformatted sequential input file without an ultimate newline
(or CR-LF). Other Fortran implementations can handle it, so change
the runtime to support it.
Differential Revision: https://reviews.llvm.org/
D106321
peter klausler [Mon, 19 Jul 2021 18:53:20 +0000 (11:53 -0700)]
[flang] Run-time derived type initialization and destruction
Use derived type information tables to drive default component
initialization (when needed), component destruction, and calls to
final subroutines. Perform these operations automatically for
ALLOCATE()/DEALLOCATE() APIs for allocatables, automatics, and
pointers. Add APIs for use in lowering to perform these operations
for non-allocatable/automatic non-pointer variables.
Data pointer component initialization supports arbitrary constant
designators, a F'2008 feature, which may be a first for Fortran
implementations.
Differential Revision: https://reviews.llvm.org/
D106297
Rob Suderman [Tue, 20 Jul 2021 22:07:04 +0000 (15:07 -0700)]
[mlir][tosa] Added tosa to linalg lowering to unstrided transposed conv
The unstrided transposed conv can be represented as a regular convolution.
Lower to this variant to handle the basic case. This includes transitioning from
the TC defined convolution operation and a yaml defined one.
Reviewed By: NatashaKnk
Differential Revision: https://reviews.llvm.org/
D106389
Geoffrey Martin-Noble [Tue, 20 Jul 2021 21:33:50 +0000 (14:33 -0700)]
[Bazel] Fix Exegesis target reference and remove stray visibility