Kadir Cetinkaya [Mon, 13 Jan 2020 11:09:30 +0000 (12:09 +0100)]
[clangd] Include expression in DecltypeTypeLoc sourcerange while building SelectionTree
Summary:
Currently AST only contains the location for `decltype` keyword,
therefore we were skipping expressions inside decltype while building selection
tree.
This patch extends source range in such cases to contain the expression as well.
A proper fix would require changes to Sema and DecltypeTypeLoc to contain these
location information.
Fixes https://github.com/clangd/clangd/issues/250.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72594
Kadir Cetinkaya [Mon, 13 Jan 2020 16:50:23 +0000 (17:50 +0100)]
[clangd] Render header of hover card as a heading
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72625
Nico Weber [Mon, 13 Jan 2020 19:13:35 +0000 (14:13 -0500)]
[gn build] (manually) port
b4a99a061f51
Teresa Johnson [Mon, 13 Jan 2020 19:01:48 +0000 (11:01 -0800)]
Revert "[ThinLTO] Add additional ThinLTO pipeline testing with new PM"
This reverts commit
2af97be8027a0823b88d4b6a07fc5eedb440bc1f.
After attempting to fix bot failures from matching issues (mostly due to
inconsistent printing of "llvm::" prefixes on objects, and
AnalysisManager objects being printed differntly, I am now seeing some
differences I don't understand (real differences in the passes being
printed). Giving up at this point to allow the bots to recover. Will
revisit later.
Teresa Johnson [Mon, 13 Jan 2020 18:48:12 +0000 (10:48 -0800)]
Add a couple of missed wildcards in debug-pass-manager output checking
Along with the previous fix for bot failures from
2af97be8027a0823b88d4b6a07fc5eedb440bc1f, need to add a wildcard in a
couple of places where my local output did not print "llvm::" but the
bot is.
Fangrui Song [Mon, 13 Jan 2020 18:34:10 +0000 (10:34 -0800)]
[X86][Disassembler] Fix a bug when disassembling an empty string
readPrefixes() assumes insn->bytes is non-empty. The code path is not
exercised in llvm-mc because llvm-mc does not feed empty input to
MCDisassembler::getInstruction().
This bug is uncovered by
a5994c789a2982a770254ae1607b5b4cb641f73c.
An empty string did not crash before because the deleted regionReader()
allowed UINT64_C(-1) as insn->readerCursor.
Bytes.size() <= Address -> R->Base
0 <= UINT64_C(-1) - UINT32_C(-1)
Puyan Lotfi [Mon, 13 Jan 2020 18:30:20 +0000 (13:30 -0500)]
[llvm][MIRVRegNamerUtils] Adding hashing on FrameIndex MachineOperands.
This patch makes it so that cases where multiple instructions that differ only
in their FrameIndex MachineOperand values no longer collide. For instance:
%1:_(p0) = G_FRAME_INDEX %stack.0
%2:_(p0) = G_FRAME_INDEX %stack.1
Prior to this patch these instructions would collide together.
Differential Revision: https://reviews.llvm.org/D71583
Teresa Johnson [Mon, 13 Jan 2020 18:33:46 +0000 (10:33 -0800)]
Hopefully last fix for bot failures
Hopefully final bot fix for last few failures from
2af97be8027a0823b88d4b6a07fc5eedb440bc1f.
Looks like sometimes the "llvm::" preceeding objects get printed in the
debug pass manager output and sometimes they don't. Replace with
wildcard matching.
Nathan James [Mon, 13 Jan 2020 18:26:58 +0000 (13:26 -0500)]
Fix readability-identifier-naming missing member variables
Fixes PR41122 (missing fixes for member variables in a destructor) and
PR29005 (does not rename class members in all locations).
Benjamin Kramer [Mon, 13 Jan 2020 18:18:43 +0000 (19:18 +0100)]
Teresa Johnson [Mon, 13 Jan 2020 18:10:29 +0000 (10:10 -0800)]
Try number 2 for fixing bot failures
Additional fixes for bot failures from
2af97be8027a0823b88d4b6a07fc5eedb440bc1f.
Remove more exact matching on AnalyisManagers, as they can vary.
Also allow different orders between LoopAnalysis and
BranchProbabilityAnalysis as that can vary due to both being accessed in
the parameter list of a call.
Matt Arsenault [Sun, 5 Jan 2020 19:26:53 +0000 (14:26 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.ds.ordered.{add|swap}
Simon Pilgrim [Mon, 13 Jan 2020 17:56:15 +0000 (17:56 +0000)]
[SelectionDAG] ComputeNumSignBits add getValidMaximumShiftAmountConstant() for ISD::SHL support
Allows us to handle non-uniform SHL shifts to determine the minimum number of sign bits remaining (based off the maximum shift amount value)
Matt Arsenault [Sat, 4 Jan 2020 16:51:50 +0000 (11:51 -0500)]
AMDGPU/GlobalISel: Set insert point after waterfall loop
The current users of the waterfall loop utility functions do not make
use of the restored original insert point. The insertion is either
done, or they set the insert point somewhere else. A future change
will want to insert instructions after the waterfall loop, but
figuring out the point after the loop is more difficult than ensuring
the insert point is there after the loop.
Matt Arsenault [Fri, 3 Jan 2020 15:07:01 +0000 (10:07 -0500)]
AMDGPU/GlobalISel: Add some baseline tests for vector extract
A future change will try to fold constant offsets into the loop which
these will stress.
Matt Arsenault [Mon, 6 Jan 2020 03:09:24 +0000 (22:09 -0500)]
AMDGPU/GlobalISel: Fix branch targets when emitting SI_IF
The branch target needs to be changed depending on whether there is an
unconditional branch or not.
Loops also need to be similarly fixed, but compiling a simple testcase
end to end requires another set of patches that aren't upstream yet.
Matt Arsenault [Mon, 13 Jan 2020 16:02:19 +0000 (11:02 -0500)]
AMDGPU/GlobalISel: Simplify assert
Simon Pilgrim [Mon, 13 Jan 2020 17:20:36 +0000 (17:20 +0000)]
[X86][SSE] Add sitofp(shl(sext(x),y)) test case with non-uniform shift value
Shows that for non-uniform SHL shifts we fail to determine the minimum number of sign bits remaining (based off the maximum shift amount value)
Jonas Devlieghere [Mon, 13 Jan 2020 17:28:54 +0000 (09:28 -0800)]
[lldb/Docs] Extend description section of the main page
The current description is a bit terse. I've copy/pasted the
introduction form the website.
Teresa Johnson [Mon, 13 Jan 2020 17:20:19 +0000 (09:20 -0800)]
Fix tests for builtbot failures
Should fix most of the buildbot failures from
2af97be8027a0823b88d4b6a07fc5eedb440bc1f, by loosening up the matching
on the AnalysisProxy output.
Added in --dump-input=fail on the one test that appears to be something
different, so I can hopefully debug it better.
Jonas Devlieghere [Mon, 13 Jan 2020 17:23:48 +0000 (09:23 -0800)]
[lldb/Scripts] Remove SWIG bot
This is no longer used or maintained.
Differential revision: https://reviews.llvm.org/D72539
Andrew Wei [Mon, 13 Jan 2020 16:16:23 +0000 (00:16 +0800)]
[LegalizeTypes] Add SoftenFloatResult support for STRICT_SINT_TO_FP/STRICT_UINT_TO_FP
Some target like arm/riscv with soft-float will have compiling crash when using -fno-unsafe-math-optimization option.
This patch will add the missing strict FP support to SoftenFloatRes_XINT_TO_FP.
Differential Revision: https://reviews.llvm.org/D72277
Simon Pilgrim [Mon, 13 Jan 2020 16:30:09 +0000 (16:30 +0000)]
[SelectionDAG] ComputeNumSignBits add getValidMinimumShiftAmountConstant() ISD::SRA support
Allows us to handle more non-uniform SRA sign bits cases
Simon Pilgrim [Mon, 13 Jan 2020 15:49:13 +0000 (15:49 +0000)]
[X86][SSE] Add sitofp(ashr(x,y)) test case with non-uniform shift value
Simon Pilgrim [Mon, 13 Jan 2020 15:46:15 +0000 (15:46 +0000)]
[X86] Add AVX2 known signbits codegen tests
David Green [Thu, 9 Jan 2020 13:57:53 +0000 (13:57 +0000)]
[Scheduler] Remove superfluous casts. NFC
Danilo Carvalho Grael [Tue, 17 Dec 2019 15:42:52 +0000 (10:42 -0500)]
[AArch64][SVE] Add patterns for some arith SVE instructions.
Summary: Add patterns for the following instructions:
- smax, smin, umax, umin
Reviewers: sdesmalen, huntergr, rengolin, efriedma, c-rhodes, mgudim, kmclaughlin
Subscribers: amehsan
Differential Revision: https://reviews.llvm.org/D71779
Teresa Johnson [Fri, 10 Jan 2020 21:29:01 +0000 (13:29 -0800)]
[ThinLTO] Add additional ThinLTO pipeline testing with new PM
Summary:
I've added some more extensive ThinLTO pipeline testing with the new PM,
motivated by the bug fixed in D72386.
I beefed up llvm/test/Other/new-pm-pgo.ll a little so that it tests
ThinLTO pre and post link with PGO, similar to the testing for the
default pipelines with PGO.
Added new pre and post link PGO tests for both instrumentation and
sample PGO that exhaustively test the pipelines at different
optimization levels via opt.
Added a clang test to exhaustively test the post link pipeline invoked for
distributed builds. I am currently only testing O2 and O3 since these
are the most important for performance.
It would be nice to add similar exhaustive testing for full LTO, and for
the old PM, but I don't have the bandwidth now and this is a start to
cover some of the situations that are not currently default and were
under tested.
Reviewers: wmi
Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, jfb, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72538
James Henderson [Mon, 13 Jan 2020 16:27:05 +0000 (16:27 +0000)]
[DebugInfo] Make debug line address size mismatch non-fatal to parsing
Reasonable assumptions can be made when a parsed address length does not
match the expected length, so there's no need for this to be fatal.
Reviewed by: ikudrin
Differential Revision: https://reviews.llvm.org/D72154
Lorenzo Chelini [Mon, 13 Jan 2020 16:21:04 +0000 (17:21 +0100)]
[mlir] m_Constant()
Summary: Introduce m_Constant() which allows matching a constant operation without forcing the user also to capture the attribute value.
Differential Revision: https://reviews.llvm.org/D72397
Julian Gross [Thu, 9 Jan 2020 08:52:50 +0000 (09:52 +0100)]
[mlir] Added missing GPU lowering ops.
Summary:
This diff adds missing GPU lowering ops to MLIR.
Reviewers: herhut, pifon2a, ftynse
Tags: #pre-merge_beta_testing, #llvm
Differential Revision: https://reviews.llvm.org/D72439
Kazu Hirata [Mon, 13 Jan 2020 14:34:16 +0000 (06:34 -0800)]
[Inlining] Add PreInlineThreshold for the new pass manager
Summary:
This patch makes it easy to try out different preinlining thresholds
with a command-line switch just like -preinline-threshold for the
legacy pass manager.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72618
Nicolas Vasilache [Mon, 13 Jan 2020 03:38:57 +0000 (22:38 -0500)]
[mlir][Linalg] Update ReshapeOp::build to be more idiomatic
Summary:
This diff makes it easier to create a `linalg.reshape` op
and adds an EDSC builder api test to exercise the new builders.
Reviewers: ftynse, jpienaar
Subscribers: mehdi_amini, rriddle, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72580
Alexandre Ganea [Mon, 13 Jan 2020 15:40:04 +0000 (10:40 -0500)]
[Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation
With this patch, the clang tool will now call the -cc1 invocation directly inside the same process. Previously, the -cc1 invocation was creating, and waiting for, a new process.
This patch therefore reduces the number of created processes during a build, thus it reduces build times on platforms where process creation can be costly (Windows) and/or impacted by a antivirus.
It also makes debugging a bit easier, as there's no need to attach to the secondary -cc1 process anymore, breakpoints will be hit inside the same process.
Crashes or signaling inside the -cc1 invocation will have the same side-effect as before, and will be reported through the same means.
This behavior can be controlled at compile-time through the CLANG_SPAWN_CC1 cmake flag, which defaults to OFF. Setting it to ON will revert to the previous behavior, where any -cc1 invocation will create/fork a secondary process.
At run-time, it is also possible to tweak the CLANG_SPAWN_CC1 environment variable. Setting it and will override the compile-time setting. A value of 0 calls -cc1 inside the calling process; a value of 1 will create a secondary process, as before.
Differential Revision: https://reviews.llvm.org/D69825
Luís Marques [Mon, 13 Jan 2020 15:33:07 +0000 (15:33 +0000)]
[RISCV] Handle globals and block addresses in asm operands
Summary: These seem to be the machine operand types currently needed by the
RISC-V target.
Reviewers: asb, lenary
Reviewed By: lenary
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72275
Simon Pilgrim [Mon, 13 Jan 2020 14:55:51 +0000 (14:55 +0000)]
Fix cppcheck uninitialized variable in DiffTree() constructor warning. NFCI.
Simon Pilgrim [Mon, 13 Jan 2020 14:54:02 +0000 (14:54 +0000)]
Merge isVectorType() and getAs<VectorType> calls to silence clang static analyzer warning. NFCI.
Simon Pilgrim [Mon, 13 Jan 2020 14:41:16 +0000 (14:41 +0000)]
Fix some cppcheck shadow variable warnings. NFCI.
Simon Pilgrim [Mon, 13 Jan 2020 14:31:03 +0000 (14:31 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointers are always dereferenced and castAs will perform the null assertion for us.
Simon Pilgrim [Mon, 13 Jan 2020 14:28:49 +0000 (14:28 +0000)]
Sema::getOwningModule - take const Decl* type.
Fixes static analyzer warning that const_cast was being used despite only const methods being called.
Sam McCall [Mon, 13 Jan 2020 14:58:49 +0000 (15:58 +0100)]
Add missing triples to tests in
0c29d3ff2233696f663ae34a8aeda23c750ac68f so they target the right arch.
Pablo Barrio [Fri, 10 Jan 2020 17:51:21 +0000 (17:51 +0000)]
[AArch64] Emit HINT instead of PAC insns in Armv8.2-A or below
Summary:
The Pointer Authentication Extension (PAC) was added in Armv8.3-A. Some
instructions are implemented in the HINT space to allow compiling code
common to CPUs regardless of whether they feature PAC or not, and still
benefit from PAC protection in the PAC-enabled CPUs.
The 8.3-specific mnemonics were currently enabled in any architecture, and
LLVM was emitting them in assembly files when PAC code generation was
enabled. This was ok for compilations where both LLVM codegen and the
integrated assembler were used. However, the LLVM codegen was not
compatible with other assemblers (e.g. GAS). Given the fact that the
approach from these assemblers (i.e. to disallow Armv8.3-A mnemonics if
compiling for Armv8.2-A or lower) is entirely reasonable, this patch makes
LLVM to emit HINT when building for Armv8.2-A and below, instead of
PACIASP, AUTIASP and friends. Then, LLVM assembly should be compatible
with other assemblers.
Reviewers: samparker, chill, LukeCheeseman
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71658
Alex Richardson [Mon, 13 Jan 2020 13:52:48 +0000 (13:52 +0000)]
[MIPS] Don't emit R_(MICRO)MIPS_JALR relocations against data symbols
The R_(MICRO)MIPS_JALR optimization only works when used against functions.
Using the relocation against a data symbol (e.g. function pointer) will
cause some linkers that don't ignore the hint in this case (e.g. LLD prior
to commit
5bab291b7b) to generate a relative branch to the data symbol
which crashes at run time. Before this patch, LLVM was erroneously emitting
these relocations against local-dynamic TLS function pointers and global
function pointers with internal visibility.
Reviewers: atanasyan, jrtc27, vstefanovic
Reviewed By: atanasyan
Differential Revision: https://reviews.llvm.org/D72571
Alex Richardson [Sun, 12 Jan 2020 10:55:15 +0000 (10:55 +0000)]
[MIPS][ELF] Use PC-relative relocations in .eh_frame when possible
When compiling position-independent executables, we now use
DW_EH_PE_pcrel | DW_EH_PE_sdata4. However, the MIPS ABI does not define a
64-bit PC-relative ELF relocation so we cannot use sdata8 for the large
code model case. When using the large code model, we fall back to the
previous behaviour of generating absolute relocations.
With this change clang-generated .o files can be linked by LLD without
having to pass -Wl,-z,notext (which creates text relocations).
This is simpler than the approach used by ld.bfd, which rewrites the
.eh_frame section to convert absolute relocations into relative references.
I saw in D13104 that apparently ld.bfd did not accept pc-relative relocations
for MIPS ouput at some point. However, I also checked that recent ld.bfd
can process the clang-generated .o files so this no longer seems true.
Reviewed By: atanasyan
Differential Revision: https://reviews.llvm.org/D72228
Sanjay Patel [Mon, 13 Jan 2020 14:10:02 +0000 (09:10 -0500)]
[InstSimplify] move tests for select from InstCombine; NFC
InstCombine has transforms that would enable these simplifications
in an indirect way, but those transforms are unsafe and likely to
be removed.
Simon Pilgrim [Mon, 13 Jan 2020 14:11:57 +0000 (14:11 +0000)]
[SelectionDAG] ComputeNumSignBits - Use getValidShiftAmountConstant for shift opcodes
getValidShiftAmountConstant handles out of bounds shift amounts for us, allowing us to remove the local handling.
Simon Pilgrim [Mon, 13 Jan 2020 13:35:12 +0000 (13:35 +0000)]
[SelectionDAG] ComputeKnownBits - Add DemandedElts support to getValidShiftAmountConstant/getValidMinimumShiftAmountConstant()
Simon Pilgrim [Mon, 13 Jan 2020 13:11:46 +0000 (13:11 +0000)]
[X86] Add knownbits tests showing missing shift amount demanded elts handling.
Oliver Stannard [Mon, 13 Jan 2020 13:54:04 +0000 (13:54 +0000)]
Revert "[libc++] Explicitly enumerate std::string external instantiations."
This is causing failures for multiple buildbots and bootstrap builds,
details at https://reviews.llvm.org/rG61bd1920.
This reverts commit
61bd19206f61ace4b007838a2ff8884a13ec0374.
Ulrich Weigand [Mon, 13 Jan 2020 13:37:07 +0000 (14:37 +0100)]
[FPEnv] Fix chain handling for fpexcept.strict nodes
We need to ensure that fpexcept.strict nodes are not optimized away even if
the result is unused. To do that, we need to chain them into the block's
terminator nodes, like already done for PendingExcepts.
This patch adds two new lists of pending chains, PendingConstrainedFP and
PendingConstrainedFPStrict to hold constrained FP intrinsic nodes without
and with fpexcept.strict markers. This allows not only to solve the above
problem, but also to relax chains a bit further by no longer flushing all
FP nodes before a store or other memory access. (They are still flushed
before nodes with other side effects.)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D72341
Matt Arsenault [Fri, 10 Jan 2020 22:50:45 +0000 (17:50 -0500)]
GlobalISel: Fix assertion on wide G_ZEXT sources
It's possible to have a type that needs a mask greater than 64-bits.
Miloš Stojanović [Mon, 13 Jan 2020 13:04:56 +0000 (14:04 +0100)]
[llvm-exegesis] Remove unneeded std::move()
Caught by buildbot breakage:
/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/tools/llvm-exegesis/lib/Mips/Target.cpp:89:12: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
return std::move(Instructions);
^
/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/tools/llvm-exegesis/lib/Mips/Target.cpp:89:12: note: remove std::move call here
return std::move(Instructions);
^~~~~~~~~~ ~
Raphael Isemann [Mon, 13 Jan 2020 13:17:55 +0000 (14:17 +0100)]
[lldb][NFC] Remove debug print statement from TestExprDiagnostics.py
Oliver Stannard [Mon, 13 Jan 2020 12:38:39 +0000 (12:38 +0000)]
[clang] Remove raw string literals in macros
Older (but still supported) versions of GCC don't handle C++11 raw
string literals in macro parameters correctly.
Simon Pilgrim [Mon, 13 Jan 2020 12:01:56 +0000 (12:01 +0000)]
[SelectionDAG] ComputeKnownBits add getValidMinimumShiftAmountConstant() ISD::SHL support
As mentioned on D72573
Simon Pilgrim [Mon, 13 Jan 2020 11:51:12 +0000 (11:51 +0000)]
[X86][SSE] Add knownbits test showing missing getValidMinimumShiftAmountConstant() ISD::SHL support
As mentioned on D72573
Oliver Stannard [Mon, 13 Jan 2020 11:44:14 +0000 (11:44 +0000)]
[clangd] Remove raw string literals in macros
Older (but still supported) versions of GCC don't handle C++11 raw
string literals in macro parameters correctly.
Miloš Stojanović [Wed, 25 Dec 2019 10:23:01 +0000 (11:23 +0100)]
[llvm-exegesis][mips] Expand loadImmediate()
Add support for loading 32-bit immediates and enable the use of GPR64
registers.
Differential Revision: https://reviews.llvm.org/D71873
Simon Pilgrim [Mon, 13 Jan 2020 11:07:53 +0000 (11:07 +0000)]
[SelectionDAG] ComputeKnownBits - minimum leading/trailing zero bits in LSHR/SHL (PR44526)
As detailed in https://blog.regehr.org/archives/1709 we don't make use of the known leading/trailing zeros for shifted values in cases where we don't know the shift amount value.
This patch adds support to SelectionDAG::ComputeKnownBits to use KnownBits::countMinTrailingZeros and countMinLeadingZeros to set the minimum guaranteed leading/trailing known zero bits.
Differential Revision: https://reviews.llvm.org/D72573
Simon Pilgrim [Mon, 13 Jan 2020 10:52:22 +0000 (10:52 +0000)]
[X86] Fix MSVC "truncation from 'int' to 'bool'" warning. NFCI.
Jan Kratochvil [Mon, 13 Jan 2020 11:03:14 +0000 (12:03 +0100)]
[lldb] Fix lookup of symbols with the same address range but different binding
This fixes a failing testcase on Fedora 30 x86_64 (regression Fedora 29->30):
PASS:
./bin/lldb ./lldb-test-build.noindex/functionalities/unwind/noreturn/TestNoreturnUnwind.test_dwarf/a.out -o 'settings set symbols.enable-external-lookup false' -o r -o bt -o quit
* frame #0: 0x00007ffff7aa6e75 libc.so.6`__GI_raise + 325
frame #1: 0x00007ffff7a91895 libc.so.6`__GI_abort + 295
frame #2: 0x0000000000401140 a.out`func_c at main.c:12:2
frame #3: 0x000000000040113a a.out`func_b at main.c:18:2
frame #4: 0x0000000000401134 a.out`func_a at main.c:26:2
frame #5: 0x000000000040112e a.out`main(argc=<unavailable>, argv=<unavailable>) at main.c:32:2
frame #6: 0x00007ffff7a92f33 libc.so.6`__libc_start_main + 243
frame #7: 0x000000000040106e a.out`_start + 46
vs.
FAIL - unrecognized abort() function:
./bin/lldb ./lldb-test-build.noindex/functionalities/unwind/noreturn/TestNoreturnUnwind.test_dwarf/a.out -o 'settings set symbols.enable-external-lookup false' -o r -o bt -o quit
* frame #0: 0x00007ffff7aa6e75 libc.so.6`.annobin_raise.c + 325
frame #1: 0x00007ffff7a91895 libc.so.6`.annobin_loadmsgcat.c_end.unlikely + 295
frame #2: 0x0000000000401140 a.out`func_c at main.c:12:2
frame #3: 0x000000000040113a a.out`func_b at main.c:18:2
frame #4: 0x0000000000401134 a.out`func_a at main.c:26:2
frame #5: 0x000000000040112e a.out`main(argc=<unavailable>, argv=<unavailable>) at main.c:32:2
frame #6: 0x00007ffff7a92f33 libc.so.6`.annobin_libc_start.c + 243
frame #7: 0x000000000040106e a.out`.annobin_init.c.hot + 46
The extra ELF symbols are there due to Annobin (I did not investigate why this
problem happened specifically since F-30 and not since F-28).
It is due to:
Symbol table '.dynsym' contains 2361 entries:
Valu e Size Type Bind Vis Name
0000000000022769 5 FUNC LOCAL DEFAULT _nl_load_domain.cold
000000000002276e 0 NOTYPE LOCAL HIDDEN .annobin_abort.c.unlikely
...
000000000002276e 0 NOTYPE LOCAL HIDDEN .annobin_loadmsgcat.c_end.unlikely
...
000000000002276e 0 NOTYPE LOCAL HIDDEN .annobin_textdomain.c_end.unlikely
000000000002276e 548 FUNC GLOBAL DEFAULT abort
000000000002276e 548 FUNC GLOBAL DEFAULT abort@@GLIBC_2.2.5
000000000002276e 548 FUNC LOCAL DEFAULT __GI_abort
0000000000022992 0 NOTYPE LOCAL HIDDEN .annobin_abort.c_end.unlikely
GDB has some more complicated preferences between overlapping and/or sharing
address symbols, I have made here so far the most simple fix for this case.
Differential revision: https://reviews.llvm.org/D63540
Raphael Isemann [Mon, 13 Jan 2020 10:05:53 +0000 (11:05 +0100)]
[lldb][NFC] Use range-based for loops in IRInterpreter
James Henderson [Mon, 13 Jan 2020 09:30:52 +0000 (09:30 +0000)]
[DebugInfo][Support] Replace DWARFDataExtractor size function
This patch adds a new size function to the base DataExtractor class,
which removes the need for the DWARFDataExtractor size function.
It is unclear why DWARFDataExtractor's size function returned zero in
some circumstances (i.e. when it is constructed without a section, and
with a different data source instead), so that behaviour has changed.
The old behaviour could cause an assertion in the debug line parser, as
the size did not reflect the actual data available, and could be lower
than the current offset being parsed.
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D72337
Sjoerd Meijer [Mon, 13 Jan 2020 10:20:04 +0000 (10:20 +0000)]
ARMLowOverheadLoops: return earlier to avoid printing irrelevant dbg msg. NFC
KAWASHIMA Takahiro [Mon, 13 Jan 2020 09:28:02 +0000 (09:28 +0000)]
This option allows selecting the TLS size in the local exec TLS model,
which is the default TLS model for non-PIC objects. This allows large/
many thread local variables or a compact/fast code in an executable.
Specification is same as that of GCC. For example, the code model
option precedes the TLS size option.
TLS access models other than local-exec are not changed. It means
supoort of the large code model is only in the local exec TLS model.
Patch By KAWASHIMA Takahiro (kawashima-fj <t-kawashima@fujitsu.com>)
Reviewers: dmgreen, mstorsjo, t.p.northover, peter.smith, ostannard
Reviewd By: peter.smith
Committed by: peter.smith
Differential Revision: https://reviews.llvm.org/D71688
Pavel Labath [Mon, 13 Jan 2020 10:09:47 +0000 (11:09 +0100)]
[lldb] Fix eh-frame-small-fde test for changes in lld
lld in 2bfee35 started emitting relocations for some intra-section jumps
between global symbols. This shifted the code around a bit, invalidating
text expectations.
Change the symbols to local to keep the previous behavior.
Sam McCall [Mon, 13 Jan 2020 10:12:51 +0000 (11:12 +0100)]
Revert "[DWARF5][clang]: Added support for DebugInfo generation for auto return type for C++ member functions."
This reverts commit
6d6a4590c5d4c7fc7445d72fe685f966b0a8cafb, which
introduces a crash.
See https://reviews.llvm.org/D70524 for details.
Utkarsh Saxena [Wed, 8 Jan 2020 12:57:00 +0000 (13:57 +0100)]
[clangd] Publish xref for macros from Index and AST.
Summary:
With this patch the `findReferences` API will return Xref for macros.
If the symbol under the cursor is a macro then we collect the references to it from:
1. Main file by looking at the ParsedAST. (These were added to the ParsedAST in https://reviews.llvm.org/D70008)
2. Files other than the mainfile by looking at the:
* static index (Added in https://reviews.llvm.org/D70489)
* file index (Added in https://reviews.llvm.org/D71406)
This patch collects all the xref from the above places and outputs it in `findReferences` API.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72395
Sam Elliott [Mon, 13 Jan 2020 10:03:33 +0000 (10:03 +0000)]
[RISCV] Collect Statistics on Compressed Instructions
Summary:
It is useful to keep statistics on how many instructions we have
compressed, so we can see if future changes are increasing or decreasing this
number.
Reviewers: asb, luismarques
Reviewed By: asb, luismarques
Subscribers: xbolva00, sameer.abuasal, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67495
Raphael Isemann [Mon, 13 Jan 2020 09:00:06 +0000 (10:00 +0100)]
[lldb] Mark several tests as not dependent on debug info
Summary:
This just adds `NO_DEBUG_INFO_TESTCASE` to tests that don't really exercise anything debug information specific
and therefore don't need to be rerun for all debug information variants.
Reviewers: labath, jingham, aprantl, mib, jfb
Reviewed By: aprantl
Subscribers: dexonsmith, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72447
Pruthvi [Mon, 13 Jan 2020 09:16:44 +0000 (10:16 +0100)]
Add zero_extendi and sign_extendi to intrinsic namespace
Summary:
- update zero_extendi and sign_extendi in edsc/intrinsic namespace
- Builder API test for zero_extendi and sign_extendi
Differential Revision: https://reviews.llvm.org/D72298
Sam Parker [Mon, 13 Jan 2020 09:18:57 +0000 (09:18 +0000)]
[NFC] Update loop.decrement.reg intrinsic comment
Note that the intrinsic is now understood by SCEV and that other
optimisations can treat it as a sub.
Sjoerd Meijer [Mon, 13 Jan 2020 08:54:38 +0000 (08:54 +0000)]
[SCEV] Follow up of D71563: addressing post commit comment. NFC.
Awanish Pandey [Mon, 13 Jan 2020 07:08:00 +0000 (12:38 +0530)]
[DWARF5][clang]: Added support for DebugInfo generation for auto return type for C++ member functions.
Summary:
This patch will provide support for auto return type for the C++ member
functions.
This patch includes clang side implementation of this feature.
Patch by: Awanish Pandey <Awanish.Pandey@amd.com>
Reviewers: dblaikie, aprantl, shafik, alok, SouraVX, jini.susan.george
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D70524
Awanish Pandey [Mon, 13 Jan 2020 06:26:18 +0000 (11:56 +0530)]
[DWARF5][DebugInfo]: Added support for DebugInfo generation for auto return type for C++ member functions.
Summary:
This patch will provide support for auto return type for the C++ member
functions. Before this return type of the member function is deduced and
stored in the DIE.
This patch includes llvm side implementation of this feature.
Patch by: Awanish Pandey <Awanish.Pandey@amd.com>
Reviewers: dblaikie, aprantl, shafik, alok, SouraVX, jini.susan.george
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D70524
Craig Topper [Mon, 13 Jan 2020 05:10:37 +0000 (21:10 -0800)]
[X86] Use SDNPOptInGlue instead of SDNPInGlue on a couple SDNodes.
At least one of these is used without a Glue. This doesn't seem
to change the X86GenDAGISel.inc output so maybe it doesn't matter?
Matt Arsenault [Sun, 12 Jan 2020 23:08:41 +0000 (18:08 -0500)]
AMDGPU: Split test function
This avoids slightly different scheduling/regalloc behavior, and
avoids a test diff between GlobalISel and SelectionDAG.
Matt Arsenault [Sun, 12 Jan 2020 22:10:18 +0000 (17:10 -0500)]
AMDGPU/GlobalISel: Don't use XEXEC class for SGPRs
We don't use the xexec register classes for arbitrary values
anymore. Avoids a test variance beween GlobalISel and SelectionDAG>
Matt Arsenault [Mon, 13 Jan 2020 00:12:59 +0000 (19:12 -0500)]
AMDGPU/GlobalISel: Copy type when inserting readfirstlane
getDefIgnoringCopies will fail to find any def if no type is set if we
try to use it on the use's operand, so propagate the type.
Nathan Ridge [Thu, 19 Dec 2019 21:22:23 +0000 (16:22 -0500)]
[clangd] Show template arguments in type hierarchy when possible
Summary: Fixes https://github.com/clangd/clangd/issues/31
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71533
Nathan Ridge [Tue, 7 Jan 2020 19:44:50 +0000 (14:44 -0500)]
[clangd] Assert that the testcases in FindExplicitReferencesTest.All have no diagnostics
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72355
Zheng Chen [Mon, 13 Jan 2020 01:22:37 +0000 (20:22 -0500)]
[SCEV] accurate range for addrecexpr with nuw flag
If addrecexpr has nuw flag, the value should never be less than its
start value and start value does not required to be SCEVConstant.
Reviewed By: nikic, sanjoy
Differential Revision: https://reviews.llvm.org/D71690
James Clarke [Mon, 13 Jan 2020 00:50:37 +0000 (00:50 +0000)]
[RISCV] Check register class for AMO memory operands
Summary:
AMO memory operands use a custom parser in order to accept both (reg)
and 0(reg). However, the validation predicate used for these operands
was only checking that they were registers, and not the register class,
so non-GPRs (such as FPRs) were also accepted. Thus, fix this by making
the predicate check that they are GPRs.
Reviewers: asb, lenary
Reviewed By: asb, lenary
Subscribers: hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72471
Simon Pilgrim [Sun, 12 Jan 2020 22:08:56 +0000 (22:08 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointers are dereferenced immediately and castAs will perform the null assertion for us.
Simon Pilgrim [Sun, 12 Jan 2020 21:43:11 +0000 (21:43 +0000)]
Fix "pointer is null" static analyzer warning. NFCI.
Fangrui Song [Sat, 4 Jan 2020 05:44:57 +0000 (21:44 -0800)]
[MC][ELF] Emit a relocation if target is defined in the same section and is non-local
For a target symbol defined in the same section, currently we don't emit
a relocation if VariantKind is VK_None (with few exceptions like RISC-V
relaxation), while GNU as emits one. This causes program behavior
differences with and without -ffunction-sections, and can break intended
symbol interposition in a -shared link.
```
.globl foo
foo:
call foo # no relocation. On other targets, may be written as b foo, etc
call bar # a relocation if bar is in another section (e.g. -ffunction-sections)
call foo@plt # a relocation
```
Unify these cases by always emitting a relocation. If we ever want to
optimize `call foo` in -shared links, we should emit a STB_LOCAL alias
and call via the alias.
ARM/thumb2-beq-fixup.s: we now emit a relocation to global_thumb_fn as GNU as does.
X86/Inputs/align-branch-64-2.s: we now emit R_X86_64_PLT32 to foo as GNU does.
ELF/relax.s: rewrite the test as target-in-same-section.s .
We omitted relocations to `global` and now emit R_X86_64_PLT32.
Note, GNU as does not emit a relocation for `jmp global` (maybe its own
bug). Our new behavior is compatible except `jmp global`.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D72197
Jay Foad [Sat, 11 Jan 2020 20:48:29 +0000 (20:48 +0000)]
[AMDGPU] Add gfx8 assembler and disassembler test cases
Summary:
This adds assembler tests for cases that were previously only in the
disassembler tests, and vice versa.
Reviewers: rampitec, arsenm, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72561
Fangrui Song [Sun, 12 Jan 2020 20:23:16 +0000 (12:23 -0800)]
__patchable_function_entries: don't use linkage field 'unique' with -no-integrated-as
.section name, "flags"G, @type, GroupName[, linkage]
As of binutils 2.33, linkage cannot be 'unique'. For integrated
assembler, we use both 'o' flag and 'unique' linkage to support
--gc-sections and COMDAT with lld.
https://sourceware.org/ml/binutils/2019-11/msg00266.html
Markus Böck [Sun, 12 Jan 2020 19:24:35 +0000 (14:24 -0500)]
[NFC] Fix compilation of CrashRecoveryContext.cpp on mingw
Patch by Markus Böck.
Differential Revision: https://reviews.llvm.org/D72564
Fangrui Song [Thu, 2 Jan 2020 03:27:55 +0000 (19:27 -0800)]
[PowerPC] Delete PPCDarwinAsmPrinter and PPCMCAsmInfoDarwin
Darwin support has been removed.
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D72063
Simon Pilgrim [Sun, 12 Jan 2020 12:57:01 +0000 (12:57 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Use cast<> instead of dyn_cast<> and move into its users where its dereferenced immediately.
Simon Pilgrim [Sun, 12 Jan 2020 14:35:34 +0000 (14:35 +0000)]
[MIPS] Regenerate shl/lshr shift tests
Simon Pilgrim [Sun, 12 Jan 2020 14:34:36 +0000 (14:34 +0000)]
[AMDGPU] Regenerate shl shift tests
Simon Pilgrim [Sun, 12 Jan 2020 12:29:41 +0000 (12:29 +0000)]
[X86][AVX] Use lowerShuffleAsLanePermuteAndSHUFP to lower binary v4f64 shuffles.
Only perform this if we are shuffling lower and upper lane elements across the lanes (otherwise splitting to lower xmm shuffles would be better).
This is a regression if we shuffle build_vectors due to getVectorShuffle canonicalizing 'blend of splat' build vectors, for now I've set this not to shuffle build_vector nodes at all to avoid this.
Simon Pilgrim [Sun, 12 Jan 2020 09:41:40 +0000 (09:41 +0000)]
[X86][AVX] lowerShuffleAsLanePermuteAndSHUFP - only set the demanded elements of the lane mask.
Fixes an cyclic dependency issue with an upcoming patch where getVectorShuffle canonicalizes masks with splat build vector sources.
Fangrui Song [Sun, 12 Jan 2020 02:27:13 +0000 (18:27 -0800)]
[X86][Disassembler] Merge X86DisassemblerDecoder.cpp into X86Disassembler.cpp and refactor
Fangrui Song [Sun, 12 Jan 2020 02:08:06 +0000 (18:08 -0800)]
[X86][Disassembler] Simplify
Fangrui Song [Sun, 12 Jan 2020 08:24:10 +0000 (00:24 -0800)]
[profile] Support merge pool size >= 10
The executable acquires an advisory record lock (`fcntl(fd, F_SETLKW, *)`) on a profile file.
Merge pool size >= 10 may be beneficial when the concurrency is large.
Also fix a small problem about snprintf. It can cause the filename to be truncated after %m.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D71970
Qiu Chaofan [Sun, 12 Jan 2020 05:10:04 +0000 (13:10 +0800)]
[NFC] Refactor memory ops cluster method
Current implementation of BaseMemOpsClusterMutation is a little bit
obscure. This patch directly uses a map from store chain ID to set of
memory instrs to make it simpler, so that future improvements are easier
to read, update and review.
Reviewed By: evandro
Differential Revision: https://reviews.llvm.org/D72070
Craig Topper [Sun, 12 Jan 2020 02:10:11 +0000 (18:10 -0800)]
[X86] Don't call LowerSETCC from LowerSELECT for STRICT_FSETCC/STRICT_FSETCCS nodes.
This causes the STRICT_FSETCC/STRICT_FSETCCS nodes to lowered
early while lowering SELECT, but the output chain doesn't get
connected. Then we visit the node again when it is its turn
because we haven't replaced the use of the chain result. In the
case of the fp128 libcall lowering, after D72341 this will cause
the libcall to be emitted twice.