Reid Kleckner [Tue, 16 Jul 2019 18:17:33 +0000 (18:17 +0000)]
[COFF] Implement /safeseh:no and check @feat.00 flags by default
Summary:
Fixes PR41828. Before this, LLD always emitted SafeSEH chunks and
defined __safe_se_handler_table & size. Now, /safeseh:no leaves those
undefined.
Additionally, we were checking for the safeseh @feat.00 flag in two
places: once to emit errors, and once during safeseh table construction.
The error was set up to be off by default, but safeseh is supposed to be
on by default. I combined the two checks, so now LLD emits an error if
an input object lacks @feat.00 and safeseh is enabled. This caused the
majority of 32-bit LLD tests to fail, since many test input object files
lack @feat.00 symbols. I explicitly added -safeseh:no to those tests to
preserve behavior.
Finally, LLD no longer sets IMAGE_DLL_CHARACTERISTICS_NO_SEH if any
input file wasn't compiled for safeseh.
Reviewers: mstorsjo, ruiu, thakis
Reviewed By: ruiu, thakis
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63570
llvm-svn: 366238
Matt Arsenault [Tue, 16 Jul 2019 18:05:29 +0000 (18:05 +0000)]
AMDGPU/GlobalISel: Select flat loads
Now that the patterns use the new PatFrag address space support, the
only blocker to importing most load patterns is the addressing mode
complex patterns.
llvm-svn: 366237
Nico Weber [Tue, 16 Jul 2019 18:04:26 +0000 (18:04 +0000)]
Teach `llvm-pdbutil pretty -native` about `-injected-sources`
`pretty -native -injected-sources -injected-source-content` works with
this patch, and produces identical output to the dia version.
Differential Revision: https://reviews.llvm.org/D64428
llvm-svn: 366236
Jay Foad [Tue, 16 Jul 2019 17:44:54 +0000 (17:44 +0000)]
[AMDGPU] Optimize atomic max/min
Summary:
Extend the atomic optimizer to handle signed and unsigned max and min
operations, as well as add and subtract.
Reviewers: arsenm, sheredom, critson, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64328
llvm-svn: 366235
Matt Arsenault [Tue, 16 Jul 2019 17:38:50 +0000 (17:38 +0000)]
AMDGPU: Redefine load PatFrags
Rewrite PatFrags using the new PatFrag address space matching in
tablegen. These will now work with both SelectionDAG and GlobalISel.
llvm-svn: 366234
Louis Dionne [Tue, 16 Jul 2019 17:29:09 +0000 (17:29 +0000)]
[pstl] Use std::transform_reduce instead of hand-rolled implementation
llvm-svn: 366233
Louis Dionne [Tue, 16 Jul 2019 17:29:03 +0000 (17:29 +0000)]
[NFC] Fix -Wreorder warning in TBB backend
llvm-svn: 366232
Yonghong Song [Tue, 16 Jul 2019 17:24:33 +0000 (17:24 +0000)]
fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic
The original commit is r366076. It is temporarily reverted (r366155)
due to test failure. This resubmit makes test more robust by accepting
regex instead of hardcoded names/references in several places.
This is a followup patch for https://reviews.llvm.org/D61809.
Handle unnamed bitfield properly and add more test cases.
Fixed the unnamed bitfield issue. The unnamed bitfield is ignored
by debug info, so we need to ignore such a struct/union member
when we try to get the member index in the debug info.
D61809 contains two test cases but not enough as it does
not checking generated IRs in the fine grain level, and also
it does not have semantics checking tests.
This patch added unit tests for both code gen and semantics checking for
the new intrinsic.
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 366231
Matt Arsenault [Tue, 16 Jul 2019 17:22:21 +0000 (17:22 +0000)]
AMDGPU: Fix missing immarg for mfma intrinsics
llvm-svn: 366230
Jonas Hahnfeld [Tue, 16 Jul 2019 17:16:43 +0000 (17:16 +0000)]
[OpenMP] Move header inclusion out of 'extern "C"'
This leads to problems when compiling C++ code with libc++ for Nvidia GPUs
because Clang now uses wrappers for math functions that might include
C++ templates not allowed in 'extern "C"'.
Differentiel Revision: https://reviews.llvm.org/D64625
llvm-svn: 366229
Mitch Phillips [Tue, 16 Jul 2019 17:13:02 +0000 (17:13 +0000)]
Removed -mno-omit-leaf-frame-pointer from flags.
Removes -mno-omit-leaf-frame-pointer from Scudo and GWP-ASan's CFlags. Attempt to fix
the sanitizer buildbots.
llvm-svn: 366228
Stefan Granitz [Tue, 16 Jul 2019 16:57:45 +0000 (16:57 +0000)]
[CMake] Add Apple-lldb-Xcode.cmake cache that avoids install options
llvm-svn: 366226
Julian Lettner [Tue, 16 Jul 2019 16:22:04 +0000 (16:22 +0000)]
[TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.10
Remove now-unused assembly code for determining xor key on
Linux/AArch64. This is the final commit of this refactoring.
llvm-svn: 366225
Alexey Bataev [Tue, 16 Jul 2019 16:07:10 +0000 (16:07 +0000)]
[OPENMP][NVPTX]Fixed checks for cuda versions.
Summary:
We used CUDART_VERSION macro to check for the installed cuda version
but this macro is defined in cuda_runtime_api.h, which is not used by
project. Better to use CUDA_VERSION macro, which is defined in cuda.h.
Also, added the check if this macro is defined. If macro is undefined,
there is something wrong with the cuda configuration and we should not
continue the compilation.
This also fixes problems with runtime building in cuda 10+.
Reviewers: grokos
Subscribers: guansong, jdoerfert, caomhin, kkwli0, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D64648
llvm-svn: 366224
Michael Liao [Tue, 16 Jul 2019 15:57:12 +0000 (15:57 +0000)]
[AMDGPU] Add the adjusted FP as a livein register.
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64145
llvm-svn: 366223
Ulrich Weigand [Tue, 16 Jul 2019 15:55:45 +0000 (15:55 +0000)]
[Strict FP] Allow more relaxed scheduling
Reimplement scheduling constraints for strict FP instructions in
ScheduleDAGInstrs::buildSchedGraph to allow for more relaxed
scheduling. Specifially, allow one strict FP instruction to
be scheduled across another, as long as it is not moved across
any global barrier.
Differential Revision: https://reviews.llvm.org/D64412
Reviewed By: cameron.mcinally
llvm-svn: 366222
Jonas Devlieghere [Tue, 16 Jul 2019 15:54:33 +0000 (15:54 +0000)]
Revert "[swig] Add workaround for old swig"
With the deprecation of swig 1.x (r366213), this workaround should no
longer be necessary.
llvm-svn: 366221
Alexey Bataev [Tue, 16 Jul 2019 15:51:32 +0000 (15:51 +0000)]
[OPENMP]Fix threadid in __kmpc_omp_taskwait call for dependent target calls.
Summary:
We used to call __kmpc_omp_taskwait function with global threadid set to
0. It may crash the application at the runtime if the thread executing
target region is not a master thread.
Reviewers: grokos, kkwli0
Subscribers: guansong, jdoerfert, caomhin, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D64571
llvm-svn: 366220
Alex Brachet [Tue, 16 Jul 2019 15:33:43 +0000 (15:33 +0000)]
Revert [tools] [llvm-nm] Default to reading from stdin not a.out
This reverts r365889 (git commit
60c81354b1d3fced1bd284d334f118d2d792ab4b)
llvm-svn: 366219
Amara Emerson [Tue, 16 Jul 2019 15:28:29 +0000 (15:28 +0000)]
Add missing test for r366215
llvm-svn: 366218
Francis Visoiu Mistrih [Tue, 16 Jul 2019 15:25:05 +0000 (15:25 +0000)]
[Remarks] Simplify and refactor the RemarkParser interface
Before, everything was based on some kind of type erased parser
implementation which container a lot of boilerplate code when multiple
formats were to be supported.
This simplifies it by:
* the remark now owns its arguments
* *always* returning an error from the implementation side
* working around the way the YAML parser reports errors: catch them through
callbacks and re-insert them in a proper llvm::Error
* add a CParser wrapper that is used when implementing the C API to
avoid cluttering the C++ API with useless state
* LLVMRemarkParserGetNext now returns an object that needs to be
released to avoid leaking resources
* add a new API to dispose of a remark entry: LLVMRemarkEntryDispose
llvm-svn: 366217
Francis Visoiu Mistrih [Tue, 16 Jul 2019 15:24:59 +0000 (15:24 +0000)]
[Remarks][NFC] Combine ParserFormat and SerializerFormat
It's useless to have both.
llvm-svn: 366216
Amara Emerson [Tue, 16 Jul 2019 15:23:10 +0000 (15:23 +0000)]
[ADCE] Fix non-deterministic behaviour due to iterating over a pointer set.
Original patch by Yann Laigle-Chapuy
Differential Revision: https://reviews.llvm.org/D64785
llvm-svn: 366215
Amaury Sechet [Tue, 16 Jul 2019 15:17:00 +0000 (15:17 +0000)]
[DAGCombiner] fold (addcarry (xor a, -1), b, c) -> (subcarry b, a, !c) and flip carry.
Summary:
As per title. DAGCombiner only mathes the special case where b = 0, this patches extends the pattern to match any value of b.
Depends on D57302
Reviewers: hfinkel, RKSimon, craig.topper
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59208
llvm-svn: 366214
Jonas Devlieghere [Tue, 16 Jul 2019 15:14:01 +0000 (15:14 +0000)]
[SWIG] Deprecate SWIG 1.x
The last swig 1.x release dates from 2009, now 10 years ago. Recently, I
fixed an issue that prevented us from using swig 4 (r364974), which
turned out to be not backward compatible with swig 1.x (r365718).
This patch deprecates this (really old) version of swig and makes swig 2
the minimum supported version in LLDB . This should be fine for the
build bots, which are all running swig 3 or later.
Differential revision: https://reviews.llvm.org/D64782
llvm-svn: 366213
Neil Hickey [Tue, 16 Jul 2019 14:57:32 +0000 (14:57 +0000)]
[OpenCL] Fixing sampler initialisations for C++ mode.
Allow conversions between integer and sampler type.
Differential Revision: https://reviews.llvm.org/D64791
llvm-svn: 366212
Alexey Bataev [Tue, 16 Jul 2019 14:51:46 +0000 (14:51 +0000)]
[OPENMP]Add support for analysis of if clauses.
Summary:
Added support for analysis of if clauses in the OpenMP directives to be
able to check for the use of uninitialized variables.
Reviewers: NoQ
Subscribers: guansong, jfb, jdoerfert, caomhin, kkwli0, cfe-commits
Tags: clang
Differential Revision: https://reviews.llvm.org/D64646
llvm-svn: 366211
Matt Arsenault [Tue, 16 Jul 2019 14:28:30 +0000 (14:28 +0000)]
AMDGPU/GlobalISel: Fix test failures in release build
Apparently the check for legal instructions during instruction
select does not happen without an asserts build, so these would
successfully select in release, and fail in debug.
Make s16 and/or/xor legal. These can just be selected directly
to the 32-bit operation, as is already done in SelectionDAG, so just
make them legal.
llvm-svn: 366210
Owen Reynolds [Tue, 16 Jul 2019 14:25:37 +0000 (14:25 +0000)]
[llvm-ar][test] Add to llvm-ar test coverage
This change adds tests to cover existing llvm-ar functionality.
print.test is omitted due to failing on Darwin.
Differential Revision: https://reviews.llvm.org/D64330
llvm-svn: 366209
Louis Dionne [Tue, 16 Jul 2019 13:45:10 +0000 (13:45 +0000)]
[pstl] Fix compilation with TBB backend
Some types were not using the right namespace qualification.
llvm-svn: 366208
Johan Vikstrom [Tue, 16 Jul 2019 13:23:12 +0000 (13:23 +0000)]
[clangd] Added highlighting for the targets in typedefs and using.
Summary:
In `typedef int A` the `A` was not highlighted previously.
This patch gives `A` the same kind of highlighting that the underlying type has (class/enum) (which in this example is no special highlighting because builtins are not handled yet)
Will add highlightings for built ins in another patch.
Reviewers: hokein, sammccall, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64754
llvm-svn: 366207
Owen Reynolds [Tue, 16 Jul 2019 12:53:59 +0000 (12:53 +0000)]
Reapply [llvm-ar][test] Increase llvm-ar test coverage
This reapplies 365316 without extract.test due to failing on Darwin.
Differential Revision: https://reviews.llvm.org/D63935
llvm-svn: 366206
Sylvestre Ledru [Tue, 16 Jul 2019 12:05:54 +0000 (12:05 +0000)]
remove a duplicate declaration
llvm-svn: 366205
Sylvestre Ledru [Tue, 16 Jul 2019 11:59:17 +0000 (11:59 +0000)]
Document the LLVM_ENABLE_BINDINGS option
llvm-svn: 366204
George Rimar [Tue, 16 Jul 2019 11:07:30 +0000 (11:07 +0000)]
[Object/llvm-readelf/llvm-readobj] - Improve error reporting when e_shstrndx is broken.
When e_shstrndx is broken, it is impossible to get a section name.
In this patch I improved the error message we show and
added tests for Object and for llvm-readelf/llvm-readobj
Message was changed in two places:
1) llvm-readelf/llvm-readobj previously used a code from Object/ELF.h,
now they have a modified version of it (it has less checks and allows
dumping broken things).
2) Code in Object/ELF.h is still used for generic cases.
Differential revision: https://reviews.llvm.org/D64714
llvm-svn: 366203
Rainer Orth [Tue, 16 Jul 2019 11:06:43 +0000 (11:06 +0000)]
[Driver] Don't pass --dynamic-linker to ld on Solaris
I noticed that clang currently passes --dynamic-linker to ld. This has been the case
since Solaris 11 support was added initially back in 2012 by David Chisnall (r150580).
I couldn't find any patch submission, let alone a justification, for this, and it seems
completely useless: --dynamic-linker is a gld compatibility form of the option, the
native option being -I. First of all, however, the dynamic linker passed is simply the
default, so there's no reason at all to specify it in the first place.
This patch removes passing the option and adjusts the affected testcase accordingly.
Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64493
llvm-svn: 366202
Owen Reynolds [Tue, 16 Jul 2019 11:02:11 +0000 (11:02 +0000)]
Reapply [llvm-ar][test] Add to MRI test coverage
This reapplies 363232 without mri-utf8.test due to failing on Darwin.
Differential Revision: https://reviews.llvm.org/D63197
llvm-svn: 366201
Sam McCall [Tue, 16 Jul 2019 10:30:21 +0000 (10:30 +0000)]
[SemaTemplate] Fix uncorrected typos after pack expansion
Summary:
This case is particularly important for clangd, as it is triggered after
inserting the snippet for variadic functions.
Reviewers: kadircet, ilya-biryukov
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64677
llvm-svn: 366200
Sam McCall [Tue, 16 Jul 2019 10:17:06 +0000 (10:17 +0000)]
[clangd] Don't rebuild background index until we indexed one TU per thread.
Summary:
This increases the odds that the boosted file (cpp file matching header)
will be ready. (It always enqueues first, so it'll be present unless
another thread indexes *two* files before the first thread indexes one.)
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64682
llvm-svn: 366199
Sam McCall [Tue, 16 Jul 2019 10:14:53 +0000 (10:14 +0000)]
Remove username from git-llvm script, erroneously added in 366197
llvm-svn: 366198
Kyrylo Tkachov [Tue, 16 Jul 2019 09:27:39 +0000 (09:27 +0000)]
[AArch64] Implement __jcvt intrinsic from Armv8.3-A
The jcvt intrinsic defined in ACLE [1] is available when ARM_FEATURE_JCVT is defined.
This change introduces the AArch64 intrinsic, wires it up to the instruction and a new clang builtin function.
The __ARM_FEATURE_JCVT macro is now defined when an Armv8.3-A or higher target is used.
I've implemented the target detection logic in Clang so that this feature is enabled for architectures from armv8.3-a onwards (so -march=armv8.4-a also enables this, for example).
make check-all didn't show any new failures.
[1] https://developer.arm.com/docs/101028/latest/data-processing-intrinsics
Differential Revision: https://reviews.llvm.org/D64495
llvm-svn: 366197
Raphael Isemann [Tue, 16 Jul 2019 09:27:02 +0000 (09:27 +0000)]
[lldb] Rename Options.inc to CommandOptions.inc [NFC]
It seems having two Options.inc files in the same project is giving our
custom Xcode project a hard time. This patch renames the new Options.inc
to CommandOptions.inc to prevent this conflict.
llvm-svn: 366196
Kyrylo Tkachov [Tue, 16 Jul 2019 09:15:01 +0000 (09:15 +0000)]
[NFC] Test commit: add full stop at end of comment
llvm-svn: 366195
Serge Guelton [Tue, 16 Jul 2019 08:56:47 +0000 (08:56 +0000)]
[clang-scan-view] Force utf-8 when handling report (python2 only)
Original patch by random human <random.bored.human@gmail.com>
Differential Revision: https://reviews.llvm.org/D64129
llvm-svn: 366194
Fangrui Song [Tue, 16 Jul 2019 08:26:38 +0000 (08:26 +0000)]
[COFF] Rename variale references in comments after VariableName -> variableName change
llvm-svn: 366193
Fangrui Song [Tue, 16 Jul 2019 08:08:17 +0000 (08:08 +0000)]
[WebAssembly] Rename variale references in comments after VariableName -> variableName change
llvm-svn: 366192
Zi Xuan Wu [Tue, 16 Jul 2019 07:54:47 +0000 (07:54 +0000)]
[NFC][PowerPC] Add test case for D64195
llvm-svn: 366191
Igor Kudrin [Tue, 16 Jul 2019 07:01:08 +0000 (07:01 +0000)]
[DWARF] Fix the reserved values for unit length in DWARFDebugLine.
The DWARF3 documentation had inconsistency concerning the reserved range
for unit length values. The issue was fixed in DWARF4.
Differential Revision: https://reviews.llvm.org/D64622
llvm-svn: 366190
Igor Kudrin [Tue, 16 Jul 2019 06:56:10 +0000 (06:56 +0000)]
[DWARF] Fix an incorrect format specifier.
This adjusts the format specifier because PCOffset is uint16_t.
Differential Revision: https://reviews.llvm.org/D64620
llvm-svn: 366189
Igor Kudrin [Tue, 16 Jul 2019 06:53:06 +0000 (06:53 +0000)]
[DWARF] Simplify DWARFAttribute. NFC.
The first argument in the constructor was ignored, and the remaining
arguments were always passed as their defaults.
Differential Revision: https://reviews.llvm.org/D64407
llvm-svn: 366188
Jan Kratochvil [Tue, 16 Jul 2019 06:34:44 +0000 (06:34 +0000)]
[lldb] Handle EOF from `lldb-vscode`
Sometimes (when running lldb-vscode under strace) I get:
read(0, "", 16) = 0
read(0, "", 16) = 0
read(0, "", 16) = 0
...
With this patch testcases finish properly even with strace:
read(0, "", 16) = 0
futex(0x1346508, FUTEX_WAKE_PRIVATE,
2147483647) = 0
stat("", 0x7ffe8f2634c8) = -1 ENOENT (No such file or directory)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=9124, si_uid=1001, si_status=SIGINT, si_utime=1, si_stime=0} ---
close(4) = 0
exit_group(0) = ?
+++ exited with 0 +++
Differential Revision: https://reviews.llvm.org/D64698
llvm-svn: 366187
Stephan Bergmann [Tue, 16 Jul 2019 06:23:27 +0000 (06:23 +0000)]
Finish "Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFO"
i.e., recent
5745eccef54ddd3caca278d1d292a88b2281528b:
* Bump the function_type_mismatch handler version, as its signature has changed.
* The function_type_mismatch handler can return successfully now, so
SanitizerKind::Function must be AlwaysRecoverable (like for
SanitizerKind::Vptr).
* But the minimal runtime would still unconditionally treat a call to the
function_type_mismatch handler as failure, so disallow -fsanitize=function in
combination with -fsanitize-minimal-runtime (like it was already done for
-fsanitize=vptr).
* Add tests.
Differential Revision: https://reviews.llvm.org/D61479
llvm-svn: 366186
Puyan Lotfi [Tue, 16 Jul 2019 05:58:03 +0000 (05:58 +0000)]
[NFC][test] Fix for riscv tests.
Following tests need updating for: https://reviews.llvm.org/D55277
llvm-svn: 366183
Craig Topper [Tue, 16 Jul 2019 05:52:27 +0000 (05:52 +0000)]
[X86] In combineStore, don't convert v2f32 load/store pairs to f64 loads/stores.
Type legalization can take care of this. This gives DAG combine
a little more time with the original types.
llvm-svn: 366182
Fangrui Song [Tue, 16 Jul 2019 05:50:45 +0000 (05:50 +0000)]
[ELF] Fix variable names in comments after VariableName -> variableName change
Also fix some typos.
llvm-svn: 366181
Alex Bradbury [Tue, 16 Jul 2019 04:56:43 +0000 (04:56 +0000)]
[RISCV] Match GNU tools canonical JALR and add aliases
The canonical GNU form of JALR resembles a load/store instruction rather
than placing the immediate offset as a separate argument, so match this
behaviour. Also add parser-only aliases for the three-operand form, and
add other shorter aliases also emitted by GNU tools.
Differential Revision: https://reviews.llvm.org/D55277
Patch by James Clarke.
llvm-svn: 366179
Rui Ueyama [Tue, 16 Jul 2019 04:46:31 +0000 (04:46 +0000)]
Fix parameter name comments using clang-tidy. NFC.
This patch applies clang-tidy's bugprone-argument-comment tool
to LLVM, clang and lld source trees. Here is how I created this
patch:
$ git clone https://github.com/llvm/llvm-project.git
$ cd llvm-project
$ mkdir build
$ cd build
$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \
-DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm
$ ninja
$ parallel clang-tidy -checks='-*,bugprone-argument-comment' \
-config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \
::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h}
llvm-svn: 366177
Alex Bradbury [Tue, 16 Jul 2019 04:40:25 +0000 (04:40 +0000)]
[RISCV] Avoid overflow when determining number of nops for code align
RISCVAsmBackend::shouldInsertExtraNopBytesForCodeAlign() assumed that the
align specified would be greater than or equal to the minimum nop length, but
that is not always the case - for example if a user specifies ".align 0" in
assembly.
Differential Revision: https://reviews.llvm.org/D63274
Patch by Edward Jones.
llvm-svn: 366176
Alex Bradbury [Tue, 16 Jul 2019 04:37:19 +0000 (04:37 +0000)]
[RISCV] Fix a potential issue in shouldInsertFixupForCodeAlign()
The bool result of shouldInsertExtraNopBytesForCodeAlign() is not checked but
the returned nop count is unconditionally read even though it could be
uninitialized.
Differential Revision: https://reviews.llvm.org/D63285
Patch by Edward Jones.
llvm-svn: 366175
Alex Bradbury [Tue, 16 Jul 2019 03:56:45 +0000 (03:56 +0000)]
[RISCV][NFC] Split PseudoCALL pattern out from instruction
Since PseudoCALL defines AsmString, it can be generated from assembly,
and so code-gen patterns should be defined separately to be consistent
with the style of the RISCV backend. Other pseudo-instructions exist
that have code-gen patterns defined directly, but these instructions are
purely for code-gen and cannot be written in assembly.
Differential Revision: https://reviews.llvm.org/D64012
Patch by James Clarke.
llvm-svn: 366174
Alex Bradbury [Tue, 16 Jul 2019 03:54:08 +0000 (03:54 +0000)]
[RISCV][NFC] Fix HasStedExtA -> HasStdExtA typo in comment
Differential Revision: https://reviews.llvm.org/D64011
Patch by James Clarke.
llvm-svn: 366173
Alex Bradbury [Tue, 16 Jul 2019 03:47:34 +0000 (03:47 +0000)]
[RISCV] Make RISCVELFObjectWriter::getRelocType check IsPCRel
Previously, this function didn't check the IsPCRel argument. But doing so is a
useful check for errors, and also seemingly necessary for FK_Data_4 (which we
produce a R_RISCV_32_PCREL relocation for if IsPCRel).
Other than R_RISCV_32_PCREL, this should be NFC. Future exception handling
related patches will include tests that capture this behaviour.
llvm-svn: 366172
Peter Collingbourne [Tue, 16 Jul 2019 03:25:50 +0000 (03:25 +0000)]
hwasan: Pad arrays with non-1 size correctly.
Spotted by eugenis.
Differential Revision: https://reviews.llvm.org/D64783
llvm-svn: 366171
Zoe Carver [Tue, 16 Jul 2019 03:21:01 +0000 (03:21 +0000)]
Add contains method to associative containers. This patch implements P0458R2, adding contains to map, multimap, unordered_map, unordered_multimap, set, multiset, unordered_set, and unordered_multiset.
llvm-svn: 366170
Ali Tamur [Tue, 16 Jul 2019 03:20:15 +0000 (03:20 +0000)]
Revert "[OPENMP]Add support for analysis of if clauses."
This reverts commit rL366068.
The patch broke 86 tests under clang/test/OpenMP/ when run with address sanitizer.
llvm-svn: 366169
Matt Arsenault [Tue, 16 Jul 2019 02:46:05 +0000 (02:46 +0000)]
AMDGPU: Avoid code predicates for extload PatFrags
Use the MemoryVT field. This will be necessary for tablegen to
automatically handle patterns for GlobalISel.
Doesn't handle the d16 lo/hi patterns. Those are a special case since
it involvess the custom node type.
llvm-svn: 366168
Nathan Lanza [Tue, 16 Jul 2019 02:05:52 +0000 (02:05 +0000)]
Change a lit test to permit vendor specific clang version
A test manually checks for the string `__VERSION__ "Clang`. This needs
to permit vendor specific variants.
llvm-svn: 366166
Bob Haarman [Tue, 16 Jul 2019 01:35:49 +0000 (01:35 +0000)]
reland "add -fthinlto-index= option to clang-cl"
Summary:
This is a reland of r366146, adding in the previously missing '--'
flag that prevents filenames from being interpreted as flags.
Original description:
This adds a -fthinlto-index= option to clang-cl, which allows it to
be used to drive ThinLTO backend passes. This allows clang-cl to be
used for distributed ThinLTO.
Tags: #clang
llvm-svn: 366165
Jonas Devlieghere [Tue, 16 Jul 2019 01:21:25 +0000 (01:21 +0000)]
Re-land "[DebugInfo] Move function from line table to the prologue (NFC)"
In LLDB, when parsing type units, we don't need to parse the whole line
table. Instead, we only need to parse the "support files" from the line
table prologue.
To make that possible, this patch moves the respective functions from
the LineTable into the Prologue. Because I don't think users of the
LineTable should have to know that these files come from the Prologue,
I've left the original methods in place, and made them redirect to the
LineTable.
Differential revision: https://reviews.llvm.org/D64774
llvm-svn: 366164
Peter Wu [Tue, 16 Jul 2019 01:13:36 +0000 (01:13 +0000)]
[Sema] Suppress additional warnings for C's zero initializer
Summary:
D28148 relaxed some checks for assigning { 0 } to a structure for all C
standards, but it failed to handle structures with non-integer
subobjects. Relax -Wmissing-braces checks for such structures, and add
some additional tests.
This fixes PR39931.
Patch By: al3xtjames
Reviewed By: Lekensteyn
Differential Revision: https://reviews.llvm.org/D61838
llvm-svn: 366163
Michael Liao [Tue, 16 Jul 2019 01:03:06 +0000 (01:03 +0000)]
[InstructionSimplify] Apply sext/trunc after pointer stripping
Summary:
- As the pointer stripping could trace through `addrspacecast` now, need
to sext/trunc the offset to ensure it has the same width as the
pointer after stripping.
Reviewers: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64768
llvm-svn: 366162
Alex Langford [Tue, 16 Jul 2019 01:02:32 +0000 (01:02 +0000)]
[Target] Remove unused method Target::GetDefaultClangModuleSearchPaths
llvm-svn: 366161
Jonas Devlieghere [Tue, 16 Jul 2019 00:59:04 +0000 (00:59 +0000)]
Revert "[DebugInfo] Move function from line table to the prologue (NFC)"
This broke LLD, which I didn't have enabled.
llvm-svn: 366160
Nathan Lanza [Tue, 16 Jul 2019 00:57:50 +0000 (00:57 +0000)]
Allow for vendor prefixes in a list test
Summary:
Preprocessor/init.c contains a line that explicitly checks for the
string
__VERSION__ "Clang{{.*}}
It's valid to have a toolchain configured to emit a vendor prefix
before the word Clang. e.g.
__VERSION__ "Vendor Clang{{.*}}
Subscribers: fedor.sergeev, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64772
llvm-svn: 366159
Jonas Devlieghere [Tue, 16 Jul 2019 00:37:17 +0000 (00:37 +0000)]
[DebugInfo] Move function from line table to the prologue (NFC)
In LLDB, when parsing type units, we don't need to parse the whole line
table. Instead, we only need to parse the "support files" from the line
table prologue.
To make that possible, this patch moves the respective functions from
the LineTable into the Prologue. Because I don't think users of the
LineTable should have to know that these files come from the Prologue,
I've left the original methods in place, and made them redirect to the
LineTable.
Differential revision: https://reviews.llvm.org/D64774
llvm-svn: 366158
Eric Christopher [Tue, 16 Jul 2019 00:02:40 +0000 (00:02 +0000)]
Temporarily revert "add -fthinlto-index= option to clang-cl"
This is causing testsuite failures on (at least) darwin release+asserts.
This reverts commit r366146.
llvm-svn: 366157
Jason Molenda [Mon, 15 Jul 2019 23:55:22 +0000 (23:55 +0000)]
Update some file changes, but there's a dependency loop so
it doesn't quite work rigtht now.
llvm-svn: 366156
Eric Christopher [Mon, 15 Jul 2019 23:49:31 +0000 (23:49 +0000)]
Temporarily Revert "fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic"
The commit had tests that would only work with names in the IR.
This reverts commit r366076.
llvm-svn: 366155
Eric Christopher [Mon, 15 Jul 2019 23:36:02 +0000 (23:36 +0000)]
Temporarily Revert "[SLP] Recommit: Look-ahead operand reordering heuristic."
As there are some reported miscompiles with AVX512 and performance regressions
in Eigen. Verified with the original committer and testcases will be forthcoming.
This reverts commit r364964.
llvm-svn: 366154
Leonard Chan [Mon, 15 Jul 2019 23:18:31 +0000 (23:18 +0000)]
Revert "[NewPM] Port Sancov"
This reverts commit
5652f35817f07b16f8b3856d594cc42f4d7ee29c.
llvm-svn: 366153
Jan Korous [Mon, 15 Jul 2019 23:14:00 +0000 (23:14 +0000)]
[DirectoryWatcher][linux] Fix for older kernels
IN_EXCL_UNLINK exists since Linux 2.6.36
Differential Revision: https://reviews.llvm.org/D64764
llvm-svn: 366152
Craig Topper [Mon, 15 Jul 2019 23:07:56 +0000 (23:07 +0000)]
[X86] Teach convertToThreeAddress to handle SUB with immediate
We mostly avoid sub with immediate but there are a couple cases that can create them. One is the add 128, %rax -> sub -128, %rax trick in isel. The other is when a SUB immediate gets created for a compare where both the flags and the subtract value is used. If we are unable to linearize the SelectionDAG to satisfy the flag user and the sub result user from the same instruction, we will clone the sub immediate for the two uses. The one that produces flags will eventually become a compare. The other will have its flag output dead, and could then be considered for LEA creation.
I added additional test cases to add.ll to show the the sub -128 trick gets converted to LEA and a case where we don't need to convert it.
This showed up in the current codegen for PR42571.
Differential Revision: https://reviews.llvm.org/D64574
llvm-svn: 366151
Julian Lettner [Mon, 15 Jul 2019 23:05:14 +0000 (23:05 +0000)]
[TSan] Fix asm token error (again)
llvm-svn: 366150
Heejin Ahn [Mon, 15 Jul 2019 23:04:00 +0000 (23:04 +0000)]
[WebAssembly] Add missing utility methods for exnref type
Summary:
This adds missing utility methods and copy instruction handling for
`exnref` type and also adds tests.
`tee` instruction tests are missing because `isTee` is currently only
used in ExplicitLocals pass and testing that pass in mir requires
serialization of stackified registers in mir files, which is a bit
nontrivial because `MachineFunctionInfo` only has info of vreg numbers
(which are large integers) but not the mir's register numbers. But this
change is quite trivial anyway.
Reviewers: tlively
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64705
llvm-svn: 366149
Alex Langford [Mon, 15 Jul 2019 22:56:12 +0000 (22:56 +0000)]
[LanguageRuntime] Move ObjCLanguageRuntime into a plugin
Summary:
Following up to my CPPLanguageRuntime change, I'm moving
ObjCLanguageRuntime into a plugin as well.
Reviewers: JDevlieghere, compnerd, jingham, clayborg
Subscribers: mgorny, arphaman, lldb-commits
Differential Revision: https://reviews.llvm.org/D64763
llvm-svn: 366148
Yuanfang Chen [Mon, 15 Jul 2019 22:52:01 +0000 (22:52 +0000)]
[llvm-readelf] Print "File: lib.a(file.o)" info when dumping archive files.
Match GNU readelf.
https://bugs.llvm.org/show_bug.cgi?id=35351
Reviewers: jhenderson, grimar, MaskRay, rupprecht
Reviewed by: jhenderson, MaskRay, grimar
Differential Revision: https://reviews.llvm.org/D64361
llvm-svn: 366147
Bob Haarman [Mon, 15 Jul 2019 22:50:04 +0000 (22:50 +0000)]
add -fthinlto-index= option to clang-cl
Summary:
This adds a -fthinlto-index= option to clang-cl, which allows it to
be used to drive ThinLTO backend passes. This allows clang-cl to be
used for distributed ThinLTO.
Reviewers: tejohnson, pcc, rnk
Subscribers: mehdi_amini, steven_wu, dexonsmith, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64458
llvm-svn: 366146
Heejin Ahn [Mon, 15 Jul 2019 22:49:25 +0000 (22:49 +0000)]
[WebAssembly] Rename except_ref type to exnref
Summary:
We agreed to rename `except_ref` to `exnref` for consistency with other
reference types in
https://github.com/WebAssembly/exception-handling/issues/79. This also
renames WebAssemblyInstrExceptRef.td to WebAssemblyInstrRef.td in order
to use the file for other reference types in future.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64703
llvm-svn: 366145
Shoaib Meenai [Mon, 15 Jul 2019 22:44:08 +0000 (22:44 +0000)]
Revert [llvm-lipo] Implement -create (with hardcoded alignments)
This reverts r366142 (git commit
67cee1dc7ee285b03372eb818a3894d35efa7394)
The test is failing on the Windows buildbots. Reverting while I
investigate.
llvm-svn: 366144
Tom Stellard [Mon, 15 Jul 2019 22:34:19 +0000 (22:34 +0000)]
[OpenCL] Make TableGen'd builtin tables and helper functions static
Reviewers: Pierre, Anastasia
Reviewed By: Anastasia
Subscribers: yaxunl, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64608
llvm-svn: 366143
Shoaib Meenai [Mon, 15 Jul 2019 22:29:30 +0000 (22:29 +0000)]
[llvm-lipo] Implement -create (with hardcoded alignments)
Creates universal binary output file from input files. Currently uses
hard coded value for alignment. Want to get the create functionality
approved before implementing the alignment function.
Patch by Anusha Basana <anusha.basana@gmail.com>
Differential Revision: https://reviews.llvm.org/D64102
llvm-svn: 366142
Lang Hames [Mon, 15 Jul 2019 22:27:57 +0000 (22:27 +0000)]
[clang-fuzzer] Remove 'setUseOrcMCJITReplacement(false)' call.
The default value for this option (UseMCJITReplacement) is already false, and
OrcMCJITReplacement is going to have deprecation warnings attached in LLVM 9.0.
Removing this call removes a spurious warning.
llvm-svn: 366141
Heejin Ahn [Mon, 15 Jul 2019 22:22:10 +0000 (22:22 +0000)]
[WebAssembly] Simplify regcopy.mir
Summary:
This deletes the ll templates from the functions because they don't need
them (mir files need ll templates only when they have function calls or
BB names that are not numbers).
This also renames the filename to `reg-copy.mir`, because I'm planning
to add some more `reg-*.mir` soon.
Reviewers: tlively
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64704
llvm-svn: 366140
Wouter van Oortmerssen [Mon, 15 Jul 2019 22:13:39 +0000 (22:13 +0000)]
[WebAssembly] Assembler: support special floats: infinity / nan
Summary:
These are emitted as identifiers by the InstPrinter, so we should
parse them as such. These could potentially clash with symbols of
the same name, but that is out of our (the WebAssembly backend) control.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, aheejin, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64770
llvm-svn: 366139
Jan Korous [Mon, 15 Jul 2019 22:11:51 +0000 (22:11 +0000)]
[DirectoryWatcher][test] Relax test assumptions
Workaround for FSEvents sometimes sending notifications for events that happened
before DirectoryWatcher was created.
This caused tests to be flaky on green dragon.
llvm-svn: 366138
Jan Korous [Mon, 15 Jul 2019 22:11:28 +0000 (22:11 +0000)]
[DirectoryWatcher][NFC][test] Add typedef for enum
llvm-svn: 366137
Matt Morehouse [Mon, 15 Jul 2019 22:07:56 +0000 (22:07 +0000)]
[ASan] Fix >80 character line.
llvm-svn: 366136
Austin Kerbow [Mon, 15 Jul 2019 22:07:05 +0000 (22:07 +0000)]
[AMDGPU] Enable merging m0 initializations.
Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.
Reviewers: rampitec, arsenm
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64766
llvm-svn: 366135
Dominik Adamski [Mon, 15 Jul 2019 22:01:55 +0000 (22:01 +0000)]
[ScopInfo][NFC] Add dot at the end of comment statement.
llvm-svn: 366134
Simon Atanasyan [Mon, 15 Jul 2019 21:46:38 +0000 (21:46 +0000)]
[mips] Print BEQZL and BNEZL pseudo instructions
One of the reasons - to be compatible with GNU tools.
llvm-svn: 366133