Marshall Clow [Fri, 31 May 2019 18:35:30 +0000 (18:35 +0000)]
Add include for 'test_macros.h' to all the tests that were missing them. Thanks to Zoe for the (big, but simple) patch. NFC intended.
llvm-svn: 362252
Andrea Di Biagio [Fri, 31 May 2019 18:01:42 +0000 (18:01 +0000)]
[MCA] Remove unused fields from BottleneckAnalysis. NFC
This should appease the buildbots.
llvm-svn: 362251
Csaba Dabis [Fri, 31 May 2019 17:54:12 +0000 (17:54 +0000)]
[analyzer] print() JSONify: ExplodedNode revision
Summary: Revert node-ID removal.
Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus
Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp,
cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62658
llvm-svn: 362249
Chris Bieneman [Fri, 31 May 2019 17:40:49 +0000 (17:40 +0000)]
[CMake] Feed BUNDLE_PATH through llvm target wrappers
This feeds the new llvm_codsign BUNDLE_PATH option through from the llvm target wrapper functions, so that you can specify the BUNDLE_PATH on the target's codesign.
llvm-svn: 362248
Puyan Lotfi [Fri, 31 May 2019 17:34:25 +0000 (17:34 +0000)]
[MIR-Canon] Don't do vreg skip for independent instructions if there are none.
We don't want to create vregs if there is nothing to use them for. That causes
verifier errors.
Differential Revision: https://reviews.llvm.org/D62740
llvm-svn: 362247
Andrea Di Biagio [Fri, 31 May 2019 17:18:34 +0000 (17:18 +0000)]
[MCA] Refactor class BottleneckAnalysis. NFCI
The resource pressure distribution computation is now delegated by class
BottleneckAnalysis to an instance of class PressureTracker.
Class PressureTracker is also responsible for:
- tracking users of processor resource units.
- tracking the number of delay cycles caused by increases in backpressure.
BottleneckAnalysis internally initializes a dependency graph. Each nodes
represents an instruction in the input code sequence. Edges of the dependency
graph are critical register/memory/resource dependencies. Dependencies are only
added to the graph if they are seen as critical by backend pressure events.
The DependencyGraph is currently unused. It is possible to print the dependency
graph (see method DependencyGraph::dump()) for debugging purposes.
The long term goal is to use the information stored by the dependency graph in
order to do critical path computation.
llvm-svn: 362246
Erich Keane [Fri, 31 May 2019 17:00:48 +0000 (17:00 +0000)]
Replace 'default' in an enum-over-a-switch with the missing list.
This suppressed the Wswitch warning causing me to miss it and write an
assertion failure.
llvm-svn: 362245
Philip Reames [Fri, 31 May 2019 16:54:38 +0000 (16:54 +0000)]
[Tests] Add tests for loop predication of loops w/ne latch conditions
llvm-svn: 362244
Erich Keane [Fri, 31 May 2019 16:46:38 +0000 (16:46 +0000)]
Suppress nothrow/Exception spec conflict warning when we dont know the ES.
In any situation where the Exception Spec isn't clear, suppress the
warning to avoid false positives.
llvm-svn: 362243
Nikita Popov [Fri, 31 May 2019 16:46:05 +0000 (16:46 +0000)]
[CVP] Simplify non-overflowing saturating add/sub
If we can determine that a saturating add/sub will not overflow
based on range analysis, convert it into a simple binary operation.
This is a sibling transform to the existing with.overflow handling.
Differential Revision: https://reviews.llvm.org/D62703
llvm-svn: 362242
Kevin P. Neal [Fri, 31 May 2019 16:32:12 +0000 (16:32 +0000)]
Revert revert of r362112 with minor SystemZ test file corrections.
[FPEnv] Added a special UnrollVectorOp method to deal with the chain on StrictFP opcodes
This change creates UnrollVectorOp_StrictFP. The purpose of this is to address a failure that consistently occurs when calling StrictFP functions on vectors whose number of elements is 3 + 2n on most platforms, such as PowerPC or SystemZ. The old UnrollVectorOp method does not expect that the vector that it will unroll will have a chain, so it has an assert that prevents it from running if this is the case. This new StrictFP version of the method deals with the chain while unrolling the vector. With this new function in place during vector widending, llc can run vector-constrained-fp-intrinsics.ll for SystemZ successfully.
Submitted by: Drew Wock <drew.wock@sas.com>
Reviewed by: Cameron McInally, Kevin P. Neal
Approved by: Cameron McInally
Differential Revision: https://reviews.llvm.org/D62546
llvm-svn: 362241
Jonas Devlieghere [Fri, 31 May 2019 16:27:44 +0000 (16:27 +0000)]
[FormatEntity] Ignore ASCII escape sequences when colors are disabled.
This patch makes the FormatEntity honor the debugger's color settings by
not inserting ASCII escape sequences when colors are disabled.
Differential revision: https://reviews.llvm.org/D62714
llvm-svn: 362240
Stanislav Mekhanoshin [Fri, 31 May 2019 16:19:26 +0000 (16:19 +0000)]
[AMDGPU] Use InliningThresholdMultiplier for inline hint
AMDGPU uses multiplier 9 for the inline cost. It is taken into account
everywhere except for inline hint threshold. As a result we are penalizing
functions with the inline hint making them less probable to be inlined
than those without the hint. Defaults are 225 for a normal function and
325 for a function with an inline hint. Currently we have effective
threshold 225 * 9 = 2025 for normal functions and just 325 for those with
the hint. That is fixed by this patch.
Differential Revision: https://reviews.llvm.org/D62707
llvm-svn: 362239
Cameron McInally [Fri, 31 May 2019 16:17:04 +0000 (16:17 +0000)]
[NFC][InstCombine] Add unary FNeg tests to fabs.ll
llvm-svn: 362238
Guozhi Wei [Fri, 31 May 2019 16:11:17 +0000 (16:11 +0000)]
[PPC] Correctly adjust branch probability in PPCReduceCRLogicals
In PPCReduceCRLogicals after splitting the original MBB into 2, the 2 impacted branches still use original branch probability. This is unreasonable. Suppose we have following code, and the probability of each successor is 50%.
condc = conda || condb
br condc, label %target, label %fallthrough
It can be transformed to following,
br conda, label %target, label %newbb
newbb:
br condb, label %target, label %fallthrough
Since each branch has a probability of 50% to each successor, the total probability to %fallthrough is 25% now, and the total probability to %target is 75%. This actually changed the original profiling data. A more reasonable probability can be set to 70% to the false side for each branch instruction, so the total probability to %fallthrough is close to 50%.
This patch assumes the branch target with two incoming edges have same edge frequency and computes new probability fore each target, and keep the total probability to original targets unchanged.
Differential Revision: https://reviews.llvm.org/D62430
llvm-svn: 362237
Erich Keane [Fri, 31 May 2019 15:56:27 +0000 (15:56 +0000)]
Suppress nothrow/exception spec conflict warning when ES is parsed.
The previously added warning ended up causing false positives when
nothrow was used on member functions, where the exception specification
wasn't yet parsed. So, throw() and noexcept(true) both were incorrectly
warning. There doesn't seem to be a good way to force these to be parsed
to identify which they are (and likely should not be), so suppress the warning.
For now, unevaluated/uninstantiated are left as warnings as I am not
creative enough to find a reproducer that causes a false positive for
either.
llvm-svn: 362236
Fangrui Song [Fri, 31 May 2019 15:41:19 +0000 (15:41 +0000)]
[PPC64][test] Delete redundant labels from ppc64-relocs.s
llvm-svn: 362235
Cameron McInally [Fri, 31 May 2019 15:40:03 +0000 (15:40 +0000)]
[NFC][InstCombine] Add unary FNeg tests to fcmp.ll
llvm-svn: 362234
Jinsong Ji [Fri, 31 May 2019 15:35:19 +0000 (15:35 +0000)]
[MachinePipeliner][NFC] Add some debug log and statistics
This is to add some log and statistics for debugging
Differential Revision: https://reviews.llvm.org/D62165
llvm-svn: 362233
Michael Liao [Fri, 31 May 2019 15:29:55 +0000 (15:29 +0000)]
Revise test case due to the change from CUDA 10+.
llvm-svn: 362232
Cameron McInally [Fri, 31 May 2019 15:10:34 +0000 (15:10 +0000)]
[NFC][InstCombine] Add unary FNeg tests to fdiv.ll
llvm-svn: 362231
Simon Pilgrim [Fri, 31 May 2019 15:06:51 +0000 (15:06 +0000)]
[AMDGPU] Regenerate add/sub shrink constant tests for an upcoming patch
llvm-svn: 362230
Simon Pilgrim [Fri, 31 May 2019 15:06:14 +0000 (15:06 +0000)]
[AMDGPU] Regenerate CTLZ tests for an upcoming patch
llvm-svn: 362229
Simon Pilgrim [Fri, 31 May 2019 15:05:06 +0000 (15:05 +0000)]
[UpdateTestChecks] Add support for -march=r600 to match existing -march=amdgcn support
llvm-svn: 362228
Cameron McInally [Fri, 31 May 2019 14:49:31 +0000 (14:49 +0000)]
[NFC][InstCombine] Add unary FNeg tests to fma.ll
llvm-svn: 362227
Haojian Wu [Fri, 31 May 2019 14:38:16 +0000 (14:38 +0000)]
[clangd] Add missing license for rename.cpp, NFC.
llvm-svn: 362226
Erich Keane [Fri, 31 May 2019 14:26:19 +0000 (14:26 +0000)]
Fix for PR42089, regression from r362119
The implementation of the NoThrow ExceptionSpecificationType missed a
switch statement for forming the diagnostic when an out-of-line member
redeclaration misses the exception specification. This patch adds the
correct case statement.
llvm-svn: 362225
George Rimar [Fri, 31 May 2019 13:16:21 +0000 (13:16 +0000)]
[llvm-readobj] - Remove excessive `dynamic.test`
dynamic.test is a test that checks dumping of
dynamic tags. It uses precompiled objects as inputs
and it is completely excessive nowadays:
Now we have elf-dynamic-tags-machine-specific.test
and elf-dynamic-tags.test.
(https://github.com/llvm-mirror/llvm/blob/master/test/tools/llvm-readobj/elf-dynamic-tags-machine-specific.test)
(https://github.com/llvm-mirror/llvm/blob/master/test/tools/llvm-readobj/elf-dynamic-tags.test)
First is used to check target specific tags and second tests the common flags.
These tests use YAML, which is much better than using precompiled binaries.
Note that new reviews tend to update the YAML based
tests to add new tags, e.g. see D62596.
With this patch it became possible to remove
dynamic-table-so.aarch64 binary from the inputs folder.
(other binaries are still used in other tests).
Differential revision: https://reviews.llvm.org/D62728
llvm-svn: 362224
Nico Weber [Fri, 31 May 2019 12:07:05 +0000 (12:07 +0000)]
gn build: Merge r362160
llvm-svn: 362223
Nico Weber [Fri, 31 May 2019 11:52:59 +0000 (11:52 +0000)]
gn build: Merge r362196
llvm-svn: 362222
Nico Weber [Fri, 31 May 2019 11:51:42 +0000 (11:51 +0000)]
gn build: Merge r362190
llvm-svn: 362221
Fangrui Song [Fri, 31 May 2019 10:35:45 +0000 (10:35 +0000)]
[ELF] Delete GotEntrySize and GotPltEntrySize
GotEntrySize and GotPltEntrySize were added in D22288. Later, with
the introduction of wordsize() (then Config->Wordsize), they become
redundant, because there is no target that sets GotEntrySize or
GotPltEntrySize to a number different from Config->Wordsize.
Reviewed By: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D62727
llvm-svn: 362220
Russell Gallop [Fri, 31 May 2019 10:14:04 +0000 (10:14 +0000)]
ftime-trace: Trace loop passes
These can take a significant amount of time in some builds.
Suggested by Andrea Di Biagio.
Differential Revision: https://reviews.llvm.org/D62666
llvm-svn: 362219
Fangrui Song [Fri, 31 May 2019 10:12:22 +0000 (10:12 +0000)]
[ELF] Replace a dead test in getSymVA() with assert()
Symbols relative to discarded comdat sections are Undefined instead of
Defined now (after D59649 and D61583). The `== &InputSection::Discarded`
test becomes dead. I cannot find a test related to this behavior.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D62725
llvm-svn: 362218
Roman Lebedev [Fri, 31 May 2019 09:47:16 +0000 (09:47 +0000)]
[InstCombine] 'C-(C2-X) --> X+(C-C2)' constant-fold
It looks this fold was already partially happening, indirectly
via some other folds, but with one-use limitation.
No other fold here has that restriction.
https://rise4fun.com/Alive/ftR
llvm-svn: 362217
Roman Lebedev [Fri, 31 May 2019 09:47:04 +0000 (09:47 +0000)]
[InstCombine] 'add (sub C1, X), C2 --> sub (add C1, C2), X' constant-fold
https://rise4fun.com/Alive/qJQ
llvm-svn: 362216
Cullen Rhodes [Fri, 31 May 2019 09:13:55 +0000 (09:13 +0000)]
[AArch64][SVE2] Asm: support WHILE instructions
Summary:
Patch adds support for the following instructions:
* WHILEGE, WHILEGT, WHILEHS, WHILEHI, WHILEWR, WHILERW
The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D62601
llvm-svn: 362215
Cullen Rhodes [Fri, 31 May 2019 09:06:53 +0000 (09:06 +0000)]
[AArch64][SVE2] Asm: support TBL/TBX instructions
Summary:
A three sources variant of the TBL instruction is added to the existing
SVE instruction in SVE2. This is implemented with minor changes to the
existing TableGen class. TBX is a new instruction with its own
definition.
The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D62600
llvm-svn: 362214
Cullen Rhodes [Fri, 31 May 2019 08:59:40 +0000 (08:59 +0000)]
[AArch64][SVE2] Asm: support SVE2 store instructions
Summary:
Patch adds support for the following instructions:
* STNT1B, STNT1H, STNT1S, STNT1D
The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D62599
llvm-svn: 362213
Petar Avramovic [Fri, 31 May 2019 08:40:08 +0000 (08:40 +0000)]
[MIPS GlobalISel] Add detailed tests for lower call
Test different operand types of callee and their behavior whether
relocation model is pic or not.
Possible operand types are:
Register (function pointer),
External symbol (used for libcalls e.g. __udivdi3 or memcpy),
Global address.
Global address has different handling depending on relocation model
and linkage type. Register and external symbol do not.
Differential Revision: https://reviews.llvm.org/D62590
llvm-svn: 362212
Sjoerd Meijer [Fri, 31 May 2019 08:39:34 +0000 (08:39 +0000)]
Follow up and fix for rL362064
Fix the misleadingly indentation introduced in rL362064. This will get rid of
the compiler warning, and it was actually a bug. This change will be used and
tested in D62669.
llvm-svn: 362211
Petar Avramovic [Fri, 31 May 2019 08:27:06 +0000 (08:27 +0000)]
[MIPS GlobalISel] Handle position independent code
Handle position independent code for MIPS32.
When callee is global address, lower call will emit callee
as G_GLOBAL_VALUE and add target flag if needed.
Support $gp in getRegBankFromRegClass().
Select G_GLOBAL_VALUE, specially handle case when
there are target flags attached by lowerCall.
Differential Revision: https://reviews.llvm.org/D62589
llvm-svn: 362210
Roman Lebedev [Fri, 31 May 2019 08:24:07 +0000 (08:24 +0000)]
[NFC][InstCombine] Copy add/sub constant-folding tests from codegen
Last three patterns are missed.
llvm-svn: 362209
Roman Lebedev [Fri, 31 May 2019 08:23:48 +0000 (08:23 +0000)]
[NFC][Codegen] Add/sub constant-folding: add scalar tests too
Just for completeness.
llvm-svn: 362208
Fangrui Song [Fri, 31 May 2019 08:20:43 +0000 (08:20 +0000)]
[ELF][test] Restore linkerscript/symbol-location.s to test getLinkerScriptLocation()
The test (the only test that checks getLinkerScriptLocation()) deleted
by r358652 can be restored by replacing R_X86_64_PLT32 with
R_X86_64_PC32, and changing -pie to -shared (preemptable). Then, the
symbol will not be a link-time constant and a -fPIC error will be
issued.
llvm-svn: 362207
Petar Avramovic [Fri, 31 May 2019 08:15:28 +0000 (08:15 +0000)]
[mips] Move initGlobalBaseReg to MipsFunctionInfo. NFC
Move initGlobalBaseReg from MipsSEDAGToDAGISel to MipsFunctionInfo.
This way functions used for handling position independent code during
instruction selection, getGlobalBaseReg and initGlobalBaseReg,
end up in same class.
Differential Revision: https://reviews.llvm.org/D62586
llvm-svn: 362206
Craig Topper [Fri, 31 May 2019 08:10:23 +0000 (08:10 +0000)]
[InstructionSimplify] Add missing implementation of llvm::SimplifyUnOp. NFC
There are no callers currently, but the function is declared so we should at
least implement it.
llvm-svn: 362205
Petar Avramovic [Fri, 31 May 2019 08:06:17 +0000 (08:06 +0000)]
[MIPS GlobalISel] Lower call for callee that is register
Lower call for callee that is register for MIPS32.
Register should contain callee function address.
Differential Revision: https://reviews.llvm.org/D62585
llvm-svn: 362204
Craig Topper [Fri, 31 May 2019 07:38:26 +0000 (07:38 +0000)]
[X86] Remove patterns for X86VSintToFP/X86VUintToFP+loadv4f32 to v2f64.
These patterns can incorrectly narrow a volatile load from 128-bits to 64-bits.
Similar to PR42079.
Switch to using (v4i32 (bitcast (v2i64 (scalar_to_vector (loadi64))))) as the
load pattern used in the instructions.
This probably still has issues in 32-bit mode where loadi64 isn't legal. Maybe
we should use VZMOVL for widened loads even when we don't need the upper bits
as zeroes?
llvm-svn: 362203
Craig Topper [Fri, 31 May 2019 07:38:22 +0000 (07:38 +0000)]
[X86] Add test cases for failure to use 128-bit masked vcvtdq2pd when load starts as v2i32.
llvm-svn: 362202
Craig Topper [Fri, 31 May 2019 07:38:18 +0000 (07:38 +0000)]
[X86] Add test cases for a volatile load shrinking bug involving cvtdq2pd. NFC
Similar to PR42079
llvm-svn: 362201
Craig Topper [Fri, 31 May 2019 07:38:14 +0000 (07:38 +0000)]
[X86] Copy a test case from avx512-cvt.ll to avx512-cvt-widen.ll. NFC
llvm-svn: 362200
Craig Topper [Fri, 31 May 2019 06:21:53 +0000 (06:21 +0000)]
[X86] Remove avx512 isel patterns for fpextend+load. Prefer to only match fp extloads instead.
DAG combine will usually fold fpextend+load to an fp extload anyway. So the
256 and 512 patterns were probably unnecessary. The 128 bit pattern was special
in that it looked for a v4f32 load, but then used it in an instruction that
only loads 64-bits. This is bad if the load happens to be volatile. We could
probably make the patterns volatile aware, but that's more work for something
that's probably rare. The peephole pass might kick in and save us anyway. We
might also be able to fix this with some additional DAG combines.
This also adds patterns for vselect+extload to enabled masked vcvtps2pd to be
used. Previously we looked for the unlikely vselect+fpextend+load.
llvm-svn: 362199
Craig Topper [Fri, 31 May 2019 06:21:49 +0000 (06:21 +0000)]
[X86] Add test to show missed opportunity to use masked vcvtps2pd for vselect+extload.
llvm-svn: 362198
Craig Topper [Fri, 31 May 2019 06:21:45 +0000 (06:21 +0000)]
[X86] Add test case for PR42079. NFC
llvm-svn: 362197
Pengfei Wang [Fri, 31 May 2019 06:09:35 +0000 (06:09 +0000)]
[X86] Add VP2INTERSECT instructions
Support intel AVX512 VP2INTERSECT instructions in clang
Patch by Xiang Zhang (xiangzhangllvm)
Differential Revision: https://reviews.llvm.org/D62367
llvm-svn: 362196
Puyan Lotfi [Fri, 31 May 2019 06:02:38 +0000 (06:02 +0000)]
[MIR-Canon] Skip the first N vreg names lazily.
This consolidates the vreg skip code into one function (SkipVRegs()).
SkipVRegs() now knows if it should skip as if it is the first initialization or
subsequent skips.
The first skip is also done the first time createVirtualRegister is called by
the cursor instead of by the cursor's constructor. This prevents verifier
errors on machine functions that have no vregs (where the verifier will
complain that there are vregs when the function uses none).
Differential Revision: https://reviews.llvm.org/D62717
llvm-svn: 362195
Richard Trieu [Fri, 31 May 2019 05:55:07 +0000 (05:55 +0000)]
Fix problem with r362192
The string returned only sometimes ends in NULL. Explicitly check for the NULL
and pop off the NULL if it is there.
llvm-svn: 362194
Craig Topper [Fri, 31 May 2019 05:20:27 +0000 (05:20 +0000)]
[X86] Correct the ins operand order for MASKPAIR16STORE to match other store instructions.
This makes the 5 address operands come first. And the data operand comes last.
This matches the operand order the instruction is created with. It's also the
expected order in X86MCInstLower. So everything appeared to work, but the
operands didn't match their declared type.
Fixes a -verify-machineinstrs failure.
Also remove the isel patterns from these instructions since they should only
be used for stack spills and reloads. I'm not even sure what types the patterns
were looking for to match.
llvm-svn: 362193
Richard Trieu [Fri, 31 May 2019 05:06:54 +0000 (05:06 +0000)]
Fix off-by-one error.
The created string is one char too large, so it pulls the terminating NULL as
the last character of the string. This later causes SocketTest.cpp to fail.
llvm-svn: 362192
Puyan Lotfi [Fri, 31 May 2019 04:49:58 +0000 (04:49 +0000)]
[MIR-Canon] Hardening propagateLocalCopies.
This is am almost NFC, it does the following:
- If there is no register class for a COPY's src or dst, bail.
- Fixes uses iterator invalidation bug.
Differential Revision: https://reviews.llvm.org/D62713
llvm-svn: 362191
Zi Xuan Wu [Fri, 31 May 2019 04:42:13 +0000 (04:42 +0000)]
re-commit r361928: [PowerPC] [Clang] Port SSE intrinsics to PowerPC
Port xmmintrin.h which include Intel SSE intrinsics implementation to PowerPC platform (using Altivec).
The new headers containing those implemenations are located into a directory named ppc_wrappers
which has higher priority when the platform is PowerPC on Linux. They are mainly developed by Steven Munroe,
with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu.
Patched by: Qiu Chaofan <qiucf@cn.ibm.com>
Reviewed By: Jinsong Ji
Differential Revision: https://reviews.llvm.org/D62121
llvm-svn: 362190
Richard Trieu [Fri, 31 May 2019 03:45:11 +0000 (03:45 +0000)]
Fix bad go bindings test.
After r362128, the "byval" attribute has a stricter check and will cause an
assertion. Remove the "byval" test case for now.
llvm-svn: 362189
Pengfei Wang [Fri, 31 May 2019 02:50:41 +0000 (02:50 +0000)]
[X86] Add VP2INTERSECT instructions
Support Intel AVX512 VP2INTERSECT instructions in llvm
Patch by Xiang Zhang (xiangzhangllvm)
Differential Revision: https://reviews.llvm.org/D62366
llvm-svn: 362188
Richard Trieu [Fri, 31 May 2019 02:23:33 +0000 (02:23 +0000)]
Redirect test output to /dev/null
llvm-svn: 362187
Pengfei Wang [Fri, 31 May 2019 01:50:07 +0000 (01:50 +0000)]
Revert "[X86] Fix i386 struct and union parameter alignment"
This reverts commit
d61cb749f4ac2c90244906d756e80a5c4a7ffa89 (SVN:
361934).
According to James suggestion, revert this change. Please ref:
https://reviews.llvm.org/D60748
llvm-svn: 362186
Petr Hosek [Fri, 31 May 2019 01:34:51 +0000 (01:34 +0000)]
[CMake] Provide an option to use relative paths in debug info
CMake always uses absolute file paths in the generated compiler
invocation which results in absolute file paths being embedded in debug
info. This is undesirable when building a toolchain e.g. on bots as the
debug info may embed the bot source checkout path which is meaningless
anywhere else.
This change introduces the LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO which uses
-fdebug-prefix-map (where supported) options to rewrite paths embedded
into debug info with relative ones. Additionally, LLVM_SOURCE_PREFIX can
be used to override the path to source directory with a different one.
Differential Revision: https://reviews.llvm.org/D62622
llvm-svn: 362185
Richard Smith [Fri, 31 May 2019 01:25:16 +0000 (01:25 +0000)]
PR39728: When completing a class, complete the destructor first.
We need to know whether the destructor is trivial in order to tell
whether other parts of the class are valid (in particular, this affects
whether the type is a literal type, which affects whether defaulted
special members can be declared constexpr or are implicitly constexpr).
llvm-svn: 362184
John McCall [Fri, 31 May 2019 01:21:36 +0000 (01:21 +0000)]
Fix the predefined exponent limit macros for the 16-bit IEEE format.
The magnitude range of normalized _Float16 is 2^-14 (~6e-5) to
(2-2^-10)*2^15 (65504). You might think, then, that the code is
correct to defne FLT16_MIN_EXP and FLT16_MAX_EXP to be -14 and 15
respectively. However, for some reason the C specification actually
specifies a bias for these macros:
C11 5.2.4.2.2:
- minimum negative integer such that FLT_RADIX raised to one less than
that power is a normalized floating-point number, e_min:
FLT_MIN_EXP
DBL_MIN_EXP
LDBL_MIN_EXP
- maximum integer such that FLT_RADIX raised to one less than that
power is a representable finite floating-point number, e_max:
FLT_MAX_EXP
DBL_MAX_EXP
LDBL_MAX_EXP
FLT16_MIN_EXP and FLT16_MAX_EXP should clearly be biased the same way,
and other compilers do in fact do so, as do our OpenCL headers for `half`.
Additionally, FLT16_MIN_10_EXP is just wrong.
llvm-svn: 362183
Richard Smith [Fri, 31 May 2019 01:17:04 +0000 (01:17 +0000)]
Defer building 'this' captures until we have left the capturing region
and returned to the context in which 'this' should be captured.
This means we now always mark 'this' referenced from the context in
which it's actually referenced, rather than potentially from some
context nested within that.
llvm-svn: 362182
Petr Hosek [Fri, 31 May 2019 01:16:43 +0000 (01:16 +0000)]
[CMake][Fuchsia] Use libc++ ABI v2 on Darwin as well
Since we share headers between host and target builds, we need to use
the same version for both.
Differential Revision: https://reviews.llvm.org/D62712
llvm-svn: 362181
Sam Clegg [Fri, 31 May 2019 01:04:00 +0000 (01:04 +0000)]
Fix -DBUILD_SHARED_LIBS=ON build after rL362160
Differential Revision: https://reviews.llvm.org/D62709
llvm-svn: 362180
Richard Smith [Fri, 31 May 2019 00:45:10 +0000 (00:45 +0000)]
Defer capture initialization for captured regions until after we've left
the captured region scope.
This removes a case where we would build expressions (and mark
declarations odr-used) in the wrong scope.
Remove the now-unused 'capture initializer' field on sema::Capture
(except for 'this' captures, which still need to be cleaned up).
No functionality change intended (except that we now very slightly more
precisely determine whether we need to use a capture or not when another
captured region encloses an OpenMP captured region).
llvm-svn: 362179
Richard Smith [Fri, 31 May 2019 00:45:09 +0000 (00:45 +0000)]
Defer capture initialization for blocks until after we've left the
function scope.
This removes one of the last few cases where we build expressions in the
wrong function scope context. No functionality change intended.
llvm-svn: 362178
Adrian Prantl [Fri, 31 May 2019 00:18:42 +0000 (00:18 +0000)]
Make CPlusPlusNameParser robust against nullptr StringRefs.
There is likely also an underlying bug in all code that calls
CPlusPlusNameParser with nullptrs, but this patch can also stand for
itself.
rdar://problem/
49072829
llvm-svn: 362177
Nathan Ridge [Thu, 30 May 2019 23:54:43 +0000 (23:54 +0000)]
[clangd] clang-format SymbolCollector.cpp
llvm-svn: 362176
Craig Topper [Thu, 30 May 2019 23:35:24 +0000 (23:35 +0000)]
[X86] Remove result type constraints from the extloadv2f32/extloadv4f32/extloadv8f32 PatFrags. NFC
The result types aren't mentioned in the pattern name so really shouldn't be in the PatFrags.
The users of these either have their own type constraint or rely on the type constranit system to realize the only legal extend would be to f64.
llvm-svn: 362175
Matt Arsenault [Thu, 30 May 2019 23:31:36 +0000 (23:31 +0000)]
MISched: Fix -misched-regpressure=0 if subreg liveness enabled
Test is waiting on fixing several more crashes in the AMDGPU scheduler
implementation with this.
llvm-svn: 362174
Antonio Afonso [Thu, 30 May 2019 23:30:35 +0000 (23:30 +0000)]
Make ConnectionFileDescription work with all sockets
Summary:
My main goal here is to make lldb-server work with Android Studio.
This is currently not the case because lldb-server is started in platform mode listening on a domain socket. When Android Studio connects to it lldb-server crashes because even though it's listening on a domain socket as soon as it gets a connection it asserts that it's a TCP connection, which will obviously fails for any non-tcp connection.
To do this I came up with a new method called GetConnectURI() in Socket that returns the URI needed to connect to the connected portion of the socket.
Reviewers: labath, clayborg, xiaobai
Reviewed By: labath
Subscribers: mgorny, jfb, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62089
llvm-svn: 362173
Richard Smith [Thu, 30 May 2019 23:21:14 +0000 (23:21 +0000)]
Refactor OpenMP stack management.
Instead of duplicating access to the directive stack throughout
SemaOpenMP.cpp, consolidate it to a few methods and call those
everywhere else. In passing, simplify adjacent code where possible.
No functionality change intended.
llvm-svn: 362172
Richard Smith [Thu, 30 May 2019 23:21:13 +0000 (23:21 +0000)]
Fix "fallthrough annotation in unreachable code" warning.
llvm-svn: 362171
Craig Topper [Thu, 30 May 2019 22:29:06 +0000 (22:29 +0000)]
[X86] Remove code that unnecessarily sets EXTLOAD with src type of v2f32/v4f32/v8f32 as Legal for SSE2/AVX/AVX512 respectively. NFC
The LoadExt table defaults to all combinations being Legal. For
vector types, only src VTs with an i1 element type were ever changed.
So we don't need to mark them legal manually.
llvm-svn: 362170
Chris Bieneman [Thu, 30 May 2019 22:25:48 +0000 (22:25 +0000)]
Support codesigning bundles and forcing
Summary:
Clangd's framework is assembled by copying binaries from the lib and bin directories into a bundle shape. This results in an invalid bundle code signature because the signature only applies to the binaries not the resources.
This patch adds two new options to `llvm_codesign` to enable re-signing the library and XPC service as bundles.
The `BUNDLE_PATH` option allow specifying an explicit path to codesign, which enables signing bundles which aren't generated using CMake's `FRAMEWORK` or `BUNDLE` target properties.
The `FORCE` option allows re-signing binaries that have already been signed. This is required for how clangd exposes the clangd library and tools as both XPC and non-XPC services using the same binary.
Reviewers: jkorous, bogner
Reviewed By: bogner
Subscribers: mgorny, ilya-biryukov, dexonsmith, arphaman, kadircet, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62693
llvm-svn: 362169
Douglas Yung [Thu, 30 May 2019 22:20:31 +0000 (22:20 +0000)]
Fix test to add missing '|' to regex.
llvm-svn: 362168
Michael Trent [Thu, 30 May 2019 22:11:29 +0000 (22:11 +0000)]
Update the tests in r362121 / r362141 to allow for Windows-specific error
messages: "Is a directory" instead of "is a directory"
This should resolve the errors being reported on clang-x64-windows-msvc.
llvm-svn: 362167
Amy Huang [Thu, 30 May 2019 22:04:11 +0000 (22:04 +0000)]
Add enums as global variables in the IR metadata.
Summary:
Keeps track of the enums that were used by saving them as DIGlobalVariables,
since CodeView emits debug info for global constants.
Reviewers: rnk
Subscribers: aprantl, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62635
llvm-svn: 362166
Francis Visoiu Mistrih [Thu, 30 May 2019 22:01:56 +0000 (22:01 +0000)]
[Remarks] Fix usage of enum class
Breaks the build on some compilers:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/9720/steps/build%20stage%201/logs/stdio
llvm-svn: 362165
Alex Langford [Thu, 30 May 2019 22:00:18 +0000 (22:00 +0000)]
[Target] Generalize language-specific behavior in ThreadPlanStepThrough
Summary:
When creating a ThreadPlan to step through a trampoline, we ask the
ObjC language runtime and the CPP language runtime to come up with such a thread
plan if the dynamic loader fails to give us one. I don't see why this behavior
can't be language agnostic.
Differential Revision: https://reviews.llvm.org/D61921
llvm-svn: 362164
Mitch Phillips [Thu, 30 May 2019 21:58:47 +0000 (21:58 +0000)]
Attempt to fix test failure for armv8.
Looks like armv8 can't handle a thousand threads, which GWP-ASan
requests when running a synchronised mutex test. Limiting this to 100 to
attempt to fix the build issue.
llvm-svn: 362163
Thomas Lively [Thu, 30 May 2019 21:57:23 +0000 (21:57 +0000)]
[WebAssembly] Improve feature validation error messages
Summary:
Add the names of the input files responsible for each error to the
messages.
Reviewers: sbc100, azakai
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62704
llvm-svn: 362162
Francis Visoiu Mistrih [Thu, 30 May 2019 21:45:59 +0000 (21:45 +0000)]
[Remarks][NFC] Move the serialization to lib/Remarks
Separate the remark serialization to YAML from the LLVM Diagnostics.
This adds a new serialization abstraction: remarks::Serializer. It's
completely independent from lib/IR and it provides an easy way to
replace YAML by providing a new remarks::Serializer.
Differential Revision: https://reviews.llvm.org/D62632
llvm-svn: 362160
Roman Lebedev [Thu, 30 May 2019 21:41:21 +0000 (21:41 +0000)]
[NFC][ARM] Add a test that potentially causes endless combine loop with D62266
llvm-svn: 362159
Puyan Lotfi [Thu, 30 May 2019 21:37:25 +0000 (21:37 +0000)]
[MIR-Canon] Fixing case where MachineFunction is empty.
In cases where the machine function is empty: bail on the RPO traversal.
Differential Revision: https://reviews.llvm.org/D62617
llvm-svn: 362158
Erich Keane [Thu, 30 May 2019 21:35:32 +0000 (21:35 +0000)]
Fix constexpr __builtin_*_overflow issue when unsigned->signed operand.
As reported here https://bugs.llvm.org/show_bug.cgi?id=42000, it was
possible to get the constexpr version of __builtin_*_overflow to give
the wrong answer.
This was because when extending the operands to fit the largest type (so
that the math could be done), the decision on whether to sign/zero
extend the operands was based on the result signedness, not on the
operands signedness.
In the reported case, (unsigned char)255 - (int)100 needed
to have each extended to the int in order to do the math. However, when
extending the first operand to 'int', we incorrectly sign extended it
instead of zero extending. Thus, the result didnt fit back into the
unsigned char.
The fix for this was simply to choose zero/sign extension based on the
sign of the operand itself.
Differential Revision: https://reviews.llvm.org/D62665
llvm-svn: 362157
Roman Lebedev [Thu, 30 May 2019 21:10:37 +0000 (21:10 +0000)]
[DAGCombine] Limit 'hoist add/sub binop w/ constant op' to non-opaque consts
I don't have a test case for these, but there is a test case for D62266
where, even after all the constant-folding patches, we still end up
with endless combine loop. Which makes sense, since we don't constant
fold for opaque constants.
llvm-svn: 362156
Louis Dionne [Thu, 30 May 2019 21:09:19 +0000 (21:09 +0000)]
[pstl] Use OpenMP pragmas with Clang, which supports them
Most importantly, Clang doesn't seem to support the non-OpenMP pragmas
that were being used previously.
llvm-svn: 362155
Alex Langford [Thu, 30 May 2019 21:03:53 +0000 (21:03 +0000)]
[Target] Generalize Process::IsPossibleDynamicValue
llvm-svn: 362154
Nikita Popov [Thu, 30 May 2019 21:03:17 +0000 (21:03 +0000)]
[CVP] Add tests for non-overflowing saturating math; NFC
llvm-svn: 362153
Nikita Popov [Thu, 30 May 2019 21:03:10 +0000 (21:03 +0000)]
[CVP] Generalize willNotOverflow(); NFC
Change argument from WithOverflowInst to BinaryOpIntrinsic, so this
function can also be used for saturating math intrinsics.
llvm-svn: 362152
Lang Hames [Thu, 30 May 2019 20:58:28 +0000 (20:58 +0000)]
[RuntimeDyld] Update reserveAllocationSpace to account for stub padding.
This should fix the buildbot failures caused by r362139.
llvm-svn: 362151