David Blaikie [Mon, 4 Aug 2014 20:32:48 +0000 (20:32 +0000)]
Document the "emission kind" field of the DICompileUnit in LLVM's Source Level Debugging metadata.
llvm-svn: 214771
Aaron Ballman [Mon, 4 Aug 2014 20:28:35 +0000 (20:28 +0000)]
A static_assert declaration cannot be a template; adding the diagnostic for this instead of silently accepting and producing possibly-unexpected behavior.
llvm-svn: 214770
Joerg Sonnenberger [Mon, 4 Aug 2014 20:28:34 +0000 (20:28 +0000)]
Recognize mftbl as alias for mftb, for symmetry with mttb.
llvm-svn: 214769
Dan Albert [Mon, 4 Aug 2014 20:27:45 +0000 (20:27 +0000)]
Fix typo.
llvm-svn: 214768
Joerg Sonnenberger [Mon, 4 Aug 2014 19:33:25 +0000 (19:33 +0000)]
Add a sentence that all entries should include an email address.
Add one for Greg Clayton, Peter Collingbourne, Tobias Grosser and
Jakob Olesen based on recent commits.
llvm-svn: 214762
David Blaikie [Mon, 4 Aug 2014 19:30:08 +0000 (19:30 +0000)]
Reapply "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself."
Originally reverted in r213432 with flakey failures on an ASan self-host
build. After reduction it seems to be the same issue fixed in r213805
(ArgPromo + DebugInfo: Handle updating debug info over multiple
applications of argument promotion) and r213952 (by having
LiveDebugVariables strip dbg_value intrinsics in functions that are not
described by debug info). Though I cannot explain why this failure was
flakey...
llvm-svn: 214761
Marshall Clow [Mon, 4 Aug 2014 19:20:17 +0000 (19:20 +0000)]
Fix a problem with reference_wrapper in C++03 that was causing counting predicates to fail. Add a test to make sure it works. However, most of the reference_wrapper tests still fail in C++03 mode, due to a lack of decltype. No change there.
llvm-svn: 214760
Alex Lorenz [Mon, 4 Aug 2014 19:04:38 +0000 (19:04 +0000)]
Revert r214757 (Same fix as r214758)
llvm-svn: 214759
David Blaikie [Mon, 4 Aug 2014 18:59:39 +0000 (18:59 +0000)]
Add CoverageMappingGen.cpp (introduced in r214752) to CMakeLists.txt
llvm-svn: 214758
Alex Lorenz [Mon, 4 Aug 2014 18:55:53 +0000 (18:55 +0000)]
add lib/CodeGen/CoverageMappingGen.cpp to CMake
llvm-svn: 214757
Matt Arsenault [Mon, 4 Aug 2014 18:49:22 +0000 (18:49 +0000)]
R600/SI: Fix definitions for ds_read2 / ds_write2 instructions.
These were just wrong, using the wrong register classes
and store2 was missing an operand.
llvm-svn: 214756
Joerg Sonnenberger [Mon, 4 Aug 2014 18:46:13 +0000 (18:46 +0000)]
Rename PPCLinuxMCAsmInfo to PPCELFMCAsmInfo to better reflect the
systems it represents.
llvm-svn: 214755
Joerg Sonnenberger [Mon, 4 Aug 2014 18:45:10 +0000 (18:45 +0000)]
Allow .lcomm with alignment on ELF targets.
llvm-svn: 214754
Dan Albert [Mon, 4 Aug 2014 18:44:48 +0000 (18:44 +0000)]
Add locales to available_features for tests.
Linux has a lot of failures caused by not having support for certain
locales. Since these come out as a lot of noise in the test results,
have lit.cfg detect the presence of the various locales used in the
tests and add them to config.available_features as locale.LOCALE_NAME.
This patch also adds REQUIRES: locale.REQUIRED_LOCALE to every test that
I saw failing in this manner. We probably need to add more for all the
tests requiring en_US.UTF-8, but we can do that on an as-needed basis.
One thing that concerns me is how many tests get skipped because of
missing locales (especially in regex/). We should make a point of
splitting up any tests that test default behavior _and_ behavior under a
given locale so that we aren't losing coverage for default behavior.
llvm-svn: 214753
Alex Lorenz [Mon, 4 Aug 2014 18:41:51 +0000 (18:41 +0000)]
Add coverage mapping generation.
This patch adds the '-fcoverage-mapping' option which
allows clang to generate the coverage mapping information
that can be used to provide code coverage analysis using
the execution counts obtained from the instrumentation
based profiling (-fprofile-instr-generate).
llvm-svn: 214752
Alex Lorenz [Mon, 4 Aug 2014 18:00:51 +0000 (18:00 +0000)]
Coverage: add HasCodeBefore flag to a mapping region.
This flag will be used by the coverage tool to help
compute the execution counts for each line in a source file.
Differential Revision: http://reviews.llvm.org/D4746
llvm-svn: 214740
Aaron Ballman [Mon, 4 Aug 2014 17:49:55 +0000 (17:49 +0000)]
Removing some extraneous spaces; no functional changes intended.
llvm-svn: 214739
Eric Christopher [Mon, 4 Aug 2014 17:37:43 +0000 (17:37 +0000)]
Move the R600 intrinsic support back to the target machine - there's
nothing subtarget dependent about the intrinsic support in any
backend as far as I can tell.
llvm-svn: 214738
Justin Bogner [Mon, 4 Aug 2014 17:36:41 +0000 (17:36 +0000)]
Path: Stop claiming path::const_iterator is bidirectional
path::const_iterator claims that it's a bidirectional iterator, but it
doesn't satisfy all of the contracts for a bidirectional iterator.
For example, n3376 24.2.5 p6 says "If a and b are both dereferenceable,
then a == b if and only if *a and *b are bound to the same object",
but this doesn't work with how we stash and recreate Components.
This means that our use of reverse_iterator on this type is invalid
and leads to many of the valgrind errors we're hitting, as explained
by Tilmann Scheller here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20140728/228654.html
Instead, we admit that path::const_iterator is only an input_iterator,
and implement a second input_iterator for path::reverse_iterator (by
changing const_iterator::operator-- to reverse_iterator::operator++).
All of the uses of this just traverse once over the path in one
direction or the other anyway.
llvm-svn: 214737
Marshall Clow [Mon, 4 Aug 2014 17:32:25 +0000 (17:32 +0000)]
Fix PR#202520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm
llvm-svn: 214736
Olivier Goffart [Mon, 4 Aug 2014 17:28:11 +0000 (17:28 +0000)]
Fix crash when accessing a property of an invalid interface
llvm-svn: 214735
Olivier Goffart [Mon, 4 Aug 2014 17:28:05 +0000 (17:28 +0000)]
Fix crash when assiging to a property with an invalid type
This is a regression from clang 3.4
Set the result to ExprError and returns true, rather than simply
returns false because errors have been reported already and returning
false show a confusing error
llvm-svn: 214734
Joerg Sonnenberger [Mon, 4 Aug 2014 17:26:15 +0000 (17:26 +0000)]
Refactor SPRG instructions.
llvm-svn: 214733
Akira Hatanaka [Mon, 4 Aug 2014 17:23:38 +0000 (17:23 +0000)]
[X86] Place parentheses around "isMask_32(STReturns) && N <= 2".
This corrects r214672, which was committed to silence a gcc warning.
llvm-svn: 214732
Joerg Sonnenberger [Mon, 4 Aug 2014 17:07:41 +0000 (17:07 +0000)]
Add support for m[ft][di]bat[ul] instructions.
llvm-svn: 214731
Aaron Ballman [Mon, 4 Aug 2014 17:03:51 +0000 (17:03 +0000)]
Diagnose GNU-style attributes preceding virt-specifiers, but only when the attribute is known to GCC. Clang accepts attributes in this position, but
GCC does not, so this is a GCC-compat warning. If the attribute is not known to GCC, then the diagnostic is suppressed.
llvm-svn: 214730
Matt Arsenault [Mon, 4 Aug 2014 16:55:35 +0000 (16:55 +0000)]
Use the known address space constant rather than checking it
llvm-svn: 214729
Matt Arsenault [Mon, 4 Aug 2014 16:55:33 +0000 (16:55 +0000)]
R600: Remove unused include
llvm-svn: 214728
Eric Christopher [Mon, 4 Aug 2014 16:40:55 +0000 (16:40 +0000)]
Add a dummy subtarget to the CPP backend target machine. This will
allow us to forward all of the standard TargetMachine calls to the
subtarget and still return null as we were before.
llvm-svn: 214727
Dan Albert [Mon, 4 Aug 2014 16:13:32 +0000 (16:13 +0000)]
Obey LLVM_LIBDIR_SUFFIX.
llvm-svn: 214726
DeLesley Hutchins [Mon, 4 Aug 2014 16:10:59 +0000 (16:10 +0000)]
Thread safety analysis: Add support for negative requirements, which are
capability expressions of the form !expr, and denote a capability that must
not be held.
llvm-svn: 214725
Joerg Sonnenberger [Mon, 4 Aug 2014 15:47:38 +0000 (15:47 +0000)]
Add features for PPC 4xx and e500/e500mc instructions.
Move the test cases for them into separate files.
llvm-svn: 214724
Aaron Ballman [Mon, 4 Aug 2014 15:26:33 +0000 (15:26 +0000)]
Highlight the offending function parameter when the format argument refers to an invalid function parameter type.
llvm-svn: 214723
Aaron Ballman [Mon, 4 Aug 2014 15:17:29 +0000 (15:17 +0000)]
Highlight the offending function parameter when the format_arg argument refers to an invalid function parameter type.
llvm-svn: 214722
Ulrich Weigand [Mon, 4 Aug 2014 14:55:26 +0000 (14:55 +0000)]
[PowerPC] Add target triple to vec_urem_const.ll test case
This should hopefully fix build bots on other architectures.
llvm-svn: 214721
Daniel Jasper [Mon, 4 Aug 2014 14:51:02 +0000 (14:51 +0000)]
clang-format: Understand parameter pack initialization.
Before:
Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {}
After:
Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}
llvm-svn: 214720
Robert Khasanov [Mon, 4 Aug 2014 14:35:15 +0000 (14:35 +0000)]
[SKX] Enabling load/store instructions: encoding
Instructions: VMOVAPD, VMOVAPS, VMOVDQA8, VMOVDQA16, VMOVDQA32,VMOVDQA64, VMOVDQU8, VMOVDQU16, VMOVDQU32,VMOVDQU64, VMOVUPD, VMOVUPS,
Reviewed by Elena Demikhovsky <elena.demikhovsky@intel.com>
llvm-svn: 214719
Ulrich Weigand [Mon, 4 Aug 2014 13:53:40 +0000 (13:53 +0000)]
[PowerPC] Swap arguments to vpkuhum/vpkuwum on little-endian
In commit r213915, Bill fixed little-endian usage of vmrgh* and vmrgl*
by swapping the input arguments. As it turns out, the exact same fix
is also required for the vpkuhum/vpkuwum patterns.
This fixes another regression in llvmpipe when vector support is
enabled.
Reviewed by Bill Schmidt.
llvm-svn: 214718
Aaron Ballman [Mon, 4 Aug 2014 13:51:27 +0000 (13:51 +0000)]
Improving the name of the function parameter, which happens to solve two likely-less-than-useful MSVC warnings: warning C4258: 'I' : definition from the for loop is ignored; the definition from the enclosing scope is used.
llvm-svn: 214717
Ulrich Weigand [Mon, 4 Aug 2014 13:27:12 +0000 (13:27 +0000)]
[PowerPC] MULHU/MULHS are not legal for vector types
I ran into some test failures where common code changed vector division
by constant into a multiply-high operation (MULHU). But these are not
implemented by the back-end, so we failed to recognize the insn.
Fixed by marking MULHU/MULHS as Expand for vector types.
llvm-svn: 214716
Daniel Sanders [Mon, 4 Aug 2014 13:27:03 +0000 (13:27 +0000)]
Fixed accidental use of reserved identifier in r214709.
llvm-svn: 214715
Ulrich Weigand [Mon, 4 Aug 2014 13:13:57 +0000 (13:13 +0000)]
[PowerPC] Fix and improve vector comparisons
This patch refactors code generation of vector comparisons.
This fixes a wrong code-gen bug for ISD::SETGE for floating-point types,
and improves generated code for vector comparisons in general.
Specifically, the patch moves all logic deciding how to implement vector
comparisons into getVCmpInst, which gets two extra boolean outputs
indicating to its caller whether its needs to swap the input operands
and/or negate the result of the comparison. Apart from implementing
these two modifications as directed by getVCmpInst, there is no need
to ever implement vector comparisons in any other manner; in particular,
there is never a need to perform two separate comparisons (e.g. one for
equal and one for greater-than, as code used to do before this patch).
Reviewed by Bill Schmidt.
llvm-svn: 214714
Kostya Serebryany [Mon, 4 Aug 2014 12:59:45 +0000 (12:59 +0000)]
[asan] poison array cookies only on 64-bit arch
llvm-svn: 214713
Simon Atanasyan [Mon, 4 Aug 2014 12:57:52 +0000 (12:57 +0000)]
[Driver][Mips] Construct dynamic linker path by string concatination.
That reduces a number of `if` operators and prevent a combinatorics explosion
if/when more dynamic linker path variants added.
No functional changes.
llvm-svn: 214712
Kostya Serebryany [Mon, 4 Aug 2014 12:43:13 +0000 (12:43 +0000)]
[asan] introduce __asan_poison_cxx_array_cookie. This is asan-rt part of PR19838 (Left OOB accesses on new[]-allocated arrays with array cookies are not detected). No tests yet. They will follow once I commit the clang part.
llvm-svn: 214711
Pavel Chupin [Mon, 4 Aug 2014 12:39:43 +0000 (12:39 +0000)]
[x32] Add __int128 support
Summary:
Adding __int128 support explicitly for x86_64 because currently it's on
only when pointer size >= 64 which is not the case for x32.
Test Plan: One of the tests using __int128 is updated
Reviewers: atanasyan, chandlerc
Subscribers: cfe-commits, rob.khasanov, zinovy.nis, dschuff
Differential Revision: http://reviews.llvm.org/D4755
llvm-svn: 214710
Daniel Sanders [Mon, 4 Aug 2014 12:20:00 +0000 (12:20 +0000)]
[mips] Add assembler support for '.set mipsX'.
Summary:
This patch also fixes an issue with the way the Mips assembler enables/disables architecture
features. Before this patch, the assembler never disabled feature bits. For example,
.set mips64
.set mips32r2
would result in the 'OR' of mips64 with mips32r2 feature bits which isn't right.
Unfortunately this isn't trivial to fix because there's not an easy way to clear
feature bits as the algorithm in MCSubtargetInfo (ToggleFeature) only clears the bits
that imply the feature being cleared and not the implied bits by the feature (there's a
better explanation to the code I added).
Patch by Matheus Almeida and updated by Toma Tabacu
Reviewers: vmedic, matheusalmeida, dsanders
Reviewed By: dsanders
Subscribers: tomatabacu, llvm-commits
Differential Revision: http://reviews.llvm.org/D4123
llvm-svn: 214709
NAKAMURA Takumi [Mon, 4 Aug 2014 10:23:22 +0000 (10:23 +0000)]
TargetInstrInfo::genAlternativeCodeSequence(): Fix a couple of \param(s). [-Wdocumentation]
llvm-svn: 214708
Chandler Carruth [Mon, 4 Aug 2014 10:17:35 +0000 (10:17 +0000)]
[x86] Just unilaterally prefer SSSE3-style PSHUFB lowerings over clever
use of PACKUS. It's cleaner that way.
I looked at implementing clever combine-based folding of PACKUS chains
into PSHUFB but it is quite hard and doesn't seem likely to be worth it.
The most annoying part would be detecting that the correct masking had
been done to use PACKUS-style instructions as a blend operation rather
than there being any saturating as is indicated by its name. We generate
really nice code for what few test cases I've come up with that aren't
completely contrived for this by just directly prefering PSHUFB and so
let's go with that strategy for now. =]
llvm-svn: 214707
Keith Walker [Mon, 4 Aug 2014 10:13:09 +0000 (10:13 +0000)]
Fix tests Clang::Sema/statements.c and Clang::SemaTemplate/instantiate-expr-1.cpp when AArch64 is the default target.
Commit r213935 added additional validation of register constants/size for AArch64 and because these tests which contain Intel assembler the new validation caused these tests to fail when the default target is changed to an AArch64 target.
llvm-svn: 214706
Benjamin Kramer [Mon, 4 Aug 2014 10:11:47 +0000 (10:11 +0000)]
[clang-tidy] Rewrite a for-range loop in the old style.
Haven't thought that I ever needed to do this, but in this case comparing the
index using pointer arithmetic turns out to be really ugly. It also generates
nasty sign-compare warnings on 32 bit targets.
llvm-svn: 214705
Kostya Serebryany [Mon, 4 Aug 2014 10:10:50 +0000 (10:10 +0000)]
[asan] intercept sized operator delete[]
llvm-svn: 214704
Benjamin Kramer [Mon, 4 Aug 2014 09:42:18 +0000 (09:42 +0000)]
[clang-tidy] Fix unnamed parameter comment insertion with multiple parameters.
llvm-svn: 214703
Chandler Carruth [Mon, 4 Aug 2014 09:40:02 +0000 (09:40 +0000)]
[x86] Implement more aggressive use of PACKUS chains for lowering common
patterns of v16i8 shuffles.
This implements one of the more important FIXMEs for the SSE2 support in
the new shuffle lowering. We now generate the optimal shuffle sequence
for truncate-derived shuffles which show up essentially everywhere.
Unfortunately, this exposes a weakness in other parts of the shuffle
logic -- we can no longer form PSHUFB here. I'll add the necessary
support for that and other things in a subsequent commit.
llvm-svn: 214702
Benjamin Kramer [Mon, 4 Aug 2014 09:33:58 +0000 (09:33 +0000)]
[clang-tidy] Make the named parameter check only warn on declarations if a definition is visible.
Summary:
This allows us to copy the parameter name from the definition (as a comment)
or insert /*unused*/ in both places.
Reviewers: alexfh, klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4772
llvm-svn: 214701
Benjamin Kramer [Mon, 4 Aug 2014 09:26:40 +0000 (09:26 +0000)]
Update links to the gcc and java documentation that 404'd.
llvm-svn: 214700
David Majnemer [Mon, 4 Aug 2014 06:16:50 +0000 (06:16 +0000)]
AST: Fix the mangling for unqualified-blocks
CXXNameMangler::mangleUnqualifiedBlock believed that
MangleContext::getBlockId returned something that used Itanium-style
discriminator numbers.
Discriminator numbers start their numberign from 1 and the first
mangling that actually gets any sort of number mangled in is the second
discriminator.
However, Block IDs start from zero. The logic for omitting the mangling
number did a ' > 1' instead of a ' > 0' comparison; this could
potentially cause mangling conflicts.
llvm-svn: 214699
David Majnemer [Mon, 4 Aug 2014 05:11:01 +0000 (05:11 +0000)]
AST: Propagate 'AlignIsRequired' though many levels of typedefs
A typedef of a typedef should have AlignIsRequired if *either* typedef
has an AlignAttr attached to it.
llvm-svn: 214698
Kevin Qin [Mon, 4 Aug 2014 05:10:33 +0000 (05:10 +0000)]
Revert "r214669 - MachineCombiner Pass for selecting faster instruction"
This commit broke "make check" for several hours, so get it reverted.
llvm-svn: 214697
NAKAMURA Takumi [Mon, 4 Aug 2014 01:43:37 +0000 (01:43 +0000)]
MemoryBuffer: Don't use mmap when FileSize is multiple of 4k on Cygwin.
On Cygwin, getpagesize() returns 64k(AllocationGranularity).
In r214580, the size of X86GenInstrInfo.inc became 1499136.
FIXME: We should reorganize again getPageSize() on Win32.
MapFile allocates address along AllocationGranularity but view is mapped by physical page.
llvm-svn: 214681
Chandler Carruth [Mon, 4 Aug 2014 01:14:24 +0000 (01:14 +0000)]
[x86] Handle single input shuffles in the SSSE3 case more intelligently.
I spent some time looking into a better or more principled way to handle
this. For example, by detecting arbitrary "unneeded" ORs... But really,
there wasn't any point. We just shouldn't build blatantly wrong code so
late in the pipeline rather than adding more stages and logic later on
to fix it. Avoiding this is just too simple.
llvm-svn: 214680
Chandler Carruth [Mon, 4 Aug 2014 00:54:28 +0000 (00:54 +0000)]
[x86] Fix the test case added in r214670 and tweaked in r214674 further.
Fundamentally, there isn't a really portable way to test the constant
pool contents. Instead, pin this test to the bare-metal triple. This
also makes it a 64-bit triple which allows us to only match a single
constant pool rather than two. It can also just hard code the '.' prefix
as the format should be stable now that it has a fixed triple. Finally,
I've switched it to use CHECK-NEXT to be more precise in the instruction
sequence expected and to use variables rather than hard coding decisions
by the register allocator.
llvm-svn: 214679
Richard Smith [Mon, 4 Aug 2014 00:40:48 +0000 (00:40 +0000)]
PR11778: Fix the rejects-valid half of this bug. We still produce the same
poorly-worded warning for a case value that is not a possible value of the
switched-on expression.
llvm-svn: 214678
Peter Zotov [Sun, 3 Aug 2014 23:54:22 +0000 (23:54 +0000)]
[OCaml] Add Llvm.{string_of_const,const_element}.
llvm-svn: 214677
Peter Zotov [Sun, 3 Aug 2014 23:54:16 +0000 (23:54 +0000)]
[LLVM-C] Add LLVM{IsConstantString,GetAsString,GetElementAsConstant}.
llvm-svn: 214676
Richard Smith [Sun, 3 Aug 2014 23:41:04 +0000 (23:41 +0000)]
Don't destroy MacroInfos if we find the macro definition is invalid; it'll get
destroyed on shutdown regardless. Fixes a double-delete.
llvm-svn: 214675
Sanjay Patel [Sun, 3 Aug 2014 23:20:16 +0000 (23:20 +0000)]
Account for possible leading '.' in label string.
llvm-svn: 214674
Chandler Carruth [Sun, 3 Aug 2014 23:10:59 +0000 (23:10 +0000)]
[x86] Don't add nodes to the combined set (and prune subsequent
combines) until they are legal.
Doing it the old way could, when the stars align *just* right, cause
a node to get into the combine set prior to being legalized. Then, when
the same node showed up as an operand to another node later on (but not
so much later on that it had been deleted as dead) we would fail to add
it back to the worklist thinking it had already been combined. This
would in turn cause it to not be legalized. Fortunately, we can also
walk the operands looking for uncombined (and thus potentially
un-legalized) nodes late. It will still ensure that we walk all operands
of all nodes and send all of them through both the legalizer without
changes and the combiner at least once. (Which was the original goal of
this).
I have a test case for this bug, but it is terribly brittle. For
example, it will stop finding the bug the moment I enable the new
shuffle lowering. I don't yet have any test case that reliably exercises
this bug, and it isn't clear that it will be possible to craft one. It
is entirely possible that with the new shuffle lowering the two forms of
doing this are precisely equivalent. That doesn't mean we shouldn't take
the more conservative approach of insisting on things in the combined
set having survived the legalizer.
llvm-svn: 214673
Saleem Abdulrasool [Sun, 3 Aug 2014 23:00:39 +0000 (23:00 +0000)]
X86: silence warning (-Wparentheses)
GCC 4.8.2 points out the ambiguity in evaluation of the assertion condition:
lib/Target/X86/X86FloatingPoint.cpp:949:49: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
assert(STReturns == 0 || isMask_32(STReturns) && N <= 2);
llvm-svn: 214672
Saleem Abdulrasool [Sun, 3 Aug 2014 23:00:38 +0000 (23:00 +0000)]
CodeGen: silence a warning
GCC 4.8.2 objects to the tautological condition in the assert as the unsigned
value is guaranteed to be >= 0. Simplify the assertion by dropping the
tautological condition.
llvm-svn: 214671
Sanjay Patel [Sun, 3 Aug 2014 22:48:23 +0000 (22:48 +0000)]
fix for PR20354 - Miscompile of fabs due to vectorization
This is intended to be the minimal change needed to fix PR20354 ( http://llvm.org/bugs/show_bug.cgi?id=20354 ). The check for a vector operation was wrong; we need to check that the fabs itself is not a vector operation.
This patch will not generate the optimal code. A constant pool load and 'and' op will be generated instead of just returning a value that we can calculate in advance (as we do for the scalar case). I've put a 'TODO' comment for that here and expect to have that patch ready soon.
There is a very similar optimization that we can do in visitFNEG, so I've put another 'TODO' there and expect to have another patch for that too.
llvm-svn: 214670
Gerolf Hoflehner [Sun, 3 Aug 2014 22:03:40 +0000 (22:03 +0000)]
MachineCombiner Pass for selecting faster instruction
sequence - AArch64 target support
This patch turns off madd/msub generation in the DAGCombiner and generates
them in the MachineCombiner instead. It replaces the original code sequence
with the combined sequence when it is beneficial to do so.
When there is no machine model support it always generates the madd/msub
instruction. This is true also when the objective is to optimize for code
size: when the combined sequence is shorter is always chosen and does not
get evaluated.
When there is a machine model the combined instruction sequence
is evaluated for critical path and resource length using machine
trace metrics and the original code sequence is replaced when it is
determined to be faster.
rdar://
16319955
llvm-svn: 214669
Justin Bogner [Sun, 3 Aug 2014 21:46:33 +0000 (21:46 +0000)]
Driver: Simplify a use of the path API
It's a bit more obvious what's going on if we use path::filename
rather than decrementing an iterator here.
llvm-svn: 214668
Jason Molenda [Sun, 3 Aug 2014 21:42:52 +0000 (21:42 +0000)]
Change ProcessGDBRemote::DidLaunchOrAttach to
call Target::SetArchitecture instead of modifying a
reference to the target's architecture so that the
target logging can show that the arch has been changed.
llvm-svn: 214667
Gerolf Hoflehner [Sun, 3 Aug 2014 21:35:39 +0000 (21:35 +0000)]
MachineCombiner Pass for selecting faster instruction
sequence - target independent framework
When the DAGcombiner selects instruction sequences
it could increase the critical path or resource len.
For example, on arm64 there are multiply-accumulate instructions (madd,
msub). If e.g. the equivalent multiply-add sequence is not on the
crictial path it makes sense to select it instead of the combined,
single accumulate instruction (madd/msub). The reason is that the
conversion from add+mul to the madd could lengthen the critical path
by the latency of the multiply.
But the DAGCombiner would always combine and select the madd/msub
instruction.
This patch uses machine trace metrics to estimate critical path length
and resource length of an original instruction sequence vs a combined
instruction sequence and picks the faster code based on its estimates.
This patch only commits the target independent framework that evaluates
and selects code sequences. The machine instruction combiner is turned
off for all targets and expected to evolve over time by gradually
handling DAGCombiner pattern in the target specific code.
This framework lays the groundwork for fixing
rdar://
16319955
llvm-svn: 214666
Tobias Grosser [Sun, 3 Aug 2014 21:07:30 +0000 (21:07 +0000)]
Do allow negative offsets in the outermost array dimension
There is no needed for neither 1-dimensional nor higher dimensional arrays to
require positive offsets in the outermost array dimension.
We originally introduced this assumption with the support for delinearizing
multi-dimensional arrays.
llvm-svn: 214665
Saleem Abdulrasool [Sun, 3 Aug 2014 18:51:26 +0000 (18:51 +0000)]
MC: virtualise EmitWindowsUnwindTables
This makes EmitWindowsUnwindTables a virtual function and lowers the
implementation of the function to the X86WinCOFFStreamer. This method is a
target specific operation. This enables making the behaviour target dependent
by isolating it entirely to the target specific streamer.
llvm-svn: 214664
Saleem Abdulrasool [Sun, 3 Aug 2014 18:51:17 +0000 (18:51 +0000)]
MC: rename Win64EHFrameInfo to WinEH::FrameInfo
The frame information stored in this structure is driven by the requirements for
Windows NT unwinding rather than Windows 64 specifically. As a result, this
type can be shared across multiple architectures (ARM, AXP, MIPS, PPC, SH).
Rename this class in preparation for adding support for supporting unwinding
information for Windows on ARM.
Take the opportunity to constify the members as everything except the
ChainedParent is read-only. This required some adjustment to the label
handling.
llvm-svn: 214663
Simon Atanasyan [Sun, 3 Aug 2014 16:11:05 +0000 (16:11 +0000)]
[Mips] Add the `mips64-linux-gnu` target to the test case to check `in128`
type handling.
llvm-svn: 214662
Matt Arsenault [Sun, 3 Aug 2014 05:27:14 +0000 (05:27 +0000)]
R600/SI: Fix extra whitespace in asm str
This slipped in in r214467, so something like
V_MOV_B32_e32 v0, ... is now printed with 2 spaces
between the instruction name and first operand.
llvm-svn: 214660
Johannes Doerfert [Sun, 3 Aug 2014 01:51:59 +0000 (01:51 +0000)]
Fix the modifiable access creation
+ Remove the class IslGenerator which duplicates the functionality of
IslExprBuilder.
+ Use the IslExprBuilder to create code for memory access relations.
+ Also handle array types during access creation.
+ Enable scev codegen for one of the transformed memory access tests,
thus access creation without canonical induction variables available.
+ Update one test case to the new output.
llvm-svn: 214659
Johannes Doerfert [Sun, 3 Aug 2014 01:50:50 +0000 (01:50 +0000)]
Allow the IslExprBuilder to generate access operations
llvm-svn: 214658
Johannes Doerfert [Sun, 3 Aug 2014 01:48:49 +0000 (01:48 +0000)]
Update the jscop tests and port them to isl codegen.
The updated tests use a different context than the old ones did.
Other than that only their path and the code generation we use
changed.
llvm-svn: 214657
NAKAMURA Takumi [Sun, 3 Aug 2014 01:11:44 +0000 (01:11 +0000)]
Tools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease mingw32 builder.
llvm-svn: 214656
Manman Ren [Sat, 2 Aug 2014 23:41:54 +0000 (23:41 +0000)]
[SimplifyCFG] fix accessing deleted PHINodes in switch-to-table conversion.
When we have a covered lookup table, make sure we don't delete PHINodes that
are cached in PHIs.
rdar://
17887153
llvm-svn: 214642
Simon Atanasyan [Sat, 2 Aug 2014 20:18:31 +0000 (20:18 +0000)]
[Mips] Replace assembler code by YAML to make the 'gotsym.test' test
target independent.
llvm-svn: 214641
Joerg Sonnenberger [Sat, 2 Aug 2014 20:16:29 +0000 (20:16 +0000)]
tlbia support
llvm-svn: 214640
Joerg Sonnenberger [Sat, 2 Aug 2014 20:00:26 +0000 (20:00 +0000)]
mfdcr / mtdcr support
llvm-svn: 214639
Erik Eckstein [Sat, 2 Aug 2014 19:39:42 +0000 (19:39 +0000)]
fix bug 20513 - Crash in SLP Vectorizer
llvm-svn: 214638
James Molloy [Sat, 2 Aug 2014 17:15:11 +0000 (17:15 +0000)]
Update test to use a more modern AArch64 triple, as requested by Renato.
llvm-svn: 214637
Joerg Sonnenberger [Sat, 2 Aug 2014 15:09:41 +0000 (15:09 +0000)]
Don't use additional arguments for dss and friends to satisfy DSS_Form,
when let can do the same thing. Keep the 64bit variants as codegen-only.
While they have a different register class, the encoding is the same for
32bit and 64bit mode. Having both present would otherwise confuse the
disassembler.
llvm-svn: 214636
Joerg Sonnenberger [Sat, 2 Aug 2014 15:07:21 +0000 (15:07 +0000)]
vcfsx and dss instructions require immediates, variables are not valid.
llvm-svn: 214635
James Molloy [Sat, 2 Aug 2014 14:51:24 +0000 (14:51 +0000)]
[AArch64] Teach DAGCombiner that converting two consecutive loads into a vector load is not a good transform when paired loads are available.
The combiner was creating Q-register loads and stores, which then had to be spilled because there are no callee-save Q registers!
llvm-svn: 214634
Tobias Grosser [Sat, 2 Aug 2014 13:37:32 +0000 (13:37 +0000)]
Mark a GPGPU test case as XFAIL
This area of code is currently not very much tested. It will hopefully be
superseeded by Yabin's GSoC project.
llvm-svn: 214633
Tobias Grosser [Sat, 2 Aug 2014 13:37:25 +0000 (13:37 +0000)]
No need to run -mem2reg twice
llvm-svn: 214632
Chandler Carruth [Sat, 2 Aug 2014 11:34:23 +0000 (11:34 +0000)]
[x86] Remove the FIXME that was implemented in r214628. Managed to
forget to update the comment here... =/
llvm-svn: 214630
Chandler Carruth [Sat, 2 Aug 2014 11:17:41 +0000 (11:17 +0000)]
[x86] Give this test a bare metal triple so it doesn't use the weird
Darwin x86 asm comment prefix designed to work around GAS on that
platform. That makes the comment-matching of the test much more stable.
llvm-svn: 214629
Chandler Carruth [Sat, 2 Aug 2014 10:39:15 +0000 (10:39 +0000)]
[x86] Largely complete the use of PSHUFB in the new vector shuffle
lowering with a small addition to it and adding PSHUFB combining.
There is one obvious place in the new vector shuffle lowering where we
should form PSHUFBs directly: when without them we will unpack a vector
of i8s across two different registers and do a potentially 4-way blend
as i16s only to re-pack them into i8s afterward. This is the crazy
expensive fallback path for i8 shuffles and we can just directly use
pshufb here as it will always be cheaper (the unpack and pack are
two instructions so even a single shuffle between them hits our
three instruction limit for forming PSHUFB).
However, this doesn't generate very good code in many cases, and it
leaves a bunch of common patterns not using PSHUFB. So this patch also
adds support for extracting a shuffle mask from PSHUFB in the X86
lowering code, and uses it to handle PSHUFBs in the recursive shuffle
combining. This allows us to combine through them, combine multiple ones
together, and generally produce sufficiently high quality code.
Extracting the PSHUFB mask is annoyingly complex because it could be
either pre-legalization or post-legalization. At least this doesn't have
to deal with re-materialized constants. =] I've added decode routines to
handle the different patterns that show up at this level and we dispatch
through them as appropriate.
The two primary test cases are updated. For the v16 test case there is
still a lot of room for improvement. Since I was going through it
systematically I left behind a bunch of FIXME lines that I'm hoping to
turn into ALL lines by the end of this.
llvm-svn: 214628
Chandler Carruth [Sat, 2 Aug 2014 10:29:36 +0000 (10:29 +0000)]
[x86] Switch to using the variable we extracted this operand into.
Spotted this missed refactoring by inspection when reading code, and it
doesn't changethe functionality at all.
llvm-svn: 214627
Chandler Carruth [Sat, 2 Aug 2014 10:29:34 +0000 (10:29 +0000)]
[x86] Fix a few typos in my comments spotted in passing.
llvm-svn: 214626