Stephen Neuendorffer [Sat, 11 Jul 2020 18:47:07 +0000 (11:47 -0700)]
[examples] fix ExceptionDemo
Code didn't compile in a release build. Guard debug output with
ifndef NDEBUG.
Differential Revision: https://reviews.llvm.org/D83628
clementval [Sat, 11 Jul 2020 16:59:14 +0000 (12:59 -0400)]
[openmp] Remove unused variable in DirectiveEmitter
Johannes Doerfert [Sat, 11 Jul 2020 16:57:17 +0000 (11:57 -0500)]
[OpenMP] Silence unused symbol warning with proper ifdefs
Yaxun (Sam) Liu [Sat, 11 Jul 2020 14:04:27 +0000 (10:04 -0400)]
Fix regression due to test hip-version.hip
Added RocmInstallationDetector to Darwin and MinGW.
Fixed duplicate ROCm detector in ROCm toolchain.
Valentin Clement [Sat, 11 Jul 2020 16:42:05 +0000 (12:42 -0400)]
[flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.
Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert
Reviewed By: DavidTruby, ichoyjx
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83326
Yash Jain [Sat, 11 Jul 2020 15:24:18 +0000 (20:54 +0530)]
[MLIR] Parallelize affine.for op to 1-D affine.parallel op
Introduce pass to convert parallel affine.for op into 1-D affine.parallel op.
Run using --affine-parallelize. Removes test-detect-parallel: pass for checking
parallel affine.for ops.
Signed-off-by: Yash Jain <yash.jain@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D83193
Michael Liao [Sat, 11 Jul 2020 14:09:09 +0000 (10:09 -0400)]
Fix `-Wunused-variable` warnings. NFC.
Michael Liao [Fri, 10 Jul 2020 14:56:28 +0000 (10:56 -0400)]
[fix-irreducible] Skip unreachable predecessors.
Summary:
- Skip unreachable predecessors during header detection in SCC. Those
unreachable blocks would be generated in the switch lowering pass in
the corner cases or other frontends. Even though they could be removed
through the CFG simplification, we should skip them during header
detection.
Reviewers: sameerds
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83562
sstefan1 [Sat, 11 Jul 2020 12:24:56 +0000 (14:24 +0200)]
[Attributor][NFC] Add more debug output for deleted functions
Christudasan Devadasan [Fri, 10 Jul 2020 18:49:51 +0000 (00:19 +0530)]
[AMDGPU] Move LowerSwitch pass to CodeGenPrepare.
It is possible that LowerSwitch pass leaves certain blocks
unreachable from the entry. If not removed, these dead blocks
can cause undefined behavior in the subsequent passes.
It caused a crash in the AMDGPU backend after the instruction
selection when a PHI node has its incoming values coming from
these unreachable blocks.
In the AMDGPU pass flow, the last invocation of UnreachableBlockElim
precedes where LowerSwitch is currently placed and eventually
missed out on the opportunity to get these blocks eliminated.
This patch ensures that LowerSwitch pass get inserted earlier
to make use of the existing unreachable block elimination pass.
Reviewed By: sameerds, arsenm
Differential Revision: https://reviews.llvm.org/D83584
Alexey Lapshin [Fri, 19 Jun 2020 20:55:05 +0000 (23:55 +0300)]
[TRE] allow TRE for non-capturing calls.
The current implementation of Tail Recursion Elimination has a very restricted
pre-requisite: AllCallsAreTailCalls. i.e. it requires that no function
call receives a pointer to local stack. Generally, function calls that
receive a pointer to local stack but do not capture it - should not
break TRE. This fix allows us to do TRE if it is proved that no pointer
to the local stack is escaped.
Reviewed by: efriedma
Differential Revision: https://reviews.llvm.org/D82085
Roman Lebedev [Sat, 11 Jul 2020 10:52:33 +0000 (13:52 +0300)]
Revert "Reland "[InstCombine] Lower infinite combine loop detection thresholds"""
And there's a new hit: https://bugs.llvm.org/show_bug.cgi?id=46680
This reverts commit
7103c87596efccd532e9fe04a6ba6a200fed8481.
Nico Weber [Sat, 11 Jul 2020 10:43:28 +0000 (06:43 -0400)]
[gn build] (manually) merge
943660fd15f193
Nathan James [Sat, 11 Jul 2020 10:42:05 +0000 (11:42 +0100)]
Reland Fix gn build after 943660f
Nathan James [Sat, 11 Jul 2020 09:45:17 +0000 (10:45 +0100)]
Revert "Fix gn builds after
943660fd1"
This reverts commit
4abdcdb45ee22d77dd64a71cb41e967d35361280.
Nathan James [Sat, 11 Jul 2020 09:42:57 +0000 (10:42 +0100)]
Fix gn builds after
943660fd1
Nathan James [Sat, 11 Jul 2020 09:10:59 +0000 (10:10 +0100)]
[clang-tidy] Reworked enum options handling(again)
Reland b9306fd after fixing the issue causing mac builds to fail unittests.
Following on from D77085, I was never happy with the passing a mapping to the option get/store functions. This patch addresses this by using explicit specializations to handle the serializing and deserializing of enum options.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D82188
Johannes Doerfert [Sat, 11 Jul 2020 07:36:07 +0000 (02:36 -0500)]
[OpenMP][FIX] remove unused variable and long if-else chain
MSVC throws an error if you use "too many" if-else in a row:
`Frontend/OpenMP/OMPKinds.def(570): fatal error C1061: compiler limit:
blocks nested too deeply`
We work around it now...
Mehdi Amini [Sat, 11 Jul 2020 07:17:28 +0000 (07:17 +0000)]
Remove unused variable `KMPC_KERNEL_PARALLEL_WORK_FN_PTR_ARG_NO` (NFC)
This fixes a compiler warning.
Johannes Doerfert [Tue, 7 Jul 2020 00:57:37 +0000 (19:57 -0500)]
[OpenMP] Replace function pointer uses in GPU state machine
In non-SPMD mode we create a state machine like code to identify the
parallel region the GPU worker threads should execute next. The
identification uses the parallel region function pointer as that allows
it to work even if the kernel (=target region) and the parallel region
are in separate TUs. However, taking the address of a function comes
with various downsides. With this patch we will identify the most common
situation and replace the function pointer use with a dummy global
symbol (for identification purposes only). That means, if the parallel
region is only called from a single target region (or kernel), we do not
use the function pointer of the parallel region to identify it but a new
global symbol.
Fixes PR46450.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D83271
Johannes Doerfert [Tue, 7 Jul 2020 00:26:01 +0000 (19:26 -0500)]
[OpenMP] Compute a proper module slice for the CGSCCC pass
The module slice describes which functions we can analyze and transform
while working on an SCC as part of the CGSCC OpenMPOpt pass. So far, we
simply restricted it to the SCC. In a follow up we will need to have a
bigger scope which is why this patch introduces a proper identification
of the module slice. In short, everything that has a transitive
reference to a function in the SCC or is transitively referenced by one
is fair game.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D83270
Johannes Doerfert [Tue, 7 Jul 2020 00:19:12 +0000 (19:19 -0500)]
[OpenMP] Identify GPU kernels (aka. OpenMP target regions)
We now identify GPU kernels, that is entry points into the GPU code.
These kernels (can) correspond to OpenMP target regions. With this patch
we identify and on request print them via remarks.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D83269
Johannes Doerfert [Tue, 7 Jul 2020 00:30:14 +0000 (19:30 -0500)]
[OpenMP][NFC] Add convenient helper and early exit check
Johannes Doerfert [Tue, 7 Jul 2020 00:29:23 +0000 (19:29 -0500)]
[OpenMP][NFC] Fix some typos
Johannes Doerfert [Tue, 7 Jul 2020 00:13:37 +0000 (19:13 -0500)]
[OpenMP][NFC] Remove unused (always fixed) arguments
There are various runtime calls in the device runtime with unused, or
always fixed, arguments. This is bad for all sorts of reasons. Clean up
two before as we match them in OpenMPOpt now.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D83268
Eric Christopher [Sat, 11 Jul 2020 05:52:04 +0000 (22:52 -0700)]
Fix signed vs unsigned comparison warnings a different way.
Johannes Doerfert [Fri, 10 Jul 2020 21:45:02 +0000 (16:45 -0500)]
[OpenMP][CUDA] Fix std::complex in GPU regions
The old way worked to some degree for C++-mode but in C mode we actually
tried to introduce variants of macros (e.g., isinf). To make both modes
work reliably we get rid of those extra variants and directly use NVIDIA
intrinsics in the complex implementation. While this has to be revisited
as we add other GPU targets which want to reuse the code, it should be
fine for now.
Reviewed By: tra, JonChesterfield, yaxunl
Differential Revision: https://reviews.llvm.org/D83591
Jonas Devlieghere [Sat, 11 Jul 2020 04:14:06 +0000 (21:14 -0700)]
[lldb/Test] Fix missing yaml2obj in Xcode standalone build.
Rather than trying to find the yaml2obj from dotest we should pass it in
like we do for dsymutil and FileCheck.
Yaxun (Sam) Liu [Wed, 1 Jul 2020 04:00:04 +0000 (00:00 -0400)]
[HIP] Fix rocm detection
Do not detect device library by default in rocm detector.
Only detect device library in Rocm and HIP toolchain.
Separate detection of HIP runtime and Rocm device library.
Detect rocm path by version file in host toolchains.
Also added detecting rocm version and printing rocm
installation path and version with -v.
Fixed include path and device library detection for
ROCm 3.5.
Added --hip-version option. Renamed --hip-device-lib-path
to --rocm-device-lib-path.
Fixed default value for -fhip-new-launch-api.
Added default -std option for HIP.
Differential Revision: https://reviews.llvm.org/D82930
Wang, Pengfei [Fri, 10 Jul 2020 06:12:24 +0000 (14:12 +0800)]
[X86][MMX] Optimize MMX shift intrinsics.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D83534
Jinsong Ji [Sat, 11 Jul 2020 02:23:40 +0000 (02:23 +0000)]
[PowerPC][MachinePipeliner] Enable pipeliner if hasInstrSchedModel
P9 is the only one with InstrSchedModel, but we may have more in the
future, we should not hardcoded it to P9, check hasInstrSchedModel
instead.
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D83590
Ben Shi [Sat, 11 Jul 2020 01:32:57 +0000 (18:32 -0700)]
[RISCV][test] Add a test for (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2) transformation
Reviewed By: lenary, MaskRay
Differential Revision: https://reviews.llvm.org/D83159
Vy Nguyen [Fri, 10 Jul 2020 03:19:06 +0000 (23:19 -0400)]
Summary: [clang] Provide a way for WhileStmt to report the location of its LParen and RParen.
Summary: This helps avoiding hacks downstream.
Reviewers: shafik
Subscribers: martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83529
Thomas Lively [Sat, 11 Jul 2020 01:27:52 +0000 (18:27 -0700)]
[WebAssembly] Prefer v128.const for constant splats
In BUILD_VECTOR lowering, we used to generally prefer using splats
over v128.const instructions because v128.const has a very large
encoding. However, in
d5b7a4e2e8 we switched to preferring consts
because they are expected to be more efficient in engines. This patch
updates the ISel patterns to match this current preference.
Differential Revision: https://reviews.llvm.org/D83581
Valentin Clement [Sat, 11 Jul 2020 00:57:00 +0000 (20:57 -0400)]
[openmp] Fix warning in generated OMP.cpp
Mauricio Sifontes [Sat, 11 Jul 2020 00:46:55 +0000 (00:46 +0000)]
Create TestReducer pass
- Create a pass that generates bugs based on trivially defined behavior for the purpose of testing the MLIR Reduce Tool.
- Implement the functionality inside the pass to crash mlir-opt in the presence of an operation with the name "crashOp".
- Register the pass as a test pass in the mlir-opt tool.
Reviewed by: jpienaar
Differential Revision: https://reviews.llvm.org/D83422
Akira Hatanaka [Sat, 11 Jul 2020 00:40:30 +0000 (17:40 -0700)]
Fix build error
sstefan1 [Fri, 10 Jul 2020 23:06:46 +0000 (01:06 +0200)]
Reland "[OpenMPOpt] ICV Tracking"
This reverts commit
1d542f0ca83fa1411d6501a8d088450d83abd5b8.
`recollectUses()` is added to prevent looking at dead uses after
Attributor run.
This is the first and most basic ICV Tracking implementation. For this
first version, we only support deduplication within the same BB.
Reviewers: jdoerfert, JonChesterfield, hamax97, jhuber6, uenoku,
baziotis, lebedev.ri
Differential Revision: https://reviews.llvm.org/D81788
Akira Hatanaka [Sat, 11 Jul 2020 00:24:12 +0000 (17:24 -0700)]
[CodeGen] Store the return value of the target function call to the
thunk's return value slot directly when the return type is an aggregate
instead of doing so via a temporary
This fixes PR45997 (https://bugs.llvm.org/show_bug.cgi?id=45997), which
is caused by a bug that has existed since we started passing and
returning C++ structs with ObjC strong pointer members (see
https://reviews.llvm.org/D44908) or structs annotated with trivial_abi
directly.
rdar://problem/
63740936
Differential Revision: https://reviews.llvm.org/D82513
Sanjay Patel [Fri, 10 Jul 2020 22:56:26 +0000 (18:56 -0400)]
[InstSimplify] add tests for maxnum (PR46627); NFC
Adrian Prantl [Sat, 11 Jul 2020 00:09:39 +0000 (17:09 -0700)]
Fix nesting of #ifdef
This fixes a compile error when building for an arm64 host.
Differential Revision: https://reviews.llvm.org/D83582
Valentin Clement [Sat, 11 Jul 2020 00:11:11 +0000 (20:11 -0400)]
[openmp] Remove OMPConstants.cpp and replace it by OMP.cpp generated by tablegen
Summary:
Diff D83176 moved the last piece of code from OMPConstants.cpp and now this file was only
useful to include the tablegen generated file. This patch replace OMPConstants.cpp with OMP.cpp
generated by tablegen.
Reviewers: sstefan1, jdoerfert, jdenny
Reviewed By: sstefan1
Subscribers: mgorny, yaxunl, hiraditya, guansong, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83583
Johannes Doerfert [Tue, 7 Jul 2020 21:44:33 +0000 (16:44 -0500)]
[OpenMP][NFC] Remove unused and untested code from the device runtime
Summary:
We carried a lot of unused and untested code in the device runtime.
Among other reasons, we are planning major rewrites for which reduced
size is going to help a lot.
The number of code lines reduced by 14%!
Before:
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
CUDA 13 489 841 2454
C/C++ Header 14 322 493 1377
C 12 117 124 559
CMake 4 64 64 262
C++ 1 6 6 39
-------------------------------------------------------------------------------
SUM: 44 998 1528 4691
-------------------------------------------------------------------------------
After:
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
CUDA 13 366 733 1879
C/C++ Header 14 317 484 1293
C 12 117 124 559
CMake 4 64 64 262
C++ 1 6 6 39
-------------------------------------------------------------------------------
SUM: 44 870 1411 4032
-------------------------------------------------------------------------------
Reviewers: hfinkel, jhuber6, fghanim, JonChesterfield, grokos, AndreyChurbanov, ye-luo, tianshilei1992, ggeorgakoudis, Hahnfeld, ABataev, hbae, ronlieb, gregrodgers
Subscribers: jvesely, yaxunl, bollu, guansong, jfb, sstefan1, aaron.ballman, openmp-commits, cfe-commits
Tags: #clang, #openmp
Differential Revision: https://reviews.llvm.org/D83349
Zequan Wu [Fri, 26 Jun 2020 03:35:03 +0000 (20:35 -0700)]
[COFF] Add cg_profile directive and .llvm.call-graph-profile section
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83597
Walter Erquinigo [Sat, 11 Jul 2020 00:05:23 +0000 (17:05 -0700)]
Revert "[lldb-vscode] Fix TestVSCode_module"
This reverts commit
881af6eb0030986876d3b80668193e5c3c04a87c.
Revert "[lldb-vscode] Add Compile Unit List to Modules View"
This reverts commit
03ef61033ff5e1e40518f14f642e4ad8d686974c.
Revert "[lldb-vscode] Add Support for Module Event"
This reverts commit
f7f80159753ba725f7e32529fcc369bc358efbb3.
The debian buildbot has reported issues with the modules test.
http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/13767/steps/test/logs/stdio
Reverting it for now.
Teresa Johnson [Fri, 10 Jul 2020 22:25:27 +0000 (15:25 -0700)]
[BPI] Compile time improvement when erasing blocks (NFC)
Summary:
eraseBlock is trying to erase all probability info for the given BB.
This info is stored in a DenseMap organized like so:
using Edge = std::pair<const BasicBlock *, unsigned>;
DenseMap<Edge, BranchProbability> Probs;
where the unsigned in the Edge key is the successor id.
It was walking through every single map entry, checking if the BB in the
key's pair matched the given BB. Much more efficient is to do what
another method (getEdgeProbability) was already doing, which is to walk
the successors of the BB, and simply do a map lookup on the key formed
from each <BB, successor id> pair.
Doing this dropped the overall compile time for a file containing a
very large function by around 32%.
Reviewers: davidxl, xur
Subscribers: llvm-commits, hiraditya
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83596
Johannes Doerfert [Fri, 10 Jul 2020 22:11:29 +0000 (17:11 -0500)]
[OpenMP] Use __OPENMP_NVPTX__ instead of _OPENMP in wrapper headers
Due to recent changes we cannot use OpenMP in CUDA files anymore
(PR45533) as the math handling of CUDA is different when _OPENMP is
defined. We actually want this different behavior only if we are
offloading with OpenMP to NVIDIA, thus generating NVPTX. With this patch
we do not interfere with the CUDA math handling except if we are in
NVPTX offloading mode, as indicated by the presence of __OPENMP_NVPTX__.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D78155
Walter Erquinigo [Fri, 10 Jul 2020 23:32:22 +0000 (16:32 -0700)]
[lldb-vscode] Fix TestVSCode_module
For some reason this works on the original author's machine, but not on my. So I'm using a safer approach of using an unstripped dynamic library to place breakpoints on. The author was placing a breakpoint on the main symbol of a stripped library and for some reason it worked on their machine, but it shouldn't have...
Offender diff: D82477
Yifan Shen [Fri, 10 Jul 2020 21:07:30 +0000 (14:07 -0700)]
[lldb-vscode] Add Compile Unit List to Modules View
Summary: User can expand and check compile unit list for the modules that have debug info.
Reviewers: wallace, clayborg
Reviewed By: clayborg
Subscribers: aprantl, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D83072
Yifan Shen [Fri, 10 Jul 2020 21:07:18 +0000 (14:07 -0700)]
[lldb-vscode] Add Support for Module Event
Summary:
Whenever a module is created, removed or changed, lldb-vscode is now sending an event that can be interpreted by the IDE so that modules can be rendered in the IDE, like the tree view in this screenshot
{
F12229758}
Reviewers: wallace, clayborg, kusmour, aadsm
Reviewed By: clayborg
Subscribers: cfe-commits, labath, lldb-commits
Tags: #lldb, #clang
Differential Revision: https://reviews.llvm.org/D82477
Gui Andrade [Fri, 10 Jul 2020 23:49:40 +0000 (23:49 +0000)]
[Sanitizers] Change protoent test to check for IPv6 instead of RDP
Looks like RDP isn't present on some of LLVM's buildbot machines
Alexandre Ganea [Fri, 10 Jul 2020 23:45:01 +0000 (19:45 -0400)]
Revert "Re-land [CodeView] Add full repro to LF_BUILDINFO record"
This reverts commit
add59ecb34e3003311b7e2318b16a0ef10c76d79 and
41d2813a5faea1c18b7d329109e0287c5cd9ffea.
cgyurgyik [Fri, 10 Jul 2020 23:12:03 +0000 (19:12 -0400)]
[libc] [Obvious] Remove unneeded header in strchr.
Reviewers: sivachandra
Reviewed By: sivachandra
Subscribers: mgorny, tschuett, ecnelises, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D83589
David Blaikie [Thu, 9 Jul 2020 22:33:09 +0000 (15:33 -0700)]
Remove unnecessary/erroneous "static" from function templates in headers
This risks ODR violations in inline functions that call these functions
(if they remain static) & otherwise just causes some object size
increase, potentially, by these functions not being deduplicated by the
linker.
Alexandre Ganea [Fri, 10 Jul 2020 22:52:19 +0000 (18:52 -0400)]
[PDB] Attempt fix for debug-info-codeview-buildinfo.c test
This is a bit a shot in the dark, as it doesn't occur on my Windows 10 machines, nor on x64 Linux Ubuntu 18.04.
This patch tries to fix the following kind of error:
- http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/31511/steps/cmake%20stage%201/logs/stdio
- http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/25150/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Adebug-info-codeview-buildinfo.c
- http://lab.llvm.org:8011/builders/fuchsia-x86_64-linux/builds/7947/steps/check/logs/stdio
JF Bastien [Fri, 15 Nov 2019 18:54:39 +0000 (10:54 -0800)]
[docs] LLVM Security Group and Process
Summary:
See the corresponding RFC on llvm-dev for a discussion of this proposal.
http://lists.llvm.org/pipermail/llvm-dev/2019-November/136839.html
Subscribers: jkorous, dexonsmith, arphaman, ributzka, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70326
Eric Christopher [Fri, 10 Jul 2020 22:10:52 +0000 (15:10 -0700)]
Temporarily revert "[NFC] Separate bitcode reading for FUNC_CODE_INST_CMPXCHG(_OLD)"
as it wasn't NFC and is causing issues with thinlto bitcode reading.
I've followed up offline with reproduction instructions and testcases.
This reverts commit
30582457b47004dec8a78144abc919a13ccbd08c.
Matt Arsenault [Mon, 29 Jun 2020 21:02:10 +0000 (17:02 -0400)]
AMDGPU: Remove .value_type from kernel metadata
This doesn't appear used for anything, and is emitted incorrectly
based on the description. This also depends on the IR type, and
pointee element type.
Craig Topper [Fri, 10 Jul 2020 22:15:01 +0000 (15:15 -0700)]
[X86] Add isel patterns for matching broadcast vpternlog if the ternlog and the broadcast have different types.
Thomas Raoux [Fri, 10 Jul 2020 21:55:04 +0000 (14:55 -0700)]
[mlir][linalg] Improve aliasing approximation for hoisting transfer read/write
Improve the logic deciding if it is safe to hoist vector transfer read/write
out of the loop. Change the logic to prevent hoisting operations if there are
any unknown access to the memref in the loop no matter where the operation is.
For other transfer read/write in the loop check if we can prove that they
access disjoint memory and ignore them in this case.
Differential Revision: https://reviews.llvm.org/D83538
Michael Kruse [Fri, 10 Jul 2020 21:11:19 +0000 (16:11 -0500)]
[Polly] Fix prevectorization of fused loops.
The schedule of a fused loop has one isl_space per statement, such that
a conversion to a isl_map fails. However, the prevectorization is
interested in the schedule space only: Converting to the non-union
representation only after extracting the schedule range fixes the problem.
This fixes llvm.org/PR46578
Michael Kruse [Fri, 10 Jul 2020 21:05:42 +0000 (16:05 -0500)]
[Polly] Fix -polly-opt-isl -analyze
The member LastSchedule was never set, such that printScop would always
print "n/a" instead of the last schedule.
To ensure that the isl_ctx lives as least as long as the stored
schedule, also store a shared_ptr.
Also set the schedule tree output style to ISL_YAML_STYLE_BLOCK to avoid
printing everything on a single line.
`opt -polly-opt-isl -analyze` will be used in the next commit.
Tom Stellard [Fri, 10 Jul 2020 15:44:28 +0000 (08:44 -0700)]
[clang-shlib] Don't link with static clang libraries
Summary:
If we are building static libraries we don't need to link them into
clang-shlib, since clang-shlib already has all the individual object
files linked in.
Reviewers: smeenai
Reviewed By: smeenai
Subscribers: mgorny, cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82694
Joel E. Denny [Fri, 10 Jul 2020 21:13:25 +0000 (17:13 -0400)]
[FileCheck] Fix up -dump-input* docs
In FileCheck.rst, add `-dump-input-context` and `-dump-input-filter`,
and fix some `-dump-input` documentation.
In `FileCheck -help`, `cl::value_desc("kind")` is being ignored for
`-dump-input-filter`, so just drop it.
Extend `-dump-input=help` to mention FILECHECK_OPTS.
Nicolas Vasilache [Fri, 10 Jul 2020 20:47:51 +0000 (16:47 -0400)]
[mlir][Vector] Add folding for vector.transfer ops
This revision folds vector.transfer operations by updating the `masked` bool array attribute when more unmasked dimensions can be discovered.
Differential revision: https://reviews.llvm.org/D83586
Artem Dergachev [Fri, 10 Jul 2020 18:56:06 +0000 (11:56 -0700)]
[analyzer] Silence a warning.
An old clang warns that the const object has no default constructor so it may
remain uninitialized forever. That's a false alarm because all fields
have a default initializer. Apply the suggested fixit anyway.
aartbik [Fri, 10 Jul 2020 20:11:52 +0000 (13:11 -0700)]
[mlir] [VectorOps] Merge OUTER/AXPY vector.contract lowering into single case
We temporarily had separate OUTER lowering (for matmat flavors) and
AXPY lowering (for matvec flavors). With the new generalized
"vector.outerproduct" semantics, these cases can be merged into
a single lowering method. This refactoring will simplify future
decisions on cost models and lowering heuristics.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D83585
Aaron Ballman [Fri, 10 Jul 2020 19:54:57 +0000 (15:54 -0400)]
Change behavior with zero-sized static array extents
Currently, Clang previously diagnosed this code by default:
void f(int a[static 0]);
saying that "static has no effect on zero-length arrays", which was
accurate.
However, static array extents require that the caller of the function
pass a nonnull pointer to an array of *at least* that number of
elements, but it can pass more (see C17 6.7.6.3p6). Given that we allow
zero-sized arrays as a GNU extension and that it's valid to pass more
elements than specified by the static array extent, we now support
zero-sized static array extents with the usual semantics because it can
be useful in cases like:
void my_bzero(char p[static 0], int n);
my_bzero(&c+1, 0); //ok
my_bzero(t+k,n-k); //ok, pattern from actual code
Arthur Eubanks [Thu, 9 Jul 2020 23:49:48 +0000 (16:49 -0700)]
Reland [NFC] Derive from PassInfoMixin for no-op/printing passes
PassInfoMixin should be used for all NPM passes, rater than a custom
`name()`.
This caused ambiguous references in LegacyPassManager.cpp, so had to
remove "using namespace llvm::legacy" and move some things around.
Reviewed By: ychen, asbirlea
Differential Revision: https://reviews.llvm.org/D83498
Jonas Devlieghere [Fri, 10 Jul 2020 19:45:38 +0000 (12:45 -0700)]
[ldb/Reproducers] Add YamlRecorder and MultiProvider
This patch does several things that are all closely related:
- It introduces a new YamlRecorder as a counterpart to the existing
DataRecorder. As the name suggests the former serializes data as yaml
while the latter uses raw texts or bytes.
- It introduces a new MultiProvider base class which can be backed by
either a DataRecorder or a YamlRecorder.
- It reimplements the CommandProvider in terms of the new
MultiProvider.
Finally, it adds unit testing coverage for the MultiProvider, a naive
YamlProvider built on top of the new YamlRecorder and the existing
MutliLoader.
Differential revision: https://reviews.llvm.org/D83441
David Goldman [Thu, 9 Jul 2020 21:32:05 +0000 (17:32 -0400)]
[AST][ObjC] Fix crash when printing invalid objc categories
Summary:
If no valid interface definition was found previously we would crash.
With this change instead we just print `<<error-type>>` in place
of the NULL interface. In the future this could be improved by
saving the invalid interface's name and using that.
Reviewers: sammccall, gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83513
aartbik [Fri, 10 Jul 2020 19:23:03 +0000 (12:23 -0700)]
[mlir] [VectorOps] Allow AXPY to be expressed as special case of OUTERPRODUCT
This specialization allows sharing more code where an AXPY follows naturally
in cases where an OUTERPRODUCT on a scalar would be generated.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D83453
Matt Arsenault [Fri, 10 Jul 2020 18:27:24 +0000 (14:27 -0400)]
AArch64: Fix unused variables
Konrad Kleine [Fri, 10 Jul 2020 18:47:00 +0000 (14:47 -0400)]
[lldb] on s390x fix override issue
Summary:
This fixes an override issue by marking a function as const so that the
signature maps to the signature of the function in the base class.
This is the original error:
In file included from /root/llvm/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp:11:
/root/llvm/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h:79:10: error: 'size_t lldb_private::process_linux::NativeRegisterContextLinux_s390x::GetGPRSize()' marked 'override', but does not override
79 | size_t GetGPRSize() override { return sizeof(m_regs); }
| ^~~~~~~~~~
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D83580
Erik Pilkington [Fri, 10 Jul 2020 17:22:11 +0000 (13:22 -0400)]
[Sema] Emit a -Wformat warning for printf("%s", (void*)p)
Its dangerous to assume that the opaque pointer points to a null-terminated
string, and this has an easy fix (casting to char*).
rdar://
62432331
Nikita Popov [Fri, 10 Jul 2020 18:58:09 +0000 (20:58 +0200)]
[PredicateInfo] Add test for multiple branches on same condition (NFC)
This illustrates a case where RenamedOp does not correspond to the
value used in the condition, which it ideally should.
Sidharth Baveja [Fri, 10 Jul 2020 18:38:08 +0000 (18:38 +0000)]
[NFC] Separate Peeling Properties into its own struct (re-land after minor fix)
Summary:
This patch separates the peeling specific parameters from the UnrollingPreferences,
and creates a new struct called PeelingPreferences. Functions which used the
UnrollingPreferences struct for peeling have been updated to use the PeelingPreferences struct.
Author: sidbav (Sidharth Baveja)
Reviewers: Whitney (Whitney Tsang), Meinersbur (Michael Kruse), skatkov (Serguei Katkov), ashlykov (Arkady Shlykov), bogner (Justin Bogner), hfinkel (Hal Finkel), anhtuyen (Anh Tuyen Tran), nikic (Nikita Popov)
Reviewed By: Meinersbur (Michael Kruse)
Subscribers: fhahn (Florian Hahn), hiraditya (Aditya Kumar), llvm-commits, LLVM
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D80580
cgyurgyik [Fri, 10 Jul 2020 18:28:20 +0000 (14:28 -0400)]
[libc] Add strchr implementation. Fixes bug in memchr.
Summary: [libc] Adds strchr implementation with unit tests. Fixes signed character bug in memchr.
Reviewers: sivachandra, PaulkaToast
Reviewed By: sivachandra
Subscribers: mgorny, tschuett, ecnelises, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D83353
Lei Huang [Wed, 8 Jul 2020 22:07:34 +0000 (17:07 -0500)]
[PowerPC] Enable default support of quad precision operations
Summary: Remove option guarding support of quad precision operations.
Reviewers: nemanjai, #powerpc, steven.zhang
Reviewed By: nemanjai, #powerpc, steven.zhang
Subscribers: qiucf, wuzish, nemanjai, hiraditya, kbarton, shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83437
Davide Italiano [Fri, 10 Jul 2020 18:16:33 +0000 (11:16 -0700)]
Revert "[NFC] Derive from PassInfoMixin for no-op/printing passes"
This reverts commit
8039d2c3bf14585ef37dc9343bf393ecad9aead9 as
it breaks the modules build on macOS.
Jim Ingham [Fri, 10 Jul 2020 18:10:56 +0000 (11:10 -0700)]
This is a refinement on
96601ec28b7efe5abf3479a1aa91bcedb235bbbd. The intent of that change was to do the same work for the computation of the locations of the children of ValueObjectVariable as was done for the root ValueObjectVariable. This original patch did that by moving the computation from ValueObjectVariable to ValueObject. That fixed the problem but caused a handful of swift-lldb testsuite failures and a crash or two.
The problem is that synthetic value objects can sometimes represent objects in target memory, and other times they might be made up wholly in lldb memory, with pointers from one synthetic object to another, and so the ValueObjectVariable computation was not appropriate.
This patch delegates the computation to the root of the ValueObject in question. That solves the problem for ValueObjectVariable while not messing up the computation for ValueObjectConstResult or ValueObjectSynthetic.
Differential Revision: https://reviews.llvm.org/D83450
Anastasia Stulova [Fri, 10 Jul 2020 18:04:49 +0000 (19:04 +0100)]
[OpenCL] Fixed typo for ctor stub name in UsersManual
Alexandre Ganea [Fri, 10 Jul 2020 16:47:58 +0000 (12:47 -0400)]
Re-land [CodeView] Add full repro to LF_BUILDINFO record
This patch adds some missing information to the LF_BUILDINFO which allows for rebuilding an .OBJ without any external dependency but the .OBJ itself (other than the compiler executable).
Some tools need this information to reproduce a build without any knowledge of the build system. The LF_BUILDINFO therefore stores a full path to the compiler, the PWD (which is the CWD at program startup), a relative or absolute path to the TU, and the full CC1 command line. The command line needs to be freestanding (not depend on any environment variable). In the same way, MSVC doesn't store the provided command-line, but an expanded version (somehow their equivalent of CC1) which is also freestanding.
For more information see PR36198 and D43002.
Differential Revision: https://reviews.llvm.org/D80833
Craig Topper [Fri, 10 Jul 2020 17:41:46 +0000 (10:41 -0700)]
[IR] Disable select ? C : undef -> C fold in ConstantFoldSelectInstruction unless we know C isn't poison.
This matches the recent change to InstSimplify from D83440.
Differential Revision: https://reviews.llvm.org/D83535
Luke Geeson [Wed, 1 Jul 2020 11:50:36 +0000 (12:50 +0100)]
[ARM] Add Cortex-A78 and Cortex-X1 Support for Clang and LLVM
This patch upstreams support for the Arm-v8 Cortex-A78 and Cortex-X1
processors for AArch64 and ARM.
In detail:
- Adding cortex-a78 and cortex-x1 as cpu options for aarch64 and arm targets in clang
- Adding Cortex-A78 and Cortex-X1 CPU names and ProcessorModels in llvm
details of the CPU can be found here:
https://www.arm.com/products/cortex-x
https://www.arm.com/products/silicon-ip-cpu/cortex-a/cortex-a78
The following people contributed to this patch:
- Luke Geeson
- Mikhail Maltsev
Reviewers: t.p.northover, dmgreen
Reviewed By: dmgreen
Subscribers: dmgreen, kristof.beyls, hiraditya, danielkiss, cfe-commits,
llvm-commits, miyuki
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D83206
Benjamin Kramer [Fri, 10 Jul 2020 17:13:47 +0000 (19:13 +0200)]
[CGProfile] Fix layering, IPO depends in Instrumentation.
Sergej Jaskiewicz [Fri, 10 Jul 2020 17:01:50 +0000 (20:01 +0300)]
Revert "[compiler-rt] [test] Use the parent process env as base env in tests"
This reverts commit
5ab446cfe5503fd4431a94db4d741cf3b5fdcd15.
That commit caused memory sanitizer test failures on PowerPC buildbots
Daniel Grumberg [Fri, 10 Jul 2020 16:54:44 +0000 (17:54 +0100)]
Remove clang options that were added back when merging the TableGen files
Saleem Abdulrasool [Fri, 10 Jul 2020 16:33:54 +0000 (09:33 -0700)]
repair standalone clang builds
Add missing C++ language standard setup for clang standalone build.
Patch by Michele Scandale!
Differential Revision: https://reviews.llvm.org/D83426
Eduardo Caldas [Fri, 10 Jul 2020 09:23:09 +0000 (09:23 +0000)]
Use FileRange::text instead of Lexer::getSpelling
* as we are using them only for integer and floating literals they have
the same behavior
* FileRange::text is simpler to call and is within the context of
syntax trees
Eduardo Caldas [Thu, 9 Jul 2020 15:49:15 +0000 (15:49 +0000)]
Add kinded UDL for raw literal operator and numeric literal operator template
Eduardo Caldas [Mon, 15 Jun 2020 17:08:39 +0000 (17:08 +0000)]
Fix crash on `user defined literals`
Summary:
Given an UserDefinedLiteral `1.2_w`:
Problem: Lexer generates one Token for the literal, but ClangAST
references two source locations
Fix: Ignore the operator and interpret it as the underlying literal.
e.g.: `1.2_w` token generates syntax node IntegerLiteral(1.2_w)
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82157
Kang Zhang [Fri, 10 Jul 2020 16:08:07 +0000 (16:08 +0000)]
[NFC][PowerPC] Add a new MIR file to test mi-peephole pass
Zequan Wu [Thu, 9 Jul 2020 21:56:06 +0000 (14:56 -0700)]
[Lexer] Fix missing coverage line after #endif
Summary: bug reported here: https://bugs.llvm.org/show_bug.cgi?id=46660
Reviewers: vsk, efriedma, arphaman
Reviewed By: vsk
Subscribers: dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83514
Zequan Wu [Wed, 8 Jul 2020 19:30:28 +0000 (12:30 -0700)]
[LPM] Port CGProfilePass from NPM to LPM
Reviewers: hans, chandlerc!, asbirlea, nikic
Reviewed By: hans, nikic
Subscribers: steven_wu, dexonsmith, nikic, echristo, void, zhizhouy, cfe-commits, aeubanks, MaskRay, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D83013
Roman Lebedev [Fri, 10 Jul 2020 15:54:48 +0000 (18:54 +0300)]
Revert "[OpenMPOpt] ICV Tracking"
There appears to be some kind of memory corruption/use-after-free/etc
going on here. In particular, in `OpenMPOpt::deleteParallelRegions()`,
in `DeleteCallCB()`, `CI` is garbage.
WIll post reproducer in the original review.
This reverts commit
6c4a5e9257bac022ffe60e466686ba7fc96ffd1a.
Daniel Grumberg [Fri, 10 Jul 2020 15:11:54 +0000 (16:11 +0100)]
Delete CC1Options.td, since it should have happened in D82574
Florian Hahn [Fri, 10 Jul 2020 15:43:35 +0000 (16:43 +0100)]
[ARM] Pass -verify-machineinstr to test and XFAIL until fixed.
Some bots run with -verify-machineinstr enabled. Add it to the new test
and XFAIL it until fixed.
Johannes Doerfert [Fri, 10 Jul 2020 15:37:31 +0000 (10:37 -0500)]
[Attributor][NFC] Update tests after recent changes
Attributor tests are mostly updated using the auto upgrade scripts but
sometimes we forget. If we do it manually or continue using old check
lines that still match we see unrelated changes down the line. This is
just a cleanup.
Florian Hahn [Fri, 10 Jul 2020 15:39:15 +0000 (16:39 +0100)]
[DomTreeUpdater] Use const auto * when iterating over pointers (NFC).
This silences the warning below:
llvm-project/llvm/lib/Analysis/DomTreeUpdater.cpp:510:20: warning: loop variable 'BB' is always a copy because the range of type 'const SmallPtrSet<llvm::BasicBlock *, 8>' does not return a reference [-Wrange-loop-analysis]
for (const auto &BB : DeletedBBs) {
^
llvm-project/llvm/lib/Analysis/DomTreeUpdater.cpp:510:8: note: use non-reference type 'llvm::BasicBlock *'
for (const auto &BB : DeletedBBs) {
^~~~~~~~~~~~~~~~
1 warning generated.