Georgii Rymar [Tue, 11 Feb 2020 11:13:16 +0000 (14:13 +0300)]
[yaml2obj][test] - Simplify the test: yaml2obj/ELF/call-graph-profile-section.yaml
Now with the new functionality that allows creating "defines", it is
possible to reduce this test (I tried to find another ones, but seems others
were already fixed previously).
Differential revision: https://reviews.llvm.org/D74392
Nicolai Hähnle [Tue, 11 Feb 2020 13:40:00 +0000 (14:40 +0100)]
AMDGPU: llvm.amdgcn.writelane is a source of divergence
Summary:
Consider:
%r = call i32 @llvm.amdgcn.writelane(i32 0, i32 1, i32 2)
This produces a value that is 0 on lane 1, and 2 everywhere else; i.e.,
it is divergent.
Reported-by: Marek Olsak <Marek.Olsak@amd.com>
Reviewers: arsenm, foad, mareko
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74400
Nicolai Hähnle [Fri, 7 Feb 2020 21:08:36 +0000 (22:08 +0100)]
SelectionDAG: Fix bug in ClusterNeighboringLoads
Summary:
The method attempts to find loads that can be legally clustered by
looking for loads consuming the same chain glue token.
However, the old code looks at _all_ users of values produced by the
chain node -- including uses of the loaded/returned value of volatile
loads or atomics. This could lead to circular dependencies which then
failed during scheduling.
With this change, we filter out users by getResNo, i.e. by which
SDValue value they use, to ensure that we only look at users of the
chain glue token.
This appears to be a rather old bug, which is perhaps surprising.
However, the test case is actually quite fragile (i.e., it is hidden
by fairly small changes), and the test _must_ use volatile loads for
the bug to manifest.
Reviewers: arsenm, bogner, craig.topper, foad
Subscribers: MatzeB, jvesely, wdng, hiraditya, javed.absar, jfb, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74253
Raphael Isemann [Wed, 12 Feb 2020 07:56:03 +0000 (08:56 +0100)]
[lldb][NFC] Move all completer subclasses into source file
They are all implementation details so let's keep them out of the interface.
Also makes this code more readable by keeping these small classes
not spread over header and source file.
Alexander Belyaev [Wed, 12 Feb 2020 08:04:15 +0000 (09:04 +0100)]
[MLIR] Support memrefs with complex element types.
Differential Revision: https://reviews.llvm.org/D74307
Kazushi (Jam) Marukawa [Wed, 12 Feb 2020 08:01:30 +0000 (09:01 +0100)]
[VE] Bit operator isel
Summary: Isel and tests for bswap,brev,ctpop,ctlz,ctty,rotl,rotr
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D74304
Raphael Isemann [Wed, 12 Feb 2020 06:57:00 +0000 (07:57 +0100)]
[lldb][NFC] Remove eCustomCompletion mode
It's not used by anyone. Also if something implements its own
completion it could just not call the method instead of having
a parameter that makes the function a no-op.
Craig Topper [Wed, 12 Feb 2020 07:27:26 +0000 (23:27 -0800)]
[X86] Add test case for SoftPromoteHalf of STRICT_FP_EXTEND/STRICT_FP_ROUND.
Tests that should have been with
0daf9b8e41327b1511b2bbc272184ff4fdb8de79
Craig Topper [Wed, 12 Feb 2020 07:16:32 +0000 (23:16 -0800)]
[X86] Remove unnecessary hasSideEffects = 0, mayLoad = 1 from an instruction with a pattern. NFC
Craig Topper [Wed, 12 Feb 2020 07:13:28 +0000 (23:13 -0800)]
[X86] Correct the predicate on some patterns for 128 and 256 EVEX versions of VCVTPS2PH.
These should require AVX512VL not AVX512F. The legacy VEX patterns
will match first unless AVX512VL is enabled so this doesn't cause
a functional issue.
Igor Kudrin [Mon, 8 Jul 2019 14:55:36 +0000 (21:55 +0700)]
[DebugInfo] Add support for DWARF64 into DWARFDebugAddr.
Differential Revision: https://reviews.llvm.org/D74198
Igor Kudrin [Thu, 6 Feb 2020 07:14:12 +0000 (14:14 +0700)]
[DebugInfo] Simplify DWARFDebugAddr.
The patch removes unnecessary members of DWARFDebugAddr and further
simplifies the implementation by separating parsing methods of tables
in the DWARFv5 and pre-standard formats.
Differential Revision: https://reviews.llvm.org/D74197
Igor Kudrin [Thu, 6 Feb 2020 09:30:30 +0000 (16:30 +0700)]
[DebugInfo] Refine error messages in DWARFDebugAddr.
As a preparation for the subsequent patches, this updates the wordings
of some error messages in DWARFDebugAddr.
Differential Revision: https://reviews.llvm.org/D74196
Igor Kudrin [Tue, 11 Feb 2020 08:55:12 +0000 (15:55 +0700)]
[DebugInfo] Use "an address table" in diagnostic messages of DWARFDebugAddr.
This replaces a collocation "a .debug_addr table" with "an address table"
because the latter sounds more accurate.
Differential Revision: https://reviews.llvm.org/D74407
Igor Kudrin [Thu, 6 Feb 2020 13:34:10 +0000 (20:34 +0700)]
[DebugInfo] Do not dump header field for pre-DWARFv5 address tables.
As there is no header in pre-DWARFv5 address tables, and we fill
the class data members with some artificial values, we should not
dump them as that might be misleading.
Differential Revision: https://reviews.llvm.org/D74195
Igor Kudrin [Tue, 11 Feb 2020 12:43:20 +0000 (19:43 +0700)]
[DebugInfo] Fix reading addresses in DWARFDebugAddr.
As addresses in the address tables may have relocations, thus,
the relocations should be resolved to read the correct address.
That is especially important for targets that use RELA relocations
because in that case addends are stored in relocation sections.
Differential Revision: https://reviews.llvm.org/D74404
Craig Topper [Wed, 12 Feb 2020 04:24:51 +0000 (20:24 -0800)]
[X86][LegalizeTypes] Add SoftPromoteHalf support STRICT_FP_EXTEND and STRICT_FP_ROUND
This adds a strict version of FP16_TO_FP and FP_TO_FP16 and uses
them to implement soft promotion for the half type. This is
enough to provide basic support for __fp16 with strictfp.
Add the necessary X86 support to use VCVTPS2PH/VCVTPH2PS when F16C
is enabled.
Raphael Isemann [Wed, 12 Feb 2020 06:13:48 +0000 (07:13 +0100)]
[lldb] Remove skipIfFreeBSD from TestCompletion
This was skipped because of an pexpect issue (http://llvm.org/pr22784),
but this test is no longer using pexpect and is running fine on FreeBSD.
Fangrui Song [Wed, 12 Feb 2020 04:45:05 +0000 (20:45 -0800)]
[CMake] Delete llvm_add_go_executable and a reference to TARGET llvm-go
llvm-go was deleted by
102814b4d36ad004a2e37cd2a1e84bd2c3593d29.
Yuanfang Chen [Wed, 12 Feb 2020 04:39:34 +0000 (20:39 -0800)]
Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""
This reverts commit rGcd5b308b828e, rGcd5b308b828e, rG8cedf0e2994c.
There are issues to be investigated for polly bots and bots turning on
EXPENSIVE_CHECKS.
Davide Italiano [Wed, 12 Feb 2020 04:30:12 +0000 (20:30 -0800)]
[TestConstVariable] Clean-up XFAIL lists.
These versions of `clang` are ancient history.
Matt Arsenault [Tue, 11 Feb 2020 20:13:42 +0000 (15:13 -0500)]
AMDGPU: Use conditions directly in division expansion
This was creating a select on true/false values, and then comparing
that later. This produced more work for later combines, which can be
avoided by just using the boolean values. This was copied from the
original DAG expansion, which also has the same problem. This doesn't
have a observable change using SelectionDAG, but since GlobalISel is
missing these optimizations, the final code was noticeably longer.
Johannes Doerfert [Wed, 12 Feb 2020 04:06:32 +0000 (22:06 -0600)]
[OpenMP][Offloading] Added support for multiple streams so that multiple kernels can be executed concurrently
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D74145
Yuanfang Chen [Wed, 12 Feb 2020 03:18:23 +0000 (19:18 -0800)]
Temporarily XFAIL these two tests.
llvm/test/CodeGen/X86/inline-asm-avx-v-constraint-32bit.ll
llvm/test/CodeGen/X86/inline-asm-avx512vl-v-constraint-32bit.ll
Yuanfang Chen [Wed, 12 Feb 2020 02:34:34 +0000 (18:34 -0800)]
Fix two more test cases for https://reviews.llvm.org/D74456.
Yuanfang Chen [Tue, 11 Feb 2020 02:33:05 +0000 (18:33 -0800)]
Reland "[Support] make report_fatal_error `abort` instead of `exit`"
Summary:
Reland D67847 after D73742 is committed. Replace `sys::Process::Exit(1)`
with `abort` in `report_fatal_error`.
After this patch, for tools turning on `CrashRecoveryContext`,
crash handler installed by `CrashRecoveryContext` is called unless
they installed a non-returning handler using `llvm::install_fatal_error_handler`
like `cc1_main` currently does.
Reviewers: rnk, MaskRay, aganea, hans, espindola, jhenderson
Subscribers: jholewinski, qcolombet, dschuff, jyknight, emaste, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, rupprecht, jocewei, jsji, Jim, dmgreen, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, kerbowa, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74456
Mehdi Amini [Wed, 12 Feb 2020 02:05:31 +0000 (02:05 +0000)]
Removed declared but non-existent createMaterializeVectorsPass() (NFC)
Sam Clegg [Fri, 20 Dec 2019 01:30:24 +0000 (17:30 -0800)]
[lld][WebAssembly] Fail if bitcode objects are pulled in after LTO
This can happen if lto::LTO::getRuntimeLibcallSymbols doesn't return
an complete/accurate list of libcalls. In this case new bitcode
object can be linked in after LTO.
For example the WebAssembly backend currently calls:
setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2");
But `__truncsfhf2` is not part of `getRuntimeLibcallSymbols` so if
this symbol is generated during LTO the link will currently fail.
Without this change the linker crashes because the bitcode symbol
makes it all the way to the output phase.
See: https://bugs.llvm.org/show_bug.cgi?id=44353
Differential Revision: https://reviews.llvm.org/D71632
Sam Clegg [Sat, 8 Feb 2020 02:15:15 +0000 (18:15 -0800)]
[compiler-rt] Compile __powitf2 under wasm
See https://github.com/emscripten-core/emscripten/issues/10374
See https://reviews.llvm.org/D74274
Differential Revision: https://reviews.llvm.org/D74275
Fangrui Song [Wed, 12 Feb 2020 01:17:08 +0000 (17:17 -0800)]
[test] Improve test/CodeGen/X86/linux-preemption.ll
Austin Kerbow [Fri, 7 Feb 2020 16:29:23 +0000 (08:29 -0800)]
[AMDGPU][GlobalISel] Refactor selectDS1Addr1Offset/selectDS64Bit4ByteAligned
Differential Revision: https://reviews.llvm.org/D74261
Reid Kleckner [Wed, 12 Feb 2020 00:03:26 +0000 (16:03 -0800)]
Re-land "[MS] Overhaul how clang passes overaligned args on x86_32"
This brings back
2af74e27ed7d0832cbdde9cb969aaca7a42e99f9 and reverts
eaabaf7e04fe98990a8177a3e053346395efde1c.
The changes were correct, the code that was broken contained an ODR
violation that assumed that these types are passed equivalently:
struct alignas(uint64_t) Wrapper { uint64_t P };
void f(uint64_t p);
void f(Wrapper p);
MSVC does not pass them the same way, and so clang-cl should not pass
them the same way either.
Jonas Devlieghere [Wed, 12 Feb 2020 00:31:26 +0000 (16:31 -0800)]
[lldb/Plugins] Rename OSPython plugin to OperatingSystemPython (NFC)
Rename the plugin to match both the directory structure and the class.
Galina Kistanova [Wed, 12 Feb 2020 00:20:06 +0000 (16:20 -0800)]
Reverted the remainings of
c1c9819ef91aab51b5a23fb3027adac5a2f551cc
as it has left broken llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast buildbot for long time.
Differential Revision: https://reviews.llvm.org/D73840
Jason Molenda [Wed, 12 Feb 2020 00:17:35 +0000 (16:17 -0800)]
Rewrite default "could not attach" msg to point to hints
about where more information can be found about why it
may have failed.
<rdar://problem/
59277928>
Matt Arsenault [Tue, 11 Feb 2020 19:57:09 +0000 (14:57 -0500)]
AMDGPU: Don't expand more special div cases in IR
These have nicer expansions implemented in the DAG. Ideally we would
either directly implement all of these special expansions, or stop
expanding division in the IR.
Reid Kleckner [Tue, 11 Feb 2020 23:50:27 +0000 (15:50 -0800)]
Fix MSVC build with C++ EH enabled
Mark the CrashRecoveryContextImpl constructor noexcept, so that MSVC
won't emit an unwind helper to clean up the allocation from `new` if the
constructor throws an exception.
Otherwise, MSVC complains:
llvm\lib\Support\CrashRecoveryContext.cpp(220): error C2712: \
Cannot use __try in functions that require object unwinding
The other simple fix would be to wrap `new` in a static helper or
lambda.
Users have reported that Tensorflow builds LLVM with /EHsc.
Jonas Devlieghere [Tue, 11 Feb 2020 23:52:41 +0000 (15:52 -0800)]
[lldb/Plugins] Move PlatformRemoteiOS into PlatformMacOSX (NFCI)
Move the logic for initialization and termination for PlatformRemoteiOS
into PlatformMacOSX, like we did for the other Darwin platforms in
a731c6ba94d0464c6a122de1af70ab88ffb5c1a6.
Matt Arsenault [Mon, 10 Feb 2020 15:30:34 +0000 (10:30 -0500)]
AMDGPU: Don't report 2-byte alignment as fast
This is apparently worse than 1-byte alignment. This does not attempt
to decompose 2-byte aligned wide stores, but will stop trying to
produce them.
Also fix bug in LoadStoreVectorizer which was decreasing the alignment
and vectorizing stack accesses. It was assuming a stack object was an
alloca that could have its base alignment changed, which is not true
if the pointer is derived from a function argument.
Derek Schuff [Tue, 11 Feb 2020 23:13:40 +0000 (15:13 -0800)]
[llvm-objcopy][WebAssembly] Add dump/add/remove-section support
Add support for adding, removing, and dumping wasm sections to objcopy
Differential Revision: https://reviews.llvm.org/D70970
Justin Lebar [Tue, 11 Feb 2020 04:33:08 +0000 (20:33 -0800)]
Use std::foo_t rather than std::foo in LLVM.
Summary: C++14 migration. No functional change.
Reviewers: bkramer, JDevlieghere, lebedev.ri
Subscribers: MatzeB, hiraditya, jkorous, dexonsmith, arphaman, kadircet, lebedev.ri, usaxena95, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74384
Johannes Doerfert [Tue, 11 Feb 2020 23:08:48 +0000 (17:08 -0600)]
[OpenMP] Switch default C++ standard to C++ 14
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D74258
Matt Arsenault [Tue, 11 Feb 2020 18:54:17 +0000 (13:54 -0500)]
AMDGPU: Add baseline tests for CGP div expansion
These cases are harmed by expanding division early in the IR, before
DAGCombiner.
Matt Arsenault [Tue, 11 Feb 2020 19:33:50 +0000 (14:33 -0500)]
AMDGPU: Fix crash on v3i15 kernel arguments
This was split into 3 i15 arguments. The i15 piece needs to be rounded
to a simple MVT for the memory type.
Matt Arsenault [Tue, 11 Feb 2020 14:58:53 +0000 (09:58 -0500)]
AMDGPU: Directly use rcp intrinsic in idiv expansions
Since natural fdiv lowering is now more conservative even with
denormals disabled, we get a slower expansion from just a plain
1.0/fdiv. Directly emit the rcp intrinsic when using it to implement
integer division to avoid a pointlessly complex sequence.
Matt Arsenault [Tue, 11 Feb 2020 15:16:16 +0000 (10:16 -0500)]
AMDGPU: Don't create potentially dead rcp declarations
This will introduce unused declarations if this doesn't reach any of
the paths that will really use it.
Aditya Nandakumar [Tue, 11 Feb 2020 22:51:49 +0000 (14:51 -0800)]
[MachO] Pad section data to pointer size bytes
https://reviews.llvm.org/D74273
Pad macho section data to pointer size bytes, so that relocation
table and symbol table following section data will be pointer size
aligned.
Patch by pguo.
Huihui Zhang [Tue, 11 Feb 2020 22:42:41 +0000 (14:42 -0800)]
[NFC] Fix warning: comparison of integers of different signs.
../polly/lib/Transform/ScheduleOptimizer.cpp:812:54: warning: comparison of integers of different signs: 'isl_size' (aka 'int') and 'const unsigned int' [-Wsign-compare]
isl_schedule_node_band_n_member(Node.get()) >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
Johannes Doerfert [Tue, 11 Feb 2020 22:43:52 +0000 (16:43 -0600)]
[NFC] Fix spelling
Jacques Pienaar [Tue, 11 Feb 2020 22:38:18 +0000 (14:38 -0800)]
[mlir] Start Shape dialect
* Add basic skeleton for Shape dialect;
* Add description of types and ops to be used;
Differential Revision: https://reviews.llvm.org/D73944
Justin Lebar [Tue, 11 Feb 2020 18:34:01 +0000 (10:34 -0800)]
Use C++14-style return type deduction in clang.
Summary:
Simplifies the C++11-style "-> decltype(...)" return-type deduction.
Note that you have to be careful about whether the function return type
is `auto` or `decltype(auto)`. The difference is that bare `auto`
strips const and reference, just like lambda return type deduction. In
some cases that's what we want (or more likely, we know that the return
type is a value type), but whenever we're wrapping a templated function
which might return a reference, we need to be sure that the return type
is decltype(auto).
No functional change.
Reviewers: bkramer, MaskRay, martong, shafik
Subscribers: martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74423
Craig Topper [Tue, 11 Feb 2020 21:14:03 +0000 (13:14 -0800)]
[X86] Don't disable code in combineHorizontalPredicateResult just because we have avx512
We aren't doing a good job of optimizing AVX512 outside of this code. So remove the bail out for AVX512 and replace with a FIXME. This at least gets us the AVX2 codegen.
Differential Revision: https://reviews.llvm.org/D74431
Johannes Doerfert [Fri, 1 Nov 2019 03:45:17 +0000 (22:45 -0500)]
[Utils] Allow "on-the-fly" argument changes for update_test_check scripts
Update test scripts were limited because they performed a single action
on the entire file and if that action was controlled by arguments, like
the one introduced in D68819, there was no record of it.
This patch introduces the capability of changing the arguments passed to
the script "on-the-fly" while processing a test file. In addition, an
"on/off" switch was added so that processing can be disabled for parts
of the file where the content is simply copied. The last extension is a
record of the invocation arguments in the auto generated NOTE. These
arguments are also picked up in a subsequent invocation, allowing
updates with special options enabled without user interaction.
To change the arguments the string `UTC_ARGS:` has to be present in a
line, followed by "additional command line arguments". That is
everything that follows `UTC_ARGS:` will be added to a growing list
of "command line arguments" which is reparsed after every update.
Reviewed By: arichardson
Differential Revision: https://reviews.llvm.org/D69701
Stanislav Mekhanoshin [Tue, 11 Feb 2020 22:04:51 +0000 (14:04 -0800)]
[AMDGPU] Fixed subreg use in sdwa-scalar-ops.mir. NFC
Melanie Blower [Tue, 11 Feb 2020 22:20:00 +0000 (14:20 -0800)]
Revert "Change clang option -ffp-model=precise to select ffp-contract=on"
This reverts commit
3fcdf2fa945aca5849c5587c55de4186c7d81b8a.
Sorry I was too hasty with my commit, I will review Andy's comments
and resubmit.
Melanie Blower [Tue, 11 Feb 2020 20:39:53 +0000 (12:39 -0800)]
Change clang option -ffp-model=precise to select ffp-contract=on
Reviewers: rjmccall
Differential Revision: https://reviews.llvm.org/D74436
Huihui Zhang [Tue, 11 Feb 2020 22:04:45 +0000 (14:04 -0800)]
[ConstantFold][SVE] Fix constand fold for vector call.
Summary:
Do not iterate on scalable vectors.
Reviewers: sdesmalen, efriedma, apazos, huntergr, willlovett
Reviewed By: sdesmalen
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74419
Ian Levesque [Tue, 11 Feb 2020 21:52:45 +0000 (13:52 -0800)]
[xray][clang] Always add xray-skip-entry/exit and xray-ignore-loops attrs
The function attributes xray-skip-entry, xray-skip-exit, and
xray-ignore-loops were only being applied if a function had an
xray-instrument attribute, but they should apply if xray is enabled
globally too.
Differential Revision: https://reviews.llvm.org/D73842
Andy Davis [Tue, 11 Feb 2020 21:30:49 +0000 (13:30 -0800)]
[mlir][AffineOps] Adds affine loop fusion transformation function to LoopFusionUtils.
Summary:
Adds affine loop fusion transformation function to LoopFusionUtils.
Updates TestLoopFusion utility to run loop fusion transformation until a fixed point is reached.
Adds unit tests to test the transformation.
Includes ASAN bug fix for D73190.
Reviewers: bondhugula, dcaballe
Reviewed By: bondhugula, dcaballe
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74330
Max Moroz [Mon, 10 Feb 2020 22:25:00 +0000 (14:25 -0800)]
[compiler-rt] FuzzedDataProvider: add ConsumeData and method.
Reviewers: metzman
Subscribers: dberris, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74359
Krzysztof Parzyszek [Tue, 11 Feb 2020 21:17:22 +0000 (15:17 -0600)]
[Hexagon] Don't generate short vectors in ISD::SELECT in preprocessing
Selection DAG preprocessing runs long after legalization, so make sure
that the types can be handled by the selection code.
lewis-revill [Tue, 11 Feb 2020 21:23:18 +0000 (21:23 +0000)]
[DebugInfo] Call site entries cannot be generated for FrameSetup calls
Instructions marked as FrameSetup do not cause requestLabelAfterInsn to
be called and so no such label is generated. Call instructions which
require call site entries to be generated require this label to be
present in order to calculate the return PC offset/address, but the
check for whether the call instruction is marked as FrameSetup was not
present.
Therefore in the case where a call instruction is marked as FrameSetup,
an assertion failure occurs if a call site entry is to be generated.
This is the case with RISC-V's implementation of save/restore via
library calls.
Differential Revision: https://reviews.llvm.org/D71593
lewis-revill [Tue, 11 Feb 2020 21:23:03 +0000 (21:23 +0000)]
[RISCV] Add support for save/restore of callee-saved registers via libcalls
This patch adds the support required for using the __riscv_save and
__riscv_restore libcalls to implement a size-optimization for prologue
and epilogue code, whereby the spill and restore code of callee-saved
registers is implemented by common functions to reduce code duplication.
Logic is also included to ensure that if both this optimization and
shrink wrapping are enabled then the prologue and epilogue code can be
safely inserted into the basic blocks chosen by shrink wrapping.
Differential Revision: https://reviews.llvm.org/D62686
Johannes Doerfert [Tue, 11 Feb 2020 21:11:32 +0000 (15:11 -0600)]
[Attributor][NFC] Clarify the documentation a bit more
Johannes Doerfert [Tue, 11 Feb 2020 06:10:35 +0000 (00:10 -0600)]
[Attributor] Identify dead uses in PHIs (almost) based on dead edges
As an approximation to a dead edge we can check if the terminator is
dead. If so, the corresponding operand use in a PHI node is dead even if
the PHI node itself is not.
Andy Davis [Tue, 11 Feb 2020 20:57:57 +0000 (12:57 -0800)]
[mlir][VectorOps] Adds canonicalization rewrite patterns for vector ShapeCastOp.
Summary:
Adds two rewrite patterns for the vector ShapeCastOp.
*) ShapeCastOp decomposer: decomposes ShapeCastOp on tuple-of-vectors to multiple ShapeCastOps each on vector types.
*) ShapeCastOp folder: folds canceling shape cast ops (e.g. shape_cast A -> B followed by shape_cast B -> A) away.
Reviewers: nicolasvasilache, aartbik
Reviewed By: nicolasvasilache
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74327
Steven Wan [Tue, 11 Feb 2020 20:58:32 +0000 (15:58 -0500)]
[NFC] Delete extra white space in a test case.
Remove an extra empty line in one of the AIX driver test cases.
Lang Hames [Tue, 11 Feb 2020 17:02:22 +0000 (09:02 -0800)]
[ORC] Fix symbol dependence propagation algorithm in ObjectLinkingLayer.
ObjectLinkingLayer was not correctly propagating dependencies through local
symbols within an object. This could cause symbol lookup to return before a
searched-for symbol is ready if the following conditions are met:
(1) The definition of the symbol being searched for transitively depends on a
local symbol within the same object, and that local symbol in turn
transitively depends on an external symbol provided by some other module
in the JIT.
(2) Concurrent compilation is enabled.
(3) Thread scheduling causes the lookup of the searched-for symbol to return
before all transitive dependencies of the looked-up symbol are emitted.
This bug was found by inspection and has not been observed in practice.
A jitlink test case has been added to verify that symbol dependencies are
correctly propagated through local symbol definitions.
Lang Hames [Tue, 11 Feb 2020 16:51:45 +0000 (08:51 -0800)]
[JITLink] Add an assertion that block removal leaves no dangling symbols.
Lang Hames [Tue, 11 Feb 2020 17:14:44 +0000 (09:14 -0800)]
[ORC] Add debug logging to JITDylib::addDependencies.
Alexey Bataev [Tue, 11 Feb 2020 20:15:21 +0000 (15:15 -0500)]
[OPENMP50]Full handling of atomic_default_mem_order in requires
directive.
According to OpenMP 5.0, The atomic_default_mem_order clause specifies the default memory ordering behavior for atomic constructs that must be provided by an implementation. If the default memory ordering is specified as seq_cst, all atomic constructs on which memory-order-clause is not specified behave as if the seq_cst clause appears. If the default memory ordering is specified as relaxed, all atomic constructs on which memory-order-clause is not specified behave as if the relaxed clause appears.
If the default memory ordering is specified as acq_rel, atomic constructs on which memory-order-clause is not specified behave as if the release clause appears if the atomic write or atomic update operation is specified, as if the acquire clause appears if the atomic read operation is specified, and as if the acq_rel clause appears if the atomic captured update operation is specified.
Sterling Augustine [Tue, 11 Feb 2020 20:35:10 +0000 (12:35 -0800)]
Update test for windows.
Peter Collingbourne [Tue, 11 Feb 2020 19:28:16 +0000 (11:28 -0800)]
scudo: Fix various test failures, mostly on 32-bit.
Differential Revision: https://reviews.llvm.org/D74429
Jay Foad [Tue, 11 Feb 2020 19:12:48 +0000 (19:12 +0000)]
[AMDGPU] Fix implicit operands for ENTER_WWM pseudo
Summary:
SIInstrInfo::expandPostRAPseudo converts ENTER_WWM in-place into an
S_OR_SAVEEXEC instruction that needs certain implicit operands. Without
this patch I get errors like this that make it harder to use -stop-after
to bisect the pass pipeline:
$ llc -march=amdgcn test/CodeGen/AMDGPU/wqm.ll -stop-after=postrapseudos -o - | sed -E 's/ (from|into) custom "TargetCustom[0-9]+"//' | llc -march=amdgcn -x=mir
error: <stdin>:1295:70: missing implicit register operand 'implicit-def $scc'
renamable $sgpr2_sgpr3 = S_OR_SAVEEXEC_B64 -1, implicit-def $exec
^
Note that this error is currently only generated by MIParser but it
comes with a FIXME comment:
// FIXME: Move the implicit operand verification to the machine verifier.
Reviewers: critson, arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74428
David Zarzycki [Tue, 11 Feb 2020 19:58:05 +0000 (14:58 -0500)]
[libc++] Unbreak test suite (CWG1423)
clang
9ce6dc9872be4081fb98f6161c28581e1cbbe7dc drops support for
implicit conversion of nullptr_t to bool. From that commit:
The C++ rules briefly allowed this, but the rule changed nearly 10
years ago and we never updated our implementation to match. However,
we've warned on this by default for a long time, and no other compiler
accepts (even as an extension).
Sterling Augustine [Fri, 24 Jan 2020 22:36:22 +0000 (14:36 -0800)]
Allow retrieving source files relative to the compilation directory.
Summary:
Dwarf stores source-file names the three parts:
<compilation_directory><include_directory><filename>
Prior to this change, the code only allowed retrieving either all
three as the absolute path, or just the filename. But many
compile-command lines--especially those in hermetic build systems
don't specify an absolute path, nor just the filename, but rather the
path relative to the compilation directory. This features allows
retrieving them in that style.
Add tests for path printing styles.
Modify createBasicPrologue to handle include directories.
Subscribers: aprantl, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73383
diggerlin [Tue, 11 Feb 2020 19:41:24 +0000 (14:41 -0500)]
[NFC] Refactor the tuple of symbol information with structure for llvm-objdump
SUMMARY:
address the comment of
https://reviews.llvm.org/D74240#inline-676127
https://reviews.llvm.org/D74240#inline-675875
Reviewers: daltenty, jason liu, xiangling liao
Subscribers: wuzish, nemanjai, hiraditya
Differential Revision: https://reviews.llvm.org/D74240
Reid Kleckner [Wed, 22 Jan 2020 22:31:12 +0000 (14:31 -0800)]
[gn] Paper over Py3 urllib2 incompatibility in gn/get.py
Tested with both Python 2.7 and Python 3.7.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D73234
Raphael Isemann [Tue, 11 Feb 2020 19:37:26 +0000 (20:37 +0100)]
[lldb][NFC] Test ModuleCompletion mode by completing the target modules load argument
Nathan James [Tue, 11 Feb 2020 19:35:41 +0000 (19:35 +0000)]
[clang-tidy] Added check to disable bugprone-infinite-loop on known false condition
Summary: Addresses [[ https://bugs.llvm.org/show_bug.cgi?id=44816 | bugprone-infinite-loop false positive with CATCH2 ]] by disabling the check on loops where the condition is known to always eval as false, in other words not a loop.
Reviewers: aaron.ballman, alexfh, hokein, gribozavr2, JonasToth
Reviewed By: gribozavr2
Subscribers: xazax.hun, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D74374
aartbik [Tue, 11 Feb 2020 19:09:14 +0000 (11:09 -0800)]
[mlir] [VectorOps] Implement vector.reduce operation
Summary:
This new operation operates on 1-D vectors and
forms the bridge between vector.contract and
llvm intrinsics for vector reductions.
Reviewers: nicolasvasilache, andydavis1, ftynse
Reviewed By: nicolasvasilache
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74370
Alina Sbirlea [Fri, 7 Feb 2020 18:15:59 +0000 (10:15 -0800)]
[BasicAA] Make BasicAA a cfg pass.
Summary:
Part of the changes in D44564 made BasicAA not CFG only due to it using
PhiAnalysisValues which may have values invalidated.
Subsequent patches (rL340613) appear to have addressed this limitation.
BasicAA should not be invalidated by non-CFG-altering passes.
A concrete example is MemCpyOpt which preserves CFG, but we are testing
it invalidates BasicAA.
llvm-dev RFC: https://groups.google.com/forum/#!topic/llvm-dev/eSPXuWnNfzM
Reviewers: john.brawn, sebpop, hfinkel, brzycki
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74353
Craig Topper [Tue, 11 Feb 2020 19:04:47 +0000 (11:04 -0800)]
[X86] Raise the latency for VectorImul from 4 to 5 in Skylake scheduler models
Based on uops.info these should have 5 cycle latency as they did on Haswell/Broadwell. I have no additional internal information from Intel.
This was also shown as a discrepancy in the spreadsheet that was sent with an early llvm-dev post about llvm-exegesis.
It also matches Agner Fog.
Differential Revision: https://reviews.llvm.org/D74357
LLVM GN Syncbot [Tue, 11 Feb 2020 19:14:15 +0000 (19:14 +0000)]
[gn build] Port
453a8f3af78
Stanislav Mekhanoshin [Tue, 11 Feb 2020 18:55:14 +0000 (10:55 -0800)]
[AMDGPU] Remove AMDGPURegisterInfo
R600 and GCN do not have anything in common in terms of register
file organization anymore.
Differential Revision: https://reviews.llvm.org/D74426
Raphael Isemann [Tue, 11 Feb 2020 18:59:21 +0000 (19:59 +0100)]
[lldb][NFC] Test SourceFileCompletion by completing the target line-table argument
Michael Halkenhäuser [Tue, 11 Feb 2020 18:46:31 +0000 (12:46 -0600)]
[Polly] LLVM OpenMP Backend -- Fix "static chunked" scheduling.
Static chunked OpenMP scheduling has not been treated correctly.
This patch fixes the problem that threads would not process their
(work-)chunks as intended.
Differential Revision: https://reviews.llvm.org/D61081
Teresa Johnson [Thu, 6 Feb 2020 18:54:15 +0000 (10:54 -0800)]
Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP"
This restores commit
748bb5a0f1964d20dfb3891b0948ab6c66236c70, along
with a fix for a Chromium test suite build issue (and a new test for
that case).
Differential Revision: https://reviews.llvm.org/D73242
Krzysztof Parzyszek [Tue, 11 Feb 2020 17:06:21 +0000 (11:06 -0600)]
[Hexagon] Fix ABI info for returning HVX vectors
Cyndy Ishida [Tue, 11 Feb 2020 18:31:54 +0000 (10:31 -0800)]
[llvm][TextAPI] add simulators to output
Summary:
* for <= tbd_v3, simulator platforms appear the same as the real
platform and we distinct the difference from the architecture.
fixes: rdar://problem/
59161559
Reviewers: ributzka, steven_wu
Reviewed By: ributzka
Subscribers: hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74416
Justin Lebar [Tue, 11 Feb 2020 07:23:44 +0000 (23:23 -0800)]
Use std::foo_t rather than std::foo in clang.
Summary: No functional change.
Reviewers: bkramer, MaskRay, martong, shafik
Subscribers: martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74414
Justin Lebar [Tue, 11 Feb 2020 06:52:00 +0000 (22:52 -0800)]
Fix SFINAE in CFG.cpp.
Summary: Used std::enable_if without ::type.
Reviewers: bkramer, MaskRay
Subscribers: martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74412
Diego Caballero [Tue, 11 Feb 2020 17:38:34 +0000 (09:38 -0800)]
[mlir] Turn flags in ConvertStandardToLLVM into pass flags
Follow-up on D72802. Turn -convert-std-to-llvm-use-alloca and
-convert-std-to-llvm-bare-ptr-memref-call-conv into pass flags
of LLVMLoweringPass.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D73912
Jordan Rupprecht [Tue, 11 Feb 2020 18:10:52 +0000 (10:10 -0800)]
[NFC] Fix unused var in release builds
Peter Collingbourne [Tue, 11 Feb 2020 18:03:35 +0000 (10:03 -0800)]
gn build: Make scudo cflags more consistent with the cmake build.
Jordan Rupprecht [Tue, 11 Feb 2020 18:01:16 +0000 (10:01 -0800)]
[lldb][test] Remove symlink for API tests.
Summary: Moves lldbsuite tests to lldb/test/API.
This is a largely mechanical change, moved with the following steps:
```
rm lldb/test/API/testcases
mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}}
mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner
for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done
```
lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure.
Reviewers: labath, JDevlieghere
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71151
Yonghong Song [Wed, 5 Feb 2020 18:27:43 +0000 (10:27 -0800)]
[BPF] implement isTruncateFree and isZExtFree in BPFTargetLowering
Currently, isTruncateFree() and isZExtFree() callbacks return false
as they are not implemented in BPF backend. This may cause suboptimal
code generation. For example, if the load in the context of zero extension
has more than one use, the pattern zextload{i8,i16,i32} will
not be generated. Rather, the load will be matched first and
then the result is zero extended.
For example, in the test together with this commit, we have
I1: %0 = load i32, i32* %data_end1, align 4, !tbaa !2
I2: %conv = zext i32 %0 to i64
...
I3: %2 = load i32, i32* %data, align 4, !tbaa !7
I4: %conv2 = zext i32 %2 to i64
...
I5: %4 = trunc i64 %sub.ptr.lhs.cast to i32
I6: %conv13 = sub i32 %4, %2
...
The I1 and I2 will match to one zextloadi32 DAG node, where SUBREG_TO_REG is
used to convert a 32bit register to 64bit one. During code generation,
SUBREG_TO_REG is a noop.
The %2 in I3 is used in both I4 and I6. If isTruncateFree() is false,
the current implementation will generate a SLL_ri and SRL_ri
for the zext part during lowering.
This patch implement isTruncateFree() in the BPF backend, so for the
above example, I3 and I4 will generate a zextloadi32 DAG node with
SUBREG_TO_REG is generated during lowering to Machine IR.
isZExtFree() is also implemented as it should help code gen as well.
This patch also enables the change in https://reviews.llvm.org/D73985
since it won't kick in generates MOV_32_64 machine instruction.
Differential Revision: https://reviews.llvm.org/D74101
Raphael Isemann [Tue, 11 Feb 2020 17:44:02 +0000 (18:44 +0100)]
[lldb][NFC] Remove support file searching from SourceFileCompleter
This code seems wrong as the directory variable actually contains
the file name. It's also unreachable code as m_include_support_files
is hardcoded to false which is the condition for the surrounding 'if
statement'. Let's just remove all of this.
Ben Langmuir [Tue, 11 Feb 2020 01:22:52 +0000 (17:22 -0800)]
[DirectoryWatcher] Fix misuse of FSEvents API and data race
I observed two bugs in the DirectoryWatcher on macOS
1. We were calling FSEventStreamStop and FSEventStreamInvalidate before
we called FSEventStreamStart and FSEventStreamSetDispatchQueue, if the
DirectoryWatcher was destroyed before the initial async work was done.
This violates the requirements of the FSEvents API.
2. Calls to Receiver could race between the initial work and the
invalidation during destruction.
The second issue is easier to see when using TSan.
Differential Revision: https://reviews.llvm.org/D74371
rdar://
59215667
Johannes Doerfert [Tue, 11 Feb 2020 17:19:34 +0000 (11:19 -0600)]
[Attributor][NFC] Improve documentation