Alexey Bataev [Fri, 20 Jan 2017 08:57:28 +0000 (08:57 +0000)]
[OPENMP] Fix for PR31643: Clang crashes when compiling code on Windows
with SEH and openmp
In some cituations (during codegen for Windows SEH constructs)
CodeGenFunction instance may have CurFn equal to nullptr. OpenMP related
code does not expect such situation during cleanup.
llvm-svn: 292590
Chandler Carruth [Fri, 20 Jan 2017 08:42:19 +0000 (08:42 +0000)]
[PM] Port LoopSink to the new pass manager.
Like several other loop passes (the vectorizer, etc) this pass doesn't
really fit the model of a loop pass. The critical distinction is that it
isn't intended to be pipelined together with other loop passes. I plan
to add some documentation to the loop pass manager to make this more
clear on that side.
LoopSink is also different because it doesn't really need a lot of the
infrastructure of our loop passes. For example, if there aren't loop
invariant instructions causing a preheader to exist, there is no need to
form a preheader. It also doesn't need LCSSA because this pass is
only involved in sinking invariant instructions from a preheader into
the loop, not reasoning about live-outs.
This allows some nice simplifications to the pass in the new PM where we
can directly walk the loops once without restructuring them.
Differential Revision: https://reviews.llvm.org/D28921
llvm-svn: 292589
Chandler Carruth [Fri, 20 Jan 2017 08:42:14 +0000 (08:42 +0000)]
[LoopSink] Trivial comment cleanup.
llvm-svn: 292588
Diana Picus [Fri, 20 Jan 2017 08:15:24 +0000 (08:15 +0000)]
[ARM] Use helpers for adding pred / CC operands. NFC
Hunt down some of the places where we use bare addReg(0) or addImm(AL).addReg(0)
and replace with add(condCodeOp()) and add(predOps()). This should make it
easier to understand what those operands represent (without having to look at
the definition of the instruction that we're adding to).
Differential Revision: https://reviews.llvm.org/D27984
llvm-svn: 292587
Craig Topper [Fri, 20 Jan 2017 07:12:30 +0000 (07:12 +0000)]
[AVX-512] Fix a couple test cases to not pass an undef mask to gather intrinsic. This could break if any future optimizations taken advantage of the undef.
llvm-svn: 292585
Jonas Paulsson [Fri, 20 Jan 2017 06:48:47 +0000 (06:48 +0000)]
[TargetLowering] Improve comment for setOperationAction().
Add a sentence that says that the type argument can refer to
either the type of a result, or that of an operand.
Review: Eli Friedman.
llvm-svn: 292584
Daniel Berlin [Fri, 20 Jan 2017 06:38:41 +0000 (06:38 +0000)]
NewGVN: Fix PR 31682, an overactive assert.
Part of the assert has been left active for further debugging.
The other part has been turned into a stat for tracking for the
moment.
llvm-svn: 292583
Eric Fiselier [Fri, 20 Jan 2017 06:27:34 +0000 (06:27 +0000)]
Still expose std::align_val_t in C++17 even if we don't have aligned new/delete.
r292564 disabled the aligned new/delete overloads on platforms without
posix_memalign. Unfortunately that patch also disabled the align_val_t
definition in C++17 as well.
This patch causes align_val_t to be exposed in C++17 regardless
of if we have the new/delete overloads.
llvm-svn: 292582
Mohammad Shahid [Fri, 20 Jan 2017 06:05:33 +0000 (06:05 +0000)]
[SLP] Add a base test for jumbled store
Change-Id: I905ce08a02c76a6896dcfd9629547417c99adc4a
llvm-svn: 292581
Saleem Abdulrasool [Fri, 20 Jan 2017 05:33:22 +0000 (05:33 +0000)]
llvm-cxxfilt: add missing includes from previous change
llvm-svn: 292580
Saleem Abdulrasool [Fri, 20 Jan 2017 05:27:09 +0000 (05:27 +0000)]
llvm-cxxfilt: fix program description
Fix a silly copy-paste error in the tool description. Take the
opportunity to add crash stack printing which will hopefully never be
needed.
llvm-svn: 292579
Peter Collingbourne [Fri, 20 Jan 2017 04:58:12 +0000 (04:58 +0000)]
ELF: Fix ICF crash on absolute symbol relocations.
If two sections contained relocations to absolute symbols with the same
value we would crash when trying to access their sections. Add a check that
both symbols point to sections before accessing their sections, and treat
absolute symbols as equal if their values are equal.
Differential Revision: https://reviews.llvm.org/D28935
llvm-svn: 292578
Eric Fiselier [Fri, 20 Jan 2017 04:39:17 +0000 (04:39 +0000)]
Refactor unique_ptr/shared_ptr deleter test types into single header.
llvm-svn: 292577
Saleem Abdulrasool [Fri, 20 Jan 2017 04:25:26 +0000 (04:25 +0000)]
llvm-cxxfilt: support `-t` to demangle types
By default c++filt demangles functions, though you can optionally pass
`-t` to have it decode types as well, behaving nearly identical to
`__cxa_demangle`. Add support for this mode.
llvm-svn: 292576
Matthias Braun [Fri, 20 Jan 2017 04:23:08 +0000 (04:23 +0000)]
BitVector: Fix undefined behaviour
Calling reset() on an empty BitVector would call memset with a nullptr
argument which is undefined behaviour.
This should fix the sanitizer bot.
llvm-svn: 292575
Matthias Braun [Fri, 20 Jan 2017 03:58:42 +0000 (03:58 +0000)]
Revert "LiveRegUnits: Add accumulateBackward() function"
This seems to be breaking some bots.
This reverts commit r292543.
llvm-svn: 292574
Saleem Abdulrasool [Fri, 20 Jan 2017 03:54:04 +0000 (03:54 +0000)]
Revert "Demangle: only demangle mangled symbols"
This reverts SVN r286795. This was incorrect the demangler is expected
to be able to demangle types as well as functions. This makes the
behaviour of itaniumDemangle similar to __cxa_demangle once more.
llvm-svn: 292573
Haicheng Wu [Fri, 20 Jan 2017 03:40:41 +0000 (03:40 +0000)]
Revert "Recommit "[InlineCost] Use TTI to check if GEP is free.""
This reverts commit r292570. The test still has problem.
llvm-svn: 292572
Jordan Rose [Fri, 20 Jan 2017 03:33:42 +0000 (03:33 +0000)]
[AST Printer] Print attributes on enum constants
The AST printer was dropping attributes on enumerators (enum
constants). Now it's not.
llvm-svn: 292571
Haicheng Wu [Fri, 20 Jan 2017 03:09:11 +0000 (03:09 +0000)]
Recommit "[InlineCost] Use TTI to check if GEP is free."
This recommits r292526 which is reverted in r292529 after fixing the test case.
The original summary:
Currently, a GEP is considered free only if its indices are all constant.
TTI::getGEPCost() can give target-specific more accurate analysis. TTI is
already used for the cost of many other instructions.
llvm-svn: 292570
Chandler Carruth [Fri, 20 Jan 2017 02:41:20 +0000 (02:41 +0000)]
[LoopInfo] Add helper methods to compute two useful orderings of the
loops in a function.
These are relatively confusing to talk about and compute correctly so it
seems really good to write down their implementation in one place. I've
replaced one place we needed this in the loop PM infrastructure and
I have another place in a pending patch that wants it.
We can't quite use this for the core loop PM walk because there we're
sometimes working on a sub-forest.
I'll add the expected unittests before committing this but wanted to
make sure folks were happy with these names / comments.
Credit goes to Richard Smith for the idea for naming the order where siblings
are in reverse program order but the tree traversal remains preorder.
Differential Revision: https://reviews.llvm.org/D28932
llvm-svn: 292569
Greg Parker [Fri, 20 Jan 2017 02:12:22 +0000 (02:12 +0000)]
[test] Remove an unwanted match for `UNSUPPORTED:`.
llvm-svn: 292568
Greg Parker [Fri, 20 Jan 2017 02:01:04 +0000 (02:01 +0000)]
[test] Remove a unwanted match for `XFAIL:`.
llvm-svn: 292567
Eric Fiselier [Fri, 20 Jan 2017 01:47:26 +0000 (01:47 +0000)]
Disable aligned new/delete on Apple platforms without posix_memalign
Summary:
This patch disables the aligned new/delet overloads on Apple platforms without `posix_memalign`. This fixes libc++.dylib build regressions on such platforms.
This fixes http://llvm.org/PR31448.
This patch should also be merged into the 4.0 release branch
Reviewers: mclow.lists, rsmith, dexonsmith, jeremyhu
Reviewed By: mclow.lists
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D28931
llvm-svn: 292564
Ahmed Bougacha [Fri, 20 Jan 2017 01:37:24 +0000 (01:37 +0000)]
[AArch64][GlobalISel] Widen scalar int->fp conversions.
It's incorrect to ignore the higher bits of the integer source.
Teach the legalizer how to widen it.
llvm-svn: 292563
Antonio Maiorano [Fri, 20 Jan 2017 01:22:42 +0000 (01:22 +0000)]
clang-format: fix fallback style set to "none" not always formatting
This fixes clang-format not formatting if fallback-style is explicitly set to
"none", and either a config file is found or YAML is passed in without a
"BasedOnStyle". With this change, passing "none" in these cases will have no
affect, and LLVM style will be used as the base style.
Differential Revision: https://reviews.llvm.org/D28844
llvm-svn: 292562
Richard Smith [Fri, 20 Jan 2017 01:19:46 +0000 (01:19 +0000)]
PR31701: Fix crash on invalid caused by parsing a dependent initializer when we
don't know we're in a dependent context.
llvm-svn: 292561
Eric Fiselier [Fri, 20 Jan 2017 01:13:49 +0000 (01:13 +0000)]
[NFC] Group aligned new/delete definitions together in new.cpp
This patch is cleanup to prepare for future changes
llvm-svn: 292560
Richard Smith [Fri, 20 Jan 2017 01:08:15 +0000 (01:08 +0000)]
Fix documentation typo.
llvm-svn: 292559
Richard Smith [Fri, 20 Jan 2017 00:57:59 +0000 (00:57 +0000)]
Add documentation for constexpr string builtin support.
llvm-svn: 292558
Eric Fiselier [Fri, 20 Jan 2017 00:57:08 +0000 (00:57 +0000)]
Fix handling of Apple target triple when checking the ABI lists.
The check-cxx-abilist rule uses TARGET_TRIPLE to determine which
ABI list to check. However the triple on Apple contains the darwin
version which changes frequently, but libc++ doesn't need
different ABI lists for each darwin version.
This patch strips the minor version and patchlevel from TARGET_TRIPLE
before using it to determine the ABI list.
llvm-svn: 292557
Michael Kuperstein [Fri, 20 Jan 2017 00:47:32 +0000 (00:47 +0000)]
[PM] Attempt to pacify windows bots.
Another difference in type pretty-printing, this one windows-specific.
llvm-svn: 292556
Richard Smith [Fri, 20 Jan 2017 00:45:35 +0000 (00:45 +0000)]
P0426: Make the library implementation of constexpr char_traits a little easier
by providing a memchr builtin that returns char* instead of void*.
Also add a __has_feature flag to indicate the presence of constexpr forms of
the relevant <string> functions.
llvm-svn: 292555
Stanislav Mekhanoshin [Fri, 20 Jan 2017 00:44:31 +0000 (00:44 +0000)]
[AMDGPU] Prevent spills before exec mask is restored
Inline spiller can decide to move a spill as early as possible in the basic block.
It will skip phis and label, but we also need to make sure it skips instructions
in the basic block prologue which restore exec mask.
Added isPositionLike callback in TargetInstrInfo to detect instructions which
shall be skipped in addition to common phis, labels etc.
Differential Revision: https://reviews.llvm.org/D27997
llvm-svn: 292554
Justin Bogner [Fri, 20 Jan 2017 00:30:17 +0000 (00:30 +0000)]
GlobalISel: Add a note about how we're being a bit loose with memory operands
The logic in r292461 is conservatively correct, but we should revisit
this later. Add a TODO so we don't forget.
llvm-svn: 292553
Ahmed Bougacha [Fri, 20 Jan 2017 00:30:09 +0000 (00:30 +0000)]
[AArch64][GlobalISel] Split FP conversion legalizer tests. NFC.
Big functions with large vreg # are quite unwieldy to update.
Change it to have one function per test (it does increase boilerplate,
but makes the core hopefully more readable and maintanable).
llvm-svn: 292552
Ahmed Bougacha [Fri, 20 Jan 2017 00:30:06 +0000 (00:30 +0000)]
[AArch64][GlobalISel] Split legalizer combine tests. NFC.
Big functions with large vreg # are quite unwieldy to update. This test
also relied on legal s8 operations which we're considering removing.
Change it to have one function per test (it does increase boilerplate,
but makes the core hopefully more readable and maintanable), and use
100% legal operations throughout.
llvm-svn: 292551
Ahmed Bougacha [Fri, 20 Jan 2017 00:29:59 +0000 (00:29 +0000)]
[MIRParser] Allow generic register specification on operand.
This completes r292321 by adding support for generic registers, e.g.:
%2:_(s32) = G_ADD %0, %1
llvm-svn: 292550
Kuba Mracek [Fri, 20 Jan 2017 00:25:01 +0000 (00:25 +0000)]
[lit] Limit parallelism of sanitizer tests on Darwin [compiler-rt part, take 2]
Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests.
This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests.
Differential Revision: https://reviews.llvm.org/D28420
llvm-svn: 292549
Kuba Mracek [Fri, 20 Jan 2017 00:24:32 +0000 (00:24 +0000)]
[lit] Limit parallelism of sanitizer tests on Darwin [llvm part, take 2]
Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests.
This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests.
Differential Revision: https://reviews.llvm.org/D28420
llvm-svn: 292548
Justin Bogner [Fri, 20 Jan 2017 00:24:30 +0000 (00:24 +0000)]
GlobalISel: Only set FailedISel on dropped dbg intrinsics when using fallback
It's easier to test the non-fallback path if we just drop these
intrinsics for now, like we did before we added the fallback path.
We'll obviously need to fix this properly, but the fixme for that is
already here.
llvm-svn: 292547
Anna Thomas [Fri, 20 Jan 2017 00:21:33 +0000 (00:21 +0000)]
[AliasAnalysis] Fences do not modify constant memory location
Summary:
Fence instructions are currently marked as `ModRef` for all memory locations.
We can improve this for constant memory locations (such as constant globals),
since fence instructions cannot modify these locations.
This helps us to forward constant loads across fences (added test case in GVN).
There were no changes in behaviour for similar test cases in early-cse and licm.
Reviewers: dberlin, sanjoy, reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28914
llvm-svn: 292546
Richard Smith [Fri, 20 Jan 2017 00:20:39 +0000 (00:20 +0000)]
Finish implementation of C++ DR1310 (wg21.link/cwg1310).
Diagnose the case when a dependent template name instantiates to an
injected-class-name outside a nested-name-specifier.
llvm-svn: 292545
Justin Bogner [Fri, 20 Jan 2017 00:16:19 +0000 (00:16 +0000)]
GlobalISel: Pass the MachineFunction in to reportSelectionError directly
Rather than trying to find MF based on the possibly-null MI we've
passed in here, just pass it in directly. It's already available at
all callers anyway.
llvm-svn: 292544
Matthias Braun [Fri, 20 Jan 2017 00:16:17 +0000 (00:16 +0000)]
LiveRegUnits: Add accumulateBackward() function
This function can be used to accumulate the set of all read and modified
register in a sequence of instructions.
Use this code in AArch64A57FPLoadBalancing::scavengeRegister() to prove
the concept.
- The AArch64A57LoadBalancing code is using a backwards analysis now
which is irrespective of kill flags. This is the main motivation for
this change.
Differential Revision: http://reviews.llvm.org/D22082
llvm-svn: 292543
Matthias Braun [Fri, 20 Jan 2017 00:16:14 +0000 (00:16 +0000)]
CodeGen: Add/Factor out LiveRegUnits class; NFCI
This is a set of register units intended to track register liveness, it
is similar in spirit to LivePhysRegs.
You can also think of this as the liveness tracking parts of the
RegisterScavenger factored out into an own class.
This was proposed in http://llvm.org/PR27609
Differential Revision: http://reviews.llvm.org/D21916
llvm-svn: 292542
Eric Fiselier [Fri, 20 Jan 2017 00:00:31 +0000 (00:00 +0000)]
Fix demangle helper after r286788
llvm-svn: 292541
Tim Northover [Thu, 19 Jan 2017 23:59:35 +0000 (23:59 +0000)]
AArch64: fall back to DAG ISel for inline assembly.
We can't currently handle "calls" to inlineasm strings so it's better to let
the DAG handle it than generate rubbish.
llvm-svn: 292540
Eric Fiselier [Thu, 19 Jan 2017 23:48:05 +0000 (23:48 +0000)]
Adjust msvc_stdlib_force_include.hpp to handle clang++
Summary: This patch adjusts the newly added `msvc_stdlib_force_include.hpp` so that it also works when used with `clang++`.
Reviewers: STL_MSFT
Reviewed By: STL_MSFT
Differential Revision: https://reviews.llvm.org/D28917
llvm-svn: 292539
Zachary Turner [Thu, 19 Jan 2017 23:44:14 +0000 (23:44 +0000)]
Fix a few more build errors.
llvm-svn: 292538
Zachary Turner [Thu, 19 Jan 2017 23:41:11 +0000 (23:41 +0000)]
Fix incorrectly formed assert statement.
llvm-svn: 292537
Michael Kuperstein [Thu, 19 Jan 2017 23:39:28 +0000 (23:39 +0000)]
[PM] Make default pipeline test for the new PM strict
Use CHECK-NEXT to verify that a test breaks whenever unexpected passes,
analyses, or invalidations show up in default pipelines. The test case
is constructed so that we don't expect to invalidate anything, and needs
to be kept that way.
The test is slightly less strict than we'd like because of differences
in type pretty-printing.
(Right now it does show some invalidations - all of those are intentional
and temporary.)
Differential Revision: https://reviews.llvm.org/D28887
llvm-svn: 292536
Zachary Turner [Thu, 19 Jan 2017 23:31:24 +0000 (23:31 +0000)]
[pdb] Add HashTable data structure.
This was being parsed / serialized ad-hoc inside the code
for a specific PDB stream. But this data structure is used
in multiple ways / places within the PDB format. To be able
to re-use it we need to raise this code out and make it more
generic. In doing so, a number of bugs are fixed in the
original implementation, and support is added for growing
the hash table and deleting items from the hash table,
which had either been omitted or incorrect implemented in
the initial version.
Differential Revision: https://reviews.llvm.org/D28715
llvm-svn: 292535
Michael Kuperstein [Thu, 19 Jan 2017 23:22:55 +0000 (23:22 +0000)]
Revert r292530 since it breaks buildbots.
llvm-svn: 292534
Dehao Chen [Thu, 19 Jan 2017 23:20:31 +0000 (23:20 +0000)]
clang-format SampleProfile.cpp (NFC)
llvm-svn: 292533
Peter Collingbourne [Thu, 19 Jan 2017 23:10:14 +0000 (23:10 +0000)]
LTO: Flush the resolution file after writing to it.
Without this the file could be truncated if the linker crashes.
llvm-svn: 292532
Davide Italiano [Thu, 19 Jan 2017 23:07:51 +0000 (23:07 +0000)]
[SCCP] Teach the pass how to handle `div` with overdefined operands.
This can prove that:
extern int f;
int g() {
int x = 0;
for (int i = 0; i < 365; ++i) {
x /= f;
}
return x;
}
always returns zero. Thanks to Sanjoy for confirming this
transformation actually made sense (bugs are mine).
llvm-svn: 292531
Michael Kuperstein [Thu, 19 Jan 2017 22:55:46 +0000 (22:55 +0000)]
[PM] Make default pipeline test for the new PM strict
Use CHECK-NEXT to verify that a test breaks whenever unexpected passes,
analyses, or invalidations show up in default pipelines. The test case
is constructed so that we don't expect to invalidate anything, and needs
to be kept that way.
(Right now it does show some invalidations - all of those are intentional
and temporary.)
Differential Revision: https://reviews.llvm.org/D28887
llvm-svn: 292530
Haicheng Wu [Thu, 19 Jan 2017 22:51:03 +0000 (22:51 +0000)]
Revert "[InlineCost] Use TTI to check if GEP is free."
This reverts commit r292526. The test case has problem.
llvm-svn: 292529
Simon Pilgrim [Thu, 19 Jan 2017 22:41:22 +0000 (22:41 +0000)]
[SelectionDAG] Improve knownbits handling of UMIN/UMAX (PR31293)
This patch improves the knownbits logic for unsigned integer min/max opcodes.
For UMIN we know that the result will have the maximum of the inputs' known leading zero bits in the result, similarly for UMAX the maximum of the inputs' leading one bits.
This is particularly useful for simplifying clamping patterns,. e.g. as SSE doesn't have a uitofp instruction we want to use sitofp instead where possible and for that we need to confirm that the top bit is not set.
Differential Revision: https://reviews.llvm.org/D28853
llvm-svn: 292528
Haicheng Wu [Thu, 19 Jan 2017 22:28:34 +0000 (22:28 +0000)]
[InlineCost] Use TTI to check if GEP is free.
Currently, a GEP is considered free only if its indices are all constant.
TTI::getGEPCost() can give target-specific more accurate analysis. TTI is
already used for the cost of many other instructions.
Differential Revision: https://reviews.llvm.org/D28693
llvm-svn: 292526
Alex Shlyapnikov [Thu, 19 Jan 2017 22:15:54 +0000 (22:15 +0000)]
Whenever reasonable, merge ASAN quarantine batches to save memory.
Summary:
There are cases when thread local quarantine drains almost empty
quarantine batches into the global quarantine. The current approach leaves
them almost empty, which might create a huge memory overhead (each batch
is 4K/8K, depends on bitness).
Reviewers: eugenis
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D28068
llvm-svn: 292525
Hans Wennborg [Thu, 19 Jan 2017 21:33:13 +0000 (21:33 +0000)]
Don't inline dllimport functions referencing non-imported methods
This is another follow-up to r246338. I had assumed methods were already
handled by the AST visitor, but turns out they weren't.
llvm-svn: 292522
Stanislav Mekhanoshin [Thu, 19 Jan 2017 21:26:22 +0000 (21:26 +0000)]
[AMDGPU] Add exec copy to LiveIntervals in SILowerControlFlow::emitElse
This instruction is missing from LiveIntervals.
I'm not aware of any problems because of this though.
Differential Revision: https://reviews.llvm.org/D28879
llvm-svn: 292521
Kostya Serebryany [Thu, 19 Jan 2017 21:14:47 +0000 (21:14 +0000)]
[libFuzzer] ensure that entries in PersistentAutoDictionary are not empty
llvm-svn: 292520
Davide Italiano [Thu, 19 Jan 2017 21:07:42 +0000 (21:07 +0000)]
[SCCP] Update comment in visitBinaryOp() after recent changes.
llvm-svn: 292519
Richard Smith [Thu, 19 Jan 2017 21:00:13 +0000 (21:00 +0000)]
PR13403 (+duplicates): implement C++ DR1310 (wg21.link/cwg1310).
Under this defect resolution, the injected-class-name of a class or class
template cannot be used except in very limited circumstances (when declaring a
constructor, in a nested-name-specifier, in a base-specifier, or in an
elaborated-type-specifier). This is apparently done to make parsing easier, but
it's a pain for us since we don't know whether a template-id using the
injected-class-name is valid at the point when we annotate it (we don't yet
know whether the template-id will become part of an elaborated-type-specifier).
As a tentative resolution to a perceived language defect, mem-initializer-ids
are added to the list of exceptions here (they generally follow the same rules
as base-specifiers).
When the reference to the injected-class-name uses the 'typename' or 'template'
keywords, we permit it to be used to name a type or template as an extension;
other compilers also accept some cases in this area. There are also a couple of
corner cases with dependent template names that we do not yet diagnose, but
which will also get this treatment.
llvm-svn: 292518
Serge Rogatch [Thu, 19 Jan 2017 20:27:11 +0000 (20:27 +0000)]
[XRay][Arm] Enable back XRay testing on Arm32 and fix the failing tests
Summary:
Testing of XRay was occasionally disabled on 32-bit Arm targets (someone assumed that XRay was supported on 64-bit targets only). This patch should fix that problem. Also here the instruction&data cache incoherency problem is fixed, because it may be causing a test to fail.
This patch is one of a series: see also
- https://reviews.llvm.org/D28624
Reviewers: dberris, rengolin
Reviewed By: rengolin
Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown
Differential Revision: https://reviews.llvm.org/D28623
llvm-svn: 292517
Serge Rogatch [Thu, 19 Jan 2017 20:24:23 +0000 (20:24 +0000)]
[XRay][Arm] Repair XRay table emission on Arm32 and add tests to identify such problem earlier
Summary:
Emission of XRay table was occasionally disabled for Arm32, but this bug was not then detected because earlier (also by mistake) testing of XRay was occasionally disabled on 32-bit Arm targets. This patch should fix that problem and detect such problems in the future.
This patch is one of a series, see also
- https://reviews.llvm.org/D28623
Reviewers: rengolin, dberris
Reviewed By: dberris
Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown
Differential Revision: https://reviews.llvm.org/D28624
llvm-svn: 292516
Chad Rosier [Thu, 19 Jan 2017 20:06:32 +0000 (20:06 +0000)]
[Assembler] Improve error when unable to evaluate expression.
Add a SMLoc to MCExpr. Most code does not generate or consume the SMLoc (yet).
Patch by Sanne Wouda <sanne.wouda@arm.com>!
Differential Revision: https://reviews.llvm.org/D28861
llvm-svn: 292515
Evgeniy Stepanov [Thu, 19 Jan 2017 20:04:11 +0000 (20:04 +0000)]
Fix aliases to thumbfunc-based exprs to be thumbfunc.
If F is a Thumb function symbol, and G = F + const, and G is a
function symbol, then G is Thumb. Because what else could it be?
Differential Revision: https://reviews.llvm.org/D28878
llvm-svn: 292514
Rafael Espindola [Thu, 19 Jan 2017 19:51:02 +0000 (19:51 +0000)]
Also define 'end' if it is present in a .so.
I don't know of anything using it, but we should handle it like _end.
llvm-svn: 292513
Rafael Espindola [Thu, 19 Jan 2017 19:43:34 +0000 (19:43 +0000)]
Create _end symbol even if a .so defines it.
The freebsd sbrk implementation uses _end to find the initial value of
brk, so it has to be defined in the main binary.
This should fix the emacs build.
llvm-svn: 292512
Kostya Serebryany [Thu, 19 Jan 2017 19:38:12 +0000 (19:38 +0000)]
[libFuzzer] improve -minimize_crash: honor -artifact_prefix= and don't special case 2-byte inputs
llvm-svn: 292511
Xin Tong [Thu, 19 Jan 2017 19:31:40 +0000 (19:31 +0000)]
Improve what can be promoted in LICM.
Summary:
In case of non-alloca pointers, we check for whether it is a pointer
from malloc-like calls and it is not captured. In such case, we can
promote the pointer, as the caller will have no way to access this pointer
even if there is unwinding in middle of the loop.
Reviewers: hfinkel, sanjoy, reames, eli.friedman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28834
llvm-svn: 292510
Kostya Serebryany [Thu, 19 Jan 2017 19:07:26 +0000 (19:07 +0000)]
[libFuzzer] add two tests for experimenting with equivalence fuzzing
llvm-svn: 292509
Manman Ren [Thu, 19 Jan 2017 19:05:55 +0000 (19:05 +0000)]
Module: Improve diagnostic message when cxx modules are disabled and @import is used in Objective CXX.
rdar://problem/
19399671
llvm-svn: 292508
Easwaran Raman [Thu, 19 Jan 2017 18:53:16 +0000 (18:53 +0000)]
Add an interface to scale the frequencies of a set of blocks.
The scaling is done with reference to the the new frequency of a reference block.
Differential Revision: https://reviews.llvm.org/D28535
llvm-svn: 292507
Davide Italiano [Thu, 19 Jan 2017 18:51:56 +0000 (18:51 +0000)]
[InstCombine] Simplify gep (gep p, a), (b-a)
Patch by Andrea Canciani.
Differential Revision: https://reviews.llvm.org/D27413
llvm-svn: 292506
Weiming Zhao [Thu, 19 Jan 2017 18:46:11 +0000 (18:46 +0000)]
[Builtin] [ARM] Update CMake to support the build of armv6m
Summary:
Setting -DCOMPILER_RT_TEST_TARGET_TRIPLE=armv6m-none-eabi will enable the build of builtin functions ARMv6m.
Currently, only those asms that support armv6m are added.
TODO:All asm sin ARM_EABI_Sources are ported for thumb1 so Thumb1_EABI_Sources will be deprecated.
Reviewers: rengolin, compnerd
Reviewed By: compnerd
Subscribers: aemerson, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D28463
llvm-svn: 292504
Simon Pilgrim [Thu, 19 Jan 2017 18:18:32 +0000 (18:18 +0000)]
[X86][SSE] Improve comments describing combineTruncatedArithmetic. NFCI.
llvm-svn: 292502
Kevin Enderby [Thu, 19 Jan 2017 18:07:22 +0000 (18:07 +0000)]
Remove this test from the r292500 commit till Chris and I figure out
why it is failing on a couple of build bots.
llvm-svn: 292501
Kevin Enderby [Thu, 19 Jan 2017 17:36:31 +0000 (17:36 +0000)]
Add support for the new LC_NOTE load command.
It describes a region of arbitrary data included in a Mach-O file.
Its initial use is to record extra data in MH_CORE files.
rdar://
30001545
rdar://
30001731
llvm-svn: 292500
Hafiz Abid Qadeer [Thu, 19 Jan 2017 17:32:50 +0000 (17:32 +0000)]
Provide a substitute to load command of gdb.
For bare-metal targets, lldb was missing a command like 'load' in gdb
which can be used to create executable image on the target. This was
discussed in
http://lists.llvm.org/pipermail/lldb-dev/2016-December/011752.html
This commits adds an option to "target module load" command to provide
that functionality. It does not set the PC to entry address which will
be done separately.
Reviewed in https://reviews.llvm.org/D28804
llvm-svn: 292499
Malcolm Parsons [Thu, 19 Jan 2017 17:19:22 +0000 (17:19 +0000)]
[Sema] Reword unused lambda capture warning
Summary:
The warning doesn't know why the variable was looked up but not
odr-used, so reword it to not claim that it was used in an unevaluated
context.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D28902
llvm-svn: 292498
Alex Lorenz [Thu, 19 Jan 2017 17:17:57 +0000 (17:17 +0000)]
[Sema] Fix PR28181 by avoiding calling BuildOverloadedBinOp in C mode
rdar://
28532840
Differential Revision: https://reviews.llvm.org/D25213
llvm-svn: 292497
Sumanth Gundapaneni [Thu, 19 Jan 2017 16:54:04 +0000 (16:54 +0000)]
[Hexagon] Linux linker does not support .gnu-hash
Hexagon Linux dynamic loader does not use (in fact does not support)
.gnu-hash
Differential Revision: https://reviews.llvm.org/D28865
llvm-svn: 292496
Simon Pilgrim [Thu, 19 Jan 2017 16:25:02 +0000 (16:25 +0000)]
[X86][SSE] Attempt to pre-truncate arithmetic operations that have already been extended
As discussed on D28219 - it is profitable to combine trunc(binop (s/zext(x), s/zext(y)) to binop(trunc(s/zext(x)), trunc(s/zext(y))) assuming the trunc(ext()) will simplify further
llvm-svn: 292493
Sanjay Patel [Thu, 19 Jan 2017 16:12:10 +0000 (16:12 +0000)]
[InstCombine] icmp Pred (shl nsw X, C1), C0 --> icmp Pred X, C0 >> C1
Try harder to fold icmp with shl nsw as discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/108749.html
This is similar to the 'shl nuw' transforms that were added with D25913.
This may eventually help solve:
https://llvm.org/bugs/show_bug.cgi?id=30773
Differential Revision: https://reviews.llvm.org/D28406
llvm-svn: 292492
Felix Berger [Thu, 19 Jan 2017 15:51:10 +0000 (15:51 +0000)]
[clang-tidy] Do not trigger move fix for non-copy assignment operators in performance-unnecessary-value-param check
Reviewers: alexfh, sbenza, malcolm.parsons
Subscribers: JDevlieghere, cfe-commits
Differential Revision: https://reviews.llvm.org/D28899
llvm-svn: 292491
Marshall Clow [Thu, 19 Jan 2017 15:30:36 +0000 (15:30 +0000)]
Mark two of the TS implementations as 'in progress'
llvm-svn: 292490
Pavel Labath [Thu, 19 Jan 2017 15:26:04 +0000 (15:26 +0000)]
Refactor logging in NativeProcessLinux
Use the LLDB_LOG macro instead of the more verbose if(log) ... syntax.
I have also consolidated the log channels (everything now goes to the posix
channel, instead of a mixture of posix and lldb), and cleaned up some of the
more convoluted log statements.
llvm-svn: 292489
Hafiz Abid Qadeer [Thu, 19 Jan 2017 15:11:01 +0000 (15:11 +0000)]
Avoid unused variable warning when assert is disabled.
llvm-svn: 292488
Simon Pilgrim [Thu, 19 Jan 2017 15:03:00 +0000 (15:03 +0000)]
[X86][SSE] Added tests for pre-truncating arithmetic operations that have already been extended
As discussed on D28219 - it is profitable to combine trunc(binop (s/zext(x), s/zext(y)) to binop(trunc(s/zext(x)), trunc(s/zext(y))) assuming the trunc(ext()) will simplify further
llvm-svn: 292487
Tobias Grosser [Thu, 19 Jan 2017 14:12:45 +0000 (14:12 +0000)]
BlockGenerator: Do not redundantly reload from PHI-allocas in non-affine stmts
Before this change we created an additional reload in the copy of the incoming
block of a PHI node to reload the incoming value, even though the necessary
value has already been made available by the normally generated scalar loads.
In this change, we drop the code that generates this redundant reload and
instead just reuse the scalar value already available.
Besides making the generated code slightly cleaner, this change also makes sure
that scalar loads go through the normal logic, which means they can be remapped
(e.g. to array slots) and corresponding code is generated to load from the
remapped location. Without this change, the original scalar load at the
beginning of the non-affine region would have been remapped, but the redundant
scalar load would continue to load from the old PHI slot location.
It might be possible to further simplify the code in addOperandToPHI,
but this would not only mean to pull out getNewValue, but to also change the
insertion point update logic. As this did not work when trying it the first
time, this change is likely not trivial. To not introduce bugs last minute, we
postpone further simplications to a subsequent commit.
We also document the current behavior a little bit better.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D28892
llvm-svn: 292486
Mikael Holmen [Thu, 19 Jan 2017 13:55:55 +0000 (13:55 +0000)]
[DAG] Don't increase SDNodeOrder for dbg.value/declare.
Summary:
The SDNodeOrder is saved in the IROrder field in the SDNode, and this
field may affects scheduling. Thus, letting dbg.value/declare increase
the order numbers may in turn affect scheduling.
Because of this change we also need to update the code deciding when
dbg values should be output, in ScheduleDAGSDNodes.cpp/ProcessSDDbgValues.
Dbg values now have the same order as the SDNode they are connected to,
not the following orders.
Test cases provided by Florian Hahn.
Reviewers: bogner, aprantl, sunfish, atrick
Reviewed By: atrick
Subscribers: fhahn, probinson, andreadb, llvm-commits, MatzeB
Differential Revision: https://reviews.llvm.org/D25318
llvm-svn: 292485
Malcolm Parsons [Thu, 19 Jan 2017 13:38:19 +0000 (13:38 +0000)]
[docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing
Summary:
Docs for clang::Decl and clang::TemplateSpecializationType have
not been generated since LLVM_ALIGNAS was added to them.
Tell Doxygen to expand LLVM_ALIGNAS to nothing as described at
https://www.stack.nl/~dimitri/doxygen/manual/preprocessing.html
Reviewers: aaron.ballman, klimek, alexfh
Subscribers: ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D28850
llvm-svn: 292484
Malcolm Parsons [Thu, 19 Jan 2017 13:37:42 +0000 (13:37 +0000)]
[docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing
Summary:
Docs for clang::Decl and clang::TemplateSpecializationType have
not been generated since LLVM_ALIGNAS was added to them.
Tell Doxygen to expand LLVM_ALIGNAS to nothing as described at
https://www.stack.nl/~dimitri/doxygen/manual/preprocessing.html
Reviewers: aaron.ballman, klimek, alexfh
Subscribers: ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D28850
llvm-svn: 292483
Mikael Holmen [Thu, 19 Jan 2017 13:35:13 +0000 (13:35 +0000)]
Test commit access, remove trailing whitespace
llvm-svn: 292482
Kristof Beyls [Thu, 19 Jan 2017 13:32:14 +0000 (13:32 +0000)]
[GlobalISel] Pointers are legal operands for G_SELECT on AArch64
Differential Revision: https://reviews.llvm.org/D28805
llvm-svn: 292481