Raphael Isemann [Fri, 27 Jul 2018 23:37:08 +0000 (23:37 +0000)]
Add missing boundary checks to variable completion.
Summary: Stopgap patch to at least stop all the crashes I get from this code.
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D49949
llvm-svn: 338177
Wouter van Oortmerssen [Fri, 27 Jul 2018 23:19:51 +0000 (23:19 +0000)]
Revert "[WebAssembly] Added default stack-only instruction mode for MC."
This reverts commit
d3c9af4179eae7793d1487d652e2d4e23844555f.
(SVN revision 338164)
llvm-svn: 338176
Fangrui Song [Fri, 27 Jul 2018 23:12:11 +0000 (23:12 +0000)]
[Support] Remove unnecessary MemoryBuffer::anchor (where the destructor serves as the key function)
llvm-svn: 338175
Craig Topper [Fri, 27 Jul 2018 23:04:59 +0000 (23:04 +0000)]
[X86] Add support expanding multiplies by constant where the constant is -3/-5/-9 multplied by a power of 2.
These can be replaced with an LEA, a shift, and a negate. This seems to match what gcc and icc would do.
llvm-svn: 338174
Fangrui Song [Fri, 27 Jul 2018 22:51:36 +0000 (22:51 +0000)]
[llvm-objcopy] Make --strip-debug strip .zdebug* (zlib-gnu) sections
This behavior matches GNU objcopy.
llvm-svn: 338173
Reid Kleckner [Fri, 27 Jul 2018 22:21:35 +0000 (22:21 +0000)]
[InstrProf] Don't register __llvm_profile_runtime_user
Refactor some FileCheck prefixes while I'm at it.
Fixes PR38340
llvm-svn: 338172
Raphael Isemann [Fri, 27 Jul 2018 22:20:59 +0000 (22:20 +0000)]
Fix whitespace in the python test suite.
Summary:
The test suite has often unnecessary trailing whitespace, and sometimes
unnecessary trailing lines or a missing final new line. This patch just strips
trailing whitespace/lines and adds missing newlines at the end.
Subscribers: ki.stfu, JDevlieghere, christof, lldb-commits
Differential Revision: https://reviews.llvm.org/D49943
llvm-svn: 338171
Nicolas Lesser [Fri, 27 Jul 2018 21:55:12 +0000 (21:55 +0000)]
Parse a possible trailing postfix expression suffix after a fold expression
Summary:
This patch allows the parsing of a postfix expression involving a fold expression, which is legal as a fold-expression is a primary-expression.
See also https://llvm.org/pr38282
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49848
llvm-svn: 338170
Erik Pilkington [Fri, 27 Jul 2018 21:23:48 +0000 (21:23 +0000)]
[Sema] Use a TreeTransform to extract deduction guide parameter types
Previously, we just canonicalized the type, but this lead to crashes with
parameter types that referred to ParmVarDecls of the constructor. There may be
more cases that this TreeTransform needs to handle though, such as a constructor
parameter type referring to a member in an unevaluated context. Canonicalization
doesn't address these cases either though, so we can address them as-needed in
follow-up commits.
rdar://
41330135
Differential revision: https://reviews.llvm.org/D49439
llvm-svn: 338165
Wouter van Oortmerssen [Fri, 27 Jul 2018 20:56:43 +0000 (20:56 +0000)]
[WebAssembly] Added default stack-only instruction mode for MC.
Summary:
Moved Explicit Locals pass to last.
Made that pass obligatory.
Made it convert from register to stack based instructions, and removed the registers.
Fixes to related code that was expecting register based instructions.
Added the correct testing flag to all tests, depending on what the
format they were expecting so far.
Translated one test to stack format as example: reg-stackify-stack.ll
tested:
llvm-lit -v `find test -name WebAssembly`
unittests/MC/*
Reviewers: dschuff, sunfish
Subscribers: sbc100, jgravelle-google, eraman, aheejin, llvm-commits
Differential Revision: https://reviews.llvm.org/D49160
llvm-svn: 338164
Davide Italiano [Fri, 27 Jul 2018 20:38:01 +0000 (20:38 +0000)]
Revert "Recommit [DataFormatters] Add formatter for C++17 std::optional."
This broke a linux bot which doesn't support -std=c++17. The solution
is to add a decorator to skip these tests on machines with older compilers.
llvm-svn: 338162
David Bolvansky [Fri, 27 Jul 2018 20:29:32 +0000 (20:29 +0000)]
[InstCombine] [NFC] [Tests] Fold Select with AND/OR condition - fixed
Differential Revision: https://reviews.llvm.org/D49933
llvm-svn: 338161
Jessica Paquette [Fri, 27 Jul 2018 20:18:27 +0000 (20:18 +0000)]
Recommit "Enable MachineOutliner by default under -Oz for AArch64"
Fixed the ASAN failure from before in r338148, so recommiting.
This patch enables the MachineOutliner by default in AArch64 under -Oz.
The MachineOutliner offers around a 4.5% improvement on the current -Oz code
size improvements.
We have done work into improving the debuggability of outlined code, so that
users of -Oz won't be surprised by the optimization. We have also been executing
the LLVM test suite and common external tests such as the SPEC suites
continuously with no issue. The outliner has a low compile-time overhead of
roughly 1%. At this point, the outliner would be a really good addition to the
-Oz pass pipeline!
llvm-svn: 338160
David Bolvansky [Fri, 27 Jul 2018 20:18:12 +0000 (20:18 +0000)]
[InstCombine] [NFC] [Tests] Fold Select with AND/OR condition
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49932
llvm-svn: 338159
Alexey Bataev [Fri, 27 Jul 2018 20:16:44 +0000 (20:16 +0000)]
[DEBUG_INFO] Fix tests, NFC.
llvm-svn: 338158
Jordan Rupprecht [Fri, 27 Jul 2018 20:02:58 +0000 (20:02 +0000)]
[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
Summary:
[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
r338122 changed the linkage of some methods which revealed an existing ODR violation, e.g.:
projects/libcxx/include/support/xlocale/__posix_l_fallback.h:83:38: error: 'internal_linkage' attribute does not appear on the first declaration of 'iswcntrl_l'
inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) {
^
lib/include/wctype.h:55:12: note: previous definition is here
extern int iswcntrl_l (wint_t, locale_t);
These were added to newlib in 2.4 [1] [2], so move them to the already existing include guard.
[1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=
238455adfab4f8070ac65400aac22bb8a9e502fc
[2] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=
8493c1631643fada62384768408852bc0fa6ff44
Reviewers: ldionne, rsmith, EricWF
Subscribers: christof, cfe-commits
Differential Revision: https://reviews.llvm.org/D49927
llvm-svn: 338157
Davide Italiano [Fri, 27 Jul 2018 19:57:30 +0000 (19:57 +0000)]
Recommit [DataFormatters] Add formatter for C++17 std::optional.
This should have all the correct files now.
<rdar://problem/
41471112>
Patch by Shafik Yaghmour.
Differential Revision: https://reviews.llvm.org/D49271
llvm-svn: 338156
Alexey Bataev [Fri, 27 Jul 2018 19:45:14 +0000 (19:45 +0000)]
[DEBUGINFO] Disable unsupported debug info options for NVPTX target.
Summary:
Some targets support only default set of the debug options and do not
support additional debug options, like NVPTX target. Patch introduced
virtual function supportsDebugInfoOptions() that can be overloaded
by the toolchain, checks if the target supports some debug
options and emits warning when an unsupported debug option is
found.
Reviewers: echristo
Subscribers: aprantl, JDevlieghere, cfe-commits
Differential Revision: https://reviews.llvm.org/D49148
llvm-svn: 338155
Alex Langford [Fri, 27 Jul 2018 19:41:17 +0000 (19:41 +0000)]
Stop building liblldb with CMake's framework functionality
Summary:
CMake has a bug in its ninja generator that prevents you from
installing targets that are built with framework support. Therefore, I want to
not rely on CMake's framework support.
See https://gitlab.kitware.com/cmake/cmake/issues/18216
Differential Revision: https://reviews.llvm.org/D49888
llvm-svn: 338154
Peter Collingbourne [Fri, 27 Jul 2018 19:10:44 +0000 (19:10 +0000)]
Reland r338088, "ELF: Make --print-icf-sections output deterministic."
The xxHash64 function has been made unsigned-char-independent, so
we can reland this change now.
Original commit message:
> The icf-safe.s test currently fails on 32-bit platforms because it uses
> the --print-icf-sections flag and depends on the output appearing in
> a specific order. However, this flag causes the output to depend on
> the order of the sections in the Sections array, which depends on the
> hash values returned from hash_combine, which happen to be different
> for that test between 32-bit and 64-bit platforms.
>
> This change makes the output deterministic by using xxHash64 instead of
> hash_combine.
Differential Revision: https://reviews.llvm.org/D49877
llvm-svn: 338153
Evandro Menezes [Fri, 27 Jul 2018 18:56:47 +0000 (18:56 +0000)]
[SLC] Test simplification of pow(x, 0.333...) to cbrt(x) (NFC)
Add test case for simplifying `pow(x, 0.333...)` into `cbrt(x)`, which
D49040 enables.
llvm-svn: 338152
Raphael Isemann [Fri, 27 Jul 2018 18:42:46 +0000 (18:42 +0000)]
Narrow the CompletionRequest API to being append-only.
Summary:
We currently allow any completion handler to read and manipulate the list of matches we
calculated so far. This leads to a few problems:
Firstly, a completion handler's logic can now depend on previously calculated results
by another handlers. No completion handler should have such an implicit dependency,
but the current API makes it likely that this could happen (or already happens). Especially
the fact that some completion handler deleted all previously calculated results can mess
things up right now.
Secondly, all completion handlers have knowledge about our internal data structures with
this API. This makes refactoring this internal data structure much harder than it should be.
Especially planned changes like the support of descriptions for completions are currently
giant patches because we have to refactor every single completion handler.
This patch narrows the contract the CompletionRequest has with the different handlers to:
1. A handler can suggest a completion.
2. A handler can ask how many suggestions we already have.
Point 2 obviously means we still have a dependency left between the different handlers, but
getting rid of this is too large to just append it to this patch.
Otherwise this patch just completely hides the internal StringList to the different handlers.
The CompletionRequest API now also ensures that the list of completions is unique and we
don't suggest the same value multiple times to the user. This property has been so far only
been ensured by the `Option` handler, but is now applied globally. This is part of this patch
as the OptionHandler is no longer able to implement this functionality itself.
Reviewers: jingham, davide, labath
Reviewed By: davide
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D49322
llvm-svn: 338151
Sanjay Patel [Fri, 27 Jul 2018 18:31:21 +0000 (18:31 +0000)]
[AArch64, PowerPC, x86] add more signbit math tests; NFC
The tests with a constant sub operand were added with rL338143,
but the potential transform doesn't have that requirement, so
adding more tests with variable operands.
llvm-svn: 338150
George Karpenkov [Fri, 27 Jul 2018 18:26:40 +0000 (18:26 +0000)]
[analyzer] Extend NoStoreFuncVisitor to insert a note on IVars
The note is added in the following situation:
- We are throwing a nullability-related warning on an IVar
- The path goes through a method which *could have* (syntactically
determined) written into that IVar, but did not
rdar://
42444460
Differential Revision: https://reviews.llvm.org/D49689
llvm-svn: 338149
Jessica Paquette [Fri, 27 Jul 2018 18:21:57 +0000 (18:21 +0000)]
[MachineOutliner] Exit getOutliningCandidateInfo when we erase all candidates
There was a missing check for if a candidate list was entirely deleted. This
adds that check.
This fixes an asan failure caused by running test/CodeGen/AArch64/addsub_ext.ll
with the MachineOutliner enabled.
llvm-svn: 338148
Evandro Menezes [Fri, 27 Jul 2018 18:16:47 +0000 (18:16 +0000)]
[ARM] Add new target feature to fuse literal generation
This feature enables the fusion of such operations on Cortex A57 and Cortex
A72, as recommended in their Software Optimisation Guides, sections 4.14 and
4.11, respectively.
Differential revision: https://reviews.llvm.org/D49563
llvm-svn: 338147
Joachim Protze [Fri, 27 Jul 2018 18:13:24 +0000 (18:13 +0000)]
[OMPT] Fix OMPT callbacks for the taskloop construct and add testcase
Fix the order of callbacks related to the taskloop construct.
Add the iteration_count to work callbacks (according to the spec).
Use kmpc_omp_task() instead of kmp_omp_task() to include OMPT callbacks.
Add a testcase.
Patch by Simon Convent
Reviewed by: protze.joachim, hbae
Subscribers: openmp-commits
Differential Revision: https://reviews.llvm.org/D47709
llvm-svn: 338146
Joachim Protze [Fri, 27 Jul 2018 18:13:20 +0000 (18:13 +0000)]
[OMPT] Adapt OMPT callbacks for tasks to handle untied tasks correctly
The ompt/tasks/task_types.c testcase did not test untied tasks properly. Now,
frame addresses are tested and two scheduling points are added at which the
task can switch to another thread. Due to scheduling effects, the frame address
could be NULL.
This needed a restructure of the way OMPT callbacks are called.
__ompt_task_finish() now as an extra parameter, whether a task is completed.
Its invocation has been moved into __kmp_task_finish(). Thus, the order of the
writes to the frame addresses is not subject to scheduling effects anymore.
Patch by Simon Convent
Reviewed by: protze.joachim, hbae
Subscribers: openmp-commits
Differential Revision: https://reviews.llvm.org/D49181
llvm-svn: 338145
Joachim Protze [Fri, 27 Jul 2018 18:13:15 +0000 (18:13 +0000)]
[OMPT] Print two more addresses in print_fuzzy_address_block()
The two more outputs are needed to match the return addresses when using the
Intel Compiler, as it generates more instructions between the fuzzy-printing
of the address and the runtime call.
Patch by Simon Convent
Reviewed By: protze.joachim, hbae
Differential Revision: https://reviews.llvm.org/D49373
llvm-svn: 338144
Sanjay Patel [Fri, 27 Jul 2018 18:12:29 +0000 (18:12 +0000)]
[AArch64, PowerPC, x86] add more signbit math tests; NFC
llvm-svn: 338143
Richard Smith [Fri, 27 Jul 2018 18:06:54 +0000 (18:06 +0000)]
Fix typos in comment.
llvm-svn: 338141
George Karpenkov [Fri, 27 Jul 2018 17:40:59 +0000 (17:40 +0000)]
[ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration
ObjCIvarExpr is *not* a subclass of MemberExpr, and a separate matcher
is required to support it.
Adding a hasDeclaration support as well, as it's not very useful without
it.
Differential Revision: https://reviews.llvm.org/D49701
llvm-svn: 338140
Alexey Bataev [Fri, 27 Jul 2018 17:37:32 +0000 (17:37 +0000)]
[OPENMP] Static variables on device must be externally visible.
Do not mark static variable as internal on the device as they must be
visible from the host to be mapped correctly.
llvm-svn: 338139
Erik Pilkington [Fri, 27 Jul 2018 17:27:40 +0000 (17:27 +0000)]
[demangler] Support for reference collapsing
llvm.org/PR38323
llvm-svn: 338138
George Karpenkov [Fri, 27 Jul 2018 17:26:11 +0000 (17:26 +0000)]
[ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration.
ObjCIvarExpr is *not* a subclass of MemberExpr, and a separate matcher
is required to support it.
Adding a hasDeclaration support as well, as it's not very useful without
it.
Differential Revision: https://reviews.llvm.org/D49701
llvm-svn: 338137
Jessica Paquette [Fri, 27 Jul 2018 17:25:38 +0000 (17:25 +0000)]
Revert "Enable MachineOutliner by default under -Oz for AArch64"
It failed an Asan test on a bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/21543/steps/check-llvm%20asan/logs/stdio
Fixing that before recommitting.
llvm-svn: 338136
Richard Smith [Fri, 27 Jul 2018 17:13:18 +0000 (17:13 +0000)]
Add missing temporary materialization conversion on left-hand side of .
in some member function calls.
Specifically, when calling a conversion function, we would fail to
create the AST node representing materialization of the class object.
llvm-svn: 338135
Yonghong Song [Fri, 27 Jul 2018 16:58:52 +0000 (16:58 +0000)]
bpf: add missing RegState to notify MachineInstr verifier necessary register usage
Errors like the following are reported by:
https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8011_builders_llvm-2Dclang-2Dx86-5F64-2Dexpensive-2Dchecks-2Dwin_builds_11261&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=DA8e1B5r073vIqRrFz7MRA&m=929oWPCf7Bf2qQnir4GBtowB8ZAlIRWsAdTfRkDaK-g&s=9k-wbEUVpUm474hhzsmAO29VXVvbxJPWD9RTgCD71fQ&e=
*** Bad machine code: Explicit definition marked as use ***
- function: cal_align1
- basic block: %bb.0 entry (0x47edd98)
- instruction: LDB $r3, $r2, 0
- operand 0: $r3
This is because RegState info was missing for ScratchReg inside
expandMEMCPY. This caused incomplete register usage information to
MachineInstr verifier which then would complain as there could be potential
code-gen issue if the complained MachineInstr is used in place where
register usage information matters even though the memcpy expanding is not
in such case as it happens at the last stage of IR optimization pipeline.
We should always specify those register usage information which compiler
couldn't deduct automatically whenever we add a hardware register manually.
Reported-by: Builder llvm-clang-x86_64-expensive-checks-win Build #11261
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 338134
Jessica Paquette [Fri, 27 Jul 2018 16:44:42 +0000 (16:44 +0000)]
Enable MachineOutliner by default under -Oz for AArch64
This patch enables the MachineOutliner by default in AArch64 under -Oz.
The MachineOutliner offers around a 4.5% improvement on the current -Oz code
size improvements.
We have done work into improving the debuggability of outlined code, so that
users of -Oz won't be surprised by the optimization. We have also been executing
the LLVM test suite and common external tests such as the SPEC suites
continuously with no issue. The outliner has a low compile-time overhead of
roughly 1%. At this point, the outliner would be a really good addition to the
-Oz pass pipeline!
llvm-svn: 338133
Sanjay Patel [Fri, 27 Jul 2018 16:42:55 +0000 (16:42 +0000)]
[DAGCombiner] fold 'not' with signbit math
This is a follow-up suggested in D48970.
Alive proofs:
https://rise4fun.com/Alive/sII
We can eliminate an instruction in the usual select-of-constants
to bit hack transform by adjusting the add/sub with constant.
This is always a win.
There are more transforms that are likely wins, but they may need
target hooks in case some targets do not benefit.
This is another step towards making up for canonicalizing to
select-of-constants in rL331486.
llvm-svn: 338132
Sanjay Patel [Fri, 27 Jul 2018 16:22:40 +0000 (16:22 +0000)]
[x86] add more tests for signbit math; NFC
llvm-svn: 338131
Sanjay Patel [Fri, 27 Jul 2018 16:22:18 +0000 (16:22 +0000)]
[PowerPC] add more tests for signbit math; NFC
llvm-svn: 338130
Sanjay Patel [Fri, 27 Jul 2018 16:21:56 +0000 (16:21 +0000)]
[AArch64] add more tests for signbit math; NFC
llvm-svn: 338129
Fangrui Song [Fri, 27 Jul 2018 16:01:09 +0000 (16:01 +0000)]
[Support] Use unsigned char for xxHash 64-bit
Before, the last 3 bytes were char-signedness dependent.
llvm-svn: 338128
Jan Vesely [Fri, 27 Jul 2018 15:00:13 +0000 (15:00 +0000)]
AMDGPU/R600: Add MOV instructions to BFE patterns
R600 can't handle immediates for BFE, these will be eliminated later.
Fixes powr/pow regressions n r600 since r334817
Differential Revision: https://reviews.llvm.org/D49641
llvm-svn: 338127
Sander de Smalen [Fri, 27 Jul 2018 14:24:55 +0000 (14:24 +0000)]
[AArch64][SVE] Asm: Predicated integer reductions.
This patch adds support for various integer reduction operations:
SADDV signed add reduction to scalar
UADDV unsigned add reduction to scalar
SMAXV signed maximum reduction to scalar
SMINV signed minimum reduction to scalar
UMAXV unsigned maximum reduction to scalar
UMINV unsigned minimum reduction to scalar
ANDV logical AND reduction to scalar
ORV logical OR reduction to scalar
EORV logical EOR reduction to scalar
The reduction is predicated, e.g.
smaxv s0, p0, z1.s
performs a signed maximum reduction on active elements in z1,
and stores the (signed max value) result in s0.
llvm-svn: 338126
Dmitry Preobrazhensky [Fri, 27 Jul 2018 14:17:15 +0000 (14:17 +0000)]
[AMDGPU][MC][DOC] Updated AMD GPU assembler description
llvm-svn: 338125
Ilya Biryukov [Fri, 27 Jul 2018 14:05:39 +0000 (14:05 +0000)]
[clang-tidy] Fix a crash in fuchsia-multiple-inheritance
Summary: See the test case for a repro.
Reviewers: juliehockett, ioeric, hokein, aaron.ballman
Reviewed By: hokein
Subscribers: lebedev.ri, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D49862
llvm-svn: 338124
Sander de Smalen [Fri, 27 Jul 2018 13:58:48 +0000 (13:58 +0000)]
[AArch64][SVE] Asm: Predicated floating point reductions.
This patch adds support for various floating-point
reduction operations:
FADDA strictly-ordered add reduction, accumulating in scalar
FADDV recursive add reduction to scalar
FMAXV recursive max reduction to scalar
FMINV recursive min reduction to scalar
FMAXNMV recursive max number reduction to scalar
FMINNMV recursive min number reduction to scalar
The reduction is predicated, e.g.
fadda d0, p0, d0, z1.d
performs the add-reduction in strict order on active elements
in z1, accumulating into d0.
faddv d0, p0, z1.d
performs the add-reduction (not in strict order)
on active elements in z1, storing the result in d0.
llvm-svn: 338123
Louis Dionne [Fri, 27 Jul 2018 12:46:03 +0000 (12:46 +0000)]
[libc++] Introduce _LIBCPP_HIDE_FROM_ABI to replace _LIBCPP_INLINE_VISIBILITY
Summary:
This commit introduces a new macro, _LIBCPP_HIDE_FROM_ABI, whose goal is to
mark functions that shouldn't be part of libc++'s ABI. It marks the functions
as being hidden for dylib visibility purposes, and as having internal linkage
using Clang's __attribute__((internal_linkage)) when available, and
__always_inline__ otherwise.
It replaces _LIBCPP_INLINE_VISIBILITY, which was always using __always_inline__
to achieve similar goals, but suffered from debuggability and code size problems.
The full proposal, along with more background information, can be found here:
http://lists.llvm.org/pipermail/cfe-dev/2018-July/058419.html
This commit does not rename uses of _LIBCPP_INLINE_VISIBILITY to
_LIBCPP_HIDE_FROM_ABI: this wide reaching but mechanical change can
be done later when we've confirmed we're happy with the new macro.
In the future, it would be nice if we could optionally allow dropping
any internal_linkage or __always_inline__ attribute, which could result
in code size improvements. However, this is currently impossible for
reasons explained here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058450.html
Reviewers: EricWF, dexonsmith, mclow.lists
Subscribers: christof, dexonsmith, llvm-commits, mclow.lists
Differential Revision: https://reviews.llvm.org/D49240
llvm-svn: 338122
Sander de Smalen [Fri, 27 Jul 2018 12:40:09 +0000 (12:40 +0000)]
[AArch64][SVE] Asm: Support for FEXPA and FTSSEL.
This patch adds support for transcendental acceleration
instructions 'FEXPA' (exponential accelerator) and 'FTSSEL'
(trigonometric select coefficient).
llvm-svn: 338121
Sander de Smalen [Fri, 27 Jul 2018 12:26:24 +0000 (12:26 +0000)]
[AArch64][SVE] Asm: Support for FRECPE and FRSQRTE.
Support for floating-point instructions for reciprocal
estimate (FRECPE) and reciprocal square root estimate (FRSQRTE).
llvm-svn: 338120
Philip Pfaffe [Fri, 27 Jul 2018 10:57:51 +0000 (10:57 +0000)]
[CMake] Followup for r337366: Only export LLVM_LINK_LLVM_DYLIB if it's set to ON
Summary:
As it was, always exporting LLVM_LINK_LLVM_DYLIB caused out-of-tree
clients to lose the ability to link against the dylib, even if in-tree tools did
not. By only exporting the setting if it is enabled, out-of-tree clients get the
correct default, but may still choose if they can.
Reviewers: mgorny, beanz, labath, bogner, chandlerc
Reviewed By: bogner, chandlerc
Subscribers: bollu, llvm-commits
Differential Revision: https://reviews.llvm.org/D49843
llvm-svn: 338119
Sanjay Patel [Fri, 27 Jul 2018 10:54:48 +0000 (10:54 +0000)]
[InstCombine] not(sub X, Y) --> add (not X), Y
The tests with constants show a missing optimization.
Analysis for adds is better than subs, so this can also
help with other transforms. And codegen is better with
adds for targets like x86 (destructive ops, no sub-from).
https://rise4fun.com/Alive/llK
llvm-svn: 338118
Sanjay Patel [Fri, 27 Jul 2018 10:45:04 +0000 (10:45 +0000)]
[InstCombine] add tests for not+sub; NFC
llvm-svn: 338117
Kirill Bobyrev [Fri, 27 Jul 2018 09:54:27 +0000 (09:54 +0000)]
[clangd] Return Dex Iterators
The original Dex Iterators patch (https://reviews.llvm.org/rL338017)
caused problems for Clang 3.6 and Clang 3.7 due to the compiler bug
which prevented inferring template parameter (`Size`) in create(And|Or)?
functions. It was reverted in https://reviews.llvm.org/rL338054.
In this revision the mentioned helper functions were replaced with
variadic templated versions.
Proposed changes were tested on multiple compiler versions, including
Clang 3.6 which originally caused the failure.
llvm-svn: 338116
Max Kazantsev [Fri, 27 Jul 2018 09:43:39 +0000 (09:43 +0000)]
[SimplifyIndVar] Canonicalize comparisons to unsigned while eliminating truncs
This is a follow-up for the patch rL335020. When we replace compares against
trunc with compares against wide IV, we can also replace signed predicates with
unsigned where it is legal.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D48763
llvm-svn: 338115
Victor Leschuk [Fri, 27 Jul 2018 09:15:05 +0000 (09:15 +0000)]
[Support] Bring std::errc::not_supported to llvm::errc.
llvm-svn: 338114
Matt Arsenault [Fri, 27 Jul 2018 09:15:03 +0000 (09:15 +0000)]
AMDGPU: Fix code size for return_to_epilog pseudo
llvm-svn: 338113
Matt Arsenault [Fri, 27 Jul 2018 09:04:41 +0000 (09:04 +0000)]
DAG: Remove unnecessary .str()
llvm-svn: 338112
Matt Arsenault [Fri, 27 Jul 2018 09:04:35 +0000 (09:04 +0000)]
PatternMatch: Add wrappers for fabs and canonicalize
llvm-svn: 338111
Ilya Biryukov [Fri, 27 Jul 2018 09:01:03 +0000 (09:01 +0000)]
Revert "ELF: Make --print-icf-sections output deterministic."
This reverts commit r338088. To unbreak our integrate.
The resulting lld output is different if compiled with '-funsigned-char'.
llvm-svn: 338110
Anastasis Grammenos [Fri, 27 Jul 2018 08:22:54 +0000 (08:22 +0000)]
Revert "[LV][DebugInfo] Set DL to the middle block Icmp instruction"
This reverts commit r338106.
llvm-svn: 338109
Roman Lebedev [Fri, 27 Jul 2018 07:27:14 +0000 (07:27 +0000)]
[AST] Sink 'part of explicit cast' down into ImplicitCastExpr
Summary:
As discussed in IRC with @rsmith, it is slightly not good to keep that in the `CastExpr` itself:
Given the explicit cast, which is represented in AST as an `ExplicitCastExpr` + `ImplicitCastExpr`'s,
only the `ImplicitCastExpr`'s will be marked as `PartOfExplicitCast`, but not the `ExplicitCastExpr` itself.
Thus, it is only ever `true` for `ImplicitCastExpr`'s, so we don't need to write/read/dump it for `ExplicitCastExpr`'s.
We don't need to worry that we write the `PartOfExplicitCast` in PCH after `CastExpr::path_iterator`,
since the `ExprImplicitCastAbbrev` is only used when the `NumBaseSpecs == 0`, i.e. there is no 'path'.
Reviewers: rsmith, rjmccall, erichkeane, aaron.ballman
Reviewed By: rsmith, erichkeane
Subscribers: vsk, cfe-commits, rsmith
Tags: #clang
Differential Revision: https://reviews.llvm.org/D49838
llvm-svn: 338108
Hiroshi Inoue [Fri, 27 Jul 2018 07:21:02 +0000 (07:21 +0000)]
[InstSimplify] tests for D48828: fold extraction from std::pair
This commit includes unit tests for D48828, which enhances InstSimplify to enable jump threading with a method whose return type is std::pair<int, bool> or std::pair<bool, int>.
I am going to commit the actual transformation later.
llvm-svn: 338107
Anastasis Grammenos [Fri, 27 Jul 2018 07:12:44 +0000 (07:12 +0000)]
[LV][DebugInfo] Set DL to the middle block Icmp instruction
Reviewers: hsaito
Differential Revision: https://reviews.llvm.org/D49746
llvm-svn: 338106
Craig Topper [Fri, 27 Jul 2018 06:54:13 +0000 (06:54 +0000)]
[Docs] Remove hard tab character from code block in optbisect documentation
llvm-svn: 338105
Xin Tong [Fri, 27 Jul 2018 06:50:45 +0000 (06:50 +0000)]
[NFC] Remove an empty line.
llvm-svn: 338104
Eric Fiselier [Fri, 27 Jul 2018 06:12:46 +0000 (06:12 +0000)]
Move Filesystem namespace definition out of a clang specific ifdef block.
llvm-svn: 338103
Tom Stellard [Fri, 27 Jul 2018 06:04:40 +0000 (06:04 +0000)]
AMDGPU/GlobalISel: Fix crash in regbankselect on non-power-of-2 types
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D49624
llvm-svn: 338102
Craig Topper [Fri, 27 Jul 2018 05:56:27 +0000 (05:56 +0000)]
[X86] Remove an unnecessary 'if' that prevented treating INT64_MAX and -INT64_MAX as power of 2 minus 1 in the multiply expansion code.
Not sure why they were being explicitly excluded, but I believe all the math inside the if works. I changed the absolute value to be uint64_t instead of int64_t so INT64_MIN+1 wouldn't be signed wrap.
llvm-svn: 338101
Bob Haarman [Fri, 27 Jul 2018 05:40:29 +0000 (05:40 +0000)]
[LTO] Don't internalize declarations
Summary:
Some links were failing with "Global is external, but doesn't have
external or weak linkage!" in ThinLTO builds with debug
information. This happened when we elide the body of a global that is
referenced by debug info. This results in a declaration, which we
would then internalize - but declarations cannot be internal. This
change avoids the problem by not internalizing these declarations.
Fixes PR38046.
Reviewers: pcc, tejohnson
Subscribers: mehdi_amini, aprantl, hiraditya, JDevlieghere, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D49777
llvm-svn: 338100
Fangrui Song [Fri, 27 Jul 2018 05:38:14 +0000 (05:38 +0000)]
Replace LLVM_ALIGNAS with alignas as a follow-up of r337330
The minimum required GCC version was raised to 4.8 (which started to support alignas) in r284497.
llvm-svn: 338099
Mike Edwards [Fri, 27 Jul 2018 04:41:37 +0000 (04:41 +0000)]
[WWW] Fixing file permissions for the .html pages.
llvm-svn: 338098
Craig Topper [Fri, 27 Jul 2018 04:29:10 +0000 (04:29 +0000)]
[X86] Add matching for another pattern of PMADDWD.
Summary:
This is the pattern you get from the loop vectorizer for something like this
int16_t A[1024];
int16_t B[1024];
int32_t C[512];
void pmaddwd() {
for (int i = 0; i != 512; ++i)
C[i] = (A[2*i]*B[2*i]) + (A[2*i+1]*B[2*i+1]);
}
In this case we will have (add (mul (build_vector), (build_vector)), (mul (build_vector), (build_vector))). This is different than the pattern we currently match which has the build_vectors between an add and a single multiply. I'm not sure what C code would get you that pattern.
Reviewers: RKSimon, spatel, zvi
Reviewed By: zvi
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49636
llvm-svn: 338097
Eric Fiselier [Fri, 27 Jul 2018 03:47:46 +0000 (03:47 +0000)]
Add libc++fs to the test deps, and not to the target 'cxx'.
llvm-svn: 338096
Eric Fiselier [Fri, 27 Jul 2018 03:42:58 +0000 (03:42 +0000)]
Attempt to unbreak *all the bots*
The bots were failing to build the cxx_filesystem target, so the
tests were failing. Though this does lead me to wonder how it
was ever working with c++experimental.
llvm-svn: 338095
Eric Fiselier [Fri, 27 Jul 2018 03:16:02 +0000 (03:16 +0000)]
Correctly mark the Filesystem status as complete.
llvm-svn: 338094
Eric Fiselier [Fri, 27 Jul 2018 03:07:09 +0000 (03:07 +0000)]
Implement <filesystem>
This patch implements the <filesystem> header and uses that
to provide <experimental/filesystem>.
Unlike other standard headers, the symbols needed for <filesystem>
have not yet been placed in libc++.so. Instead they live in the
new libc++fs.a library. Users of filesystem are required to link this
library. (Also note that libc++experimental no longer contains the
definition of <experimental/filesystem>, which now requires linking libc++fs).
The reason for keeping <filesystem> out of the dylib for now is that
it's still somewhat experimental, and the possibility of requiring an
ABI breaking change is very real. In the future the symbols will likely
be moved into the dylib, or the dylib will be made to link libc++fs automagically).
Note that moving the symbols out of libc++experimental may break user builds
until they update to -lc++fs. This should be OK, because the experimental
library provides no stability guarantees. However, I plan on looking into
ways we can force libc++experimental to automagically link libc++fs.
In order to use a single implementation and set of tests for <filesystem>, it
has been placed in a special `__fs` namespace. This namespace is inline in
C++17 onward, but not before that. As such implementation is available
in C++11 onward, but no filesystem namespace is present "directly", and
as such name conflicts shouldn't occur in C++11 or C++14.
llvm-svn: 338093
Chen Zheng [Fri, 27 Jul 2018 01:49:51 +0000 (01:49 +0000)]
[InstCombine] canonicalize abs pattern
Differential Revision: https://reviews.llvm.org/D48754
llvm-svn: 338092
Emmett Neyman [Fri, 27 Jul 2018 00:43:26 +0000 (00:43 +0000)]
added shared library to fix buildbot
Summary: added shared library to fix buildbot
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D49895
llvm-svn: 338091
Craig Topper [Fri, 27 Jul 2018 00:00:30 +0000 (00:00 +0000)]
[X86] When removing sign extends from gather/scatter indices, make sure we handle UpdateNodeOperands finding an existing node to CSE with.
If this happens the operands aren't updated and the existing node is returned. Make sure we pass this existing node up to the DAG combiner so that a proper replacement happens. Otherwise we get stuck in an infinite loop with an unoptimized node.
llvm-svn: 338090
Erik Pilkington [Thu, 26 Jul 2018 23:40:42 +0000 (23:40 +0000)]
[Sema] Fix a crash by completing a type before using it
Only apply this exception on a type that we're able to check.
rdar://
41903969
Differential revision: https://reviews.llvm.org/D49868
llvm-svn: 338089
Peter Collingbourne [Thu, 26 Jul 2018 23:34:35 +0000 (23:34 +0000)]
ELF: Make --print-icf-sections output deterministic.
The icf-safe.s test currently fails on 32-bit platforms because it uses
the --print-icf-sections flag and depends on the output appearing in
a specific order. However, this flag causes the output to depend on
the order of the sections in the Sections array, which depends on the
hash values returned from hash_combine, which happen to be different
for that test between 32-bit and 64-bit platforms.
This change makes the output deterministic by using xxHash64 instead of
hash_combine.
Differential Revision: https://reviews.llvm.org/D49877
llvm-svn: 338088
Mike Edwards [Thu, 26 Jul 2018 23:29:54 +0000 (23:29 +0000)]
[WWW] Removing my test file as the auto-deployment script has been fixed.
llvm-svn: 338087
Mike Edwards [Thu, 26 Jul 2018 23:23:40 +0000 (23:23 +0000)]
[WWW] Adding a test page to work out an auto-deployment issue.
llvm-svn: 338086
Craig Topper [Thu, 26 Jul 2018 23:22:11 +0000 (23:22 +0000)]
[SelectionDAGBuilder] Add masked loads to PendingLoads rather than calling DAG.setRoot.
Masked loads are calling DAG.getRoot rather than calling SelectionDAGBuilder::getRoot, which means the PendingLoads weren't emptied to update the root and create any needed TokenFactor. So it would be incorrect to call setRoot for the masked load.
This patch instead adds the masked load to PendingLoads so that the root doesn't get update until a store or scatter or something happens.. Alternatively, we could call SelectionDAGBuilder::getRoot before it, but that would create unnecessary serialization.
llvm-svn: 338085
Reid Kleckner [Thu, 26 Jul 2018 23:21:51 +0000 (23:21 +0000)]
Revert r338057 "[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name"
This broke clang/test/PCH/case-insensitive-include.c on Windows.
llvm-svn: 338084
Reid Kleckner [Thu, 26 Jul 2018 23:18:44 +0000 (23:18 +0000)]
[MS] Add L__FUNCSIG__ for compatibility
Clang already has L__FUNCTION__ as a workaround for dealing with
pre-processor code that expects to be able to do L##__FUNCTION__ in a
macro. This patch implements the same logic for __FUNCSIG__.
Fixes PR38295.
llvm-svn: 338083
Reid Kleckner [Thu, 26 Jul 2018 22:59:17 +0000 (22:59 +0000)]
[InstrProf] Use comdats on COFF for available_externally functions
Summary:
r262157 added ELF-specific logic to put a comdat on the __profc_*
globals created for available_externally functions. We should be able to
generalize that logic to all object file formats that support comdats,
i.e. everything other than MachO. This fixes duplicate symbol errors,
since on COFF, linkonce_odr doesn't make the symbol weak.
Fixes PR38251.
Reviewers: davidxl, xur
Subscribers: hiraditya, dmajor, llvm-commits, aheejin
Differential Revision: https://reviews.llvm.org/D49882
llvm-svn: 338082
Wolfgang Pieb [Thu, 26 Jul 2018 22:48:52 +0000 (22:48 +0000)]
[DWARF v5] Reposting r337981, which was reverted in r337997 due to a test failure in debuginfo_tests.
The test failure was caused by the compiler not emitting a __debug_ranges section with DWARF 4 and
earlier when no ranges are needed. The test checks for the existence regardless.
llvm-svn: 338081
Craig Topper [Thu, 26 Jul 2018 22:40:24 +0000 (22:40 +0000)]
[SelectionDAG] Add MLOAD/MSTORE/MGATHER/MSCATTER to AddNodeIDCustom to properly calculate their folding set ID to allow them to be CSEd.
llvm-svn: 338080
Craig Topper [Thu, 26 Jul 2018 22:40:22 +0000 (22:40 +0000)]
[DAGCombiner] Remove some calls to AddToWorklist that should be unnecessary.
The DAGCombiner has a system for ensuring all nodes are visited. It doesn't require an AddToWorkList for every node that is created by a combine.
llvm-svn: 338079
Zachary Turner [Thu, 26 Jul 2018 22:24:01 +0000 (22:24 +0000)]
Fix -Wsign-compare warning.
llvm-svn: 338078
Emmett Neyman [Thu, 26 Jul 2018 22:23:25 +0000 (22:23 +0000)]
Updated llvm-proto-fuzzer to execute the compiled code
Summary:
Made changes to the llvm-proto-fuzzer
- Added loop vectorizer optimization pass in order to have two IR versions
- Updated old fuzz target to handle two different IR versions
- Wrote code to execute both versions in memory
Reviewers: morehouse, kcc, alexshap
Reviewed By: morehouse
Subscribers: pcc, mgorny, cfe-commits, llvm-commits
Differential Revision: https://reviews.llvm.org/D49526
llvm-svn: 338077
Sanjin Sijaric [Thu, 26 Jul 2018 22:18:28 +0000 (22:18 +0000)]
[ARM64] [Windows] Follow MS X86_64 C++ ABI when passing structs
Summary: Microsoft's C++ object model for ARM64 is the same as that for X86_64.
For example, small structs with non-trivial copy constructors or virtual
function tables are passed indirectly. Currently, they are passed in registers
when compiled with clang.
Reviewers: rnk, mstorsjo, TomTan, haripul, javed.absar
Reviewed By: rnk, mstorsjo
Subscribers: kristof.beyls, chrib, llvm-commits, cfe-commits
Differential Revision: https://reviews.llvm.org/D49770
llvm-svn: 338076
Zachary Turner [Thu, 26 Jul 2018 22:13:39 +0000 (22:13 +0000)]
[MS Demangler] Properly handle function parameter back-refs.
Properly demangle function parameter back-references.
Previously we treated lists of function parameters and template
parameters the same. There are some important differences with regards
to back-references, and some less important differences regarding which
characters can appear before or after the name.
The important differences are that with a given type T, all instances of
a function parameter list share the same global back-ref table.
Specifically, if X and Y are function pointers, then there are 3
entities in the declaration X func(Y) which all affect and are affected
by the master parameter back-ref table:
1) The parameter list of X's function type
2) the parameter list of func itself
3) The parameter list of Y's function type.
The previous code would create a back-reference table that was local to
a single parameter list, so it would not be shared across parameter
lists.
This was discovered when porting ms-back-references.test from clang's
mangling tests. All of these tests should now pass with the new changes.
In doing so, I split the function for parsing template and function
parameters into two separate functions. This makes the template
parameter list parsing code in particular very small and easy to
understand now.
Differential Revision: https://reviews.llvm.org/D49875
llvm-svn: 338075
Alex Langford [Thu, 26 Jul 2018 21:55:14 +0000 (21:55 +0000)]
Add back lldb-framework-headers target
In r338058 we removed the target `lldb-framework-headers`, which mean
lldb-framework no longer depended on `framework_headers`, so they never
actually got generated. This is a partial revert of r338058: I added
back the lldb-framework-headers target, but the framework-header-fix.sh
script still runs on the copied headers.
llvm-svn: 338074
Keno Fischer [Thu, 26 Jul 2018 21:55:06 +0000 (21:55 +0000)]
[SCEV] Don't expand Wrap predicate using inttoptr in ni addrspaces
Summary:
In non-integral address spaces, we're not allowed to introduce inttoptr/ptrtoint
intrinsics. Instead, we need to expand any pointer arithmetic as geps on the
base pointer. Luckily this is a common task for SCEV, so all we have to do here
is hook up the corresponding helper function and add test case.
Fixes PR38290
Reviewers: sanjoy
Differential Revision: https://reviews.llvm.org/D49832
llvm-svn: 338073
Keno Fischer [Thu, 26 Jul 2018 21:55:03 +0000 (21:55 +0000)]
[SCEV] Add an expandAddToGEP overload for a single operand. NFC.
Only wanting to pass a single SCEV operand to use as the offset of
the GEP is a common operation. Right now this requires creating a
temporary stack array at every call site. Add an overload
that encapsulates that pattern and simplify the call sites.
Suggested-By: sanjoy (in https://reviews.llvm.org/D49832)
llvm-svn: 338072