Craig Topper [Fri, 18 Jan 2019 18:22:26 +0000 (18:22 +0000)]
[X86] Lower avx2/avx512f gather intrinsics to X86MaskedGatherSDNode instead of going directly to MachineSDNode.:
This sends these intrinsics through isel in a much more normal way. This should allow addressing mode matching in isel to make better use of the displacement field.
Differential Revision: https://reviews.llvm.org/D56827
llvm-svn: 351570
Jonas Toth [Fri, 18 Jan 2019 18:03:11 +0000 (18:03 +0000)]
[clang-tidy] add reproducer for PR39949 into test-suite
Summary:
The underlying issue is fixed in https://reviews.llvm.org/D56444
and this test ensures the issue does not creep back into our
code-base.
Reviewers: alexfh, aaron.ballman, hokein, hwright
Reviewed By: aaron.ballman
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D56918
llvm-svn: 351569
Craig Topper [Fri, 18 Jan 2019 17:51:51 +0000 (17:51 +0000)]
[X86] Only define _XCR_XFEATURE_ENABLED_MASK in xsaveintrin.h when _MSC_VER is defined. Remove from intrin.h.
I think this was my intention when I added it xsaveintrin.h
llvm-svn: 351568
Florian Hahn [Fri, 18 Jan 2019 17:36:22 +0000 (17:36 +0000)]
[LCSSA] Skip blocks in sub-loops when scanning for uses.
Summary:
Scanning blocks in sub-loops for uses is unnecessary, as they were
already handled while dealing with the containing sub-loop.
This speeds up LCSSA for highly nested loops. For the test case in PR37202, it
halves the time spent in LCSSA. In cases were we won't be able to skip
any blocks, the additional lookup should be negligible.
Time-passes without this patch for test case from PR37202:
Total Execution Time: 48.5505 seconds (48.5511 wall clock)
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
10.0822 ( 21.0%) 0.1406 ( 27.0%) 10.2228 ( 21.1%) 10.2228 ( 21.1%) Loop-Closed SSA Form Pass
10.0417 ( 20.9%) 0.1467 ( 28.2%) 10.1884 ( 21.0%) 10.1890 ( 21.0%) Loop-Closed SSA Form Pass #2
4.2703 ( 8.9%) 0.0040 ( 0.8%) 4.2742 ( 8.8%) 4.2742 ( 8.8%) Unswitch loops
2.7376 ( 5.7%) 0.0229 ( 4.4%) 2.7605 ( 5.7%) 2.7611 ( 5.7%) Loop-Closed SSA Form Pass #5
2.7332 ( 5.7%) 0.0214 ( 4.1%) 2.7546 ( 5.7%) 2.7546 ( 5.7%) Loop-Closed SSA Form Pass #3
2.7088 ( 5.6%) 0.0230 ( 4.4%) 2.7319 ( 5.6%) 2.7324 ( 5.6%) Loop-Closed SSA Form Pass #4
2.6855 ( 5.6%) 0.0236 ( 4.5%) 2.7091 ( 5.6%) 2.7090 ( 5.6%) Loop-Closed SSA Form Pass #6
2.1648 ( 4.5%) 0.0018 ( 0.4%) 2.1666 ( 4.5%) 2.1664 ( 4.5%) Unroll loops
1.8371 ( 3.8%) 0.0009 ( 0.2%) 1.8379 ( 3.8%) 1.8380 ( 3.8%) Value Propagation
1.8149 ( 3.8%) 0.0021 ( 0.4%) 1.8170 ( 3.7%) 1.8169 ( 3.7%) Loop Invariant Code Motion
1.6755 ( 3.5%) 0.0226 ( 4.3%) 1.6981 ( 3.5%) 1.6980 ( 3.5%) Loop-Closed SSA Form Pass #7
Time-passes with this patch
Total Execution Time: 29.9285 seconds (29.9276 wall clock)
---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name ---
5.2786 ( 17.7%) 0.0021 ( 1.2%) 5.2806 ( 17.6%) 5.2808 ( 17.6%) Unswitch loops
4.3739 ( 14.7%) 0.0303 ( 18.1%) 4.4042 ( 14.7%) 4.4042 ( 14.7%) Loop-Closed SSA Form Pass
4.2658 ( 14.3%) 0.0192 ( 11.5%) 4.2850 ( 14.3%) 4.2851 ( 14.3%) Loop-Closed SSA Form Pass #2
2.2307 ( 7.5%) 0.0013 ( 0.8%) 2.2320 ( 7.5%) 2.2318 ( 7.5%) Loop Invariant Code Motion
2.0888 ( 7.0%) 0.0012 ( 0.7%) 2.0900 ( 7.0%) 2.0897 ( 7.0%) Unroll loops
1.6761 ( 5.6%) 0.0013 ( 0.8%) 1.6774 ( 5.6%) 1.6774 ( 5.6%) Value Propagation
1.3686 ( 4.6%) 0.0029 ( 1.8%) 1.3716 ( 4.6%) 1.3714 ( 4.6%) Induction Variable Simplification
1.1457 ( 3.8%) 0.0010 ( 0.6%) 1.1468 ( 3.8%) 1.1468 ( 3.8%) Loop-Closed SSA Form Pass #4
1.1384 ( 3.8%) 0.0005 ( 0.3%) 1.1389 ( 3.8%) 1.1389 ( 3.8%) Loop-Closed SSA Form Pass #6
1.1360 ( 3.8%) 0.0027 ( 1.6%) 1.1387 ( 3.8%) 1.1387 ( 3.8%) Loop-Closed SSA Form Pass #5
1.1331 ( 3.8%) 0.0010 ( 0.6%) 1.1341 ( 3.8%) 1.1340 ( 3.8%) Loop-Closed SSA Form Pass #3
Reviewers: davide, efriedma, mzolotukhin
Reviewed By: davide, efriedma
Subscribers: hiraditya, dmgreen, llvm-commits
Differential Revision: https://reviews.llvm.org/D56848
llvm-svn: 351567
Ilya Biryukov [Fri, 18 Jan 2019 17:30:49 +0000 (17:30 +0000)]
[Support] Implement llvm::Registry::iterator via llvm_iterator_facade
Summary:
Among other things, this allows using STL algorithms like 'find_if' over
llvm::Registry.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: kristina, llvm-commits
Differential Revision: https://reviews.llvm.org/D56854
llvm-svn: 351566
Zola Bridges [Fri, 18 Jan 2019 17:20:46 +0000 (17:20 +0000)]
[clang][slh] add Clang attr no_speculative_load_hardening
Summary:
This attribute will allow users to opt specific functions out of
speculative load hardening. This compliments the Clang attribute
named speculative_load_hardening. When this attribute or the attribute
speculative_load_hardening is used in combination with the flags
-mno-speculative-load-hardening or -mspeculative-load-hardening,
the function level attribute will override the default during LLVM IR
generation. For example, in the case, where the flag opposes the
function attribute, the function attribute will take precendence.
The sticky inlining behavior of the speculative_load_hardening attribute
may cause a function with the no_speculative_load_hardening attribute
to be tagged with the speculative_load_hardening tag in
subsequent compiler phases which is desired behavior since the
speculative_load_hardening LLVM attribute is designed to be maximally
conservative.
If both attributes are specified for a function, then an error will be
thrown.
Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D54909
llvm-svn: 351565
Greg Clayton [Fri, 18 Jan 2019 17:06:01 +0000 (17:06 +0000)]
Make sure to fill in the compiler register number so when we try to backtrace using EH frame, it works.
Prior to this, backtraces could fail due to not being able to convert a EH frame register number to LLDB register number.
llvm-svn: 351564
Ilya Biryukov [Fri, 18 Jan 2019 17:04:26 +0000 (17:04 +0000)]
[clangd] Make background index less chatty
Summary:
It is producing too much input in non-verbose mode,
i.e. a message per indexed file
Reviewers: sammccall, kadircet
Reviewed By: sammccall
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D56915
llvm-svn: 351563
Neil Henning [Fri, 18 Jan 2019 16:39:27 +0000 (16:39 +0000)]
[AMDGPU] Add some missing always-uniform values.
This commit adds some missing intrinsics into the isAlwaysUniform list
for the AMDGPU backend.
Differential Revision: https://reviews.llvm.org/D56845
llvm-svn: 351562
Nirav Dave [Fri, 18 Jan 2019 16:03:08 +0000 (16:03 +0000)]
Revert "Clang side support for @cc assembly operands."
llvm-svn: 351561
Simon Pilgrim [Fri, 18 Jan 2019 15:57:59 +0000 (15:57 +0000)]
[LTO] Change test/tools/lto/no-bitcode.s requirement from arm to aarch64
Set the test to properly require aarch64 instead of arm. Otherwise, this test fails with LLVM_TARGETS_TO_BUILD='ARM;X86'
bin/llvm-mc: : error: unable to get target for 'arm64-apple-ios7.0.0'
Committed on behalf of @easyaspi314 (Devin)
Differential Revision: https://reviews.llvm.org/D56472
llvm-svn: 351560
Nirav Dave [Fri, 18 Jan 2019 15:57:23 +0000 (15:57 +0000)]
Clang side support for @cc assembly operands.
llvm-svn: 351559
Nirav Dave [Fri, 18 Jan 2019 15:57:13 +0000 (15:57 +0000)]
[SelectionDAGBuilder] Cleanup InlineAsm Output generation. NFCI.
Defer inline asm's output fixup work until after we've generated the
inline asm node itself. Remove StoresToEmit, IndirectStoresToEmit, and
RetValRegs in favor of using ConstraintOperands.
llvm-svn: 351558
Sanjay Patel [Fri, 18 Jan 2019 15:55:21 +0000 (15:55 +0000)]
[x86] simplify code for SDValue.getOperand(); NFC
llvm-svn: 351557
Clement Courbet [Fri, 18 Jan 2019 15:26:14 +0000 (15:26 +0000)]
Revert r351529 "[llvm-objdump][NFC] Improve readability."
msan errors in ELF/strip-all.s.
llvm-svn: 351556
Dmitry Preobrazhensky [Fri, 18 Jan 2019 15:17:17 +0000 (15:17 +0000)]
[AMDGPU][MC][GFX8+][DISASSEMBLER] Corrected 1/2pi value for 64-bit operands
See bug 39332: https://bugs.llvm.org/show_bug.cgi?id=39332
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D56794
llvm-svn: 351555
Simon Pilgrim [Fri, 18 Jan 2019 14:48:36 +0000 (14:48 +0000)]
[TTI] Use ConcreteTTI cast in getIntrinsicInstrCost Type variant. NFCI.
Same as we do in the Value variant.
llvm-svn: 351554
Clement Courbet [Fri, 18 Jan 2019 14:20:13 +0000 (14:20 +0000)]
Reland r351529 "[llvm-objdump][NFC] Improve readability."
`SectionSymbol*` is cast from `void*` to
`std::tuple<uint64_t, StringRef, uint8_t>` in AMDGPUSymbolizer, so it has to
*be* one, not *act like* one.
llvm-svn: 351553
Florian Hahn [Fri, 18 Jan 2019 14:05:59 +0000 (14:05 +0000)]
[SelectionDAG] Add getTokenFactor, which splits nodes with > 64k operands.
This functionality is required at multiple places which potentially
create large operand lists, like SelectionDAGBuilder or DAGCombiner.
Differential Revision: https://reviews.llvm.org/D56739
llvm-svn: 351552
James Henderson [Fri, 18 Jan 2019 13:58:41 +0000 (13:58 +0000)]
Add __[_[_]]Z demangling to new common demangle function
This is a follow-up to r351448. It adds support for other _*Z extensions
of the Itanium demanling, to the newly available demangle function
heuristic.
Reviewed by: erik.pilkington, rupprecht, grimar
Differential Revision: https://reviews.llvm.org/D56855
llvm-svn: 351551
Erich Keane [Fri, 18 Jan 2019 13:58:10 +0000 (13:58 +0000)]
Fix test failure from r351495
The test has problems due to some platforms having a different type for
ptrdiff_t, so the error message is different. The error message doesn't
matter to the test for anything other than an incompatible intger to
pointer conversion, so this patch removes the integral type from the
expected message.
Change-Id: I80e786f9b80268163813774bbf25a9ca25b6c60c
llvm-svn: 351550
Dmitry Preobrazhensky [Fri, 18 Jan 2019 13:57:43 +0000 (13:57 +0000)]
[AMDGPU][MC] Disabled use of 2 different literals with SOP2/SOPC instructions
See bug 39319: https://bugs.llvm.org/show_bug.cgi?id=39319
Reviewers: artem.tamazov, arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D56847
llvm-svn: 351549
Pavel Labath [Fri, 18 Jan 2019 12:52:03 +0000 (12:52 +0000)]
[ADT] Add streaming operators for llvm::Optional
Summary:
The operators simply print the underlying value or "None".
The trickier part of this patch is making sure the streaming operators
work even in unit tests (which was my primary motivation, though I can
also see them being useful elsewhere). Since the stream operator was a
template, implicit conversions did not kick in, and our gtest glue code
was explicitly introducing an implicit conversion to make sure other
implicit conversions do not kick in :P. I resolve that by specializing
llvm_gtest::StreamSwitch for llvm:Optional<T>.
Reviewers: sammccall, dblaikie
Reviewed By: sammccall
Subscribers: mgorny, dexonsmith, kristina, llvm-commits
Differential Revision: https://reviews.llvm.org/D56795
llvm-svn: 351548
George Rimar [Fri, 18 Jan 2019 12:01:59 +0000 (12:01 +0000)]
[llvm-objdump] - Dump the archive headers when -all-headers is specified.
When -all-headers is given it is supposed to dump all headers,
but now it skips the archive headers for no reason.
The patch fixes that.
Differential revision: https://reviews.llvm.org/D56780
llvm-svn: 351547
Anastasia Stulova [Fri, 18 Jan 2019 11:38:16 +0000 (11:38 +0000)]
[OpenCL] Fix overloading ranking rules for addrspace conversions.
Extend ranking to work with address spaces correctly when
resolving overloads.
Differential Revision: https://reviews.llvm.org/D56735
llvm-svn: 351546
George Rimar [Fri, 18 Jan 2019 11:33:26 +0000 (11:33 +0000)]
[llvm-objdump] - Move getRelocationValueString and dependenices out of the llvm-objdump.cpp
getRelocationValueString is a dispatcher function that calls the
corresponding ELF/COFF/Wasm/MachO implementations
that currently live in the llvm-objdump.cpp file.
These implementations better be moved to ELFDump.cpp,
COFFDump.cpp and other corresponding files, to move platform specific
implementation out from the common logic.
The patch does that. Also, I had to move ToolSectionFilter helper
and SectionFilterIterator, SectionFilter to a header to make them
available across the objdump code.
Differential revision: https://reviews.llvm.org/D56842
llvm-svn: 351545
Dylan McKay [Fri, 18 Jan 2019 11:27:38 +0000 (11:27 +0000)]
[AVR] Fix codegen bug in 16-bit loads
Prior to this patch, the AVR::LDWRdPtr instruction was always lowered to
instructions of this pattern:
ld $GPR8, [PTR:XYZ]+
ld $GPR8, [PTR]+1
This has a problem; the [PTR] is incremented in-place once, but never
decremented.
Future uses of the same pointer will use the now clobbered value,
leading to the pointer being incorrect by an offset of one.
This patch modifies the expansion code of the LDWRdPtr pseudo
instruction so that the pointer variable is not silently clobbered in
future uses in the same live range.
Patch by Keshav Kini.
llvm-svn: 351544
George Rimar [Fri, 18 Jan 2019 10:41:26 +0000 (10:41 +0000)]
[llvm-objdump] - Show aliases in -help.
Currently llvm-objdump is inconsistent.
When -help is specified it shows no aliases except two.
Aliases are shown with -help-hidden though.
GNU objdump also prints them by default.
This patch does a change to always show all aliases
when -help is given.
Differential revision: https://reviews.llvm.org/D56853
llvm-svn: 351542
Pavel Labath [Fri, 18 Jan 2019 10:37:04 +0000 (10:37 +0000)]
Breakpad: Extract parsing code into a separate file
Summary:
This centralizes parsing of breakpad records, which was previously
spread out over ObjectFileBreakpad and SymbolFileBreakpad.
For each record type X there is a separate breakpad::XRecord class, and
an associated parse function. The classes just store the information in
the breakpad records in a more accessible form. It is up to the users to
determine what to do with that data.
This separation also made it possible to write some targeted tests for
the parsing code, which was previously unaccessible, so I write a couple
of those too.
Reviewers: clayborg, lemo, zturner
Reviewed By: clayborg
Subscribers: mgorny, fedor.sergeev, lldb-commits
Differential Revision: https://reviews.llvm.org/D56844
llvm-svn: 351541
Alex Bradbury [Fri, 18 Jan 2019 10:13:07 +0000 (10:13 +0000)]
[analyzer] Unbreak building of SymbolReaperTest true BUILD_SHARED_LIBS=True
Extra dependencies need to be listed for StaticAnalysisTests in order for
linking to succeed when BUILD_SHARED_LIBS=True.
llvm-svn: 351540
Dylan McKay [Fri, 18 Jan 2019 10:11:33 +0000 (10:11 +0000)]
[AVR] Fix the inst-cbr test
Now that the CBR alias has lower priority than ANDI, the assembly
printer uses ANDI instead.
Original broken in r351526.
llvm-svn: 351539
Florian Hahn [Fri, 18 Jan 2019 10:00:38 +0000 (10:00 +0000)]
[SelectionDAG] Add static getMaxNumOperands function to SDNode.
Summary:
Use this helper to make sure we use the same value at various places.
This will likely be needed at more places were we currently crash
because we use more operands than possible.
Also makes it easier to change in the future.
Reviewers: RKSimon, craig.topper, efriedma, aemerson
Reviewed By: RKSimon
Subscribers: hiraditya, arsenm, llvm-commits
Differential Revision: https://reviews.llvm.org/D56859
llvm-svn: 351537
Clement Courbet [Fri, 18 Jan 2019 09:40:19 +0000 (09:40 +0000)]
Revert r351529 "[llvm-objdump][NFC] Improve readability."
Breaks labels-branch.s
llvm-svn: 351534
Kadir Cetinkaya [Fri, 18 Jan 2019 09:00:31 +0000 (09:00 +0000)]
[tooling] Add a new argument adjuster for deleting plugin related command line args
Summary:
Currently both clangd and clang-tidy makes use of this mechanism so
putting it into tooling so that all tools can make use of it.
Reviewers: ilya-biryukov, sammccall
Subscribers: ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D56856
llvm-svn: 351531
Clement Courbet [Fri, 18 Jan 2019 08:59:39 +0000 (08:59 +0000)]
[llvm-objdump][NFC] Improve readability.
Summary:
Introduce a `struct SectionSymbol` instead of
`tuple<uint64_t, StringRef, uint8>`.
Reviewers: jhenderson, davide
Subscribers: rupprecht, llvm-commits
Differential Revision: https://reviews.llvm.org/D56858
llvm-svn: 351529
Vlad Tsyrklevich [Fri, 18 Jan 2019 08:43:22 +0000 (08:43 +0000)]
Fix failing MSan bots
Revert r351508-351514, this block of changes introduced a consistent
MSan failure on the sanitizer bots.
llvm-svn: 351528
Shiva Chen [Fri, 18 Jan 2019 08:36:06 +0000 (08:36 +0000)]
[ScheduleDAGRRList] Do not preschedule the node has ADJCALLSTACKDOWN parent
We should not pre-scheduled the node has ADJCALLSTACKDOWN parent,
or else, when bottom-up scheduling, ADJCALLSTACKDOWN and
ADJCALLSTACKUP may hold CallResource too long and make other
calls can't be scheduled. If there's no other available node
to schedule, the scheduler will try to rename the register by
creating copy to avoid the conflict which will fail because
CallResource is not a real physical register.
llvm-svn: 351527
Dylan McKay [Fri, 18 Jan 2019 07:31:34 +0000 (07:31 +0000)]
[AVR] Rewrite the CBRRdK instruction as an alias of ANDIRdK
The CBR instruction is just an ANDI instruction with the immediate
complemented.
Because of this, prior to this change TableGen would warn due to a
decoding conflict.
This commit fixes the existing compilation warning:
===============
[423/492] Building AVRGenDisassemblerTables.inc...
Decoding Conflict:
0111............
01..............
................
ANDIRdK 0111____________
CBRRdK 0111____________
================
After this commit, there are no more decoding conflicts in the AVR
backend's instruction definitions.
Thanks to Eli F for pointing me torward `t2_so_imm_not` as an example of
how to perform a complement in an instruction alias.
Fixes BugZilla PR38802.
llvm-svn: 351526
Hsiangkai Wang [Fri, 18 Jan 2019 07:17:09 +0000 (07:17 +0000)]
[CodeGen] Fix bugs in LiveDebugVariables when debug labels are generated.
Remove DBG_LABELs in LiveDebugVariables and generate them in
VirtRegRewriter.
This bug is reported in
https://bugs.chromium.org/p/chromium/issues/detail?id=898152.
Differential Revision: https://reviews.llvm.org/D54465
llvm-svn: 351525
Jonas Devlieghere [Fri, 18 Jan 2019 07:17:05 +0000 (07:17 +0000)]
[Reproducers] Fix reproducers unittest.
Fix fallout from r351501 in the reproducer unittest.
llvm-svn: 351524
Dylan McKay [Fri, 18 Jan 2019 06:10:41 +0000 (06:10 +0000)]
[AVR] Expand 8/16-bit multiplication to libcalls on MCUs that don't have hardware MUL
This change modifies the LLVM ISel lowering settings so that
8-bit/16-bit multiplication is expanded to calls into the compiler
runtime library if the MCU being targeted does not support
multiplication in hardware.
Before this, MUL instructions would be generated on CPUs like the
ATtiny85, triggering a CPU reset due to an illegal instruction at
runtime.
First raised in https://github.com/avr-rust/rust/issues/124.
llvm-svn: 351523
Craig Topper [Fri, 18 Jan 2019 06:06:03 +0000 (06:06 +0000)]
[X86] Add test cases showing failure to fold a global variable address into the gather addressing mode when using the target specific intrinsics. NFC
llvm-svn: 351522
Craig Topper [Fri, 18 Jan 2019 06:06:01 +0000 (06:06 +0000)]
[X86] Change avx512-gather-scatter-intrin.ll to use x86_64-unknown-unknown instead of x86_64-apple-darwin. NFC
Will help with an upcoming patch.
llvm-svn: 351521
Max Kazantsev [Fri, 18 Jan 2019 04:57:32 +0000 (04:57 +0000)]
Re-enable terminator folding in LoopSimplifyCFG: underlying bugs fixed
llvm-svn: 351520
Nico Weber [Fri, 18 Jan 2019 04:09:30 +0000 (04:09 +0000)]
gn build: unbreak mac (and maybe win) after r351258, r351277
The check-hwasan build files assert that current_os == "linux" || current_os ==
"android", so pull it in only there.
ar is unused on mac, so don't set it in the stage2 toolchain. (It'd be nicer to
use llvm-libtool on mac instead of host libtool, but llvm-libtool doesn't seem
to understand the -no_warning_for_no_symbols flag.)
Differential Revision: https://reviews.llvm.org/D56898
llvm-svn: 351519
Chandler Carruth [Fri, 18 Jan 2019 03:57:39 +0000 (03:57 +0000)]
[PSTL] Convert license text file to use unix line endings, matching the
other licenses in the LLVM project.
llvm-svn: 351518
Xing GUO [Fri, 18 Jan 2019 03:56:37 +0000 (03:56 +0000)]
[DOCS] it it => it
Summary: it it => it for LLVM Language Reference Manual
Reviewers: aaron.ballman, Higuoxing, liangdzou
Reviewed By: aaron.ballman, Higuoxing, liangdzou
Subscribers: Higuoxing, llvm-commits
Differential Revision: https://reviews.llvm.org/D56533
llvm-svn: 351517
Nico Weber [Fri, 18 Jan 2019 03:38:53 +0000 (03:38 +0000)]
gn build: Merge r351499
llvm-svn: 351516
Nico Weber [Fri, 18 Jan 2019 03:36:04 +0000 (03:36 +0000)]
mac: Correctly disable tools/lto tests when building with LLVM_ENABLE_PIC=OFF
llvm/tools sets LLVM_TOOL_LTO_BUILD to Off if LLVM_ENABLE_PIC=OFF, but that's
not visible in llvm/test.
r289662 added the llvm_tool_lto_build lit parameter, there the intent was to
use it with an explicit -DLLVM_TOOL_LTO_BUILD=OFF, which is visible globally.
On the review for that (D27739), a mild preference was expressed for using a
lit parameter over checking the existence of libLTO.dylib. Since that works
with the LLVM_ENABLE_PIC=OFF case too and since it matches what we do for the
gold plugin, switch to that approach.
Differential Revision: https://reviews.llvm.org/D56805
llvm-svn: 351515
George Karpenkov [Fri, 18 Jan 2019 03:13:53 +0000 (03:13 +0000)]
[analyzer] Introduce proper diagnostic for freeing unowned object
Insert a note when the object becomes not (exclusively) owned.
Differential Revision: https://reviews.llvm.org/D56891
llvm-svn: 351514
George Karpenkov [Fri, 18 Jan 2019 03:13:40 +0000 (03:13 +0000)]
[analyzer] Extend the PathDiagnosticLocation constructor to handle CallExitEnd
Differential Revision: https://reviews.llvm.org/D56890
llvm-svn: 351513
George Karpenkov [Fri, 18 Jan 2019 03:13:27 +0000 (03:13 +0000)]
[analyzer] [NFC] Clean up messy handling of bug categories in RetainCountChecker
https://reviews.llvm.org/D56887
llvm-svn: 351512
George Karpenkov [Fri, 18 Jan 2019 03:13:14 +0000 (03:13 +0000)]
[analyzer] const-ify reference to bug type used in BugReporter
Differential Revision: https://reviews.llvm.org/D56885
llvm-svn: 351511
George Karpenkov [Fri, 18 Jan 2019 03:13:01 +0000 (03:13 +0000)]
[analyzer] Extend BugType constructor to accept "SuppressOnSink" as a parameter
Differential Revision: https://reviews.llvm.org/D56884
llvm-svn: 351510
George Karpenkov [Fri, 18 Jan 2019 03:12:48 +0000 (03:12 +0000)]
[analyzer] [RetainCountChecker] Produce a correct message when OSTypeAlloc is used
Differential Revision: https://reviews.llvm.org/D56820
llvm-svn: 351509
George Karpenkov [Fri, 18 Jan 2019 03:12:35 +0000 (03:12 +0000)]
[analyzer] [RetainCountChecker] Smart pointer support.
rdar://
47323216
Differential Revision: https://reviews.llvm.org/D56817
llvm-svn: 351508
Thomas Lively [Fri, 18 Jan 2019 02:47:48 +0000 (02:47 +0000)]
[WebAssembly] Add languages from debug info to producers section
Reviewers: aheejin, dschuff, sbc100
Subscribers: aprantl, jgravelle-google, hiraditya, sunfish
Differential Revision: https://reviews.llvm.org/D56889
llvm-svn: 351507
Vitaly Buka [Fri, 18 Jan 2019 01:53:37 +0000 (01:53 +0000)]
[safestack] Remove dependency of SafeStack on sanitizer_common
Summary:
SafeStack needs just few functions from there, but sanitizer_common
introduces conflicts with other runtimes, e.g. SCUDO.
Reviewers: eugenis, kcc, cryptoad
Subscribers: mgorny, krytarowski, fedor.sergeev, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D56886
llvm-svn: 351506
Artem Dergachev [Fri, 18 Jan 2019 01:37:14 +0000 (01:37 +0000)]
[analyzer] A speculative fix for buildbot failures in the new SymbolReaperTest.
I expect an xvalue to be easier to convert.
llvm-svn: 351505
Brad Smith [Fri, 18 Jan 2019 01:36:58 +0000 (01:36 +0000)]
Use llvm::VersionTuple instead of manual version marshalling
llvm-svn: 351504
Vitaly Buka [Fri, 18 Jan 2019 01:36:09 +0000 (01:36 +0000)]
[safestack] Replace statics with unnamed namespace
Reviewers: eugenis
Subscribers: jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D56888
llvm-svn: 351503
Mandeep Singh Grang [Fri, 18 Jan 2019 01:06:46 +0000 (01:06 +0000)]
[polly] Change to range-based invocation of llvm::sort
llvm-svn: 351502
Jonas Devlieghere [Fri, 18 Jan 2019 01:04:59 +0000 (01:04 +0000)]
[Reproducers] Refactor reproducer info
In the original reproducer design, I expected providers to be more
dynamic than they turned out. For example, we don't have any instances
where one provider has multiple files. Additionally, I expected there to
be less locality between capture and replay, with the provider being
defined in one place and the replay code to live in another. Both
contributed to the design of the provider info.
This patch refactors the reproducer info to be something static. This
means less magic strings and better type checking. The new design still
allows for the capture and replay code to live in different places as
long as they both have access to the new statically defined info class.
I didn't completely get rid of the index, because it is useful for (1)
sanity checking and (2) knowing what files are used by the reproducer.
Differential revision: https://reviews.llvm.org/D56814
llvm-svn: 351501
Artem Dergachev [Fri, 18 Jan 2019 00:16:25 +0000 (00:16 +0000)]
[analyzer] MoveChecker: Add one more common resetting method, "append".
This is especially crucial for reports related to use-after-move of
standard library objects.
rdar://problem/
47338505
Differential Revision: https://reviews.llvm.org/D56824
llvm-svn: 351500
Artem Dergachev [Fri, 18 Jan 2019 00:08:56 +0000 (00:08 +0000)]
[analyzer] Make sure base-region and its sub-regions are either all alive or all dead.
SymbolReaper now realizes that our liveness analysis isn't sharp enough
to discriminate between liveness of, say, variables and their fields.
Surprisingly, this didn't quite work before: having a variable live only
through Environment (eg., calling a C++ method on a local variable
as the last action ever performed on that variable) would not keep the
region value symbol of a field of that variable alive.
It would have been broken in the opposite direction as well, but both
Environment and RegionStore use the scanReachableSymbols mechanism for finding
live symbols regions within their values, and due to that they accidentally
end up marking the whole chain of super-regions as live when at least one
sub-region is known to be live.
It is now a direct responsibility of SymbolReaper to maintain this invariant,
and a unit test was added in order to make sure it stays that way.
Differential Revision: https://reviews.llvm.org/D56632
rdar://problem/
46914108
llvm-svn: 351499
Alex Langford [Fri, 18 Jan 2019 00:05:25 +0000 (00:05 +0000)]
[CMake] Only test debugserver if platform can use debugserver
In commit svn r351496 I changed this condition from
`if(LLDB_CAN_USE_DEBUGSERVER)` to `if(NOT SKIP_TEST_DEBUGSERVER)`.
This causes debugserver tests to run on windows, which shouldn't happen.
SKIP_TEST_DEBUGSERVER is set either by the user (it shouldn't be set on
windows builds) or in the debugserver CMake logic (which doesn't get
included when building on windows). Therefore, I changed the condition
to be `if(LLDB_CAN_USE_DEBUGSERVER AND NOT SKIP_TEST_DEBUGSERVER)`.
llvm-svn: 351498
Jonas Devlieghere [Thu, 17 Jan 2019 23:30:06 +0000 (23:30 +0000)]
[lit] Fix lldbtest format
The lldbtest format was incorrectly detecting XFAIL as FAIL because it
was looking for the `FAIL:` substring in the dotest output.
llvm-svn: 351497
Alex Langford [Thu, 17 Jan 2019 23:14:04 +0000 (23:14 +0000)]
[CMake] Prevent lldbDebugserverCommon from building if you disable debugserver builds
Summary:
The flags `LLDB_USE_SYSTEM_DEBUGSERVER` and `LLDB_NO_DEBUGSERVER` were
introduced to the debugserver build. If one of these two flags are set, then we
do not build and sign debugserver. However I noticed that we were still building
the lldbDebugserverCommon and lldbDebugserverCommon_NonUI libraries regardless
of whether or not these flags were set. I don't believe we should be building
these libraries unless we are building and signing debugserver.
Reviewers: sgraenitz, davide, JDevlieghere, beanz, vsk, aprantl, labath
Subscribers: mgorny, jfb, lldb-commits
Differential Revision: https://reviews.llvm.org/D56763
llvm-svn: 351496
Erich Keane [Thu, 17 Jan 2019 23:11:15 +0000 (23:11 +0000)]
Make integral-o-pointer conversions in SFINAE illegal.
As reported in PR40362, allowing the conversion from an integral to a
pointer type (despite being illegal in the C++ standard) will cause
surprsing results when testing for certain behaviors in SFINAE. This
patch converts the error to a SFINAE Error and adds a test to ensure
that it is still a warning in non-SFINAE but an error in it.
Change-Id: I1f475637fa4d83217ae37dc6b5dbf653e118fae4
llvm-svn: 351495
Matt Arsenault [Thu, 17 Jan 2019 22:47:26 +0000 (22:47 +0000)]
AMDGPU: Convert tests away from llvm.SI.load.const
llvm-svn: 351494
Erik Pilkington [Thu, 17 Jan 2019 22:39:31 +0000 (22:39 +0000)]
Address Ried's post-commit review comment on r351477.
llvm-svn: 351493
Vedant Kumar [Thu, 17 Jan 2019 22:36:05 +0000 (22:36 +0000)]
[HotColdSplit] Allow outlining with live outputs
Prior to r348205, extracting code regions with live output values was
disabled because of a miscompilation (PR39433). Lift the restriction as
PR39433 has been addressed.
Tested on LNT+externals, on a run of check-llvm in a stage2 build, and
with a full build of iOS (with hot/cold splitting enabled).
As a drive-by, remove an errant TODO.
llvm-svn: 351492
Vedant Kumar [Thu, 17 Jan 2019 22:35:47 +0000 (22:35 +0000)]
[HotColdSplit] Consider resume instructions to be cold
Resuming exception unwinding is roughly as unlikely as throwing an
exception.
Tested on LNT+externals (in particular, the C++ EH regression tests
provide end-to-end test coverage), as well as with a full build of iOS.
llvm-svn: 351491
Jason Molenda [Thu, 17 Jan 2019 22:26:25 +0000 (22:26 +0000)]
Don't run TestBreakpointThumbCodesection.py on darwin systems;
we don't use a thumb code section.
Don't run Test128BitsInteger.py on armv7k; it's not a supported
type on that target.
llvm-svn: 351490
Jonas Devlieghere [Thu, 17 Jan 2019 22:25:20 +0000 (22:25 +0000)]
[CMake] Fix lldb-test-depends target
The lldb-test-depends target was using the old CMake variable name
LLDB_TEST_DEPENDS instead of LLDB_TEST_DEPS. This patch moves the target
definition and makes it use the correct one.
llvm-svn: 351489
Sam Clegg [Thu, 17 Jan 2019 22:09:09 +0000 (22:09 +0000)]
[WebAssembly] Fix windows compiler warning by using explicit 64bit shift. NFC.
Differential Revision: https://reviews.llvm.org/D56874
llvm-svn: 351488
Richard Smith [Thu, 17 Jan 2019 22:05:50 +0000 (22:05 +0000)]
Fix cleanup registration for lambda captures.
Lambda captures should be destroyed if an exception is thrown only if
the construction of the complete lambda-expression has not completed.
(If the lambda-expression has been fully constructed, any exception will
invoke its destructor, which will destroy the captures.)
This is directly modeled after how we handle the equivalent situation in
InitListExprs.
Note that EmitLambdaLValue was unreachable because in C++11 onwards the
frontend never creates the awkward situation where a prvalue expression
(such as a lambda) is used in an lvalue context (such as the left-hand
side of a class member access).
llvm-svn: 351487
Davide Italiano [Thu, 17 Jan 2019 21:57:33 +0000 (21:57 +0000)]
[lit] Make sure tests are actually skipped on darwin and windows.
llvm-svn: 351486
Vladimir Stefanovic [Thu, 17 Jan 2019 21:50:37 +0000 (21:50 +0000)]
[mips] Emit .reloc R_{MICRO}MIPS_JALR along with j(al)r(c) $25
The callee address is added as an optional operand (MCSymbol) in
AdjustInstrPostInstrSelection() and then used by asm printer to insert:
'.reloc tmplabel, R_MIPS_JALR, symbol
tmplabel:'.
Controlled with '-mips-jalr-reloc', default is true.
Differential revision: https://reviews.llvm.org/D56694
llvm-svn: 351485
Eric Fiselier [Thu, 17 Jan 2019 21:44:24 +0000 (21:44 +0000)]
Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides.
Summary:
Some style guides want to allow using CTAD only on types that "opt-in"; i.e. on types that are designed to support it and not just types that *happen* to work with it.
This patch implements the `-Wctad-maybe-unsupported` warning, which is off by default, which warns when CTAD is used on a type that does not define any deduction guides.
The following pattern can be used to suppress the warning in cases where the type intentionally doesn't define any deduction guides:
```
struct allow_ctad_t;
template <class T>
struct TestSuppression {
TestSuppression(T) {}
};
TestSuppression(allow_ctad_t)->TestSuppression<void>; // guides with incomplete parameter types are never considered.
```
Reviewers: rsmith, james.dennett, gromer
Reviewed By: rsmith
Subscribers: jdennett, Quuxplusone, lebedev.ri, cfe-commits
Differential Revision: https://reviews.llvm.org/D56731
llvm-svn: 351484
Vedant Kumar [Thu, 17 Jan 2019 21:42:36 +0000 (21:42 +0000)]
[HotColdSplit] Relax requirement that the cold sink block be extractable
Relaxing this requirement creates opportunities to split code dominated
by an EH pad.
Tested on LNT+externals.
llvm-svn: 351483
Erik Pilkington [Thu, 17 Jan 2019 21:37:51 +0000 (21:37 +0000)]
[demangler] Support for block literals.
llvm-svn: 351482
Erik Pilkington [Thu, 17 Jan 2019 21:37:36 +0000 (21:37 +0000)]
[demangler] Ignore leading underscores if present
On MacOS, symbols start with a leading underscore, so just parse and
ignore it if present.
llvm-svn: 351481
Vedant Kumar [Thu, 17 Jan 2019 21:29:34 +0000 (21:29 +0000)]
[HotColdSplit] Simplify tests by lowering their splitting thresholds
This gets rid of the brittle/mysterious calls to @sink()/@sideeffect()
peppered throughout the test cases. They are no longer needed to force
splitting to occur.
llvm-svn: 351480
Peter Collingbourne [Thu, 17 Jan 2019 21:11:49 +0000 (21:11 +0000)]
xray: Add missing header to list of installed headers.
Spotted by gn's llvm/utils/gn/build/sync_source_lists_from_cmake.py script.
Differential Revision: https://reviews.llvm.org/D56797
llvm-svn: 351479
Reid Kleckner [Thu, 17 Jan 2019 20:52:46 +0000 (20:52 +0000)]
Fix -Wsign-compare in new tests
llvm-svn: 351478
Erik Pilkington [Thu, 17 Jan 2019 20:52:10 +0000 (20:52 +0000)]
Fix an MSVC bot failure from r351474.
llvm-svn: 351477
Wei Mi [Thu, 17 Jan 2019 20:48:34 +0000 (20:48 +0000)]
[SampleFDO] Skip profile reading when flattened profile used in ThinLTO postlink
If the sample profile has no inlining hierachy information included, we call
the sample profile is flattened. For flattened profile, in ThinLTO postlink
phase, SampleProfileLoader's hot function inlining and profile annotation will
do nothing, so it is better to save the effort to read in the profile and run
the sample profile loader pass. It is helpful for reducing compile time when
the flattened profile is huge.
Differential Revision: https://reviews.llvm.org/D54819
llvm-svn: 351476
Reid Kleckner [Thu, 17 Jan 2019 20:46:53 +0000 (20:46 +0000)]
[InstCombine] Don't sink dynamic allocas
Summary:
InstCombine's sinking algorithm only thinks about memory. It doesn't
think about non-memory constraints like stack object lifetime. It can
sink dynamic allocas across a stacksave call, which may be used with
stackrestore, which can incorrectly reduce the lifetime of the dynamic
alloca.
Fixes PR40365
Reviewers: hfinkel, efriedma
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D56872
llvm-svn: 351475
Erik Pilkington [Thu, 17 Jan 2019 20:37:51 +0000 (20:37 +0000)]
NFC: Make the copies of the demangler byte-for-byte identical
With this patch, the copies of the files ItaniumDemangle.h,
StringView.h, and Utility.h are kept byte-for-byte in sync between
libcxxabi and llvm. All differences (namespaces, fallthrough, and
unreachable macros) are defined in each copies' DemanglerConfig.h.
This patch also adds a script to copy changes from libcxxabi
(cp-to-llvm.sh), and a README.txt explaining the situation.
Differential revision: https://reviews.llvm.org/D53538
llvm-svn: 351474
Hyrum Wright [Thu, 17 Jan 2019 20:37:35 +0000 (20:37 +0000)]
[clang-tidy] Add abseil-duration-conversion-cast check
Differential Revision: https://reviews.llvm.org/D56532
llvm-svn: 351473
Sanjin Sijaric [Thu, 17 Jan 2019 20:24:14 +0000 (20:24 +0000)]
Fix the buildbot failure introduced by r351404
EXPENSIVE_CHECKS buildbots are failing due to r351404.
Add x1 as live in to the funclet basic block for SEH funclets, as well as
-verify-machineinstrs to the test case that triggered the failure.
llvm-svn: 351472
Aaron Ballman [Thu, 17 Jan 2019 20:21:44 +0000 (20:21 +0000)]
Revert r351208 (which was a revert of r350892).
This corresponds to the fix to Clang in r351470.
llvm-svn: 351471
Aaron Ballman [Thu, 17 Jan 2019 20:21:34 +0000 (20:21 +0000)]
Revert r351209 (which was a revert of r350891) with a fix.
The test case had a parse error that was causing the condition string to be misreported. We now have better fallback code for error cases.
llvm-svn: 351470
Nico Weber [Thu, 17 Jan 2019 20:20:56 +0000 (20:20 +0000)]
llvm build: Merge r351448
llvm-svn: 351469
Eugene Zelenko [Thu, 17 Jan 2019 20:00:23 +0000 (20:00 +0000)]
[Documentation] Fix another link in docs/clang-tidy/Contributing.rst.
llvm-svn: 351468
Eugene Zelenko [Thu, 17 Jan 2019 19:47:44 +0000 (19:47 +0000)]
[Documentation] Another attempt to fix link in docs/clang-tidy/Contributing.rst. Use HTTPS for links.
llvm-svn: 351467
Eugene Zelenko [Thu, 17 Jan 2019 19:35:39 +0000 (19:35 +0000)]
[Documentation] Fix link in docs/clang-tidy/Contributing.rst.
llvm-svn: 351466
Wouter van Oortmerssen [Thu, 17 Jan 2019 19:18:05 +0000 (19:18 +0000)]
[WebAssembly] Fixing 2 more symbol offset related tests.
llvm-svn: 351465
Jonas Devlieghere [Thu, 17 Jan 2019 18:35:14 +0000 (18:35 +0000)]
[Test] Fix debug-loc-0.mir with EXPENSIVE_CHECKS
The `llc` invocation was missing `-start-before=machine-cp`.
llvm-svn: 351464