Kadir Cetinkaya [Thu, 30 Jan 2020 13:07:42 +0000 (14:07 +0100)]
[clang][Index] Introduce a TemplateParm SymbolKind
Summary:
Currently template parameters has symbolkind `Unknown`. This patch
introduces a new kind `TemplateParm` for templatetemplate, templatetype and
nontypetemplate parameters.
Also adds tests in clangd hover feature.
Reviewers: sammccall
Subscribers: kristof.beyls, ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73696
Kadir Cetinkaya [Thu, 30 Jan 2020 13:00:51 +0000 (14:00 +0100)]
[clang][DeclPrinter] Implement visitors for {TemplateType,NonTypeTemplate}Parms
Reviewers: sammccall, hokein
Subscribers: kristof.beyls, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73693
Raphael Isemann [Fri, 14 Feb 2020 11:57:10 +0000 (12:57 +0100)]
[lldb] Print result when expect_expr unexpectedly succeeds
Simon Pilgrim [Fri, 14 Feb 2020 11:54:55 +0000 (11:54 +0000)]
[X86][SSE] lowerShuffleAsBitRotate - lower to vXi8 shuffles to ROTL on pre-SSSE3 targets
Without PSHUFB we are better using ROTL (expanding to OR(SHL,SRL)) than using the generic v16i8 shuffle lowering - but if we can widen to v8i16 or more then the existing shuffles are still the better option.
REAPPLIED: Original commit rG11c16e71598d was reverted at rGde1d90299b16 as it wasn't accounting for later lowering. This version emits ROTLI or the OR(VSHLI/VSRLI) directly to avoid the issue.
Luís Marques [Fri, 14 Feb 2020 11:49:18 +0000 (11:49 +0000)]
llvm/cmake/config.guess: add support for riscv32 and riscv64
Summary: LLVM configuration fails with 'unable to guess system type' on riscv64.
Add support for detecting riscv32 and riscv64 systems.
Patch by Gokturk Yuksek (gokturk)
Reviewers: erichkeane, rengolin, mgorny, aaron.ballman, beanz, luismarques
Reviewed By: luismarques
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68899
Roger Ferrer Ibanez [Thu, 12 Dec 2019 08:55:46 +0000 (08:55 +0000)]
[OpenMP] Lower taskyield using OpenMP IR Builder
This is similar to D69828.
Special codegen for enclosing untied tasks is still done in clang.
Differential Revision: https://reviews.llvm.org/D70799
Andrew Ng [Tue, 11 Feb 2020 12:28:17 +0000 (12:28 +0000)]
[llvm-ar] Simplify Windows comparePaths NFCI
Replace use of widenPath in comparePaths with UTF8ToUTF16. widenPath
does a lot more than just conversion from UTF-8 to UTF-16. This is not
necessary for CompareStringOrdinal and could possibly even cause
problems.
Differential Revision: https://reviews.llvm.org/D74477
James Henderson [Mon, 3 Feb 2020 16:43:03 +0000 (16:43 +0000)]
[DebugInfo] Error if unsupported address size detected in line table
Prior to this patch, if a DW_LNE_set_address opcode was parsed with an
address size (i.e. with a length after the opcode) of anything other 1,
2, 4, or 8, an llvm_unreachable would be hit, as the data extractor does
not support other values. This patch introduces a new error check that
verifies the address size is one of the supported sizes, in common with
other places within the DWARF parsing.
This patch also fixes calculation of a generated line table's size in
unit tests. One of the tests in this patch highlighted a bug introduced
in
1271cde4745, when non-byte operands were used as arguments for
extended or standard opcodes.
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D73962
Pavel Labath [Thu, 6 Feb 2020 14:24:39 +0000 (06:24 -0800)]
[lldb/DWARF] Don't hold a unique SymbolFileDWARFDwo in a DWARFUnit
This is the second dwp preparatory patch. When a SymbolFileDWARFDwo will
hold more than one split unit, it will not be able to be uniquely owned
by a single DWARFUnit. I achieve this by changing the
unique_ptr<SymbolFileDWARFDwo> member of DWARFUnit to
shared_ptr<DWARFUnit>. The shared_ptr points to a DWARFUnit, but it is
in fact holding the entire SymbolFileDWARFDwo alive. This is the same
method used by llvm DWARFUnit (except that is uses the DWARFContext
class).
Differential Revision: https://reviews.llvm.org/D73782
Roger Ferrer Ibanez [Thu, 12 Dec 2019 09:19:10 +0000 (09:19 +0000)]
[OpenMP] Lower taskwait using OpenMP IR Builder
The code generation is exactly the same as it was.
But not that the special handling of untied tasks is still handled by
emitUntiedSwitch in clang.
Differential Revision: https://reviews.llvm.org/D69828
James Henderson [Thu, 13 Feb 2020 10:21:55 +0000 (10:21 +0000)]
[doc] Clarify responsibility for fixing experimental target problems
Experimental targets are meant to be maintained by the community behind
the target. They are not monitored by the primary build bots. This
change clarifies that it is this communities responsibility for things
like test fixes related to the target caused by changes unrelated to
that target.
See http://lists.llvm.org/pipermail/llvm-dev/2020-February/139115.html
for a full discussion.
Reviewed by: rupprecht, lattner, MaskRay
Differential Revision: https://reviews.llvm.org/D74538
Mehdi Amini [Fri, 14 Feb 2020 09:12:41 +0000 (09:12 +0000)]
Do not build the CUBIN conversion pass when NVPTX Backend isn't configured
This pass would currently build, but fail to run when this backend isn't
linked in. On the other hand, we'd like it to initialize only the NVPTX
backend, which isn't possible if we continue to build it without the
backend available. Instead of building a broken configuration, let's
skip building the pass entirely.
Differential Revision: https://reviews.llvm.org/D74592
Pavel Labath [Thu, 13 Feb 2020 13:40:09 +0000 (14:40 +0100)]
[lldb/dotest] Remove the "exclusive test subdir" concept
Summary:
This was added in 2018 (r339929), when we were still using the
hand-rolled test runner.
It does not seem to be relevant anymore. In fact as far as I can tell,
it's a big no-op now as the exclusive_test_subdir variable is never set.
Reviewers: vsk, JDevlieghere
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74551
Alex Zinenko [Fri, 14 Feb 2020 09:18:19 +0000 (10:18 +0100)]
[mlir] Fix argument attribute attribute reassignment in ConvertStandardToLLVM
The commit switching the calling convention for memrefs (
5a1778057)
inadvertently introduced a bug in the function argument attribute conversion:
due to incorrect indexing of function arguments it was not assigning the
attributes to the arguments beyond those generated from the first original
argument. This was not caught in the commit since the test suite does have a
test for converting multi-argument functions with argument attributes. Fix the
bug and add relevant tests.
Pavel Labath [Fri, 14 Feb 2020 08:35:13 +0000 (09:35 +0100)]
[lldb] Remove accidentally checked-in debugging code
Kazushi (Jam) Marukawa [Fri, 14 Feb 2020 08:31:06 +0000 (09:31 +0100)]
[VE] Support for PIC (global data and calls)
Summary: Support for PIC with tests for global variables and function calls.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D74536
Kadir Cetinkaya [Fri, 14 Feb 2020 08:29:56 +0000 (09:29 +0100)]
[VecotrCombine] Fix unused variable for assertion disabled builds
Sam Parker [Fri, 14 Feb 2020 08:28:26 +0000 (08:28 +0000)]
[NFC][ARM] Convert some pointers to references.
Roman Lebedev [Fri, 14 Feb 2020 08:22:29 +0000 (11:22 +0300)]
[NFC][clang-tidy] Move recently newly-added tests into checkers/ subdir
That's where nowadays those tests reside, those outliers were created
before the migration but committed after,
so they just awkwardly reside in the old place.
Pavel Labath [Fri, 14 Feb 2020 07:33:42 +0000 (08:33 +0100)]
[lldb] Add a test for launch failure and its error message
Fangrui Song [Fri, 14 Feb 2020 05:58:16 +0000 (21:58 -0800)]
[AsmPrinter][MCStreamer] De-capitalize EmitInstruction and EmitCFI*
Jonas Devlieghere [Fri, 14 Feb 2020 05:55:41 +0000 (21:55 -0800)]
[lldb/Test] Partially revert assertTrue change
This reverts
b3a0c4d7dcfa252be17ef5f5b63ffaaa83e01a2b for
TestBreakpointHitCount.py because it's now timing out on the Windows
bot. I'm not sure this is the cause, but the substitution doesn't look
correct anyway...
Jonas Devlieghere [Fri, 14 Feb 2020 05:49:12 +0000 (21:49 -0800)]
[lldb/Plugins] Have one initializer per ABI plugin
After the recent change that grouped some of the ABI plugins together,
those plugins ended up with multiple initializers per plugin. This is
incompatible with my proposed approach of generating the initializers
dynamically, which is why I've grouped them together in a new entry
point.
Differential revision: https://reviews.llvm.org/D74451
Evgeniy Brevnov [Thu, 16 Jan 2020 08:17:43 +0000 (15:17 +0700)]
[DependenceAnalysis] Dependecies for loads marked with "ivnariant.load" should not be shared with general accesses(PR42151).
Summary:
This is second attempt to fix the problem with incorrect dependencies reported in presence of invariant load. Initial fix (https://reviews.llvm.org/D64405) was reverted due to a regression reported in https://reviews.llvm.org/D70516.
The original fix changed caching behavior for invariant loads. Namely such loads are not put into the second level cache (NonLocalDepInfo). The problem with that fix is the first level cache (CachedNonLocalPointerInfo) still works as if invariant loads were in the second level cache. The solution is in addition to not putting dependence results into the second level cache avoid putting info about invariant loads into the first level cache as well.
Reviewers: jdoerfert, reames, hfinkel, efriedma
Reviewed By: jdoerfert
Subscribers: DaniilSuchkov, hiraditya, bmahjour, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73027
Fangrui Song [Fri, 14 Feb 2020 04:57:03 +0000 (20:57 -0800)]
[ELF][AArch64] Rename pacPlt to zPacPlt and forceBti to zForceIbt after D71327. NFC
We use config->z* for -z options.
Jonas Devlieghere [Fri, 14 Feb 2020 01:39:29 +0000 (17:39 -0800)]
[dsymutil] Fix double relocation of DW_AT_call_return_pc
When the DW_AT_call_return_pc matches a relocation, the call return pc
would get relocated twice, once because of the relocation in the object
file and once because of dsymutil. The same problem exists for the low
and high PC and the fix is the same. We remember the low, high and
return pc of the original DIE and relocate that, rather than the
potentially already relocated value.
Reviewed offline by Fred Riss.
Liu, Chen3 [Thu, 13 Feb 2020 13:16:18 +0000 (21:16 +0800)]
[X86] Fix the bug that _mm_mask_cvtsepi64_epi32 generates result without
zero the upper 64bit.
Differential Revision : https://reviews.llvm.org/D74552
Eric Christopher [Fri, 14 Feb 2020 01:18:53 +0000 (17:18 -0800)]
Remove unused lambda argument.
Eric Christopher [Thu, 13 Feb 2020 20:53:32 +0000 (12:53 -0800)]
Reinstate llvm-go to test the go bindings.
This partially reverts commit
102814b4d36ad004a2e37cd2a1e84bd2c3593d29.
River Riddle [Fri, 14 Feb 2020 01:11:01 +0000 (17:11 -0800)]
[mlir][DeclarativeParser] Add support for formatting enum attributes in the string form.
Summary: This revision adds support to the declarative parser for formatting enum attributes in the symbolized form. It uses this new functionality to port several of the SPIRV parsers over to the declarative form.
Differential Revision: https://reviews.llvm.org/D74525
Fangrui Song [Fri, 14 Feb 2020 00:36:27 +0000 (16:36 -0800)]
[AsmPrinter] De-capitalize all AsmPrinter::Emit* but EmitInstruction
Similar to rL328848.
Thomas Lively [Tue, 4 Feb 2020 05:26:43 +0000 (21:26 -0800)]
[WebAssembly] Make stack pointer args inhibit tail calls
Summary:
Also make return calls terminator instructions so epilogues are
inserted before them rather than after them. Together, these changes
make WebAssembly's tail call optimization more stack-safe.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73943
Fangrui Song [Fri, 14 Feb 2020 00:17:21 +0000 (16:17 -0800)]
Reland D74436 "Change clang option -ffp-model=precise to select ffp-contract=on"
Buildbot are failing with the current revert status. So reland with a
fix to fp-model.c
Pavel Iliin [Wed, 12 Feb 2020 18:31:18 +0000 (18:31 +0000)]
[AArch64][NFC] Update test checks.
This NFC commit updates several llc tests checks by automatically generated ones.
Jim Ingham [Thu, 13 Feb 2020 23:48:38 +0000 (15:48 -0800)]
Add a test for debugserver handling threads suspended from within a program.
Mach allows you to suspend and resume other threads within a program, so
debugserver has to be careful not to interfere with this when it goes to supend and
resume threads while stepping over breakpoints and calling functions. Even
trickier, if you call a function on a suspended thread, it has to resume the
thread to get the expression to run, and then suspend it properly when done.
This all works already, but there wasn't a test for it. Adding that here.
This same test could be written for a unix that supports pthread_{suspend,resume}_np, but
macOS doesn't support these calls, only the mach version. It doesn't look like
a lot of Linux'es support this (AIX does apparently...) And IIUC Windows allows
you to suspend and resume other threads, but the code for that would look pretty
different than this main.c. So for simplicity's sake I wrote this test for Darwin-only.
aartbik [Thu, 13 Feb 2020 22:50:07 +0000 (14:50 -0800)]
[mlir] [VectorOps] Initial framework for progressively lowering vector.contract
Summary:
This sets the basic framework for lowering vector.contract progressively
into simpler vector.contract operations until a direct vector.reduction
operation is reached. More details will be filled out progressively as well.
Reviewers: nicolasvasilache
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/D74520
Melanie Blower [Thu, 13 Feb 2020 22:40:01 +0000 (14:40 -0800)]
Revert "Revert "Revert "Change clang option -ffp-model=precise to select ffp-contract=on"""
This reverts commit
abd09053bc7aa6144873c196a7d50aa6ce6ca430.
It's causing internal buildbot fails on ppc
Conflicts:
clang/lib/Driver/ToolChains/Clang.cpp
Vedant Kumar [Thu, 13 Feb 2020 22:38:42 +0000 (14:38 -0800)]
Add dbgs() output to help track down missing DW_AT_location bugs, NFC
Vedant Kumar [Mon, 10 Feb 2020 23:37:56 +0000 (15:37 -0800)]
[Local] Do not move around dbg.declares during replaceDbgDeclare
replaceDbgDeclare is used to update the descriptions of stack variables
when they are moved (e.g. by ASan or SafeStack). A side effect of
replaceDbgDeclare is that it moves dbg.declares around in the
instruction stream (typically by hoisting them into the entry block).
This behavior was introduced in llvm/r227544 to fix an assertion failure
(llvm.org/PR22386), but no longer appears to be necessary.
Hoisting a dbg.declare generally does not create problems. Usually,
dbg.declare either describes an argument or an alloca in the entry
block, and backends have special handling to emit locations for these.
In optimized builds, LowerDbgDeclare places dbg.values in the right
spots regardless of where the dbg.declare is. And no one uses
replaceDbgDeclare to handle things like VLAs.
However, there doesn't seem to be a positive case for moving
dbg.declares around anymore, and this reordering can get in the way of
understanding other bugs. I propose getting rid of it.
Testing: stage2 RelWithDebInfo sanitized build, check-llvm
rdar://
59397340
Differential Revision: https://reviews.llvm.org/D74517
Sanjay Patel [Thu, 13 Feb 2020 21:08:15 +0000 (16:08 -0500)]
[VectorCombine] try to form vector binop to eliminate an extract element
binop (extelt X, C), (extelt Y, C) --> extelt (binop X, Y), C
This is a transform that has been considered for canonicalization (instcombine)
in the past because it reduces instruction count. But as shown in the x86 tests,
it's impossible to know if it's profitable without a cost model. There are many
potential target constraints to consider.
We have implemented similar transforms in the backend (DAGCombiner and
target-specific), but I don't think we have this exact fold there either (and if
we did it in SDAG, it wouldn't work across blocks).
Note: this patch was intended to handle the more general case where the extract
indexes do not match, but it got too big, so I scaled it back to this pattern
for now.
Differential Revision: https://reviews.llvm.org/D74495
Francesco Petrogalli [Thu, 13 Feb 2020 22:03:41 +0000 (22:03 +0000)]
[build] Fix shared lib builds.
Wawha [Thu, 13 Feb 2020 21:46:33 +0000 (22:46 +0100)]
[clang] Fix bad line ending (DOS instead of Unix) inside the release notes.
Fangrui Song [Thu, 13 Feb 2020 21:26:21 +0000 (13:26 -0800)]
[AsmPrinter] De-capitalize some AsmPrinter::Emit* functions
Similar to rL328848.
Craig Topper [Thu, 13 Feb 2020 19:10:57 +0000 (11:10 -0800)]
[X86] Don't widen 128/256-bit strict compares with vXi1 result to 512-bits on KNL.
If we widen the compare we might trigger a spurious exception from
the garbage data.
We have two choices here. Explicitly force the upper bits to zero.
Or use a legacy VEX vcmpps/pd instruction and convert the XMM/YMM
result to mask register.
I've chosen to go with the second option. I'm not sure which is
really best. In some cases we could get rid of the zeroing since
the producing instruction probably already zeroed it. But we lose
the ability to fold a load. So which is best is dependent on
surrounding code.
Differential Revision: https://reviews.llvm.org/D74522
Fangrui Song [Thu, 13 Feb 2020 21:10:49 +0000 (13:10 -0800)]
[AsmPrinter] De-capitalize Emit{Function,BasicBlock]* and Emit{Start,End}OfAsmFile
Thomas Lively [Fri, 7 Feb 2020 23:01:34 +0000 (15:01 -0800)]
[WebAssembly] Add cbrt function signatures
Summary:
Fixes a crash in the backend where optimizations produce calls to the
cbrt runtime functions. Fixes PR 44227.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74259
Wawha [Thu, 13 Feb 2020 19:25:34 +0000 (20:25 +0100)]
[clang-format] Add new option BeforeLambdaBody in Allman style.
This option add a line break then a lambda is inside a function call.
Reviewers : djasper, klimek, krasimir, MyDeveloperDay
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D44609
Kostya Kortchinsky [Thu, 13 Feb 2020 20:55:56 +0000 (12:55 -0800)]
[GWP-ASan] Silence gcc error
Summary: It complains about reaching the end of a non-void returning function.
Reviewers: eugenis, hctim, morehouse
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74578
Jason Molenda [Thu, 13 Feb 2020 21:06:44 +0000 (13:06 -0800)]
Small reformat to avoid tripping up possible formatting.
Jason Molenda [Thu, 13 Feb 2020 21:04:51 +0000 (13:04 -0800)]
Document third option to python synthetic type summary
callback unconditionally; it was added to lldb five years
ago and we don't need to qualify its availability.
Kostya Kortchinsky [Thu, 13 Feb 2020 17:27:18 +0000 (09:27 -0800)]
[scudo][standalone] Workaround for full regions on Android
Summary:
Due to Unity, we had to reduce our region sizes, but in some rare
situations, some programs (mostly tests AFAICT) manage to fill up
a region for a given size class.
So this adds a workaround for that attempts to allocate the block
from the immediately larger size class, wasting some memory but
allowing the application to keep going.
Reviewers: pcc, eugenis, cferris, hctim, morehouse
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74567
Jonas Devlieghere [Thu, 13 Feb 2020 20:51:19 +0000 (12:51 -0800)]
[llvm][TextAPI/MachO] Extract common code into unittest helper (NFC)
This extract common code between the 4 TBD formats in a header that can
be shared.
Differential revision: https://reviews.llvm.org/D73332
Jonas Devlieghere [Thu, 13 Feb 2020 20:47:40 +0000 (12:47 -0800)]
[llvm][TextAPI/MachO] Extend TBD_V4 unittest to verify writing
Same as D73328 but for TBD_V4. One notable tidbit is that the swift abi
version for swift 1 & 2 is emitted as a float which is considered
invalid input.
Differential revision: https://reviews.llvm.org/D73330
Reid Kleckner [Thu, 13 Feb 2020 20:50:54 +0000 (12:50 -0800)]
Remove unnecessary typedef that GCC doesn't like
serge-sans-paille [Thu, 13 Feb 2020 20:48:56 +0000 (21:48 +0100)]
Fix lit version test
Looks like on some system, version is printed on stderr, on some it's on stdout...
LLVM GN Syncbot [Thu, 13 Feb 2020 20:43:19 +0000 (20:43 +0000)]
[gn build] Port
49bffa5f8b7
Alexey Bataev [Thu, 13 Feb 2020 20:42:39 +0000 (15:42 -0500)]
[OPENMP][DOCS]Fix misprint, NFC.
Roman Lebedev [Thu, 13 Feb 2020 20:34:13 +0000 (23:34 +0300)]
[clang-tidy] misc-no-recursion: a new check
Summary:
Recursion is a powerful tool, but like any tool
without care it can be dangerous. For example,
if the recursion is unbounded, you will
eventually run out of stack and crash.
You can of course track the recursion depth
but if it is hardcoded, there can always be some
other environment when that depth is too large,
so said magic number would need to be env-dependent.
But then your program's behavior is suddenly more env-dependent.
Also, recursion, while it does not outright stop optimization,
recursive calls are less great than normal calls,
for example they hinder inlining.
Recursion is banned in some coding guidelines:
* SEI CERT DCL56-CPP. Avoid cycles during initialization of static objects
* JPL 2.4 Do not use direct or indirect recursion.
* I'd say it is frowned upon in LLVM, although not banned
And is plain unsupported in some cases:
* OpenCL 1.2, 6.9 Restrictions: i. Recursion is not supported.
So there's clearly a lot of reasons why one might want to
avoid recursion, and replace it with worklist handling.
It would be great to have a enforcement for it though.
This implements such a check.
Here we detect both direct and indirect recursive calls,
although since clang-tidy (unlike clang static analyzer)
is CTU-unaware, if the recursion transcends a single standalone TU,
we will naturally not find it :/
The algorithm is pretty straight-forward:
1. Build call-graph for the entire TU.
For that, the existing `clang::CallGraph` is re-used,
although it had to be modified to also track the location of the call.
2. Then, the hard problem: how do we detect recursion?
Since we have a graph, let's just do the sane thing,
and look for Strongly Connected Function Declarations - widely known as `SCC`.
For that LLVM provides `llvm::scc_iterator`,
which is internally an Tarjan's DFS algorithm, and is used throught LLVM,
so this should be as performant as possible.
3. Now that we've got SCC's, we discard those that don't contain loops.
Note that there may be more than one loop in SCC!
4. For each loopy SCC, we call out each function, and print a single example
call graph that shows recursion -- it didn't seem worthwhile enumerating
every possible loop in SCC, although i suppose it could be implemented.
* To come up with that call graph cycle example, we start at first SCC node,
see which callee of the node is within SCC (and is thus known to be in cycle),
and recurse into it until we hit the callee that is already in call stack.
Reviewers: JonasToth, aaron.ballman, ffrankies, Eugene.Zelenko, erichkeane, NoQ
Reviewed By: aaron.ballman
Subscribers: Charusso, Naghasan, bader, riccibruno, mgorny, Anastasia, xazax.hun, cfe-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D72362
Roman Lebedev [Thu, 13 Feb 2020 20:34:11 +0000 (23:34 +0300)]
[clang][Analysis] CallGraph: store the actual call `Expr*` in the CallGraphNode::CallRecord
Summary:
Storing not just the callee, but the actual call may be interesting for some use-cases.
In particular, D72362 would like that to better pretty-print the cycles in call graph.
Reviewers: NoQ, erichkeane
Reviewed By: NoQ
Subscribers: martong, Charusso, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74081
serge-sans-paille [Thu, 13 Feb 2020 14:30:49 +0000 (15:30 +0100)]
Fix handling of --version in lit
There's no reason why we should require a directory when asking for the version.
Differential Revision: https://reviews.llvm.org/D74553
Matt Arsenault [Wed, 22 Jan 2020 01:22:57 +0000 (20:22 -0500)]
AMDGPU/GlobalISel: Make G_TRUNC legal
This is required to be legal. I'm not sure how we were getting away
without defining any rules for it.
Matt Arsenault [Thu, 13 Feb 2020 19:30:50 +0000 (14:30 -0500)]
GlobalISel: Don't use LLT references
These should always be passed by value
Nathan James [Thu, 13 Feb 2020 20:20:37 +0000 (20:20 +0000)]
Fix crash in InfinteLoopCheck
Frederic Bastien [Thu, 13 Feb 2020 20:07:22 +0000 (12:07 -0800)]
[NVPTX, LSV] Move the LSV optimization pass to later when the graph is cleaner
This allow it to recognize more loads as being consecutive when the load's address are complex at the start.
Differential Revision: https://reviews.llvm.org/D74444
Alexey Bataev [Thu, 13 Feb 2020 20:05:19 +0000 (15:05 -0500)]
[OPENMP50][DOCS]Claim iterators and add reference to array shaping
patch, NFC.
Alexey Bataev [Thu, 13 Feb 2020 20:02:11 +0000 (15:02 -0500)]
[OPENMP50][DOCS]Update list of supported constructs, NFC.
Wawha [Thu, 13 Feb 2020 19:58:57 +0000 (20:58 +0100)]
Test commit to validate invitation
Reid Kleckner [Thu, 13 Feb 2020 19:56:50 +0000 (11:56 -0800)]
Fix MSVC buildbots after ast_type_traits namespace removal
Vedant Kumar [Thu, 13 Feb 2020 19:53:15 +0000 (11:53 -0800)]
Revert "Recommit "[SCCP] Remove forcedconstant, go to overdefined instead""
This reverts commit
bb310b3f73dde5551bc2a0d564e88f7c831dfdb3. This
breaks the stage2 ASan build, see:
https://bugs.llvm.org/show_bug.cgi?id=44898
rdar://
59431448
Alexandre Ganea [Thu, 13 Feb 2020 19:46:30 +0000 (14:46 -0500)]
[clang-tidy] Fix performance-noexcept-move-constructor-fix test on non-English locale
When running on Windows under the following locale:
D:\llvm-project>python
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getlocale()
('French_Canada', '1252')
This patch fixes the following issue:
# command stderr:
Traceback (most recent call last):
File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 249, in <module>
main()
File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 245, in main
run_test_once(args, extra_args)
File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 162, in run_test_once
diff_output.decode() +
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 2050: invalid continuation byte
This is caused by diff reporting no EOL on the last line, and unfortunately this is written in French with accentuation on my locale.
Differential Revision: https://reviews.llvm.org/D74498
Greg Clayton [Thu, 13 Feb 2020 19:43:07 +0000 (11:43 -0800)]
Fix buildbots that create shared libraries from GSYM library by adding a dependency on LLVMDebugInfoDWARF.
Alex Brachet [Thu, 13 Feb 2020 19:39:16 +0000 (14:39 -0500)]
[libc] Add Convenience syscall Template Function
Summary: This patch adds a convenience template function so we don't need to cast all types to `long` manually when calling `__llvm_libc::syscall`.
Reviewers: sivachandra, MaskRay, gchatelet
Reviewed By: sivachandra
Subscribers: libc-commits, tschuett
Differential Revision: https://reviews.llvm.org/D74530
Greg Clayton [Thu, 13 Feb 2020 19:35:43 +0000 (11:35 -0800)]
Fix buildbots by not using "and" and "not".
Ted Woodward [Thu, 13 Feb 2020 19:16:46 +0000 (13:16 -0600)]
Clean up hexagon builder after object-emission removal
Original commit:
https://reviews.llvm.org/rG7683a084de6bd2637f2351f53389df8b610566cf
Denis Khalikov [Thu, 13 Feb 2020 18:29:13 +0000 (13:29 -0500)]
[mlir][spirv] Add ConvertGpuLaunchFuncToVulkanCallsPass
Implement a pass to convert gpu.launch_func op into a sequence of
Vulkan runtime calls. The Vulkan runtime API surface is huge so currently we
don't expose separate external functions in IR for each of them, instead we
expose a few external functions to wrapper libraries which manages
Vulkan runtime.
Differential Revision: https://reviews.llvm.org/D74549
Alex Brachet [Thu, 13 Feb 2020 19:02:20 +0000 (14:02 -0500)]
[libc][NFC] clang-format syscall.h.in
Reviewers: sivachandra
Reviewed By: sivachandra
Subscribers: MaskRay, tschuett, libc-commits
Differential Revision: https://reviews.llvm.org/D74570
LLVM GN Syncbot [Thu, 13 Feb 2020 18:52:48 +0000 (18:52 +0000)]
[gn build] Port
19602b71949
Greg Clayton [Wed, 12 Feb 2020 00:05:59 +0000 (16:05 -0800)]
Add a DWARF transformer class that converts DWARF to GSYM.
Summary:
The DWARF transformer is added as a class so it can be unit tested fully.
The DWARF is converted to GSYM format and handles many special cases for functions:
- omit functions in compile units with 4 byte addresses whose address is UINT32_MAX (dead stripped)
- omit functions in compile units with 8 byte addresses whose address is UINT64_MAX (dead stripped)
- omit any functions whose high PC is <= low PC (dead stripped)
- StringTable builder doesn't copy strings, so we need to make backing copies of strings but only when needed. Many strings come from sections in object files and won't need to have backing copies, but some do.
- When a function doesn't have a mangled name, store the fully qualified name by creating a string by traversing the parent decl context DIEs and then. If we don't do this, we end up having cases where some function might appear in the GSYM as "erase" instead of "std::vector<int>::erase".
- omit any functions whose address isn't in the optional TextRanges member variable of DwarfTransformer. This allows object file to register address ranges that are known valid code ranges and can help omit functions that should have been dead stripped, but just had their low PC values set to zero. In this case we have many functions that all appear at address zero and can omit these functions by making sure they fall into good address ranges on the object file. Many compilers do this when the DWARF has a DW_AT_low_pc with a DW_FORM_addr, and a DW_AT_high_pc with a DW_FORM_data4 as the offset from the low PC. In this case the linker can't write the same address to both the high and low PC since there is only a relocation for the DW_AT_low_pc, so many linkers tend to just zero it out.
Reviewers: aprantl, dblaikie, probinson
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74450
Reid Kleckner [Wed, 12 Feb 2020 19:34:13 +0000 (11:34 -0800)]
Remove clang::ast_type_traits namespace in favor of clang
DynTypedNode and ASTNodeKind are implemented as part of the clang AST
library, which uses the main clang namespace. There doesn't seem to be a
need for this extra level of namespacing.
I left behind aliases in the ast_type_traits namespace for out of tree
clients of these APIs. To provide aliases for the enumerators, I used
this pattern:
namespace ast_type_traits {
constexpr TraversalKind TK_AsIs = ::clang::TK_AsIs;
}
I think the typedefs will be useful for migration, but we might be able
to drop these enumerator aliases.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D74499
Alexey Bataev [Thu, 13 Feb 2020 17:55:41 +0000 (12:55 -0500)]
[OPENMP50]Add support for hint clause in atomic directive.
According to OpenMP 5.0, hint clause is alowed to be used in atomic
directives.
Matt Arsenault [Mon, 10 Feb 2020 02:34:32 +0000 (21:34 -0500)]
AMDGPU/GlobalISel: Add missing tests for cmpxchg selection
Yuanfang Chen [Wed, 12 Feb 2020 07:01:35 +0000 (23:01 -0800)]
Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`"""
This reverts commit
80a34ae31125aa46dcad47162ba45b152aed968d with fixes.
Previously, since bots turning on EXPENSIVE_CHECKS are essentially turning on
MachineVerifierPass by default on X86 and the fact that
inline-asm-avx-v-constraint-32bit.ll and inline-asm-avx512vl-v-constraint-32bit.ll
are not expected to generate functioning machine code, this would go
down to `report_fatal_error` in MachineVerifierPass. Here passing
`-verify-machineinstrs=0` to make the intent explicit.
Yuanfang Chen [Thu, 13 Feb 2020 18:08:05 +0000 (10:08 -0800)]
Revert "Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""""
This reverts commit
bb51d243308dbcc9a8c73180ae7b9e47b98e68fb.
Yuanfang Chen [Wed, 12 Feb 2020 07:01:35 +0000 (23:01 -0800)]
Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`"""
This reverts commit
80a34ae31125aa46dcad47162ba45b152aed968d with fixes.
On bots llvm-clang-x86_64-expensive-checks-ubuntu and
llvm-clang-x86_64-expensive-checks-debian only,
llc returns 0 for these two tests unexpectedly. I tweaked the RUN line a little
bit in the hope that LIT is the culprit since this change is not in the
codepath these tests are testing.
llvm\test\CodeGen\X86\inline-asm-avx-v-constraint-32bit.ll
llvm\test\CodeGen\X86\inline-asm-avx512vl-v-constraint-32bit.ll
Greg Clayton [Thu, 13 Feb 2020 16:44:07 +0000 (08:44 -0800)]
Fix lldb-vscode logging and enable logging for all lldb-vscode tests.
Summary:
This patch fixes logging to log incoming packets which was removed during a refactor.
We also enable logging to a "vscode.txt" file for each lldb-vscode test by creating the log file in the build artifacts directory for each test. This allows users to see the packets for their tests if needed and the log file is in a directory that will be removed after tests have been run.
Reviewers: labath, aadsm, serhiy.redko, jankratochvil, xiaobai, wallace
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74566
Nikita Popov [Wed, 12 Feb 2020 21:25:27 +0000 (22:25 +0100)]
[MemorySSA] Don't verify MemorySSA unless VerifyMemorySSA enabled
MemorySSA is often taking up an unreasonable fraction of runtime in
assertion enabled builds. Turns out that there is one code-path that
runs verifyMemorySSA() even if VerifyMemorySSA is not enabled. This
patch makes it conditional as well.
Differential Revision: https://reviews.llvm.org/D74505
Matt Arsenault [Thu, 13 Feb 2020 01:28:38 +0000 (20:28 -0500)]
AMDGPU: Use v_perm_b32 to implement bswap
Also greatly improve i64 lowering. LegalizeIntegerTypes does the
correct narrowing if i64 isn't legal. Just workaround this for
SelectionDAG by making i64 legal and splitting in the patterns.
Yuanfang Chen [Thu, 13 Feb 2020 17:27:52 +0000 (09:27 -0800)]
[openmp][cmake] passing option argument correctly
From the context, it looks like the test should not be run with `check-all`,
but it does. It turns out option argument resolving to True/False which
could not be passed down as is. There is one such example in
AddLLVM.cmake.
Greg Clayton [Thu, 13 Feb 2020 17:32:19 +0000 (09:32 -0800)]
Fix buildbots by disabling this new test until I can fix it.
This tests works on Darwin. I will need to check windows and linux.
Alexey Bataev [Thu, 13 Feb 2020 17:26:39 +0000 (12:26 -0500)]
[OPENMP][DOCS]Update status of support constructs, NFC.
Ted Woodward [Thu, 13 Feb 2020 17:17:27 +0000 (11:17 -0600)]
Add REQUIRES: x86 so this won't be run if x86 is not available.
Alexey Bataev [Wed, 12 Feb 2020 21:12:53 +0000 (16:12 -0500)]
[OPENMP50]Add cancellation support in taskloop-based directives.
According to OpenMP 5.0, cancel and cancellation point constructs are
supported in taskloop directive. Added support for cancellation in
taskloop, master taskloop and parallel master taskloop.
Fangrui Song [Wed, 12 Feb 2020 22:08:42 +0000 (14:08 -0800)]
[ELF] Fix a null pointer dereference when --emit-relocs and --strip-debug are used together
Fixes https://bugs.llvm.org//show_bug.cgi?id=44878
When --strip-debug is specified, .debug* are removed from inputSections
while .rel[a].debug* (incorrectly) remain.
LinkerScript::addOrphanSections() requires the output section of a relocated
InputSectionBase to be created first.
.debug* are not in inputSections ->
output sections .debug* are not created ->
getOutputSectionName(.rel[a].debug*) dereferences a null pointer.
Fix the null pointer dereference by deleting .rel[a].debug* from inputSections as well.
Reviewed By: grimar, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D74510
Tatyana Krasnukha [Thu, 13 Feb 2020 16:33:08 +0000 (19:33 +0300)]
[lldb-vscode] Ensure that target matches the executable file
This commit fixes an issue with lldb-vscode failing to run programs that
use different architecture/platform than the "empty" in the target.
Original implementation was creating a default target without specifying
the target architecture, platform or program, and then would set
executable file through SBLaunchInfo, assuming that this would update
architecture and platform accordingly. However this wasn't really
happening, and architecture and platform would remain at whatever values
were in the "empty" target. The simple solution is to create target
already for a desired architecture and platform.
Function request_attach is updated in a similar fashion.
This commit also adds new JSON properties to "launch" and "attach"
packets to allow user to override desired platform and architecture.
This might be especially important for cases where information in ELF is
not enough to derive those values correctly.
New code has a behavior similar to LLDB MI [1], where typically IDE would
specify target file with -file-exec-and-symbols, and then only do -exec-run
command that would launch the process. In lldb-vscode those two actions are
merged into one request_launch function. Similarly in the interpreter
session, user would first do "file" command, then "process launch"
Differential Revision: https://reviews.llvm.org/D70847
Signed-off-by: Anton Kolesov <anton.kolesov@synopsys.com>
Greg Clayton [Wed, 29 Jan 2020 22:11:40 +0000 (14:11 -0800)]
Stop emitting a breakpoint for each location in a breakpoint when responding to breakpoint commands.
Summary: The VS Code DAP expects on response for each breakpoint that was requested. If we responsd with multiple entries for one breakpoint the VS Code UI gets out of date. Currently the VS code DAP doesn't handle one breakpoint with multiple locations. If this ever gets fixed we can modify our code.
Reviewers: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73665
John Brawn [Thu, 13 Feb 2020 14:52:33 +0000 (14:52 +0000)]
[ARM] Fix infinite loop when lowering STRICT_FP_EXTEND
If the target has FP64 but not FP16 then we have custom lowering for FP_EXTEND
and STRICT_FP_EXTEND with type f64. However if the extend is from f32 to f64 the
current implementation will cause in infinite loop for STRICT_FP_EXTEND due to
emitting a merge_values of the original node which after replacement becomes a
merge_values of itself.
Fix this by not doing anything for f32 to f64 extend when we have FP64, though
for STRICT_FP_EXTEND we have to do the strict-to-nonstrict mutation as that
doesn't happen automatically for opcodes with custom lowering.
Differential Revision: https://reviews.llvm.org/D74559
Alexey Bataev [Thu, 13 Feb 2020 14:21:15 +0000 (09:21 -0500)]
[OPENMP50]Fix handling of clauses in parallel master taskloop directive.
We need to capture correctly the value of num_tasks clause and should
not try to emit the if clause at all in the task region.
Stephan Herhut [Fri, 7 Feb 2020 12:22:10 +0000 (13:22 +0100)]
[MLIR][GPU] Implement initial mapping from loop.parallel to gpu.launch.
Summary:
To unblock other work, this implements basic lowering based on mapping
attributes that have to be provided on all loop.parallel. The lowering
does not yet support reduce.
Differential Revision: https://reviews.llvm.org/D73893
Sanjay Patel [Thu, 13 Feb 2020 15:50:03 +0000 (10:50 -0500)]
[VectorCombine] adjust tests for extract-binop; NFC
We want the extra-use tests to be consistent with the
earlier single-use tests and be as cheap as possible
in vector form to show cost model edge cases. So use
i8 and extract from element 0 since that should be
cheap for all x86 targets.
Alexey Bataev [Thu, 13 Feb 2020 15:29:22 +0000 (10:29 -0500)]
[OPENMP]Fix the test, NFC.