Simon Pilgrim [Sat, 6 Apr 2019 12:08:37 +0000 (12:08 +0000)]
[CostModel][X86] Add more exhaustive masked load/store/gather/scatter/expand/compress cost tests
llvm-svn: 357838
Paul Hoad [Sat, 6 Apr 2019 10:13:04 +0000 (10:13 +0000)]
[clang-format] BreakAfterReturnType ignored on functions with numeric template parameters
Summary:
Addresses PR40696 - https://bugs.llvm.org/show_bug.cgi?id=40696
The BreakAfterReturnType didn't work if it had a single arguments which was a template with an integer template parameter
```
int foo(A<8> a) { return a; }
```
When run with the Mozilla style. would not break after the `int`
```
int TestFn(A<8> a)
{
return a;
}
```
This revision resolves this issue by allowing numeric constants to be considered function parameters if if seen inside `<>`
Reviewers: djasper, klimek, JonasToth, krasimir, reuk, alexfh
Reviewed By: klimek
Subscribers: cfe-commits, llvm-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D59309
llvm-svn: 357837
Stanislav Mekhanoshin [Sat, 6 Apr 2019 09:20:48 +0000 (09:20 +0000)]
[AMDGPU] Sort out and rename multiple CI/VI predicates
Differential Revision: https://reviews.llvm.org/D60346
llvm-svn: 357835
Fangrui Song [Sat, 6 Apr 2019 09:12:53 +0000 (09:12 +0000)]
[DWARF] Simplify DWARFDebugAranges::findAddress
The current lower_bound approach has to check two iterators pos and pos-1.
Changing it to upper_bound allows us to check one iterator (similar to
DWARFUnitVector::getUnitFor*).
llvm-svn: 357834
Fangrui Song [Sat, 6 Apr 2019 02:18:56 +0000 (02:18 +0000)]
[Symbolize] Uniquify sorted vector<pair<SymbolDesc, StringRef>>
llvm-svn: 357833
Julian Lettner [Sat, 6 Apr 2019 01:41:40 +0000 (01:41 +0000)]
[TSan][libdispatch] Remove Darwin-only version of fully-ported tests
Remove 10 tests that already have a copy in tsan/libdispatch, without
dependencies on Darwin-specifis.
llvm-svn: 357832
Peter Collingbourne [Sat, 6 Apr 2019 00:43:17 +0000 (00:43 +0000)]
tsan: Update test expectations.
llvm-svn: 357831
Nico Weber [Fri, 5 Apr 2019 23:57:10 +0000 (23:57 +0000)]
gn build: Pacify `gn format`
llvm-svn: 357830
Adrian Prantl [Fri, 5 Apr 2019 22:43:42 +0000 (22:43 +0000)]
Unify random timeouts throughout LLDB and make them configurable.
Since these timeouts guard against catastrophic error in debugserver,
I also increased all of them to the maximum value among them.
The motivation for this test was the observation that an asanified
LLDB would often exhibit seemingly random test failures that could be
traced back to debugserver packets getting out of sync. With this path
applied I can no longer reproduce the one particular failure mode that
I was investigating.
rdar://problem/
49441261
Differential Revision: https://reviews.llvm.org/D60340
llvm-svn: 357829
Dimitry Andric [Fri, 5 Apr 2019 22:19:40 +0000 (22:19 +0000)]
After rL357618, quote ${CMAKE_THREAD_LIBS_INIT} so CMake does not
complain when the variable is empty. Fixes PR 41401.
llvm-svn: 357828
Artem Dergachev [Fri, 5 Apr 2019 22:11:28 +0000 (22:11 +0000)]
Revert "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."
This reverts commit r357823.
Was breaking clang-tidy!
Differential Revision: https://reviews.llvm.org/D59977
llvm-svn: 357827
Zachary Turner [Fri, 5 Apr 2019 22:09:30 +0000 (22:09 +0000)]
[PDB Docs] Add documentation for the hash table format.
llvm-svn: 357826
Zachary Turner [Fri, 5 Apr 2019 22:09:14 +0000 (22:09 +0000)]
[PDB Docs] The IPI Stream actually has index 4.
llvm-svn: 357825
Jonas Devlieghere [Fri, 5 Apr 2019 22:06:53 +0000 (22:06 +0000)]
[testsuite] Split Objective-C new syntax test
This splits the second longest test into separate test cases. Similar to
what we did for the Objective-C data formatters in r357786.
llvm-svn: 357824
Artem Dergachev [Fri, 5 Apr 2019 21:48:52 +0000 (21:48 +0000)]
[Lexer] NFC: Fix an off-by-one bug in getAsCharRange().
As the unit test demonstrates, subtracting 1 from the offset was unnecessary.
The only user of this function was the plist file emitter (in Static Analyzer
and ARCMigrator). It means that a lot of Static Analyzer's plist arrows
are in fact off by one character. The patch carefully preserves this
completely incorrect behavior and causes no functional change,
i.e. no plist format breakage.
Differential Revision: https://reviews.llvm.org/D59977
llvm-svn: 357823
Robert Widmann [Fri, 5 Apr 2019 21:36:50 +0000 (21:36 +0000)]
[LLVM-C] Begin to Expose A More General Binary Interface
Summary:
Provides a new type, `LLVMBinaryRef`, and a binding to `llvm::object::createBinary` for more general interoperation with binary files than `LLVMObjectFileRef`. It also provides the proper non-consuming API for input buffers and populates an out parameter for error handling if necessary - two things the previous API did not do.
In a follow-up, I'll define section and symbol iterators and begin to build upon the existing test infrastructure.
This patch is a first step towards deprecating that API and replacing it with something more robust.
Reviewers: deadalnix, whitequark
Reviewed By: whitequark
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60322
llvm-svn: 357822
Petr Hosek [Fri, 5 Apr 2019 21:30:40 +0000 (21:30 +0000)]
[gn] Support for building compiler-rt builtins
This is support for building compiler-rt builtins, The library build
should be complete for a subset of supported platforms, but not all
CMake options have been replicated in GN.
We always use the just built compiler to build all the runtimes, which
is equivalent to the CMake runtimes build. This simplifies the build
configuration because we don't need to support arbitrary host compiler
and can always assume the latest Clang. With GN's toolchain support,
this is significantly more efficient than the CMake runtimes build.
Differential Revision: https://reviews.llvm.org/D60331
llvm-svn: 357821
Daniel Sanders [Fri, 5 Apr 2019 21:22:17 +0000 (21:22 +0000)]
[globalisel] Allow combiners to query legality
llvm-svn: 357820
Zachary Turner [Fri, 5 Apr 2019 21:16:00 +0000 (21:16 +0000)]
[PDB Docs] Delete * LINKER * Stream information.
This is actually just a module debug info stream, so it should
technically be covered by a discussion of the module list.
llvm-svn: 357819
Louis Dionne [Fri, 5 Apr 2019 21:05:32 +0000 (21:05 +0000)]
[libc++][CMake] Make sure the benchmarks link against libc++abi
The refactoring in r357811 made it so that we didn't add the ABI library
to the list of LIBCXX_LIBRARIES. As a result, benchmarks didn't link to
the ABI library and were missing symbols. This broke the build bots.
As a drive-by fix, we also provide the SHARED ABI library to the linker
script instead of the STATIC ABI library.
This couldn't be discovered on Apple platforms because libc++.dylib
re-exports libc++abi.dylib symbols there.
llvm-svn: 357818
Alex Langford [Fri, 5 Apr 2019 21:01:50 +0000 (21:01 +0000)]
[CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds
Summary:
This line is unnecessary because add_llvm_executable will handle
linking the correct LLVM libraries for you. LLDB standalone builds are totally
fine without this.
In the best case, having this line here is harmless. In the worst case it can
cause link issues.
If you build lldb-server for android using the standalone build, this line
will cause LLVM_LIBRARY_DIR to be the first place you look for libraries.
This is an issue because if you built libc++, it will try to link against
that one instead of the one from the android NDK. Meanwhile, the LLVM libraries
you're linking against were linked against the libc++ from the NDK.
Ideally, we would take advantage of the AFTER option for link_directories(), but
that was not available in LLDB's minimum supported version of CMake (CMake 3.4.3).
Differential Revision: https://reviews.llvm.org/D60180
llvm-svn: 357817
Sanjay Patel [Fri, 5 Apr 2019 20:54:35 +0000 (20:54 +0000)]
[InstCombine] add more tests for fmul+fdiv+sqrt; NFC
llvm-svn: 357816
Daniel Sanders [Fri, 5 Apr 2019 20:47:13 +0000 (20:47 +0000)]
[globalisel] Support 3-type legalForCartesianProduct()
llvm-svn: 357815
Eric Fiselier [Fri, 5 Apr 2019 20:38:43 +0000 (20:38 +0000)]
Fix PR41395 - __cxa_vec_new may overflow in allocation size calculation.
llvm-svn: 357814
Jonas Devlieghere [Fri, 5 Apr 2019 20:37:52 +0000 (20:37 +0000)]
[Test] Remove no_debug_info_test decorator from Obj-C data formatters.
As discussed in https://reviews.llvm.org/D60300.
llvm-svn: 357813
Robert Widmann [Fri, 5 Apr 2019 20:32:43 +0000 (20:32 +0000)]
[LLVM-C] Add bindings to insert basic blocks
Summary:
Now that we can create standalone basic blocks, it's useful to be able to append them. Add bindings to
- Insert a basic block after the current insertion block
- Append a basic block to the end of a function's list of basic blocks
Reviewers: whitequark, deadalnix, harlanhaskins
Reviewed By: whitequark, harlanhaskins
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59658
llvm-svn: 357812
Louis Dionne [Fri, 5 Apr 2019 20:29:54 +0000 (20:29 +0000)]
[libc++] Localize CMake code only related to the shared library
Summary:
There's a lot of CMake logic that's only relevant to the shared library,
yet it was using a code path and setting variables that impact both the
shared and the static libraries. This patch moves this logic so that it
clearly only impacts the shared library.
Reviewers: phosek, smeenai, EricWF
Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D60276
llvm-svn: 357811
Artem Dergachev [Fri, 5 Apr 2019 20:18:53 +0000 (20:18 +0000)]
[analyzer] NoStoreFuncVisitor: Suppress reports with no-store in system headers.
The idea behind this heuristic is that normally the visitor is there to
inform the user that a certain function may fail to initialize a certain
out-parameter. For system header functions this is usually dictated by the
contract, and it's unlikely that the header function has accidentally
forgot to put the value into the out-parameter; it's more likely
that the user has intentionally skipped the error check.
Warnings on skipped error checks are more like security warnings;
they aren't necessarily useful for all users, and they should instead
be introduced on a per-API basis.
Differential Revision: https://reviews.llvm.org/D60107
llvm-svn: 357810
Francis Visoiu Mistrih [Fri, 5 Apr 2019 20:18:25 +0000 (20:18 +0000)]
[X86] Enable tail calls for CallingConv::Swift
It's currently only enabled on AArch64 (enabled in r281376).
llvm-svn: 357809
Francis Visoiu Mistrih [Fri, 5 Apr 2019 20:18:21 +0000 (20:18 +0000)]
[X86] Preserve operand flag when expanding TCRETURNri
The expansion of TCRETURNri(64) would not keep operand flags like
undef/renamable/etc. which can result in machine verifier issues.
Also add plumbing to be able to use `-run-pass=x86-pseudo`.
llvm-svn: 357808
Vitaly Buka [Fri, 5 Apr 2019 20:17:03 +0000 (20:17 +0000)]
Use binary write mode in WriteToFile function to avoid appended \r characters on Windows
Summary:
When using libfuzzer on Windows, in the contents of a crash sample, bytes that can be mistaken for a \n are replaced by a \r\n sequence. As a consequence, crashes are not reproducible. This patch will open files in binary mode to fix this issue. The patch does not affect POSIX systems.
Patch by tuktuk
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Subscribers: dexonsmith, jdoerfert, llvm-commits, #sanitizers
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D60008
llvm-svn: 357807
Peter Collingbourne [Fri, 5 Apr 2019 20:16:26 +0000 (20:16 +0000)]
ELF: De-template ELFFileBase. NFCI.
Differential Revision: https://reviews.llvm.org/D60304
llvm-svn: 357806
Stanislav Mekhanoshin [Fri, 5 Apr 2019 20:11:32 +0000 (20:11 +0000)]
[AMDGPU] Add MachineDCE pass after RenameIndependentSubregs
Detect dead lanes can create some dead defs. Then RenameIndependentSubregs
will break a REG_SEQUENCE which may use these dead defs. At this point
a dead instruction can be removed but we do not run a DCE anymore.
MachineDCE was only running before live variable analysis. The patch
adds a mean to preserve LiveIntervals and SlotIndexes in case it works
past this.
Differential Revision: https://reviews.llvm.org/D59626
llvm-svn: 357805
Eric Fiselier [Fri, 5 Apr 2019 19:58:15 +0000 (19:58 +0000)]
Further refactor cxa_guard.cpp
This patch is a part of a series of patches to cleanup
our implementation of __cxa_acquire et al. No functionality
change was intended.
This patch does two primary things.
It introduces the GuardObject class to abstract the reading
and writing to the guard object. In future, it will be used
to ensure atomic accesses are used when needed.
It also introduces the GuardValue class used to represent
values of the guard object. It is an abstraction to access
and write to the various different bits of a guard.
llvm-svn: 357804
Matt Morehouse [Fri, 5 Apr 2019 19:47:17 +0000 (19:47 +0000)]
[clang-fuzzer] Include ExternalProject before using it.
Some versions of CMake require ExternalProject to be included before we
can use ExternalProject_Add.
llvm-svn: 357803
Craig Topper [Fri, 5 Apr 2019 19:28:09 +0000 (19:28 +0000)]
[X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand.
Summary:
This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between Jcc instructions and condition codes.
Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser.
Reviewers: spatel, lebedev.ri, courbet, gchatelet, RKSimon
Reviewed By: RKSimon
Subscribers: MatzeB, qcolombet, eraman, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60228
llvm-svn: 357802
Craig Topper [Fri, 5 Apr 2019 19:27:49 +0000 (19:27 +0000)]
[X86] Merge the different SETcc instructions for each condition code into single instructions that store the condition code as an operand.
Summary:
This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between SETcc instructions and condition codes.
Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser.
Reviewers: andreadb, courbet, RKSimon, spatel, lebedev.ri
Reviewed By: andreadb
Subscribers: hiraditya, lebedev.ri, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60138
llvm-svn: 357801
Craig Topper [Fri, 5 Apr 2019 19:27:41 +0000 (19:27 +0000)]
[X86] Merge the different CMOV instructions for each condition code into single instructions that store the condition code as an immediate.
Summary:
Reorder the condition code enum to match their encodings. Move it to MC layer so it can be used by the scheduler models.
This avoids needing an isel pattern for each condition code. And it removes
translation switches for converting between CMOV instructions and condition
codes.
Now the printer, encoder and disassembler take care of converting the immediate.
We use InstAliases to handle the assembly matching. But we print using the
asm string in the instruction definition. The instruction itself is marked
IsCodeGenOnly=1 to hide it from the assembly parser.
This does complicate the scheduler models a little since we can't assign the
A and BE instructions to a separate class now.
I plan to make similar changes for SETcc and Jcc.
Reviewers: RKSimon, spatel, lebedev.ri, andreadb, courbet
Reviewed By: RKSimon
Subscribers: gchatelet, hiraditya, kristina, lebedev.ri, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60041
llvm-svn: 357800
David Goldman [Fri, 5 Apr 2019 19:17:24 +0000 (19:17 +0000)]
Fix error in NamedDeclPrinterTest
Caused by D56924, shouldn't use raw string literals in macros.
Differential Revision: https://reviews.llvm.org/D60326
llvm-svn: 357799
Petr Hosek [Fri, 5 Apr 2019 19:13:54 +0000 (19:13 +0000)]
[gn] Rebase paths in symlink_or_copy against root_build_dir
We should be always rebasing paths against root_build_dir which is
the directory where scripts are run from, not root_out_dir which is
the current toolchain directory. The latter can result in invalid
paths when the action is being used from a non-default toolchain.
Differential Revision: https://reviews.llvm.org/D60330
llvm-svn: 357798
Petr Hosek [Fri, 5 Apr 2019 19:12:37 +0000 (19:12 +0000)]
[gn] Make -no-exceptions flag a config
This allows it to be disabled for targets that need exceptions
like libunwind, libc++abi and libc++.
Differential Revision: https://reviews.llvm.org/D60328
llvm-svn: 357797
Guozhi Wei [Fri, 5 Apr 2019 18:51:08 +0000 (18:51 +0000)]
[LCG] Add aliased functions as LCG roots
Current LCG doesn't check aliased functions. So if an internal function has a public alias it will not be added to CG SCC, but it is still reachable from outside through the alias.
So this patch adds aliased functions to SCC.
Differential Revision: https://reviews.llvm.org/D59898
llvm-svn: 357795
Louis Dionne [Fri, 5 Apr 2019 18:50:47 +0000 (18:50 +0000)]
[libc++] Add XFAILs for istream tests that were added in r357775
We fixed incorrect behavior of input streams in r357775 and tests were
added accordingly. However, older versions of macOS don't have the
change in the dylib yet, so the tests fail on those platforms.
llvm-svn: 357794
Kristina Brooks [Fri, 5 Apr 2019 18:26:43 +0000 (18:26 +0000)]
[docs] Fix rst title in clang langext docs. NFCI
Fix an odd line in LanguageExtensions.rst which
rendered incorrectly due to an underscore being
mixed in with dashes.
llvm-svn: 357793
Stanislav Mekhanoshin [Fri, 5 Apr 2019 18:25:00 +0000 (18:25 +0000)]
[AMDGPU] rename vi-insts into gfx8-insts
Differential Revision: https://reviews.llvm.org/D60293
llvm-svn: 357792
Stanislav Mekhanoshin [Fri, 5 Apr 2019 18:24:34 +0000 (18:24 +0000)]
[AMDGPU] predicate and feature refactoring
We have done some predicate and feature refactoring lately but
did not upstream it. This is to sync.
Differential revision: https://reviews.llvm.org/D60292
llvm-svn: 357791
Zachary Turner [Fri, 5 Apr 2019 18:06:42 +0000 (18:06 +0000)]
Try to fix Sphinx bot.
llvm-svn: 357790
Saleem Abdulrasool [Fri, 5 Apr 2019 18:00:49 +0000 (18:00 +0000)]
lit: make rm python 3 friendly (NFC)
Add some alterations for python 3 compatibility.
llvm-svn: 357789
Zachary Turner [Fri, 5 Apr 2019 17:59:26 +0000 (17:59 +0000)]
[PDB Docs] Finish documentation for PDB Info Stream.
The information about the named stream map and feature codes
was not present. This patch adds it.
llvm-svn: 357788
Jonas Devlieghere [Fri, 5 Apr 2019 17:57:42 +0000 (17:57 +0000)]
Add .noindex to the gitignore
The .noindex suffix is used on macOS to prevent Spotlight from indexing
its contents. These folders contain test output from dotest.py and
should be ignored when dotest is run from the LLDB source directory.
llvm-svn: 357787
Jonas Devlieghere [Fri, 5 Apr 2019 17:57:40 +0000 (17:57 +0000)]
[testsuite] Split Objective-C data formatter
The testcase for objective-c data formatters is very big as it checks a
bunch of stuff. This is annoying when using the lit test driver, because
it prevents us from running the different cases in parallel. As a
result, it's always one of the last few tests that complete. This patch
splits the test into multiple files that share a common base class. This
way lit can run the different tests in parallel.
Differential revision: https://reviews.llvm.org/D60300
llvm-svn: 357786
Zachary Turner [Fri, 5 Apr 2019 17:12:37 +0000 (17:12 +0000)]
[PDB Docs] Add info about the hash adjustment buffer.
This necessitates adding a document describing the serialized
hash table format. This document is currently empty, although
it will be filled out in followup patches.
llvm-svn: 357784
Nico Weber [Fri, 5 Apr 2019 17:05:54 +0000 (17:05 +0000)]
gn build: Merge 357768 and 357770
llvm-svn: 357783
Sanjay Patel [Fri, 5 Apr 2019 17:00:57 +0000 (17:00 +0000)]
[InstCombine] add tests for fdiv+fmul; NFC
llvm-svn: 357782
Nico Weber [Fri, 5 Apr 2019 16:57:34 +0000 (16:57 +0000)]
gn build: Merge r357719
llvm-svn: 357781
Sanjay Patel [Fri, 5 Apr 2019 16:52:57 +0000 (16:52 +0000)]
[InstCombine] add tests for sqrt+fdiv+fmul; NFC
Examples based on recent llvm-dev thread. These are specific
patterns of more general enhancements that would solve these.
llvm-svn: 357780
Evgeny Mankov [Fri, 5 Apr 2019 16:51:10 +0000 (16:51 +0000)]
[CUDA][Windows] Last fix for the clang Bug 38811 "Clang fails to compile with CUDA-9.x on Windows" (https://bugs.llvm.org/show_bug.cgi?id=38811).
[IMPORTANT]
With that last fix, CUDA has just started being compiling by clang on Windows after nearly a year and two clang’s major releases (7 and 8).
As long as the last LLVM release, in which clang was compiling CUDA on Windows successfully, was 6.0.1, this fix and two previous have to be included into upcoming 7.1.0 and 8.0.1 releases.
[How to repro]
clang++.exe -x cuda "c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\0_Simple\simplePrintf\simplePrintf.cu" -I"c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\common\inc" --cuda-gpu-arch=sm_50 --cuda-path="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0" -L"c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64" -lcudart.lib -v
[Output]
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:390:11: error: no matching function for call to '__isinfl'
return (__isinfl(a) != 0);
^~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2662:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __isinfl(long double a))
^
In file included from <built-in>:1:
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:438:11: error: no matching function for call to '__isnanl'
return (__isnanl(a) != 0);
^~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2672:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __isnanl(long double a))
^
In file included from <built-in>:1:
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:486:11: error: no matching function for call to '__finitel'
return (__finitel(a) != 0);
^~~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2652:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __finitel(long double a))
^
3 errors generated when compiling for sm_50.
[Solution]
Add missing long double device functions' declarations. Provide only declarations to prevent any use of long double on the device side, because CUDA does not support long double on the device side.
[Testing]
{Windows 10, Ubuntu 16.04.5}/{Visual C++ 2017 15.9.9, gcc+ 5.4.0}/CUDA {8.0, 9.0, 9.1, 9.2, 10.0, 10.1}
Reviewed by: Artem Belevich
Differential Revision: http://reviews.llvm.org/D60220
llvm-svn: 357779
Saleem Abdulrasool [Fri, 5 Apr 2019 16:48:00 +0000 (16:48 +0000)]
lit: support long paths on Windows
Use ctypes to call into SHFileOperationW with the extended NT path to allow us
to remove paths which exceed 261 characters on Windows. This functionality is
exercised by swift's test suite.
llvm-svn: 357778
Zachary Turner [Fri, 5 Apr 2019 16:43:42 +0000 (16:43 +0000)]
Add documentation for PDB TPI/IPI Stream.
llvm-svn: 357777
Sanjay Patel [Fri, 5 Apr 2019 16:42:21 +0000 (16:42 +0000)]
[InstCombine] add test to show reassociation that creates a denormal constant; NFC
llvm-svn: 357776
Louis Dionne [Fri, 5 Apr 2019 16:33:37 +0000 (16:33 +0000)]
[libc++] Fix error flags and exceptions propagated from input stream operations
Summary:
This is a re-application of r357533 and r357531. They had been reverted
because we thought the commits broke the LLDB data formatters, but it
turns out this was because only r357531 had been included in the CI
run.
Before this patch, we would only ever throw an exception if the badbit
was set on the stream. The Standard is currently very unclear on how
exceptions should be propagated and what error flags should be set by
the input stream operations. This commit changes libc++ to behave under
a different (but valid) interpretation of the Standard. This interpretation
of the Standard matches what other implementations are doing.
This effectively implements the wording in p1264r0. It hasn't been voted
into the Standard yet, however there is wide agreement that the fix is
correct and it's just a matter of time before the fix is standardized.
PR21586
PR15949
rdar://problem/
15347558
Reviewers: mclow.lists, EricWF
Subscribers: christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D49863
llvm-svn: 357775
Stephen Tozer [Fri, 5 Apr 2019 16:32:25 +0000 (16:32 +0000)]
Revert "[llvm-readobj] Improve error message for --string-dump"
This reverts commit
681b0798dbbc6b3500c9930977ec8a274b142acb.
Reverted due to causing build failures: llvm-svn: 357772
llvm-svn: 357774
Fangrui Song [Fri, 5 Apr 2019 16:16:23 +0000 (16:16 +0000)]
Change some dyn_cast to more apropriate isa. NFC
llvm-svn: 357773
Stephen Tozer [Fri, 5 Apr 2019 16:15:50 +0000 (16:15 +0000)]
[llvm-readobj] Improve error message for --string-dump
Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630
This patch changes the error message when the section specified by
--string-dump cannot be found by including the name of the section in
the error message and changing the prefix text to not imply that the
file itself was invalid. As part of this change some uses of
std::error_code have been replaced with the llvm Error class to better
encapsulate the error info (rather than passing File strings around),
and the WithColor class replaces string literal error prefixes.
Differential Revision: https://reviews.llvm.org/D59946
llvm-svn: 357772
Stephen Tozer [Fri, 5 Apr 2019 15:59:07 +0000 (15:59 +0000)]
[format] Add correct punctuation to comment
Test commit that adds a grammatically correct full stop to a single
comment.
llvm-svn: 357771
Sam McCall [Fri, 5 Apr 2019 15:22:20 +0000 (15:22 +0000)]
[Tooling] add a Heuristic field indicating that a CompileCommand was guessed.
Summary:
Use cases:
- a tool that dumps the heuristic used for each header in a project can
be used to evaluate changes to the heuristic
- we want to expose this information to users in clangd as it affects
accuracy/reliability of editor features
- express interpolation tests more directly
Reviewers: ilya-biryukov, klimek
Subscribers: ioeric, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60194
llvm-svn: 357770
Guillaume Chatelet [Fri, 5 Apr 2019 15:18:59 +0000 (15:18 +0000)]
Add an option do not dump the generated object on disk
Reviewers: courbet
Subscribers: llvm-commits, bdb
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60317
llvm-svn: 357769
Yitzhak Mandelbaum [Fri, 5 Apr 2019 15:14:05 +0000 (15:14 +0000)]
[LibTooling] Add Transformer, a library for source-to-source transformations.
Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling".
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: ioeric, ABataev, mgorny, jfb, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59376
llvm-svn: 357768
Clement Courbet [Fri, 5 Apr 2019 15:03:25 +0000 (15:03 +0000)]
[ExpandMemCmp][NFC] Add tests for `memcmp(p, q, n) < 0` case.
llvm-svn: 357767
Simon Pilgrim [Fri, 5 Apr 2019 14:56:21 +0000 (14:56 +0000)]
[SelectionDAG] Add fcmp UNDEF handling to SelectionDAG::FoldSetCC
Second half of PR40800, this patch adds DAG undef handling to fcmp instructions to match the behavior in llvm::ConstantFoldCompareInstruction, this permits constant folding of vector comparisons where some elements had been reduced to UNDEF (by SimplifyDemandedVectorElts etc.).
This involves a lot of tweaking to reduced tests as bugpoint loves to reduce fcmp arguments to undef........
Differential Revision: https://reviews.llvm.org/D60006
llvm-svn: 357765
Yitzhak Mandelbaum [Fri, 5 Apr 2019 14:05:03 +0000 (14:05 +0000)]
[LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.
Summary:
Introduces a utility library in Refactoring/ to collect routines related to
source-code manipulation. In this change, we move "extended-range" functions
from the FixIt library (in clangTooling) to this new library.
We need to use this functionality in Refactoring/ and cannot access it if it
resides in Tooling/, because that would cause clangToolingRefactor to depend on
clangTooling, which would be a circular dependency.
Reviewers: ilya-biryukov, ioeric
Reviewed By: ilya-biryukov
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60269
llvm-svn: 357764
Matt Arsenault [Fri, 5 Apr 2019 14:03:07 +0000 (14:03 +0000)]
GlobalISel: Add another overload of buildUnmerge
It's annoying to have to create an array of the result type,
particularly when you don't care about the size of the value.
llvm-svn: 357763
Matt Arsenault [Fri, 5 Apr 2019 14:03:04 +0000 (14:03 +0000)]
AMDGPU/GlobalISel: Fix non-power-of-2 select
llvm-svn: 357762
Don Hinton [Fri, 5 Apr 2019 13:59:24 +0000 (13:59 +0000)]
[llvm] Add isa_and_nonnull
Summary:
Add new ``isa_and_nonnull<>`` operator that works just like
the ``isa<>`` operator, except that it allows for a null pointer as an
argument (which it then returns false).
Reviewers: lattner, aaron.ballman, greened
Reviewed By: lattner
Subscribers: hubert.reinterpretcast, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60291
llvm-svn: 357761
Sanjay Patel [Fri, 5 Apr 2019 13:32:17 +0000 (13:32 +0000)]
[DAGCombiner][x86] scalarize splatted vector FP ops
There are a variety of vector patterns that may be profitably reduced to a
scalar op when scalar ops are performed using a subset (typically, the
first lane) of the vector register file.
For x86, this is true for float/double ops and element 0 because
insert/extract is just a sub-register rename.
Other targets should likely enable the hook in a similar way.
Differential Revision: https://reviews.llvm.org/D60150
llvm-svn: 357760
Petar Jovanovic [Fri, 5 Apr 2019 12:58:15 +0000 (12:58 +0000)]
[TextAPI] Fix off-by-one error in the bit index extraction loop
The loop in findNextSetBit() runs one pass more than it should.
On 64-bit architectures this does not cause a problem, but 32-bit
architectures mask the shift count to 5 bits which limits the number of
shifts inside a range of 0 to 31. Shifting by 32 has the same effect as
shifting by 0, so if the first bit in the set is 1, the function will return
with Index different from EndIndexVal. Because of that, range-based for
loops iterating thorough architectures will continue until hitting a 0 in
the set, resulting in n additional iterations, where n is equal to the
number of consecutive 1 bits at the start the set.
Ultimately TBDv1.WriteFile and TBDv2.WriteFile will output additional
architectures causing a failure in the unit tests.
Patch by Milos Stojanovic.
Differential Revision: https://reviews.llvm.org/D60198
llvm-svn: 357759
Fangrui Song [Fri, 5 Apr 2019 12:52:04 +0000 (12:52 +0000)]
[Symbolize] Replace map<SymbolDesc, StringRef> with sorted vector
llvm-svn: 357758
Simon Pilgrim [Fri, 5 Apr 2019 11:34:30 +0000 (11:34 +0000)]
[X86][AVX] Add PR34584 masked store test cases
llvm-svn: 357757
Simon Pilgrim [Fri, 5 Apr 2019 11:22:28 +0000 (11:22 +0000)]
[X86] Add SSE/AVX1/AVX2 masked trunc+store tests
llvm-svn: 357756
Pavel Labath [Fri, 5 Apr 2019 09:56:55 +0000 (09:56 +0000)]
modify-python-lldb.py: Insert initialization code with swig instead
This is the last functional change to the generated python module being
done by modify-python-lldb.py. The remaining code just deals with
reformatting of comments.
llvm-svn: 357755
Pavel Labath [Fri, 5 Apr 2019 08:43:54 +0000 (08:43 +0000)]
Fix r357749 for big-endian architectures
We need to read the strings from the minidump files as little-endian,
regardless of the host byte order.
I definitely remember thinking about this case while writing the patch
(and in fact, I have implemented that for the "write" case), but somehow
I have ended up not implementing the byte swapping when reading the
data. This adds the necessary byte-swapping and should hopefully fix
test failures on big-endian bots.
llvm-svn: 357754
Rainer Orth [Fri, 5 Apr 2019 08:42:21 +0000 (08:42 +0000)]
[Sanitizers] Provide __internal_dup on Solaris
Both LLVM 8.0.0 and current trunk fail to link libclang_rt.ubsan.standalone-*.so
on Solaris 11/x86 with GCC 8.1.0:
Undefined first referenced
symbol in file
Scanning dependencies of target clang_rt.asan_cxx-x86_64
__sanitizer::internal_dup(int) ../sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_posix.cc.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
make[2]: *** [projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan_standalone-dynamic-i386.dir/build.make:233: lib/clang/9.0.0/lib/sunos/libclang_rt.ubsan_standalone-i386.so] Error 1
Fixed by providing an implementation, which allowed the i386-pc-solaris2.11 build
to finish.
Differential Revision: https://reviews.llvm.org/D60045
llvm-svn: 357753
Roger Ferrer Ibanez [Fri, 5 Apr 2019 08:40:57 +0000 (08:40 +0000)]
[RISCV] Implement adding a displacement to a BlockAddress
Recent change rL357393 uses MachineInstrBuilder::addDisp to add a based on a
BlockAddress but this case was not implemented.
This patch adds the missing case and a test for RISC-V that exercises the new
case.
Differential Revision: https://reviews.llvm.org/D60136
llvm-svn: 357752
Rainer Orth [Fri, 5 Apr 2019 08:40:08 +0000 (08:40 +0000)]
[Sanitizers] Fix sanitizer_linux_libcdep.cc compilation on Solaris
Both LLVM 8.0.0 and current trunk fail to compile on Solaris 11/x86 with
GCC 8.1.0:
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc: In function ‘void __sanitizer::ReExec()’:
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:831:14: error: ‘getexecname’ was not declared in this scope
pathname = getexecname();
^~~~~~~~~~~
/vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:831:14: note: suggested alternative: ‘gethostname’
pathname = getexecname();
^~~~~~~~~~~
gethostname
This is easily fixed by including <stdlib.h> which declares that function.
With that patch, compilation continues.
Differential Revision: https://reviews.llvm.org/D60044
llvm-svn: 357751
Pavel Labath [Fri, 5 Apr 2019 08:26:58 +0000 (08:26 +0000)]
Fix MSVC build for r357749
MSVC found the bare "make_unique" invocation ambiguous (between std::
and llvm:: versions). Explicitly qualifying the call with llvm:: should
hopefully fix it.
llvm-svn: 357750
Pavel Labath [Fri, 5 Apr 2019 08:06:26 +0000 (08:06 +0000)]
Minidump: Add support for reading/writing strings
Summary:
Strings in minidump files are stored as a 32-bit length field, giving
the length of the string in *bytes*, which is followed by the
appropriate number of UTF16 code units. The string is also supposed to
be null-terminated, and the null-terminator is not a part of the length
field. This patch:
- adds support for reading these strings out of the minidump file (this
implementation does not depend on proper null-termination)
- adds support for writing them to a minidump file
- using the previous two pieces implements proper (de)serialization of
the CSDVersion field of the SystemInfo stream. Previously, this was
only read/written as hex, and no attempt was made to access the
referenced string -- now this string is read and written correctly.
The changes are tested via yaml2obj|obj2yaml round-trip as well as a
unit test which checks the corner cases of the string deserialization
logic.
Reviewers: jhenderson, zturner, clayborg
Subscribers: llvm-commits, aprantl, markmentovai, amccarth, lldb-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59775
llvm-svn: 357749
Pavel Labath [Fri, 5 Apr 2019 07:56:39 +0000 (07:56 +0000)]
MinidumpParser: use minidump parser in llvm/Object
This patch removes the lower layers of the minidump parsing code from
the MinidumpParser class, and replaces it with the minidump parser in
llvm.
Not all functionality is already avaiable in the llvm class, but it is
enough for us to be able to stop enumerating streams manually, and rely
on the minidump directory parsing code from the llvm class.
This also removes some checked-in binaries which were used to test error
handling in the parser, as the error handling is now done (and tested)
in llvm. Instead I just add one test that ensures we correctly propagate
the errors reported by the llvm parser. The input for this test can be
written in yaml instead of a checked-in binary.
llvm-svn: 357748
Pavel Labath [Fri, 5 Apr 2019 07:56:26 +0000 (07:56 +0000)]
TestVCCode_step: replace assertTrue with more specific assertions
When this test fails (flakes) all we get is an error message like "False
is not True". This replaces patterns like assertTrue(a == b) with
assertEqual(a, b), so we get a better error message (and hopefully a
hint as to why the test is flaky).
llvm-svn: 357747
Piotr Sobczak [Fri, 5 Apr 2019 07:44:09 +0000 (07:44 +0000)]
[SelectionDAG] Compute known bits of CopyFromReg
Summary:
Teach SelectionDAG how to compute known bits of ISD::CopyFromReg if
the virtual reg used has one def only.
This can be particularly useful when calling isBaseWithConstantOffset()
with the ISD::CopyFromReg argument, as more optimizations may get enabled
in the result.
Also add a missing truncation on X86, found by testing of this patch.
Change-Id: Id1c9fceec862d118c54a5b53adf72ada5d6daefa
Reviewers: bogner, craig.topper, RKSimon
Reviewed By: RKSimon
Subscribers: lebedev.ri, nemanjai, jvesely, nhaehnle, javed.absar, jsji, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59535
llvm-svn: 357745
Pavel Labath [Fri, 5 Apr 2019 07:28:52 +0000 (07:28 +0000)]
PDBFPO: Use references instead of pointers, where possible
Summary:
The code was passing pointers around, expecting they would be not null.
In c++ it is possible to convey this notion explicitly by using a
reference instead.
Not all uses of pointers could be converted to references (e.g. one
can't store references in a container), but this will at least make it
locally obvious that code is dealing with nonnull pointers.
Reviewers: aleksandr.urakov, amccarth
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D60271
llvm-svn: 357744
Craig Topper [Fri, 5 Apr 2019 06:32:50 +0000 (06:32 +0000)]
[X86] Promote i16 SRA instructions to i32
We already promote SRL and SHL to i32.
This will introduce sign extends sometimes which might be harder to deal with than the zero we use for promoting SRL. I ran this through some of our internal benchmark lists and didn't see any major regressions.
I think there might be some DAG combine improvement opportunities in the test changes here.
Differential Revision: https://reviews.llvm.org/D60278
llvm-svn: 357743
Serguei Katkov [Fri, 5 Apr 2019 05:41:08 +0000 (05:41 +0000)]
[FastISel] Fix crash for gc.relocate lowring
Lowering safepoint checks that all gc.relocaes observed in safepoint
must be lowered. However Fast-Isel is able to skip dead gc.relocate.
To resolve this issue we just ignore dead gc.relocate in the check.
Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D60184
llvm-svn: 357742
Julian Lettner [Fri, 5 Apr 2019 02:05:57 +0000 (02:05 +0000)]
[TSan][libdispatch] Make test work on Linux, pt. 2
llvm-svn: 357741
Alex Lorenz [Fri, 5 Apr 2019 01:48:11 +0000 (01:48 +0000)]
[test] Specify an explicit darwin version in a triple in
`test/Driver/debug-options.c` to ensure that the driver
selects the DWARF 2 version as intended by the test.
Fixes the `test/Driver/debug-options.c` test regression on GreenDragon
on macOS that started failing after r357713.
llvm-svn: 357740
Peter Collingbourne [Fri, 5 Apr 2019 01:31:40 +0000 (01:31 +0000)]
ELF: Simplify. NFCI.
Differential Revision: https://reviews.llvm.org/D60299
llvm-svn: 357739
Rui Ueyama [Fri, 5 Apr 2019 01:30:09 +0000 (01:30 +0000)]
Remove redundant parameters. NFC.
llvm-svn: 357738
Sam Clegg [Fri, 5 Apr 2019 00:35:12 +0000 (00:35 +0000)]
[WebAssembly] Include function in wasm table when used in R_WASM_TABLE_INDEX_REL_SLEB
This should have been part of rL357710 but was overlooked because
in our test code the function in question was also used in other
relocations that caused it to be added to the table anyway.
Differential Revision: https://reviews.llvm.org/D60296
llvm-svn: 357737
Eric Christopher [Thu, 4 Apr 2019 23:34:38 +0000 (23:34 +0000)]
NFC: Move API uses of MD5::MD5Result to Optional rather than a pointer.
Differential Revision: https://reviews.llvm.org/D60290
llvm-svn: 357736
David Callahan [Thu, 4 Apr 2019 23:30:47 +0000 (23:30 +0000)]
Include invoke'd functions for recursive extract
Summary: When recursively extracting a function from a bit code file, include functions mentioned in InvokeInst as well as CallInst
Reviewers: loladiro, espindola, volkan
Reviewed By: loladiro
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60231
llvm-svn: 357735
Nick Lewycky [Thu, 4 Apr 2019 23:09:40 +0000 (23:09 +0000)]
An unreachable block may have a route to a reachable block, don't fast-path return that it can't.
A block reachable from the entry block can't have any route to a block that's not reachable from the entry block (if it did, that route would make it reachable from the entry block). That is the intended performance optimization for isPotentiallyReachable. For the case where we ask whether an unreachable from entry block has a route to a reachable from entry block, we can't conclude one way or the other. Fix a bug where we claimed there could be no such route.
The fix in rL357425 ironically reintroduced the very bug it was fixing but only when a DominatorTree is provided. This fixes the remaining bug.
llvm-svn: 357734