Dean Michael Berris [Fri, 12 May 2017 05:13:11 +0000 (05:13 +0000)]
[XRay][compiler-rt] Only run custom event logging in x86_64-linux
We only have an implementation in x86_64 that works for the
patching/unpatching and runtime support (trampolines).
Follow-up to D30630.
llvm-svn: 302873
Zachary Turner [Fri, 12 May 2017 04:51:55 +0000 (04:51 +0000)]
Rename Error -> Status.
This renames the LLDB error class to Status, as discussed
on the lldb-dev mailing list.
A change of this magnitude cannot easily be done without
find and replace, but that has potential to catch unwanted
occurrences of common strings such as "Error". Every effort
was made to find all the obvious things such as the word "Error"
appearing in a string, etc, but it's possible there are still
some lingering occurences left around. Hopefully nothing too
serious.
llvm-svn: 302872
Eric Fiselier [Fri, 12 May 2017 03:53:56 +0000 (03:53 +0000)]
Fix C++03 test failures caused by static_assert emulation
llvm-svn: 302871
Eric Fiselier [Fri, 12 May 2017 03:38:28 +0000 (03:38 +0000)]
Cleanup test issues reported by STL @ Microsoft.
This patch cleans up a number of issues reported by STL, including:
1) Fix duplicate is_convertible test.
2) Move non-standard reference_wrapper tests under test/libcxx
3) Fix assumption that sizeof(wchar_t) == 32 in the codecvt and
wstring_convert tests.
llvm-svn: 302870
Eric Fiselier [Fri, 12 May 2017 03:35:53 +0000 (03:35 +0000)]
Remove non-standard basic_string_view::clear() member.
This patch removes the clear() member from <string_view>. The
modifier was removed from the TS before it ever landed in the standard.
There is no reason libc++ should be providing this method.
llvm-svn: 302869
Hongbin Zheng [Fri, 12 May 2017 02:21:50 +0000 (02:21 +0000)]
[Polly] Remove unused header
llvm-svn: 302868
Chandler Carruth [Fri, 12 May 2017 02:19:59 +0000 (02:19 +0000)]
[PM/Unswitch] Teach the new simple loop unswitch to handle loop
invariant PHI inputs and to rewrite PHI nodes during the actual
unswitching.
The checking is quite easy, but rewriting the PHI nodes is somewhat
surprisingly challenging. This should handle both branches and switches.
I think this is now a full featured trivial unswitcher, and more full
featured than the trivial cases in the old pass while still being (IMO)
somewhat simpler in how it works.
Next up is to verify its correctness in more widespread testing, and
then to add non-trivial unswitching.
Thanks to Davide and Sanjoy for the excellent review. There is one
remaining question that I may address in a follow-up patch (see the
review thread for details) but it isn't related to the functionality
specifically.
Differential Revision: https://reviews.llvm.org/D32699
llvm-svn: 302867
Hongbin Zheng [Fri, 12 May 2017 02:17:15 +0000 (02:17 +0000)]
[Polly] Generate more 'canonical' induction variable
Today Polly generates induction variable in this way:
polly.indvar = phi 0, polly.indvar.next
...
polly.indvar.next = polly.indvar + stide
polly.loop_cond = predicate polly.indvar, (UB - stride)
Instead of:
polly.indvar = phi 0, polly.indvar.next
...
polly.indvar.next = polly.indvar + stide
polly.loop_cond = predicate polly.indvar.next, UB
The way Polly generate induction variable cause some problem in the indvar simplify pass.
This patch make polly generate the later form, by assuming the induction variable never overflow
Differential Revision: https://reviews.llvm.org/D33089
llvm-svn: 302866
Eric Fiselier [Fri, 12 May 2017 02:02:09 +0000 (02:02 +0000)]
Move POSIX specific test under test/libcxx subdirectory
llvm-svn: 302865
Eric Fiselier [Fri, 12 May 2017 01:49:32 +0000 (01:49 +0000)]
Move tests for libc++ configurations into libcxx/ test subdirectory
llvm-svn: 302864
Craig Topper [Fri, 12 May 2017 01:46:01 +0000 (01:46 +0000)]
[APInt] Add a utility method to change the bit width and storage size of an APInt.
Summary:
This adds a resize method to APInt that manages deleting/allocating storage for an APInt and changes its bit width. Use this to simplify code in copy assignment and divide.
The assignment code in particular was overly complicated. Treating every possible case as a separate implementation. I'm also pretty sure the clearUnusedBits code at the end was unnecessary. Since we always copying whole words from the source APInt. All unused bits should be clear in the source.
Reviewers: hans, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33073
llvm-svn: 302863
Eric Fiselier [Fri, 12 May 2017 01:44:51 +0000 (01:44 +0000)]
Fix or move tests with non-standard assumptions
llvm-svn: 302862
Dean Michael Berris [Fri, 12 May 2017 01:43:20 +0000 (01:43 +0000)]
[XRay][compiler-rt] Remove unused variable after refactoring
Follow-up to D30630.
llvm-svn: 302861
Dean Michael Berris [Fri, 12 May 2017 01:33:55 +0000 (01:33 +0000)]
[XRay][compiler-rt] Fix misspeling of XRaySledEntry
Follow-up to D30630.
llvm-svn: 302860
Eric Fiselier [Fri, 12 May 2017 01:19:01 +0000 (01:19 +0000)]
Guard usage of libc++ regex internals inside test.
This patch attempts to make lookup_classname.pass.cpp usable against
other STL implementations by guarding the use of __regex_word. That being
said it seems likely that the test is still non-conforming due to how
libc++ handles the "w" character class.
llvm-svn: 302859
David Blaikie [Fri, 12 May 2017 01:13:45 +0000 (01:13 +0000)]
DWARF: Avoid cross-CU references under Fission
Turns out that the Fission/Split DWARF package format (DWP) is currently
insufficient to handle cross-CU (ref_addr) references. So for now,
duplicate any debug info needed in these situations:
* inlined_subroutine's abstract_origin
* inlined variable's abstract_origin
* types
Keep the ref_addr behavior in general, including in the split DWARF
inline debug info that can be emitted into the object files for online
symbolication.
Keep a flag to use the old (ref_addr) behavior for testing ways of
addressing this limitation in the DWP tool (& for those not using DWP
packaging).
llvm-svn: 302858
Dean Michael Berris [Fri, 12 May 2017 01:07:41 +0000 (01:07 +0000)]
[XRay][compiler-rt] Runtime changes to support custom event logging
Summary:
This change implements support for the custom event logging sleds and
intrinsics at runtime. For now it only supports handling the sleds in
x86_64, with the implementations for other architectures stubbed out to
do nothing.
NOTE: Work in progress, uploaded for exposition/exploration purposes.
Depends on D27503, D30018, and D33032.
Reviewers: echristo, javed.absar, timshen
Subscribers: mehdi_amini, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D30630
llvm-svn: 302857
Dean Michael Berris [Fri, 12 May 2017 01:06:41 +0000 (01:06 +0000)]
[XRay][lib] Support and temporarily skip over CustomEvent records
Summary:
In D30630 we will start writing custom event records. To avoid breaking
the tools that read the FDR mode records, we skip over these records.
To support these custom event records more effectively, we will have to
expose them in the trace loading API. Those changes will be forthcoming.
Reviewers: kpw, pelikan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33032
llvm-svn: 302856
Alexander Shaposhnikov [Fri, 12 May 2017 00:16:56 +0000 (00:16 +0000)]
[tooling] RefactoringCallbacks code cleanup
This diff
1. adds missing "explicit" for single argument constructors
2. adds missing std::move in ReplaceNodeWithTemplate constructor
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D33061
llvm-svn: 302855
Reid Kleckner [Fri, 12 May 2017 00:10:49 +0000 (00:10 +0000)]
Fix uninitialized bool read causing x86_64-mno-sse.c test failure
llvm-svn: 302854
Reid Kleckner [Fri, 12 May 2017 00:10:19 +0000 (00:10 +0000)]
[git-llvm] Fix svn:eol-style issue for one-file patches
llvm-svn: 302853
Peter Collingbourne [Thu, 11 May 2017 23:59:05 +0000 (23:59 +0000)]
CallGraph: Remove almost-unused field 'Root'.
llvm-svn: 302852
Dehao Chen [Thu, 11 May 2017 23:43:44 +0000 (23:43 +0000)]
Change sample profile writer to make it deterministic.
Summary: This patch changes the function profile output order to be deterministic. In order to make it easier to understand, hottest functions (with most total samples) is ordered first.
Reviewers: dnovillo, davidxl
Reviewed By: dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33111
llvm-svn: 302851
Sean Callanan [Thu, 11 May 2017 23:38:21 +0000 (23:38 +0000)]
xfail TestClassTemplateParameterPack on gcc to mollify lldb-x86_64-ubuntu-14.04-cmake.
llvm-svn: 302850
Rafael Espindola [Thu, 11 May 2017 23:37:55 +0000 (23:37 +0000)]
Detemplate compareSections. NFC.
llvm-svn: 302849
Rafael Espindola [Thu, 11 May 2017 23:33:19 +0000 (23:33 +0000)]
Detemplate compareSectionsNonScript. NFC.
llvm-svn: 302848
Rafael Espindola [Thu, 11 May 2017 23:31:06 +0000 (23:31 +0000)]
Detemplate isRelroSection. NFC.
llvm-svn: 302847
Rafael Espindola [Thu, 11 May 2017 23:28:49 +0000 (23:28 +0000)]
Detemplate SymbolBody::getGotVA. NFC.
llvm-svn: 302846
Rafael Espindola [Thu, 11 May 2017 23:26:03 +0000 (23:26 +0000)]
Detemplate the got.
This is a bit hackish, but allows for a lot of followup cleanups.
llvm-svn: 302845
Teresa Johnson [Thu, 11 May 2017 23:18:05 +0000 (23:18 +0000)]
Restrict call metadata based hotness detection to Sample PGO mode
Summary:
Don't use the metadata on call instructions for determining hotness
unless we are in sample PGO mode, where it is needed because profile
counts are not accurate. In instrumentation mode this is not necessary
and does more harm than good when calls have VP metadata that hasn't
been properly scaled after transformations or dropped after constant
prop based devirtualization (both should be fixed, but we don't need
to do this in the first place for instrumentation PGO).
This required adjusting a number of tests to distinguish between sample
and instrumentation PGO handling, and to add in profile summary metadata
so that getProfileCount can get the summary.
Reviewers: davidxl, danielcdh
Subscribers: aemerson, rengolin, mehdi_amini, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D32877
llvm-svn: 302844
Rafael Espindola [Thu, 11 May 2017 23:16:43 +0000 (23:16 +0000)]
Reduce templating. NFC.
llvm-svn: 302843
Richard Smith [Thu, 11 May 2017 23:11:16 +0000 (23:11 +0000)]
Remove unnecessary mapping from SourceLocation to Module.
When we parse a redefinition of an entity for which we have a hidden existing
declaration, make it visible in the current module instead of mapping the
current source location to its containing module.
llvm-svn: 302842
Eric Fiselier [Thu, 11 May 2017 23:04:04 +0000 (23:04 +0000)]
Fix XFAIL to reflect recent fixes in GCC
llvm-svn: 302841
Adrian Prantl [Thu, 11 May 2017 22:59:19 +0000 (22:59 +0000)]
Module Debug Info: Emit namespaced C++ forward decls in the correct module.
The AST merges NamespaceDecls, but for module debug info it is
important to put a namespace decl (or rather its children) into the
correct (sub-)module, so we need to use the parent module of the decl
that triggered this namespace to be serialized as a second key when
looking up DINamespace nodes.
rdar://problem/
29339538
llvm-svn: 302840
Michael Kruse [Thu, 11 May 2017 22:56:59 +0000 (22:56 +0000)]
[DeLICM] Use input access heuristic for mapped PHI WRITEs.
As with the scalar operand of the initial StoreInst, also use input
accesses when searching for new opportunities after mapping a
PHI write.
The same rational applies here: After LICM has been applied, the
promoted value will either be an instruction in the same statement
(in which case we fall back to try every scalar access of the
statement), or in another statement such that there will be such
an input access. In the latter case other scalars cannot have
originated from the same register promotion, at least not by LICM.
This mostly helps to decrease compilation time and makes debugging
easier by not pursuing unpromising routes. In some circumstances,
it may change the compiler's output.
llvm-svn: 302839
Michael Kruse [Thu, 11 May 2017 22:56:46 +0000 (22:56 +0000)]
[DeLICM] Lookup input accesses.
Previous to this patch, we used VirtualUse to determine the input
access of an llvm::Value in a statement. The input access is the
READ MemoryAccess that makes a value available in that statement,
which can either be a READ of a MemoryKind::Value or the
MemoryKind::PHI for a PHINode in the statement. DeLICM uses the input
access to heuristically find a candidate to map without searching all
possible values.
This might modify the behaviour in that previously PHI accesses were
not considered input accesses before. This was unintentially lost when
"VirtualUse" was extracted from the "Known Knowledge" patch.
llvm-svn: 302838
Michael Kruse [Thu, 11 May 2017 22:56:27 +0000 (22:56 +0000)]
[VirtualInstruction] Do a lookup instead of a linear search. NFC.
llvm-svn: 302837
Michael Kruse [Thu, 11 May 2017 22:56:12 +0000 (22:56 +0000)]
[ScopInfo] Keep scalar acceess dictionaries up-to-data. NFC.
When removing a MemoryAccess, also remove it from maps pointing to it.
This was already done for InstructionToAccess, but not yet for
ValueReads, ValueWrites and PHIWrites as those were only used during
the ScopBuilder phase. Keeping them updated allows us to use them
later as well.
llvm-svn: 302836
Reid Kleckner [Thu, 11 May 2017 22:43:02 +0000 (22:43 +0000)]
Issue diagnostics when returning FP values on x86_64 without SSE1/2
Avoid using report_fatal_error, because it will ask the user to file a
bug. If the user attempts to disable SSE on x86_64 and them use floating
point, that's a bug in their code, not a bug in the compiler.
This is just a start. There are other ways to crash the backend in this
configuration, but they should be updated to follow this pattern.
Differential Revision: https://reviews.llvm.org/D27522
llvm-svn: 302835
Guozhi Wei [Thu, 11 May 2017 22:17:35 +0000 (22:17 +0000)]
[PPC] Change the register constraint of the first source operand of instruction mtvsrdd to g8rc_nox0
According to Power ISA V3.0 document, the first source operand of mtvsrdd is constant 0 if r0 is specified. So the corresponding register constraint should be g8rc_nox0.
This bug caused wrong output generated by 401.bzip2 when -mcpu=power9 and fdo are specified.
Differential Revision: https://reviews.llvm.org/D32880
llvm-svn: 302834
Sean Callanan [Thu, 11 May 2017 22:08:05 +0000 (22:08 +0000)]
[DWARF parser] Produce correct template parameter packs
Templates can end in parameter packs, like this
template <class T...> struct MyStruct
{ /*...*/ };
LLDB does not currently support these parameter packs;
it does not emit them into the template argument list
at all. This causes problems when you specialize, e.g.:
template <> struct MyStruct<int>
{ /*...*/ };
template <> struct MyStruct<int, int> : MyStruct<int>
{ /*...*/ };
LLDB generates two template specializations, each with
no template arguments, and then when they are imported
by the ASTImporter into a parser's AST context we get a
single specialization that inherits from itself,
causing Clang's record layout mechanism to smash its
stack.
This patch fixes the problem for classes and adds
tests. The tests for functions fail because Clang's
ASTImporter can't import them at the moment, so I've
xfailed that test.
Differential Revision: https://reviews.llvm.org/D33025
llvm-svn: 302833
Rafael Espindola [Thu, 11 May 2017 22:02:41 +0000 (22:02 +0000)]
Reduce template usage. NFC.
llvm-svn: 302832
Aditya Nandakumar [Thu, 11 May 2017 21:56:51 +0000 (21:56 +0000)]
[GISel]: Remove unused lambda captures. NFC
https://reviews.llvm.org/D33085
llvm-svn: 302831
Kostya Kortchinsky [Thu, 11 May 2017 21:40:45 +0000 (21:40 +0000)]
[scudo] Use our own combined allocator
Summary:
The reasoning behind this change is twofold:
- the current combined allocator (sanitizer_allocator_combined.h) implements
features that are not relevant for Scudo, making some code redundant, and
some restrictions not pertinent (alignments for example). This forced us to
do some weird things between the frontend and our secondary to make things
work;
- we have enough information to be able to know if a chunk will be serviced by
the Primary or Secondary, allowing us to avoid extraneous calls to functions
such as `PointerIsMine` or `CanAllocate`.
As a result, the new scudo-specific combined allocator is very straightforward,
and allows us to remove some now unnecessary code both in the frontend and the
secondary. Unused functions have been left in as unimplemented for now.
It turns out to also be a sizeable performance gain (3% faster in some Android
memory_replay benchmarks, doing some more on other platforms).
Reviewers: alekseyshl, kcc, dvyukov
Reviewed By: alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33007
llvm-svn: 302830
Easwaran Raman [Thu, 11 May 2017 21:36:28 +0000 (21:36 +0000)]
Decrease inlinecold-threshold to 45
I ran the test-suite (including SPEC 2006) in PGO mode comparing cold
thresholds of 225 and 45. Here are some stats on the text size:
Out of 904 tests that ran, 197 see a change in text size. The average
text size reduction (of all the 904 binaries) is 1.07%. Of the 197
binaries, 19 see a text size increase, as high as 18%, but most of them
are small single source benchmarks. There are 3 multisource benchmarks
with a >0.5% size increase (0.7, 1.3 and 2.1 are their % increases). On
the other side of the spectrum, 31 benchmarks see >10% size reduction
and 6 of them are MultiSource.
I haven't run the test-suite with other values of inlinecold-threshold.
Since we have a cold callsite threshold of 45, I picked this value.
Differential revision: https://reviews.llvm.org/D33106
llvm-svn: 302829
Rafael Espindola [Thu, 11 May 2017 21:33:30 +0000 (21:33 +0000)]
Reduce template usage. NFC.
llvm-svn: 302828
Reid Kleckner [Thu, 11 May 2017 21:26:55 +0000 (21:26 +0000)]
De-virtualize TerminatorInst successor accessors
Use the same switch technique to eliminate virtual successor accessors
from TerminatorInst. Extracted from D31261.
NFC
llvm-svn: 302827
Rafael Espindola [Thu, 11 May 2017 21:23:38 +0000 (21:23 +0000)]
Reduce template usage. NFC.
llvm-svn: 302826
Richard Smith [Thu, 11 May 2017 21:18:27 +0000 (21:18 +0000)]
XFAIL this test for Hexagon.
It's failing due to Hexagon calling convention lowering being broken (empty
structs are not passed even if they have nontrivial destructors / copy ctors).
llvm-svn: 302825
Martell Malone [Thu, 11 May 2017 21:16:29 +0000 (21:16 +0000)]
[Libcxxabi]: Support using compiler-rt for MinGW64
Reviewers: EricWF
Differential Revision: https://reviews.llvm.org/D33098
llvm-svn: 302824
Reid Kleckner [Thu, 11 May 2017 21:14:29 +0000 (21:14 +0000)]
De-virtualize GlobalValue
The erase/remove from parent methods now use a switch table to remove
themselves from their appropriate parent ilist.
The copyAttributesFrom method is now completely non-virtual, since we
only ever copy attributes from a global of the appropriate type.
Pre-requisite to de-virtualizing Value to save a vptr
(https://reviews.llvm.org/D31261).
NFC
llvm-svn: 302823
Chad Rosier [Thu, 11 May 2017 20:07:24 +0000 (20:07 +0000)]
[AArch64][MachineCombine] Fold FNMUL+FSUB -> FNMADD.
Differential Revision: http://reviews.llvm.org/D33101.
llvm-svn: 302822
Davide Italiano [Thu, 11 May 2017 19:58:52 +0000 (19:58 +0000)]
[AMDGPU] Placate unused variable warning in release builds.
llvm-svn: 302821
Vadzim Dambrouski [Thu, 11 May 2017 19:56:14 +0000 (19:56 +0000)]
[MSP430] Generate EABI-compliant libcalls
Updates the MSP430 target to generate EABI-compatible libcall names.
As a byproduct, adjusts the hardware multiplier options available in
the MSP430 target, adds support for promotion of the ISD::MUL operation
for 8-bit integers, and correctly marks R11 as used by call instructions.
Patch by Andrew Wygle.
Differential Revision: https://reviews.llvm.org/D32676
llvm-svn: 302820
Davide Italiano [Thu, 11 May 2017 19:37:43 +0000 (19:37 +0000)]
[LiveVariables] Switch Kill/Defs sets to be DenseSet(s).
The testcase in PR32984 shows a non linear compile time increase
after a change that made the LoopUnroll pass more aggressive
(increasing the threshold).
My profiling shows all the time of PHI elimination goes to
llvm::LiveVariables::addNewBlock. This is because we keep
Defs/Kills registers in a SmallSet and vfind(const T &V); is O(N).
Switching to a DenseSet reduces the time spent in the pass from
297 seconds to 97 seconds. Profiling still shows a lot of time is
spent iterating the data structure, so I guess there's room for
improvement.
Dan tells me GCC uses real set operations for live registers and
it takes no-time on this testcase. Matthias points out we might
want to switch all this to LiveIntervalAnalysis so it's not entirely
sure if a rewrite is worth it.
Differential Revision: https://reviews.llvm.org/D33088
llvm-svn: 302819
Richard Smith [Thu, 11 May 2017 19:17:54 +0000 (19:17 +0000)]
Work around different -std= default for PS4 target.
llvm-svn: 302818
Richard Smith [Thu, 11 May 2017 18:58:24 +0000 (18:58 +0000)]
PR22877: When constructing an array via a constructor with a default argument
in list-initialization, run cleanups for the default argument after each
iteration of the initialization loop.
We previously only ran the destructor for any temporary once, at the end of the
complete loop, rather than once per iteration!
Re-commit of r302750, reverted in r302776.
llvm-svn: 302817
Craig Topper [Thu, 11 May 2017 18:40:53 +0000 (18:40 +0000)]
[APInt] Remove an APInt copy from the return of APInt::multiplicativeInverse.
llvm-svn: 302816
Craig Topper [Thu, 11 May 2017 17:57:43 +0000 (17:57 +0000)]
[APInt] Fix typo in comment. NFC
llvm-svn: 302815
Matt Arsenault [Thu, 11 May 2017 17:38:33 +0000 (17:38 +0000)]
AMDGPU: Remove tfe bit from flat instruction definitions
We don't use it and it was removed in gfx9, and the encoding
bit repurposed.
Additionally actually using it requires changing the output register
class, which wasn't done anyway.
llvm-svn: 302814
Matt Arsenault [Thu, 11 May 2017 17:26:25 +0000 (17:26 +0000)]
AMDGPU: Pull fneg out of extract_vector_elt
This allows folding source modifiers in more f16 cases.
Makes it easier to select per-component packed neg modifiers.
llvm-svn: 302813
Stanislav Mekhanoshin [Thu, 11 May 2017 17:16:55 +0000 (17:16 +0000)]
[AMDGPU] Fix incorrect register pressure calculation
Earlier fix D32572 introduced a bug where live-ins were calculated
for basic block instead of scheduling region. This change fixes it.
Differential Revision: https://reviews.llvm.org/D33086
llvm-svn: 302812
Adam Nemet [Thu, 11 May 2017 17:06:17 +0000 (17:06 +0000)]
[SLP] Emit optimization remarks
The approach I followed was to emit the remark after getTreeCost concludes
that SLP is profitable. I initially tried emitting them after the
vectorizeRootInstruction calls in vectorizeChainsInBlock but I vaguely
remember missing a few cases for example in HorizontalReduction::tryToReduce.
ORE is placed in BoUpSLP so that it's available from everywhere (notably
HorizontalReduction::tryToReduce).
We use the first instruction in the root bundle as the locator for the remark.
In order to get a sense how far the tree is spanning I've include the size of
the tree in the remark. This is not perfect of course but it gives you at
least a rough idea about the tree. Then you can follow up with -view-slp-tree
to really see the actual tree.
llvm-svn: 302811
Nemanja Ivanovic [Thu, 11 May 2017 16:54:23 +0000 (16:54 +0000)]
[PowerPC] Eliminate integer compare instructions - vol. 1
This patch is the first in a series of patches to provide code gen for
doing compares in GPRs when the compare result is required in a GPR.
It adds the infrastructure to select GPR sequences for i1->i32 and i1->i64
extensions. This first patch handles equality comparison on i32 operands with
the result sign or zero extended.
Differential Revision: https://reviews.llvm.org/D31847
llvm-svn: 302810
Adrian Prantl [Thu, 11 May 2017 16:40:48 +0000 (16:40 +0000)]
Add a test that local submodule visibility has no effect on debug info
rdar://problem/
27876262
llvm-svn: 302809
Simon Pilgrim [Thu, 11 May 2017 16:40:44 +0000 (16:40 +0000)]
[DAGCombine] Use SelectionDAG::getAnyExtOrTrunc helper. NFCI.
llvm-svn: 302808
Pierre Gousseau [Thu, 11 May 2017 16:26:50 +0000 (16:26 +0000)]
[asan] Test 'strndup_oob_test.cc' added in r302781 fails on the clang-cmake-thumbv7-a15-full-sh bot.
Marking as unsupported on armv7l-unknown-linux-gnueabihf, same as strdup_oob_test.cc
llvm-svn: 302807
Hans Wennborg [Thu, 11 May 2017 15:32:47 +0000 (15:32 +0000)]
Fix -DLLVM_ENABLE_THREADS=OFF build after r302748
llvm-svn: 302806
Michael Kruse [Thu, 11 May 2017 15:07:38 +0000 (15:07 +0000)]
[Simplify] Remove identical scalar writes.
After DeLICM, it is possible to have two writes of the same value to
the same location in the same statement when it determined that those
writes do not conflict (write the same value).
Teach -polly-simplify to remove one of the writes. It interferes with
the pattern matching of matrix-multiplication kernels and also seem
to not be optimized away by LLVM.
The algorthm is simple, has O(n^2) behaviour (n = max number of
MemoryAccesses in a statement) and only matches the most obvious cases,
but seem to be enough to pattern-match Boost ublas gemm.
Not handled cases include:
- StoreInst instructions (a.k.a. explicit writes), since the value might
be loaded or overwritten between the two stores.
- PHINode, especially LCSSA, when the PHI value matches with on other's.
- Partial writes (in preparation)
llvm-svn: 302805
Simon Pilgrim [Thu, 11 May 2017 15:02:49 +0000 (15:02 +0000)]
[X86][AVX] Added zeroall/zeroupper scheduler tests
Missing on SandyBridge and Btver2 models
llvm-svn: 302804
Tim Northover [Thu, 11 May 2017 14:51:43 +0000 (14:51 +0000)]
Modules: fix modules build.
A recent commit made GlobalVariable.h depend on intrinsics generation, so (I
think) it needs to be in the lower-level module. I'll confirm with others, but
this should fix the bots.
llvm-svn: 302803
Marshall Clow [Thu, 11 May 2017 14:25:45 +0000 (14:25 +0000)]
Mark LWG#2782 as complete. No functionality change; we already do this. Just added a few more tests.
llvm-svn: 302802
Benjamin Kramer [Thu, 11 May 2017 14:04:23 +0000 (14:04 +0000)]
Renumber test line number expectations after r302783.
Also remove a confused stable-runtimes requirement.
llvm-svn: 302801
Marshall Clow [Thu, 11 May 2017 14:00:54 +0000 (14:00 +0000)]
Replace a nested namespace used for overload resolution with a struct. Richard Smith says that using the namespace results in an ODR violation, but I disagree. Nevertheless, the struct works just as well.
llvm-svn: 302800
Marshall Clow [Thu, 11 May 2017 13:55:20 +0000 (13:55 +0000)]
Mark LWG#2850 as complete. No functionality change; we had tests that covered it already. Just added comments to the tests. Thanks to K-ballo for the heads up.
llvm-svn: 302799
Marshall Clow [Thu, 11 May 2017 13:51:09 +0000 (13:51 +0000)]
Mark LWG#2796 as complete. No functionality change; we had tests that covered it already. Just added comments to the tests
llvm-svn: 302798
Alex Lorenz [Thu, 11 May 2017 13:48:57 +0000 (13:48 +0000)]
[CodeCompletion] Provide member completions for dependent expressions whose
type is a TemplateSpecializationType or InjectedClassNameType
Fixes PR30847. Partially fixes PR20973 (first position only).
PR17614 is still not working, its expression has the dependent
builtin type. We'll have to teach the completion engine how to "resolve"
dependent expressions to fix it.
rdar://
29818301
llvm-svn: 302797
Alex Lorenz [Thu, 11 May 2017 13:41:00 +0000 (13:41 +0000)]
[CodeCompletion] NFC, extract a function that generates member
completion results for records
llvm-svn: 302796
NAKAMURA Takumi [Thu, 11 May 2017 13:19:24 +0000 (13:19 +0000)]
Fix two-stage build on windows using DistributionExample cmake cache
Thanks to Matthew Larionov <matthewtff@gmail.com>
llvm-svn: 302795
Javed Absar [Thu, 11 May 2017 12:28:08 +0000 (12:28 +0000)]
[IR] Allow attributes with global variables
This patch extends llvm-ir to allow attributes to be set on global variables.
An RFC was sent out earlier by my colleague James Molloy: http://lists.llvm.org/pipermail/cfe-dev/2017-March/053100.html
A key part of that proposal was to extend LLVM-IR to carry attributes on global variables.
This generic feature could be useful for multiple purposes.
In our present context, it would be useful to carry user specified sections for bss/rodata/data.
Reviewed by: Jonathan Roelofs, Reid Kleckner
Differential Revision: https://reviews.llvm.org/D32009
llvm-svn: 302794
Igor Breger [Thu, 11 May 2017 12:15:03 +0000 (12:15 +0000)]
[GlobalISel][X86] Remove hand-written G_FADD/F_SUB selection.
Now it handle by TableGen.
llvm-svn: 302793
George Rimar [Thu, 11 May 2017 11:53:49 +0000 (11:53 +0000)]
[ELF] - Make text section location explicit in early-assign-symbol.s test.
Testcase itself depends on .text section location, which was orphan earlier.
Suggested by Rafael EspĂndola
llvm-svn: 302792
Ayman Musa [Thu, 11 May 2017 11:51:12 +0000 (11:51 +0000)]
[X86] Moving X86Local namespace from .cpp to .h file to use it in memory folding TableGen backend.
Differential Revision: https://reviews.llvm.org/D32797
llvm-svn: 302791
Ayal Zaks [Thu, 11 May 2017 11:36:33 +0000 (11:36 +0000)]
[LV] Refactor ILV.vectorize{Loop}() by introducing LVP.executePlan(); NFC
Introduce LoopVectorizationPlanner.executePlan(), replacing ILV.vectorize() and
refactoring ILV.vectorizeLoop(). Method collectDeadInstructions() is moved from
ILV to LVP. These changes facilitate building VPlans and using them to generate
code, following https://reviews.llvm.org/D28975 and its tentative breakdown.
Method ILV.createEmptyLoop() is renamed ILV.createVectorizedLoopSkeleton() to
improve clarity; it's contents remain intact.
Differential Revision: https://reviews.llvm.org/D32200
llvm-svn: 302790
Pierre Gousseau [Thu, 11 May 2017 11:22:04 +0000 (11:22 +0000)]
[asan] Test 'strndup_oob_test.cc' added in r302781 fails on clang-s390x-linux.
Marking it as unsupported for now to hopefully make the bot green.
llvm-svn: 302789
Alexander Potapenko [Thu, 11 May 2017 11:12:26 +0000 (11:12 +0000)]
[msan] add a regression test for PR32842
Make sure MSan doesn't miss a bug comparing two integers with defined low bits.
llvm-svn: 302788
Alexander Potapenko [Thu, 11 May 2017 11:07:48 +0000 (11:07 +0000)]
[msan] Fix PR32842
It turned out that MSan was incorrectly calculating the shadow for int comparisons: it was done by truncating the result of (Shadow1 OR Shadow2) to i1, effectively rendering all bits except LSB useless.
This approach doesn't work e.g. in the case where the values being compared are even (i.e. have the LSB of the shadow equal to zero).
Instead, if CreateShadowCast() has to cast a bigger int to i1, we replace the truncation with an ICMP to 0.
This patch doesn't affect the code generated for SPEC 2006 binaries, i.e. there's no performance impact.
For the test case reported in PR32842 MSan with the patch generates a slightly more efficient code:
orq %rcx, %rax
jne .LBB0_6
, instead of:
orl %ecx, %eax
testb $1, %al
jne .LBB0_6
llvm-svn: 302787
Renato Golin [Thu, 11 May 2017 11:05:52 +0000 (11:05 +0000)]
[MSAN] test failed randomly on ARM when XFAILED for MIPS
llvm-svn: 302786
Chandler Carruth [Thu, 11 May 2017 10:52:16 +0000 (10:52 +0000)]
[x86] Fix a failure to select with AVX-512 when the type legalizer
manages to form a VSELECT with a non-i1 element type condition. Those
are technically allowed in SDAG (at least, the generic type legalization
logic will form them and I wouldn't want to try to audit everything te
preclude forming them) so we need to be able to lower them.
This isn't too hard to implement. We mark VSELECT as custom so we get
a chance in C++, add a fast path for i1 conditions to get directly
handled by the patterns, and a fallback when we need to manually force
the condition to be an i1 that uses the vptestm instruction to turn
a non-mask into a mask.
This, unsurprisingly, generates awful code. But it at least doesn't
crash. This was actually impacting open source packages built with LLVM
for AVX-512 in the wild, so quickly landing a patch that at least stops
the immediate bleeding.
I think I've found where to fix the codegen quality issue, but less
confident of that change so separating it out from the thing that
doesn't change the result of any existing test case but causes mine to
not crash.
llvm-svn: 302785
Simon Pilgrim [Thu, 11 May 2017 10:03:05 +0000 (10:03 +0000)]
Strip trailing whitespace. NFCI.
llvm-svn: 302784
Simon Dardis [Thu, 11 May 2017 09:56:01 +0000 (09:56 +0000)]
mips] XFAIL wcsncpy.cc test.
The stack unwinder fails to unwind the stack past the interceptor stack
frame, resulting in a test failure. XFAIL this for now.
llvm-svn: 302783
Diana Picus [Thu, 11 May 2017 09:45:57 +0000 (09:45 +0000)]
[ARM][GlobalISel] Legalize narrow scalar ops by widening
This is the same as r292827 for AArch64: we widen 8- and 16-bit ADD, SUB
and MUL to 32 bits since we only have TableGen patterns for 32 bits.
See the commit message for r292827 for more details.
At this point we could just remove some of the tests for regbankselect
and instruction-select, since we're not going to see any narrow
operations at those levels anymore. Instead I decided to update them
with G_ANYEXT/G_TRUNC operations, so we can validate the full sequences
generated by the legalizer.
llvm-svn: 302782
Pierre Gousseau [Thu, 11 May 2017 08:53:24 +0000 (08:53 +0000)]
[asan] Recommit of r301904: Add strndup/__strndup interceptors
Fix undeclared __interceptor_malloc in esan_interceptors.cc
Fix undeclared strnlen on OSX
Differential Revision: https://reviews.llvm.org/D31457
llvm-svn: 302781
Serge Guelton [Thu, 11 May 2017 08:53:00 +0000 (08:53 +0000)]
Remove spurious cast of nullptr. NFC.
Conversion rules allow automatic casting of nullptr to any pointer type.
llvm-svn: 302780
Serge Guelton [Thu, 11 May 2017 08:46:02 +0000 (08:46 +0000)]
Remove now useless trailing nullptr in StructType::get
llvm-svn: 302779
Diana Picus [Thu, 11 May 2017 08:28:31 +0000 (08:28 +0000)]
[ARM][GlobalISel] Support for G_ANYEXT
G_ANYEXT can be introduced by the legalizer when widening scalars. Add
support for it in the register bank info (same mapping as everything
else) and in the instruction selector.
When selecting it, we treat it as a COPY, just like G_TRUNC. On this
occasion we get rid of some assertions in selectCopy so we can reuse it.
This shouldn't be a problem at the moment since we're not supporting any
complicated cases (e.g. FPR, different register banks). We might want to
separate the paths when we do.
llvm-svn: 302778
Serge Pavlov [Thu, 11 May 2017 08:25:22 +0000 (08:25 +0000)]
Reverted r302775
llvm-svn: 302777
Diana Picus [Thu, 11 May 2017 08:10:41 +0000 (08:10 +0000)]
Revert "PR22877: When constructing an array via a constructor with a default argument in list-initialization, run cleanups for the default argument after each iteration of the initialization loop."
Revert "clang/test/CodeGenCXX/array-default-argument.cpp: Satisfy targets that have x86_thiscallcc."
This reverts commit r302750 and its fixup r302757 because the test is
still breaking on some of the ARM bots.
array-default-argument.cpp:20:12: error: expected string not found in input
// CHECK: {{call|invoke}}[[THISCALL:( x86_thiscallcc)?]] void @_ZN1AC1Ev([[TEMPORARY:.*]])
^
<stdin>:18:1: note: scanning from here
arrayctor.loop: ; preds = %arrayctor.loop, %entry
^
<stdin>:28:2: note: possible intended match here
call void @_Z1fv()
^
--
llvm-svn: 302776
Serge Pavlov [Thu, 11 May 2017 08:00:33 +0000 (08:00 +0000)]
Driver must return non-zero code on errors in command line
Now if clang driver is given wrong arguments, in some cases it
continues execution and returns zero code. This change fixes this
behavior.
The fix revealed some errors in clang test set.
File test/Driver/gfortran.f90 added in r118203 checks forwarding
gfortran flags to GCC. Now driver reports error on this file, because
the option -working-directory implemented in clang differs from the
option with the same name implemented in gfortran, in clang the option
requires argument, in gfortran does not.
In the file test/Driver/arm-darwin-builtin.c clang is called with
options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed
in r191435 and now clang reports error on this test.
File arm-default-build-attributes.s uses option -verify, which is not
supported by driver, it is cc1 option.
Similarly, the file split-debug.h uses options -fmodules-embed-all-files
and -fmodule-format=obj, which are not supported by driver.
Other revealed errors are mainly mistypes.
Differential Revision: https://reviews.llvm.org/D33013
llvm-svn: 302775
Igor Breger [Thu, 11 May 2017 07:17:40 +0000 (07:17 +0000)]
[GlobalISel][X86] G_ICMP support.
Summary: support G_ICMP for scalar types i8/i16/i64.
Reviewers: zvi, guyblank
Reviewed By: guyblank
Subscribers: rovka, kristof.beyls, llvm-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D32995
llvm-svn: 302774