Alexander Kornienko [Tue, 5 Mar 2019 14:09:57 +0000 (14:09 +0000)]
[clang-tidy] Fix bugprone-string-constructor crash
llvm-svn: 355401
Simon Pilgrim [Tue, 5 Mar 2019 13:52:09 +0000 (13:52 +0000)]
[X86] Add test cases for D58874
Add scalar and vector test cases for missing (add (add (xor a, -1), b), 1) -> (sub b, a) fold
llvm-svn: 355400
George Rimar [Tue, 5 Mar 2019 13:07:43 +0000 (13:07 +0000)]
[llvm-objcopy] - Simplify `isCompressable` and fix the issue relative.
When --compress-debug-sections is given, llvm-objcopy do not compress
sections that have "ZLIB" header in data. Normally this signature is used
in zlib-gnu compression format. But if zlib-gnu used then the name of the compressed
section should start from .z* (e.g .zdebug_info). If it does not, then it is not
a zlib-gnu format and section should be treated as a normal uncompressed section.
Differential revision: https://reviews.llvm.org/D58908
llvm-svn: 355399
Pavel Labath [Tue, 5 Mar 2019 12:51:20 +0000 (12:51 +0000)]
One more UserIDResolver fix
The intention in r355323 has been to implement a no-op resolver in the
HostInfoBase class, which will then be shadowed a an implementation in
the HostInfoPosix class. However, I add the shadowing declaration in
HostInfoPosix.h, and instead had implemented the HostInfoBase function
in HostInfoPosix.cpp. This has lead to undefined symbols on windows, and
a subsequent implementation of a no-op resolver in HostInfoWindows
(r355329).
Since now there is no point on having a no-op resolver in the base
class, I just remove the base declaration altogether, and have
HostInfoPosix implement the (newly-declared) HostInfoPosix version of
that function.
llvm-svn: 355398
Martin Storsjo [Tue, 5 Mar 2019 12:50:06 +0000 (12:50 +0000)]
[sanitizers] Don't use Windows Trace Logging with Clang in MSVC mode either
The TraceLoggingProvider.h header does work with clang-cl in general
these days with Win SDK 10.0.17763.0, but when compiled in 32 bit x86
mode, with the -Z7 flag, compilation fails with the following error:
fatal error: error in backend: assembler label '' can not be undefined
With older Win SDKs, there are other build failures (regardless of
architecture or the -Z7 flag).
Differential Revision: https://reviews.llvm.org/D58958
llvm-svn: 355397
Kristof Umann [Tue, 5 Mar 2019 12:42:59 +0000 (12:42 +0000)]
[analyzer] Fix taint propagation in GenericTaintChecker
The gets function has no SrcArgs. Because the default value for isTainted was
false, it didn't mark its DstArgs as tainted.
Patch by Gábor Borsik!
Differential Revision: https://reviews.llvm.org/D58828
llvm-svn: 355396
Dmitri Gribenko [Tue, 5 Mar 2019 12:38:18 +0000 (12:38 +0000)]
[ASTMatchers] Improved formatting in a documentation comment
llvm-svn: 355395
Carl Ritson [Tue, 5 Mar 2019 12:21:44 +0000 (12:21 +0000)]
[AMDGPU] Fix DPP operand order in atomic optimizer
Summary:
Ensure order of operands in DPP atomic optimizer final WWM step is appropriate for sub instructions.
Change-Id: I631d050e1c00a3b4bc7c11a90437064403c4cf30
Reviewers: sheredom, tpr
Reviewed By: sheredom
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58900
llvm-svn: 355394
David Green [Tue, 5 Mar 2019 12:12:18 +0000 (12:12 +0000)]
[SCEV] Ensure that isHighCostExpansion takes into account what is being divided
A SCEV is not low-cost just because you can divide it by a power of 2. We need to also
check what we are dividing to make sure it too is not a high-code expansion. This helps
to not expand the exit value of certain loops, helping not to bloat the code.
The change in no-iv-rewrite.ll is reverting back to what it was testing before rL194116,
and looks a lot like the other tests in replace-loop-exit-folds.ll.
Differential Revision: https://reviews.llvm.org/D58435
llvm-svn: 355393
Alexander Kornienko [Tue, 5 Mar 2019 12:05:35 +0000 (12:05 +0000)]
[lldb] Fix linux host build after r355342
llvm-svn: 355392
George Rimar [Tue, 5 Mar 2019 11:32:14 +0000 (11:32 +0000)]
[llvm-objcopy] - Report "no zlib available" error properly when --compress-debug-sections is used.
If zlib is not available, and --compress-debug-sections is passed,
we want to report an error. Currently, it is only reported for
--compress_debug_sections= form of the option.
Fixes the https://bugs.llvm.org/show_bug.cgi?id=40886.
I do not think there is a way to write a test for this.
Differential revision: https://reviews.llvm.org/D58909
llvm-svn: 355391
Gabor Marton [Tue, 5 Mar 2019 11:23:24 +0000 (11:23 +0000)]
[ASTImporter] Fix redecl failures of Class and ClassTemplate
Summary:
Redecl chains of classes and class templates are not handled well
currently. We want to handle them similarly to functions, i.e. try to
keep the structure of the original AST as much as possible. The aim is
to not squash a prototype with a definition, rather we create both and
put them in a redecl chain.
Reviewers: a_sidorin, shafik, a.sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58502
llvm-svn: 355390
David Green [Tue, 5 Mar 2019 11:18:55 +0000 (11:18 +0000)]
[SCEV] Add some extra tests for IndVarSimplifys loop exit values. NFC.
Add some tests for various loops of the form:
while(S >= 32) {
S -= 32;
something();
};
return S;
llvm-svn: 355389
Tatyana Krasnukha [Tue, 5 Mar 2019 11:18:45 +0000 (11:18 +0000)]
Fix embedded Python initialization according to changes in version 3.7
Differential Revision: https://reviews.llvm.org/D58833
llvm-svn: 355388
Heejin Ahn [Tue, 5 Mar 2019 11:11:34 +0000 (11:11 +0000)]
[WebAssembly] Rename a variable in LateEHPrepare (NFC)
llvm-svn: 355387
Simon Pilgrim [Tue, 5 Mar 2019 10:44:37 +0000 (10:44 +0000)]
Add wildcard support to all update_*_test_checks.py scripts (PR37500)
We can already update multiple files in each update call, this extends it to work with wildcards as well in the same way as update_mca_test_checks.py (to support shells that won't do this for us - windows command prompt etc.)
Differential Revision: https://reviews.llvm.org/D58817
llvm-svn: 355386
Oliver Stannard [Tue, 5 Mar 2019 10:42:34 +0000 (10:42 +0000)]
[ARM] Fix select_cc lowering for fp16
When lowering a select_cc node where the true and false values are of type f16,
we can't use a general conditional move because the FP16 instructions do not
support conditional execution. Instead, we must ensure that the condition code
is one of the four supported by the VSEL instruction.
Differential revision: https://reviews.llvm.org/D58813
llvm-svn: 355385
David Stuttard [Tue, 5 Mar 2019 10:25:16 +0000 (10:25 +0000)]
[AMDGPU] Omit KILL instructions from hazard recognizer
Summary:
In some cases the KILL was causing a hazard to be introduced as these were
scheduled into hazard slots, but don't result in an instruction.
KILL shouldn't be considered for hazard recognition.
Change-Id: Ib6d2a2160f8c94cd0ce611ab198c7e4f46aeffcf
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58898
llvm-svn: 355384
Fangrui Song [Tue, 5 Mar 2019 09:56:50 +0000 (09:56 +0000)]
[ELF][test] chmod u+w to prevent annoying rm prompt
If the permission does not permit writing and the standard input is a
terminal, rm gives an annoying prompt. chmod u+w to make the output
directory easier to delete.
llvm-svn: 355382
Vitaly Buka [Tue, 5 Mar 2019 05:52:34 +0000 (05:52 +0000)]
[NFC] Simplify BufferedStackTrace::UnwindImpl
llvm-svn: 355381
Vitaly Buka [Tue, 5 Mar 2019 05:40:05 +0000 (05:40 +0000)]
[NFC] Move isUnwinding check into ScopedUnwinding
llvm-svn: 355380
Craig Topper [Tue, 5 Mar 2019 05:23:37 +0000 (05:23 +0000)]
[LangRef] Add 'callbr' instruction to the 'blockaddress' section.
llvm-svn: 355379
Chen Zheng [Tue, 5 Mar 2019 04:56:54 +0000 (04:56 +0000)]
[PowerPC] fix killed/dead flag after convert x-form to d-form tranformation.
Differential Revision: https://reviews.llvm.org/D58428
llvm-svn: 355378
Vitaly Buka [Tue, 5 Mar 2019 04:36:56 +0000 (04:36 +0000)]
[NFC] Move ScopedUnwinding from .h to .cc
llvm-svn: 355377
Vitaly Buka [Tue, 5 Mar 2019 04:36:49 +0000 (04:36 +0000)]
[NFC] Reorder ifs in BufferedStackTrace::UnwindImpl
llvm-svn: 355376
Alex Langford [Tue, 5 Mar 2019 03:33:34 +0000 (03:33 +0000)]
[Expression] Remove unused parameter from Evaluate
llvm-svn: 355375
Xing GUO [Tue, 5 Mar 2019 03:07:56 +0000 (03:07 +0000)]
[ARM][MC] Update one test case in 'test/MC/Disassembler/ARM/invalid-armv7.txt'
Summary:
Instruction `[0xfe 0xf0 0x20 0xe3]` is a valid instruction on ARM-v7, which is `dbg #14`. See:
https://www.cl.cam.ac.uk/research/srg/han/ACS-P35/zynq/ARMv7-A-R-manual.pdf
(Page: 377)
```
Encoding A1:
DBG<c> #<option>
|31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16|15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00|
| cond | 0 0 1 1 0| 0| 1 0| 0 0 0 0| 1 1 1 1| 0 0 0 0| 1 1 1 1| option |
```
Reviewers: fhahn, efriedma
Reviewed By: efriedma
Subscribers: javed.absar, kristof.beyls, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58873
llvm-svn: 355374
Scott Linder [Tue, 5 Mar 2019 03:02:00 +0000 (03:02 +0000)]
[AMDGPU] Implement AMDGPUMCInstrAnalysis
Implement MCInstrAnalysis for AMDGPU, with default implementations save
for `evaluateBranch`.
Differential Revision: https://reviews.llvm.org/D58400
llvm-svn: 355373
Vitaly Buka [Tue, 5 Mar 2019 02:51:04 +0000 (02:51 +0000)]
[NFC] Return on SANITIZER_MIPS && !IsValidFrame
llvm-svn: 355372
Vitaly Buka [Tue, 5 Mar 2019 02:50:57 +0000 (02:50 +0000)]
[NFC] Put bp into Unwind(.. false) for consistency
It's not used there anyway
llvm-svn: 355371
Vitaly Buka [Tue, 5 Mar 2019 02:50:49 +0000 (02:50 +0000)]
[NFC] Move asan_inited and size reset on top of ::UnwindImpl
llvm-svn: 355370
Vitaly Buka [Tue, 5 Mar 2019 02:35:49 +0000 (02:35 +0000)]
Revert "[NFC][Sanitizer] Cleanup ASan's GetStackTrace implementation"
I've missed that UnwindSlow was removed from ScopedUnwinding.
This reverts commit
4ce918e3942f0333ccb7d65d6265f4fc5f5324be.
llvm-svn: 355369
Harlan Haskins [Tue, 5 Mar 2019 02:27:12 +0000 (02:27 +0000)]
Replace clang::FileData with llvm::vfs::Status
Summary:
FileData was only ever used as a container for the values in
llvm::vfs::Status, so they might as well be consolidated.
The `InPCH` member was also always set to false, and unused.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58924
llvm-svn: 355368
Eric Fiselier [Tue, 5 Mar 2019 02:10:31 +0000 (02:10 +0000)]
Fix -fsanitize=vptr badness in <__debug>
Summary:
This patch fixes a lifetime bug when inserting a new container into the debug database. It is
diagnosed by UBSAN when debug mode is enabled. This patch corrects how nodes are constructed
during insertion.
The fix requires unconditionally breaking the debug mode ABI. Users should not expect ABI
stability from debug mode.
Reviewers: ldionne, serge-sans-paille, EricWF
Reviewed By: EricWF
Subscribers: mclow.lists, christof, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D58011
llvm-svn: 355367
Eric Fiselier [Tue, 5 Mar 2019 01:57:01 +0000 (01:57 +0000)]
Make VCRuntime ABI configuration a first-class option.
Summary:
On Windows we currently provide two separate ABI configurations. One which defers to `vcruntime` to provide the C++ runtime and another which doesn't.
Using `vcruntime` allows interoperability which programs compiled against the MSVC STL, and should be preferred whenever possible.
When deferring to `vcruntime` much of the ABI we provide changes. Including the layout of `<stdexcept>` types, their vtables, and how the linkage of their members.
This patch introduces the `_LIBCPP_ABI_VCRUNTIME` macro to denote this configuration. It also cleans up the existing configuration for using `vcruntime`.
This cleanup lays the groundwork for fixing a number of ABI and interoperability bugs in `<stdexcept>`.
Reviewers: thomasanderson, ldionne, smeenai
Reviewed By: smeenai
Subscribers: jdoerfert, libcxx-commits, #libc
Differential Revision: https://reviews.llvm.org/D58942
llvm-svn: 355366
Jan Korous [Tue, 5 Mar 2019 01:45:31 +0000 (01:45 +0000)]
[clang-format][docs][NFC] Fix example for Allman brace breaking style
I assume the example is wrong as it's clearly missing line-breaks before
braces.
I just ran the example through clang-format with .clang-format like
this:
BreakBeforeBraces: Allman
Differential Revision: https://reviews.llvm.org/D58941
llvm-svn: 355365
Davide Italiano [Tue, 5 Mar 2019 01:34:47 +0000 (01:34 +0000)]
Revert "[testsuite] Port crashlog and dependencies to Python 3."
This revert the commit because it broke the bots. I need to find
a way that works with both versions.
llvm-svn: 355364
Manman Ren [Tue, 5 Mar 2019 01:21:40 +0000 (01:21 +0000)]
Revert compiler-rt diffs for order file instrumentation to get bot green!
This caused issues on Linux/Windows and other platforms.
r355343 355350 355350
llvm-svn: 355363
Sanjoy Das [Tue, 5 Mar 2019 01:15:08 +0000 (01:15 +0000)]
PHI nodes are not `FPMathOperator` s
Reviewers: chandlerc, arsenm
Reviewed By: arsenm
Subscribers: wdng, arsenm, mcrosier, jlebar, bixia, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58887
llvm-svn: 355362
Craig Topper [Tue, 5 Mar 2019 01:14:25 +0000 (01:14 +0000)]
[X86] Reduce some patterns by using FP instructions for integer types even when AVX2 is available and execution domain fixing will do the right thing
We have quite a few cases of using FP instructions for integer operations when only AVX1 is available. Then we switch to integer instructions with AVX2. In a lot of these cases execution domain fixing will take care of turning FP instructions into integer if its profitable.
With this patch we just keep on using the FP instructions even with AVX2. I've only handled some cases that don't require messing with patterns that are defined in the instruction definition. Those will require more subtle multiclass work possibly involving null_frag, hasSideEffects = 0, etc.
Differential Revision: https://reviews.llvm.org/D58470
llvm-svn: 355361
Yonghong Song [Tue, 5 Mar 2019 01:01:21 +0000 (01:01 +0000)]
[BPF] Do not generate BTF sections unnecessarily
If There is no types/non-empty strings, do not generate
.BTF section. If there is no func_info/line_info, do
not generate .BTF.ext section.
Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D58936
llvm-svn: 355360
Davide Italiano [Tue, 5 Mar 2019 00:53:38 +0000 (00:53 +0000)]
[testsuite] Port crashlog and dependencies to Python 3.
Fixes three tests in the testsuite.
llvm-svn: 355359
Jim Ingham [Tue, 5 Mar 2019 00:52:12 +0000 (00:52 +0000)]
Fix the Xcode project for UserIDResolver.
llvm-svn: 355358
Manman Ren [Tue, 5 Mar 2019 00:52:00 +0000 (00:52 +0000)]
Attemp to fix windows profile-rt build breakage.
Followup to D57530.
llvm-svn: 355357
Davide Italiano [Tue, 5 Mar 2019 00:47:15 +0000 (00:47 +0000)]
[lldbtest] Check against the correct name for libcxxabi (macOS).
llvm-svn: 355356
Julian Lettner [Tue, 5 Mar 2019 00:41:15 +0000 (00:41 +0000)]
[NFC][Sanitizer] Cleanup ASan's GetStackTrace implementation
Cleanup ASan's __sanitizer::BufferedStackTrace::UnwindImpl (formerly
GetStackTrace) implementation. Start with ASan because it is the most
complex implementation.
GetStackTrace implementations seem to have started out as exact copies
of the original implementation in ASan, but have diverged in subtle
ways. My goal is to parameterize this algorithm (via templating or
callbacks) so we can share the implementation and get rid of the
inversed dependency (sanitizer_common depends on concrete
implementations in asan, ubsan, etc.). This should also help us to avoid
those pesky linker errors caused by undefined, duplicate, and weak
symbols on Windows.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D58861
llvm-svn: 355355
Shoaib Meenai [Tue, 5 Mar 2019 00:38:32 +0000 (00:38 +0000)]
[cmake] Create exports for umbrella library targets
When using the umbrella llvm-libraries and clang-libraries targets, we
should export all library targets, otherwise they'll be part of our
distribution but not usable from the CMake package.
Differential Revision: https://reviews.llvm.org/D58862
llvm-svn: 355354
Davide Italiano [Tue, 5 Mar 2019 00:37:40 +0000 (00:37 +0000)]
[Host] Fix the build (and the modules build).
-> Add a missing include to find the base class.
-> Add a missing out-of-line declaration for a member function.
llvm-svn: 355353
Shafik Yaghmour [Tue, 5 Mar 2019 00:29:58 +0000 (00:29 +0000)]
Revert "[DataFormatters] Fix regression in libc++ std::atomic formatter caused by https://reviews.llvm.org/D56913"
This reverts commit r355351.
llvm-svn: 355352
Shafik Yaghmour [Tue, 5 Mar 2019 00:17:18 +0000 (00:17 +0000)]
[DataFormatters] Fix regression in libc++ std::atomic formatter caused by https://reviews.llvm.org/D56913
rdar://problem/
48568543
llvm-svn: 355351
Manman Ren [Mon, 4 Mar 2019 23:41:57 +0000 (23:41 +0000)]
Attemp to fix build brokage due to D57530.
By adding implementations for __llvm_profile_begin_orderfile for non-Darwin platforms.
llvm-svn: 355350
Florian Hahn [Mon, 4 Mar 2019 23:37:41 +0000 (23:37 +0000)]
Fix invalid target triples in tests. (NFC)
llvm-svn: 355349
Evgeniy Stepanov [Mon, 4 Mar 2019 22:58:20 +0000 (22:58 +0000)]
[msan] Instrument x86 BMI intrinsics.
Summary:
They simply shuffle bits. MSan needs to do the same with shadow bits,
after making sure that the shuffle mask is fully initialized.
Reviewers: pcc, vitalybuka
Subscribers: hiraditya, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58858
llvm-svn: 355348
Evgeniy Stepanov [Mon, 4 Mar 2019 22:58:11 +0000 (22:58 +0000)]
[sanitizer] Intercept bzero.
Summary:
Intercept bzero and enable existing __bzero interceptor in Linux.
bzero is deprecated but still used occasionally.
Reviewers: vitalybuka
Subscribers: srhines, kubamracek, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58850
llvm-svn: 355347
Jordan Rupprecht [Mon, 4 Mar 2019 22:54:44 +0000 (22:54 +0000)]
[NFC] Fix PGO link error in shared libs build
llvm-svn: 355346
Sanjay Patel [Mon, 4 Mar 2019 22:47:13 +0000 (22:47 +0000)]
[CodeGenPrepare] avoid crashing on non-canonical/degenerate code
The test is reduced from an example in the post-commit thread for:
rL354746
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20190304/632396.html
While we must avoid dying here, the real question should be:
Why is non-canonical and/or degenerate code making it to CGP when
using the new pass manager?
llvm-svn: 355345
Jessica Paquette [Mon, 4 Mar 2019 22:35:32 +0000 (22:35 +0000)]
[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT
This adds instruction selection support for G_EXTRACT_VECTOR_ELT for cases
where the index is defined by a G_CONSTANT.
It also factos out the lane copy opcode selection part into its own function,
`getLaneCopyOpcode`. This is used by both `selectUnmergeValues` and
`selectExtractElt`.
Differential Revision: https://reviews.llvm.org/D58469
llvm-svn: 355344
Manman Ren [Mon, 4 Mar 2019 22:28:38 +0000 (22:28 +0000)]
Order File Instrumentation: dump the data in compiler-rt
The profile data will be dumped in a file default_xxx.profraw.order.
Differential Revision: https://reviews.llvm.org/D57530
llvm-svn: 355343
Zachary Turner [Mon, 4 Mar 2019 21:51:03 +0000 (21:51 +0000)]
Move ProcessInfo from Host to Utility.
There are set of classes in Target that describe the parameters of a
process - e.g. it's PID, name, user id, and similar. However, since it
is a bare description of a process and contains no actual functionality,
there's nothing specifically that makes this appropriate for being in
Target -- it could just as well be describing a process on the host, or
some hypothetical virtual process that doesn't even exist.
To cement this, I'm moving these classes to Utility. It's possible that
we can find a better place for it in the future, but as it is neither
Host specific nor Target specific, Utility seems like the most appropriate
place for the time being.
After this there is only 2 remaining references to Target from Host,
which I'll address in a followup.
Differential Revision: https://reviews.llvm.org/D58842
llvm-svn: 355342
Alex Langford [Mon, 4 Mar 2019 21:36:49 +0000 (21:36 +0000)]
[build.py] Allow clang-cl to build files starting with '/U'
Summary:
clang-cl tries to match cl's interface, and treats /U as "Removes a
predefined macro" as cl does. When you feed clang-cl a file that begins with
'/U' (e.g. /Users/xiaobai/foo.c), clang-cl will emit a warning and in some cases
an error, like so:
clang-9: warning: '/Users/xiaobai/foo.c' treated as the '/U' option [-Wslash-u-filename]
clang-9: note: Use '--' to treat subsequent arguments as filenames
clang-9: error: no input files
If you're using clang-cl, make sure '--' is passed before the source file.
Differential Revision: https://reviews.llvm.org/D58860
llvm-svn: 355341
Shoaib Meenai [Mon, 4 Mar 2019 21:19:53 +0000 (21:19 +0000)]
[build] Rename clang-headers to clang-resource-headers
Summary:
The current install-clang-headers target installs clang's resource
directory headers. This is different from the install-llvm-headers
target, which installs LLVM's API headers. We want to introduce the
corresponding target to clang, and the natural name for that new target
would be install-clang-headers. Rename the existing target to
install-clang-resource-headers to free up the install-clang-headers name
for the new target, following the discussion on cfe-dev [1].
I didn't find any bots on zorg referencing install-clang-headers. I'll
send out another PSA to cfe-dev to accompany this rename.
[1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html
Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille
Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits
Tags: #clang, #sanitizers, #lldb, #openmp, #llvm
Differential Revision: https://reviews.llvm.org/D58791
llvm-svn: 355340
Jessica Paquette [Mon, 4 Mar 2019 21:12:46 +0000 (21:12 +0000)]
[GlobalISel][AArch64] Legalize vector G_SELECT
Just scalarize it, and add a test showing it works.
Differential Revision: https://reviews.llvm.org/D58747
llvm-svn: 355339
Evgeniy Stepanov [Mon, 4 Mar 2019 21:00:28 +0000 (21:00 +0000)]
Fix wrong enum value in switch.
llvm-svn: 355338
Sanjay Patel [Mon, 4 Mar 2019 20:57:14 +0000 (20:57 +0000)]
[ConstantHoisting] avoid hang/crash from unreachable blocks (PR40930)
I'm not too familiar with this pass, so there might be a better
solution, but this appears to fix the degenerate:
PR40930
PR40931
PR40932
PR40934
...without affecting any real-world code.
As we've seen in several other passes, when we have unreachable blocks,
they can contain semi-bogus IR and/or cause unexpected conditions. We
would not typically expect these patterns to make it this far, but we
have to guard against them anyway.
llvm-svn: 355337
Louis Dionne [Mon, 4 Mar 2019 20:52:14 +0000 (20:52 +0000)]
[libc++] Remove old CMake workaround
We haven't had any complaints so far, and I don't think anybody builds
libc++ from source for that old platform anymore.
llvm-svn: 355336
Eric Fiselier [Mon, 4 Mar 2019 20:49:18 +0000 (20:49 +0000)]
Install GCC 5 on buildbots to replace GCC 4.9.
LLVM is dropping support for GCC 4.9. This patch adds
a GCC 5 installation to the buildbot image so we can upgrade
the 4.9 bot to GCC 5.
As a temporary workaround until zorg updates, we install GCC 5
as GCC 4.9.
llvm-svn: 355334
Manman Ren [Mon, 4 Mar 2019 20:30:30 +0000 (20:30 +0000)]
Order File Instrumentation: add clang support for -forder-file-instrumentation
When -forder-file-instrumentation is on, we pass llvm flag to enable the order file instrumentation pass.
https://reviews.llvm.org/D58751
llvm-svn: 355333
Shafik Yaghmour [Mon, 4 Mar 2019 20:25:54 +0000 (20:25 +0000)]
[ASTImporter] Handle built-in when importing SourceLocation and FileID
Summary:
Currently when we see a built-in we try and import the include location. Instead what we do now is find the buffer like we do for the invalid case and copy that over to the to context.
Differential Revision: https://reviews.llvm.org/D58743
llvm-svn: 355332
Rong Xu [Mon, 4 Mar 2019 20:21:31 +0000 (20:21 +0000)]
[PGO] Clang part of change for context-sensitive PGO (part1)
Part 1 of CSPGO change in Clang. This includes changes in clang options
and calls to llvm PassManager. Tests will be committed in part2.
This change needs the PassManager change in llvm.
Differential Revision: https://reviews.llvm.org/D54176
llvm-svn: 355331
Rong Xu [Mon, 4 Mar 2019 20:21:27 +0000 (20:21 +0000)]
[PGO] Context sensitive PGO (part 3)
Part 3 of CSPGO changes (mostly related to PassMananger).
Differential Revision: https://reviews.llvm.org/D54175
llvm-svn: 355330
Zachary Turner [Mon, 4 Mar 2019 19:57:04 +0000 (19:57 +0000)]
Fix Windows build after UserIDResolver patch.
That patch added a function to HostInfo that returns an instance
of UserIDResolver, but this function was unimplemented on Windows,
leading to linker errors. For now, just return a dummy implementation
that doesn't resolve user ids to get the build green.
llvm-svn: 355329
Nikita Popov [Mon, 4 Mar 2019 19:35:46 +0000 (19:35 +0000)]
[InstCombine] Add tests for add nsw + sadd.with.overflow; NFC
Baseline tests for D58881, which fixes part of PR38146.
Patch by Dan Robertson.
llvm-svn: 355328
Craig Topper [Mon, 4 Mar 2019 19:23:37 +0000 (19:23 +0000)]
[Subtarget] Follow up to r355167, add another set of curly braces to FeatureBitArray initialization to satisfy older versions of clang.
Apparently older versions of clang like 3.6 require an extra set of curly braces around std::array initializations. I'm told the C++ language was changed regarding this by CWG 1270.
llvm-svn: 355327
Amara Emerson [Mon, 4 Mar 2019 19:16:00 +0000 (19:16 +0000)]
Re-commit r355104: "[AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1."
The code to materialize a mask from a constant pool load tried to use a 128 bit
LDR to load a 64 bit constant pool entry, which was 8 byte aligned. This resulted
in a link failure in the NEON tests in the test suite since the LDR address was
unaligned. This change fixes that to instead emit a 64 bit LDR if the entry is
64 bit, before converting back to a 128 bit register for the TBL.
llvm-svn: 355326
Nirav Dave [Mon, 4 Mar 2019 19:12:56 +0000 (19:12 +0000)]
[MC] Teach ELFObjectWriter that parse-time variables do not appear in
symbol table.
llvm-svn: 355325
Craig Topper [Mon, 4 Mar 2019 19:12:16 +0000 (19:12 +0000)]
[DAGCombiner][X86][SystemZ][AArch64] Combine some cases of (bitcast (build_vector constants)) between legalize types and legalize dag.
This patch enables combining integer bitcasts of integer build vectors when the new scalar type is legal. I've avoided floating point because the implementation bitcasts float to int along the way and we would need to check the intermediate types for legality
Differential Revision: https://reviews.llvm.org/D58884
llvm-svn: 355324
Pavel Labath [Mon, 4 Mar 2019 18:48:00 +0000 (18:48 +0000)]
Refactor user/group name resolving code
Summary:
This creates an abstract base class called "UserIDResolver", which can
be implemented to provide user/group ID resolution capabilities for
various objects. Posix host implement a PosixUserIDResolver, which does
that using posix apis (getpwuid and friends). PlatformGDBRemote
forwards queries over the gdb-remote link, etc. ProcessInstanceInfo
class is refactored to make use of this interface instead of taking a
platform pointer as an argument. The base resolver class already
implements caching and thread-safety, so implementations don't have to
worry about that.
The main motivating factor for this was to remove external dependencies
from the ProcessInstanceInfo class (so it can be put next to
ProcessLaunchInfo and friends), but it has other benefits too:
- ability to test the user name caching code
- ability to test ProcessInstanceInfo dumping code
- consistent interface for user/group resolution between Platform and
Host classes.
Reviewers: zturner, clayborg, jingham
Subscribers: mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D58167
llvm-svn: 355323
Erich Keane [Mon, 4 Mar 2019 18:47:21 +0000 (18:47 +0000)]
Enable _rotl, _lrotl, _rotr, _lrotr on all platforms.
The above builtins are currently implemented for MSVC mode, however GCC
also implements these. This patch enables them for all platforms.
Additionally, this corrects the type for these builtins to always be
'long int' to match the specification in the Intel Intrinsics Guide.
Change-Id: Ida34be98078709584ef5136c8761783435ec02b1
llvm-svn: 355322
Wouter van Oortmerssen [Mon, 4 Mar 2019 17:18:04 +0000 (17:18 +0000)]
[WebAssembly] Add support for data sections in the assembler.
Summary:
This is quite minimal so far, introduce them with .section,
fill them with .int8 or .asciz, end with .size
Reviewers: dschuff, sbc100, aheejin
Subscribers: jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58660
llvm-svn: 355321
Michal Gorny [Mon, 4 Mar 2019 16:54:06 +0000 (16:54 +0000)]
[lldb] [test] Mark failing tests XFAIL on NetBSD
Add a convenience 'expectedFailureNetBSD' decorator and mark all tests
currently failing on NetBSD with it. Also skip a few tests that hang
the test suite. This should establish a baseline for the test suite
and get us closer to enabling tests on buildbot. This will help us
catch regressions while we still have a lot of work to do to get tests
working.
It seems that there are also some flaky tests. I am going to address
them later on.
Differential Revision: https://reviews.llvm.org/D58527
llvm-svn: 355320
Kamil Rytarowski [Mon, 4 Mar 2019 15:51:02 +0000 (15:51 +0000)]
Revert duplicate check for DragonFly BSD
Summary: Revert duplicate check for DragonFly BSD
Submitted by tuxillo.
Reviewers: krytarowski
Reviewed By: krytarowski
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58907
llvm-svn: 355319
Louis Dionne [Mon, 4 Mar 2019 15:26:27 +0000 (15:26 +0000)]
[libc++] decoupling Freestanding atomic<T> from libatomic.a
This patch introduces non-lockfree atomics that do not require using
an external libatomic. This work is done with the long-term goal of
allowing the use of <atomic> in freestanding environments.
Thanks to Olivier Giroux for the patch.
Differential Revision: https://reviews.llvm.org/D56913
llvm-svn: 355318
Erich Keane [Mon, 4 Mar 2019 14:54:52 +0000 (14:54 +0000)]
Give builtins and alloc/dealloc operators the default calling convention.
On SPIR targets, the default calling convention is SpirFunction.
However, operator new/delete and builtins were being created with CC_C.
The result is indirect references to new/delete (or builtins that are permitted
to be called indirectly have a mismatched type, as well as questionable codegen
in some cases.
This patch sets both to the default calling convention, so that it
properly matches the calling convention of the target.
Differential Revision: https://reviews.llvm.org/D58844
Change-Id: I52065bb00bc2655945caea8f29c409ba1e0ac24a
llvm-svn: 355317
Simon Pilgrim [Mon, 4 Mar 2019 14:49:02 +0000 (14:49 +0000)]
[X86] Regenerate illegal type load test with non-undef load address.
This would be affected by an upcoming patch without undoing some of the bugpoint reduction.
llvm-svn: 355316
Kamil Rytarowski [Mon, 4 Mar 2019 14:36:43 +0000 (14:36 +0000)]
Unbreak shared library linkage on DragonFlyBSD.
Patch submitted by rimvydas.
Reviewers: llvm-commits, krytarowski, mgorny
Reviewed By: krytarowski, mgorny
Subscribers: mgorny
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D35125
llvm-svn: 355315
Andrea Di Biagio [Mon, 4 Mar 2019 13:34:56 +0000 (13:34 +0000)]
[MCA] Remove unused methods. NFC
llvm-svn: 355314
Dmitry Preobrazhensky [Mon, 4 Mar 2019 12:48:32 +0000 (12:48 +0000)]
[AMDGPU][MC] Enable lds_direct operand for v_readfirstlane_b32, v_readlane_b32 and v_writelane_b32
See bug 40662: https://bugs.llvm.org/show_bug.cgi?id=40662
Reviewers: artem.tamazov, arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D58713
llvm-svn: 355312
Andrea Di Biagio [Mon, 4 Mar 2019 12:23:05 +0000 (12:23 +0000)]
[MCA] Correctly initialize struct SummaryView::BackPressureInfo.
This should appease the buildbots.
llvm-svn: 355309
Andrea Di Biagio [Mon, 4 Mar 2019 11:52:34 +0000 (11:52 +0000)]
[MCA] Highlight kernel bottlenecks in the summary view.
This patch adds a new flag named -bottleneck-analysis to print out information
about throughput bottlenecks.
MCA knows how to identify and classify dynamic dispatch stalls. However, it
doesn't know how to analyze and highlight kernel bottlenecks. The goal of this
patch is to teach MCA how to correlate increases in backend pressure to backend
stalls (and therefore, the loss of throughput).
From a Scheduler point of view, backend pressure is a function of the scheduler
buffer usage (i.e. how the number of uOps in the scheduler buffers changes over
time). Backend pressure increases (or decreases) when there is a mismatch
between the number of opcodes dispatched, and the number of opcodes issued in
the same cycle. Since buffer resources are limited, continuous increases in
backend pressure would eventually leads to dispatch stalls. So, there is a
strong correlation between dispatch stalls, and how backpressure changed over
time.
This patch teaches how to identify situations where backend pressure increases
due to:
- unavailable pipeline resources.
- data dependencies.
Data dependencies may delay execution of instructions and therefore increase the
time that uOps have to spend in the scheduler buffers. That often translates to
an increase in backend pressure which may eventually lead to a bottleneck.
Contention on pipeline resources may also delay execution of instructions, and
lead to a temporary increase in backend pressure.
Internally, the Scheduler classifies instructions based on whether register /
memory operands are available or not.
An instruction is marked as "ready to execute" only if data dependencies are
fully resolved.
Every cycle, the Scheduler attempts to execute all instructions that are ready
to execute. If an instruction cannot execute because of unavailable pipeline
resources, then the Scheduler internally updates a BusyResourceUnits mask with
the ID of each unavailable resource.
ExecuteStage is responsible for tracking changes in backend pressure. If backend
pressure increases during a cycle because of contention on pipeline resources,
then ExecuteStage sends a "backend pressure" event to the listeners.
That event would contain information about instructions delayed by resource
pressure, as well as the BusyResourceUnits mask.
Note that ExecuteStage also knows how to identify situations where backpressure
increased because of delays introduced by data dependencies.
The SummaryView observes "backend pressure" events and prints out a "bottleneck
report".
Example of bottleneck report:
```
Cycles with backend pressure increase [ 99.89% ]
Throughput Bottlenecks:
Resource Pressure [ 0.00% ]
Data Dependencies: [ 99.89% ]
- Register Dependencies [ 0.00% ]
- Memory Dependencies [ 99.89% ]
```
A bottleneck report is printed out only if increases in backend pressure
eventually caused backend stalls.
About the time complexity:
Time complexity is linear in the number of instructions in the
Scheduler::PendingSet.
The average slowdown tends to be in the range of ~5-6%.
For memory intensive kernels, the slowdown can be significant if flag
-noalias=false is specified. In the worst case scenario I have observed a
slowdown of ~30% when flag -noalias=false was specified.
We can definitely recover part of that slowdown if we optimize class LSUnit (by
doing extra bookkeeping to speedup queries). For now, this new analysis is
disabled by default, and it can be enabled via flag -bottleneck-analysis. Users
of MCA as a library can enable the generation of pressure events through the
constructor of ExecuteStage.
This patch partially addresses https://bugs.llvm.org/show_bug.cgi?id=37494
Differential Revision: https://reviews.llvm.org/D58728
llvm-svn: 355308
Jeremy Morse [Mon, 4 Mar 2019 10:56:02 +0000 (10:56 +0000)]
[X86] Avoid codegen changes when DBG_VALUE appears between lowered selects
X86TargetLowering::EmitLoweredSelect presently detects sequences of CMOV pseudo
instructions without accounting for debug intrinsics. This leads to different
codegen with and without option -g, if a DBG_VALUE instruction lands in the
middle of several lowered selects.
Work around this by skipping over debug instructions when looking for CMOV
sequences, and sinking those debug insts into the EmitLoweredSelect sunk block.
This might slightly shift where variables appear in the instruction sequence,
but won't re-order assignments.
Differential Revision: https://reviews.llvm.org/D58672
llvm-svn: 355307
Alexey Lapshin [Mon, 4 Mar 2019 10:42:54 +0000 (10:42 +0000)]
[LLD] add test for line number info related to differrent .text sections
There is a bug for llvm-objdump which incorrectly reported line number
info for object file if several .text sections presented.
https://bugs.llvm.org/show_bug.cgi?id=40703 .
This patch adds test for the same situation.
Differential revision: https://reviews.llvm.org/D58357
llvm-svn: 355306
Oliver Stannard [Mon, 4 Mar 2019 09:17:38 +0000 (09:17 +0000)]
[ARM] Fix selection of VLDR.16 instruction with imm offset
The isScaledConstantInRange function takes upper and lower bounds which are
checked after dividing by the scale, so the bounds checks for half, single and
double precision should all be the same. Previously, we had wrong bounds checks
for half precision, so selected an immediate the instructions can't actually
represent.
Differential revision: https://reviews.llvm.org/D58822
llvm-svn: 355305
Jonas Hahnfeld [Mon, 4 Mar 2019 08:51:32 +0000 (08:51 +0000)]
[AArch64/ARM] Fix two compiler warnings in InstructionSelector, NFCI
1) GCC complains that KnownValid is set but not used.
2) In ARMInstructionSelector::selectGlobal() the code is mixing "enumeral
and non-enumeral type in conditional expression". Solve this by casting
to unsigned which is the final type anyway.
Differential Revision: https://reviews.llvm.org/D58834
llvm-svn: 355304
Eugene Leviant [Mon, 4 Mar 2019 07:15:36 +0000 (07:15 +0000)]
[DebugInfo] Construct nested types on behalf of owner CU
Differential revision: https://reviews.llvm.org/D58786
llvm-svn: 355303
Michal Gorny [Mon, 4 Mar 2019 04:53:50 +0000 (04:53 +0000)]
[llvm] [Support] Revert "Reimplement getMainExecutable() using sysctl on NetBSD"
This apparently does not work reliably after all (non-reentrant?)
and causes test failures such as:
http://lab.llvm.org:8011/builders/netbsd-amd64/builds/19254/steps/run%20unit%20tests/logs/FAIL%3A%20libc%2B%2B%3A%3Asize.pass.cpp
llvm-svn: 355302
Davide Italiano [Mon, 4 Mar 2019 04:38:58 +0000 (04:38 +0000)]
[InstCombine] Mark debug values as unavailable after DCE.
Fixes PR40838.
llvm-svn: 355301
Craig Topper [Mon, 4 Mar 2019 04:26:31 +0000 (04:26 +0000)]
[SubtargetFeatures] Add operator< for comparing SubtargetInfoKV objects. NFCI
Use instead of passing a lambda to std::is_sorted. This is more consistent with SubtargetFeatureKV.
llvm-svn: 355300
Craig Topper [Mon, 4 Mar 2019 02:02:24 +0000 (02:02 +0000)]
[SubtargetFeatures] Don't call ApplyFeatureFlag if the feature name is '+help'
Just print the help and stop. Otherwise we'll print a message about it not being a real feature name after printing the help text.
llvm-svn: 355299
Craig Topper [Mon, 4 Mar 2019 02:02:22 +0000 (02:02 +0000)]
[SubtargetFeatuers] Simplify the code used to imply features from CPU name.
If we make SetImpliedBits OR features outside of its loop, we can reuse it for the first round of implying features for CPUs.
llvm-svn: 355298
Kristof Umann [Mon, 4 Mar 2019 00:28:16 +0000 (00:28 +0000)]
[analyzer] Enable subcheckers to possess checker options
Under the term "subchecker", I mean checkers that do not have a checker class on
their own, like unix.MallocChecker to unix.DynamicMemoryModeling.
Since a checker object was required in order to retrieve checker options,
subcheckers couldn't possess options on their own.
This patch is also an excuse to change the argument order of getChecker*Option,
it always bothered me, now it resembles the actual command line argument
(checkername:option=value).
Differential Revision: https://reviews.llvm.org/D57579
llvm-svn: 355297