Elena Demikhovsky [Mon, 1 Jun 2015 09:49:53 +0000 (09:49 +0000)]
AVX-512: Implemented vector shuffle lowering for v8i64 and v8f64 types.
I removed the vector-shuffle-512-v8.ll, it is auto-generated test, not valid any more.
llvm-svn: 238735
Denis Protivensky [Mon, 1 Jun 2015 09:26:32 +0000 (09:26 +0000)]
COFF: Fix warnings found by gcc
llvm-svn: 238734
Denis Protivensky [Mon, 1 Jun 2015 09:08:11 +0000 (09:08 +0000)]
COFF: Better noexcept specification with LLVM_NOEXCEPT
This is a follow-on to r238732
llvm-svn: 238733
Denis Protivensky [Mon, 1 Jun 2015 08:12:44 +0000 (08:12 +0000)]
COFF: Add noexcept to std::error_category::name
This fixes build error with gcc.
llvm-svn: 238732
David Majnemer [Mon, 1 Jun 2015 07:41:37 +0000 (07:41 +0000)]
[MS ABI] Be a little more defensive wrt vector types
We probably shouldn't say that all appropriately sized vector types are
intel vector types (i.e. __m128, etc.) as they don't exist for all
architectures. While this is largely academic, it'd save some debugging
if we supported such a platform.
llvm-svn: 238731
David Majnemer [Mon, 1 Jun 2015 07:34:26 +0000 (07:34 +0000)]
[WinCOFF] Ignore .safeseh for non-x86 architectures
We don't want to bother with creating .sxdata sections on Win64; all the
relevant information is already in the .pdata section.
llvm-svn: 238730
Elena Demikhovsky [Mon, 1 Jun 2015 07:17:23 +0000 (07:17 +0000)]
AVX-512: added all forms of VPSHUFD and VPSHUFHW, VPSHUFLW
including encodings.
llvm-svn: 238729
Elena Demikhovsky [Mon, 1 Jun 2015 06:50:49 +0000 (06:50 +0000)]
AVX-512: Implemented VFIXUPIMMPD and VFIXUPIMMPS instructions for KNL and SKX
Implemented DAG lowering for all these forms.
Added tests for encoding.
by Igor Breger (igor.breger@intel.com)
llvm-svn: 238728
Craig Topper [Mon, 1 Jun 2015 06:44:18 +0000 (06:44 +0000)]
[TableGen] Move a couple virtual methods out of line so vtable anchors can be removed. NFC
llvm-svn: 238727
Craig Topper [Mon, 1 Jun 2015 06:44:16 +0000 (06:44 +0000)]
[TableGen] Remove unnecessary explicit initialization to null of a unique_ptr. NFC
llvm-svn: 238726
Craig Topper [Mon, 1 Jun 2015 06:44:14 +0000 (06:44 +0000)]
[TableGen] Remove unnecessary forward declarations. NFC
llvm-svn: 238725
Elena Demikhovsky [Mon, 1 Jun 2015 06:30:13 +0000 (06:30 +0000)]
AVX-512: Fixed a bug in compress and expand intrinsics.
By Igor Breger (igor.breger@intel.com)
llvm-svn: 238724
Matt Arsenault [Mon, 1 Jun 2015 05:31:59 +0000 (05:31 +0000)]
Add address space argument to isLegalAddressingMode
This is important because of different addressing modes
depending on the address space for GPU targets.
This only adds the argument, and does not update
any of the uses to provide the correct address space.
llvm-svn: 238723
Chaoren Lin [Mon, 1 Jun 2015 04:28:12 +0000 (04:28 +0000)]
Remove "%zu" format specifier for MSVC.
Reviewers: zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10153
llvm-svn: 238722
Jonathan Peyton [Mon, 1 Jun 2015 04:24:23 +0000 (04:24 +0000)]
Apply name change to testsuite file.
This change has the llvm-lit part of the testsuite have clang
link to libomp instead of libiomp5.
llvm-svn: 238721
Jonathan Peyton [Mon, 1 Jun 2015 04:21:22 +0000 (04:21 +0000)]
Apply name change to Makefile build system.
This change produces a dynamic library named libomp instead of
libiomp5. Similar to the CMake change, it produces symlinks of libiomp5
in the exports/ directory for Unix systems and copies for Windows.
llvm-svn: 238720
Rui Ueyama [Mon, 1 Jun 2015 03:55:04 +0000 (03:55 +0000)]
COFF: Fix the import table Hint/Name field.
llvm-svn: 238719
Rui Ueyama [Mon, 1 Jun 2015 03:55:02 +0000 (03:55 +0000)]
Fix comments.
llvm-svn: 238718
Rui Ueyama [Mon, 1 Jun 2015 03:42:54 +0000 (03:42 +0000)]
COFF: Fix /include. Included symbols are GC-roots.
llvm-svn: 238717
David Blaikie [Mon, 1 Jun 2015 03:09:34 +0000 (03:09 +0000)]
[opaque pointer type] Explicitly store the pointee type of the result of a GEP
Alternatively, this type could be derived on-demand whenever
getResultElementType is called - if someone thinks that's the better
choice (simple time/space tradeoff), I'm happy to give it a go.
llvm-svn: 238716
Jonathan Peyton [Mon, 1 Jun 2015 03:05:13 +0000 (03:05 +0000)]
Apply name change to CMake build system.
This change has the CMake build system create a dynamic library named
libomp instead of libiomp5. Also any reference to libiomp is replaced
with libomp. One can still use the LIBOMP_LIB_NAME variable to enforce
a different name, and everything will still work as expected. An important
note is that libiomp5 and libgomp symlinks are created at install time when
on Unix systems. On Windows, copies are created with the legacy names.
llvm-svn: 238715
Rui Ueyama [Mon, 1 Jun 2015 02:58:15 +0000 (02:58 +0000)]
COFF: Define an error category for the linker.
Instead of returning non-categorized errors, return categorized errors.
All uses of make_dynamic_error_code are removed.
Because we don't have error reporting mechanism, I just chose to print out
error messages to stderr, and then return an error object. Not sure if
that's the right thing to do, but at least it seems practical.
http://reviews.llvm.org/D10129
llvm-svn: 238714
Jonathan Peyton [Mon, 1 Jun 2015 02:41:44 +0000 (02:41 +0000)]
Apply name change to tools/* files.
These changes are all in comments. Change libiomp references to
libomp.
llvm-svn: 238713
Jonathan Peyton [Mon, 1 Jun 2015 02:37:28 +0000 (02:37 +0000)]
Apply name change to src/* files.
These changes are mostly in comments, but there are a few
that aren't. Change libiomp5 => libomp everywhere. One internal
function name is changed in kmp_gsupport.c, and in kmp_i18n.c, the
static char[] variable 'name' is changed to "libomp".
llvm-svn: 238712
Jonathan Peyton [Mon, 1 Jun 2015 02:32:03 +0000 (02:32 +0000)]
Apply name change to doxygen files.
This change only affects the doxygen file that contains a
reference to libiomp5. change libiomp5 to libomp.
llvm-svn: 238711
Jonathan Peyton [Mon, 1 Jun 2015 02:26:08 +0000 (02:26 +0000)]
Adding libomp.rc.var for name change
Adding a new file libomp.rc.var in anticipation of more
name change commits. This file is a copy of libiomp.rc.var.
llvm-svn: 238710
Rafael Espindola [Mon, 1 Jun 2015 02:18:14 +0000 (02:18 +0000)]
Try to fix the build of IntelJITEventListener.
llvm-svn: 238709
Rafael Espindola [Mon, 1 Jun 2015 01:52:18 +0000 (01:52 +0000)]
Rename HasData to IsRegistered.
There is no MCSectionData, so the old name is now meaningless.
Also remove some asserts/checks that were there just because the information
they used was in MCSectionData.
llvm-svn: 238708
Rafael Espindola [Mon, 1 Jun 2015 01:39:15 +0000 (01:39 +0000)]
Remove trivial forwarding function.
llvm-svn: 238707
Rafael Espindola [Mon, 1 Jun 2015 01:30:01 +0000 (01:30 +0000)]
Store a bit in MCSection saying if it was registered with MCAssembler.
With this we can replace a SetVector with a plain std::vector.
llvm-svn: 238706
Rafael Espindola [Mon, 1 Jun 2015 01:05:07 +0000 (01:05 +0000)]
Use a bitfield. NFC.
llvm-svn: 238705
Rafael Espindola [Mon, 1 Jun 2015 00:58:31 +0000 (00:58 +0000)]
Use a 32 bit field for the symbol index.
Even 64 ELF uses a 32 bit field to refer to symbols.
llvm-svn: 238704
Rafael Espindola [Mon, 1 Jun 2015 00:27:26 +0000 (00:27 +0000)]
Simplify another function that doesn't fail.
llvm-svn: 238703
David Majnemer [Mon, 1 Jun 2015 00:15:08 +0000 (00:15 +0000)]
[PHITransAddr] Don't translate unreachable values
Unreachable values may use themselves in strange ways due to their
dominance property. Attempting to translate through them can lead to
infinite recursion, crashing LLVM. Instead, claim that we weren't able
to translate the value.
This fixes PR23096.
llvm-svn: 238702
David Majnemer [Mon, 1 Jun 2015 00:15:04 +0000 (00:15 +0000)]
[PHITransAddr] Use std::find instead of std::count
There is no need to visit all the elements if we are merely performing a
membership check. NFCI.
llvm-svn: 238701
Rafael Espindola [Sun, 31 May 2015 23:52:50 +0000 (23:52 +0000)]
Simplify interface of function that doesn't fail.
llvm-svn: 238700
Keno Fischer [Sun, 31 May 2015 23:37:04 +0000 (23:37 +0000)]
[DWARF] Fix a bug in line info handling
This fixes a bug in the line info handling in the dwarf code, based on a
problem I when implementing RelocVisitor support for MachO.
Since addr+size will give the first address past the end of the function,
we need to back up one line table entry. Fix this by looking up the
end_addr-1, which is the last address in the range. Note that this also
removes a duplicate output from the llvm-rtdyld line table dump. The
relevant line is the end_sequence one in the line table and has an offset
of the first address part the end of the range and hence should not be
included.
Also factor out the common functionality into a separate function.
This comes up on MachO much more than on ELF, since MachO
doesn't store the symbol size separately, hence making
said situation always occur.
Differential Revision: http://reviews.llvm.org/D9925
llvm-svn: 238699
Rafael Espindola [Sun, 31 May 2015 23:15:35 +0000 (23:15 +0000)]
For COFF and MachO, compute the gap between to symbols.
Before r238028 we used to do this in O(N^2), now we do it in O(N log N).
llvm-svn: 238698
NAKAMURA Takumi [Sun, 31 May 2015 23:05:35 +0000 (23:05 +0000)]
ARMConstantIslandPass.cpp: Prune an empty \brief. [-Wdocumentation]
llvm-svn: 238697
Rui Ueyama [Sun, 31 May 2015 22:31:31 +0000 (22:31 +0000)]
COFF: Add /alternatename option.
Previously, this feature was implemented using a special type of
undefined symbol, in addition to an intricate way to make the resolver
read a virtual file containing that renaming symbols.
Now the feature is directly handled by the symbol table.
The symbol table has a function, rename(), to rename symbols, whose
definition is 4 lines long. Symbol renaming is naturally modeled using
Symbol and SymbolBody.
llvm-svn: 238696
Colin LeMahieu [Sun, 31 May 2015 22:29:33 +0000 (22:29 +0000)]
[Hexagon] Including raw_ostream for debug builds.
llvm-svn: 238695
Colin LeMahieu [Sun, 31 May 2015 22:18:42 +0000 (22:18 +0000)]
[Hexagon] classes are actually structs.
llvm-svn: 238694
Rafael Espindola [Sun, 31 May 2015 22:13:51 +0000 (22:13 +0000)]
Use a range loop. NFC.
llvm-svn: 238693
Colin LeMahieu [Sun, 31 May 2015 21:57:09 +0000 (21:57 +0000)]
[Hexagon] Adding MC packet shuffler.
llvm-svn: 238692
Rui Ueyama [Sun, 31 May 2015 21:17:10 +0000 (21:17 +0000)]
COFF: Detect file type by file magic.
llvm-svn: 238691
Rui Ueyama [Sun, 31 May 2015 21:04:56 +0000 (21:04 +0000)]
COFF: Make the Driver own all MemoryBuffers. NFC.
Previously, a MemoryBuffer of a file was owned by each InputFile object.
This patch makes the Driver own all of them. InputFiles now have only
MemoryBufferRefs. This change simplifies ownership managment
(particularly for ObjectFile -- the object owned a MemoryBuffer only when
it's not created from an archive file, because in that case a parent
archive file owned the entire buffer. Now it owns nothing unconditionally.)
llvm-svn: 238690
Simon Atanasyan [Sun, 31 May 2015 20:37:22 +0000 (20:37 +0000)]
[Mips] Add a couple of MipsAbiInfoHandler functions to check linked code type
No functional changes.
llvm-svn: 238689
Simon Atanasyan [Sun, 31 May 2015 20:37:13 +0000 (20:37 +0000)]
[Mips] Do not put the .reginfo section into the separate segment
The .reginfo should not belong to the separate segment if there is
a .MIPS.abiflags section.
llvm-svn: 238688
Simon Atanasyan [Sun, 31 May 2015 20:36:58 +0000 (20:36 +0000)]
[Mips] Sort segments so PT_MIPS_ABIFLAGS goes right after the PT_INTERP
llvm-svn: 238687
Simon Atanasyan [Sun, 31 May 2015 20:36:43 +0000 (20:36 +0000)]
[Mips] Reading, merging and writing .MIPS.abiflags section
http://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
llvm-svn: 238686
Simon Atanasyan [Sun, 31 May 2015 20:36:21 +0000 (20:36 +0000)]
[Mips] Delete MipsReginfo structure. Use the Elf_Mips_RegInfo instead.
llvm-svn: 238685
Simon Atanasyan [Sun, 31 May 2015 20:36:11 +0000 (20:36 +0000)]
[Mips] Collect all ABI related info in the single MipsAbiInfoHandler class
New MipsAbiInfoHandler merges and hold both ELF header flags
and registries usage masks. In the future commits it will manage some
additional information.
llvm-svn: 238684
Rui Ueyama [Sun, 31 May 2015 20:20:37 +0000 (20:20 +0000)]
COFF: /libpath should not take precedence over the current directory.
llvm-svn: 238683
Rui Ueyama [Sun, 31 May 2015 20:10:11 +0000 (20:10 +0000)]
COFF: Add /libpath option.
llvm-svn: 238682
Rui Ueyama [Sun, 31 May 2015 19:55:40 +0000 (19:55 +0000)]
COFF: Add /include option.
It does not involve notions of virtual archives or virtual files,
nor store a list of undefined symbols somewhere else to consume them later.
We did that before. In this patch, undefined symbols are just added to
the symbol table, which now can be done in very few lines of code.
llvm-svn: 238681
Tim Northover [Sun, 31 May 2015 19:22:07 +0000 (19:22 +0000)]
ARM: recommit r237590: allow jump tables to be placed as constant islands.
The original version didn't properly account for the base register
being modified before the final jump, so caused miscompilations in
Chromium and LLVM. I've fixed this and tested with an LLVM self-host
(I don't have the means to build & test Chromium).
The general idea remains the same: in pathological cases jump tables
can be too far away from the instructions referencing them (like other
constants) so they need to be movable.
Should fix PR23627.
llvm-svn: 238680
Rui Ueyama [Sun, 31 May 2015 19:17:14 +0000 (19:17 +0000)]
COFF: Add /nodefaultlib option.
llvm-svn: 238679
Rui Ueyama [Sun, 31 May 2015 19:17:12 +0000 (19:17 +0000)]
COFF: Refactor functions to find files from search paths.
llvm-svn: 238678
Rui Ueyama [Sun, 31 May 2015 19:17:09 +0000 (19:17 +0000)]
COFF: Create LinkerDriver class.
Previously the main linker routine is just a non-member function.
We store some context information to the Config object.
This patch makes it belong to Driver.
llvm-svn: 238677
Benjamin Kramer [Sun, 31 May 2015 18:49:28 +0000 (18:49 +0000)]
[MC] Simplify code. No functionality change intended.
llvm-svn: 238676
Rui Ueyama [Sun, 31 May 2015 16:10:50 +0000 (16:10 +0000)]
COFF: Use range-based for loop.
llvm-svn: 238675
Marshall Clow [Sun, 31 May 2015 14:01:54 +0000 (14:01 +0000)]
Remove debugging code
llvm-svn: 238674
Benjamin Kramer [Sun, 31 May 2015 11:18:05 +0000 (11:18 +0000)]
[Format] Move UnwrappedLines instead of copying.
No functional change intended.
llvm-svn: 238673
Daniel Jasper [Sun, 31 May 2015 08:51:54 +0000 (08:51 +0000)]
clang-format: NFC. Cleanup after r237895.
Specifically adhere to LLVM Coding Standards (no 'else' after
return/break/continue) and remove yet another implementation of
paren counting. We already have enough of those in the
UnwrappedLineParser.
No functional changes intended.
llvm-svn: 238672
Daniel Jasper [Sun, 31 May 2015 08:40:37 +0000 (08:40 +0000)]
clang-format: [JS] Fix line breaks in computed property names.
Before:
let foo = {
[someLongKeyHere]: 1,
someOtherLongKeyHere: 2, [keyLongEnoughToWrap]: 3,
lastLongKey: 4
};
After:
let foo = {
[someLongKeyHere]: 1,
someOtherLongKeyHere: 2,
[keyLongEnoughToWrap]: 3,
lastLongKey: 4
};
llvm-svn: 238671
Rui Ueyama [Sun, 31 May 2015 04:21:30 +0000 (04:21 +0000)]
COFF: Remove redundant options from tests.
llvm-svn: 238670
Rui Ueyama [Sun, 31 May 2015 03:57:30 +0000 (03:57 +0000)]
Fix unsafe memory access.
llvm-svn: 238669
Rui Ueyama [Sun, 31 May 2015 03:55:46 +0000 (03:55 +0000)]
COFF: Implement subsystem inference.
llvm-svn: 238668
Rui Ueyama [Sun, 31 May 2015 03:34:08 +0000 (03:34 +0000)]
COFF: Infer entry symbol name if /entry is not given.
`main` is not the only main function in Windows. You can choose one
from these four -- {w,}{WinMain,main}. There are four different entry
point functions for them, {w,}{WinMain,main}CRTStartup, respectively.
The linker needs to choose the right one depending on which `main`
function is defined.
llvm-svn: 238667
Marshall Clow [Sun, 31 May 2015 03:13:31 +0000 (03:13 +0000)]
Don't try to memcpy zero bytes; sometimes the source pointer is NULL, and that's UB. Thanks to Nuno Lopes for the catch.
llvm-svn: 238666
Davide Italiano [Sat, 30 May 2015 22:43:36 +0000 (22:43 +0000)]
Clarify how the binary file checked in was generated.
llvm-svn: 238665
Colin LeMahieu [Sat, 30 May 2015 20:03:07 +0000 (20:03 +0000)]
[Hexagon] Adding override specifier and removing erroneous assertion
llvm-svn: 238664
Keno Fischer [Sat, 30 May 2015 19:44:53 +0000 (19:44 +0000)]
Add RelocVisitor support for MachO
This commit adds partial support for MachO relocations to RelocVisitor.
A simple test case is added to show that relocations are indeed being
applied and that using llvm-dwarfdump on MachO files no longer errors.
Correctness is not yet tested, due to an unrelated bug in DebugInfo,
which will be fixed with appropriate testcase in a followup commit.
Differential Revision: http://reviews.llvm.org/D8148
llvm-svn: 238663
Rui Ueyama [Sat, 30 May 2015 19:28:58 +0000 (19:28 +0000)]
Use initializer instead of memset to zero out.
llvm-svn: 238662
Rui Ueyama [Sat, 30 May 2015 19:09:50 +0000 (19:09 +0000)]
COFF: Support long section name.
Section names were truncated to 8 bytes because the section table's
name field is 8 byte long. This patch creates the string table to
store long names.
llvm-svn: 238661
Colin LeMahieu [Sat, 30 May 2015 18:55:47 +0000 (18:55 +0000)]
[Hexagon] Adding basic relaxation functionality.
llvm-svn: 238660
Colin LeMahieu [Sat, 30 May 2015 18:42:22 +0000 (18:42 +0000)]
[MC] Allow backends to decide relaxation for unresolved fixups.
Differential Revision: http://reviews.llvm.org/D8217
llvm-svn: 238659
Kostya Serebryany [Sat, 30 May 2015 17:33:13 +0000 (17:33 +0000)]
[lib/Fuzzer] make assertions more informative and update comments for the user-supplied mutator
llvm-svn: 238658
Nuno Lopes [Sat, 30 May 2015 16:11:40 +0000 (16:11 +0000)]
ubsan: Check for null pointers given to certain builtins, such
as memcpy, memset, memmove, and bzero.
Reviewed by: Richard Smith
Differential Revision: http://reviews.llvm.org/D9673
llvm-svn: 238657
Logan Chien [Sat, 30 May 2015 14:00:39 +0000 (14:00 +0000)]
Code cleanup: Reindent statements.
llvm-svn: 238656
Benjamin Kramer [Sat, 30 May 2015 13:52:30 +0000 (13:52 +0000)]
[MC] Reorder MCSymbol members to reduce padding.
sizeof(MCSymbol) goes from 72 to 64 bytes on x86_64.
llvm-svn: 238655
Simon Pilgrim [Sat, 30 May 2015 13:01:42 +0000 (13:01 +0000)]
Stripped trailing whitespace. NFC.
llvm-svn: 238654
Renato Golin [Sat, 30 May 2015 10:44:07 +0000 (10:44 +0000)]
Comment change. NFC
That comment misleads the current discussions in mentioned bug. Leave
the discussions to the bug. Also, adding a future change FIXME.
llvm-svn: 238653
Chandler Carruth [Sat, 30 May 2015 10:35:03 +0000 (10:35 +0000)]
[x86] Unify the horizontal adding used for popcount lowering taking the
best approach of each.
For vNi16, we use SHL + ADD + SRL pattern that seem easily the best.
For vNi32, we use the PUNPCK + PSADBW + PACKUSWB pattern. In some cases
there is a huge improvement with this in IACA's estimated throughput --
over 2x higher throughput!!!! -- but the measurements are too good to be
true. In one narrow case, the SHL + ADD + SHL + ADD + SRL pattern looks
slightly faster, but I'm not sure I believe any of the measurements at
this point. Both are the exact same uops though. Hard to be confident of
anything past that.
If anyone wants to collect very detailed (Agner-level) timings with the
result of this patch, or with the i32 case replaced with SHL + ADD + SHl
+ ADD + SRL, I'd be very interested. Note that you'll need to test it on
both Ivybridge and Haswell, with both SSE3, SSSE3, and AVX selected as
I saw unique behavior in each of these buckets with IACA all of which
should be checked against measured performance.
But this patch is still a useful improvement by dropping duplicate work
and getting the much nicer PSADBW lowering for v2i64.
I'd still like to rephrase this in terms of generic horizontal sum. It's
a bit lame to have a special case of that just for popcount.
llvm-svn: 238652
Renato Golin [Sat, 30 May 2015 10:30:02 +0000 (10:30 +0000)]
[ARMTargetParser] Move IAS arch ext parser. NFC
The plan was to move the whole table into the already existing ArchExtNames
but some fields depend on a table-generated file, and we don't yet have this
feature in the generic lib/Support side.
Once the minimum target-specific table-generated files are available in a
generic fashion to these libraries, we'll have to keep it in the ASM parser.
llvm-svn: 238651
Chandler Carruth [Sat, 30 May 2015 09:46:16 +0000 (09:46 +0000)]
[x86] Split out the horizontal byte sum lowering component of the LUT
lowering into a helper function.
NFC.
llvm-svn: 238650
David Majnemer [Sat, 30 May 2015 09:12:07 +0000 (09:12 +0000)]
[CodeGen] Indirect fields can initialize a union
The first named data member is the field used to default initialize the
union. An IndirectFieldDecl can introduce the first named data member
of a union.
llvm-svn: 238649
Craig Topper [Sat, 30 May 2015 07:36:01 +0000 (07:36 +0000)]
[TableGen] Merge RecTy::typeIsConvertibleTo and RecTy::baseClassOf. NFC
typeIsConvertibleTo was just calling baseClassOf(this) on the argument passed to it, but there weren't different signatures for baseClassOf so passing 'this' didn't really do anything interesting. typeIsConvertibleTo could have just been a non-virtual method in RecTy. But since that would be kind of a silly method, I instead re-distributed the logic from baseClassOf into typeIsConvertibleTo.
llvm-svn: 238648
Craig Topper [Sat, 30 May 2015 07:35:21 +0000 (07:35 +0000)]
Fix indentation. NFC.
llvm-svn: 238647
Craig Topper [Sat, 30 May 2015 07:34:51 +0000 (07:34 +0000)]
[TableGen] Remove all the variations of RecTy::convertValue and just handle the conversions in convertInitializerTo directly. This saves a bunch of vtable entries. NFC
llvm-svn: 238646
Tobias Grosser [Sat, 30 May 2015 06:46:59 +0000 (06:46 +0000)]
Dump YAML schedule tree as properly indented tree in DEBUG output
llvm-svn: 238645
Tobias Grosser [Sat, 30 May 2015 06:26:21 +0000 (06:26 +0000)]
Add DEBUG output to -polly-scops pass
llvm-svn: 238644
Tobias Grosser [Sat, 30 May 2015 06:16:41 +0000 (06:16 +0000)]
Add indvar pass to canonicalization sequence
Running indvar before Polly is useful as this eliminates zexts as they commonly
appear when a 32 bit induction variable (type int) was used on a 64 bit system.
These zexts confuse our delinearization and prevent for example the successful
delinearization of the nussinov kernel in polybench-c-4.1.
This fixes http://llvm.org/PR23426
Suggested-by: Xing Su <xsu.llvm@outlook.com>
llvm-svn: 238643
Chandler Carruth [Sat, 30 May 2015 06:02:37 +0000 (06:02 +0000)]
[x86] Update the order of instructions after I switched to a bitcast
helper that skips creating a cast when it isn't necessary.
It's really somewhat concerning that this was caused by the the presence
of a no-op bitcast, but...
llvm-svn: 238642
David Majnemer [Sat, 30 May 2015 04:56:02 +0000 (04:56 +0000)]
[WinCOFF] Add support for the .safeseh directive
.safeseh adds an entry to the .sxdata section to register all the
appropriate functions which may handle an exception. This entry is not
a relocation to the symbol but instead the symbol table index of the
function.
llvm-svn: 238641
Chandler Carruth [Sat, 30 May 2015 04:23:13 +0000 (04:23 +0000)]
[x86] Replace the long spelling of getting a bitcast with the *much*
shorter one. NFC.
In addition to being much shorter to type and requiring fewer arguments,
this change saves over 30 lines from this one file, all wasted on total
boilerplate...
llvm-svn: 238640
Chandler Carruth [Sat, 30 May 2015 04:19:57 +0000 (04:19 +0000)]
[x86] Replace the long spelling of getting a bitcast with the new short
spelling. NFC.
llvm-svn: 238639
Chandler Carruth [Sat, 30 May 2015 04:14:10 +0000 (04:14 +0000)]
[sdag] Add the helper I most want to the DAG -- building a bitcast
around a value using its existing SDLoc.
Start using this in just one function to save omg lines of code.
llvm-svn: 238638
Chandler Carruth [Sat, 30 May 2015 04:05:11 +0000 (04:05 +0000)]
[x86] Restore the bitcasts I removed when refactoring this to avoid
shifting vectors of bytes as x86 doesn't have direct support for that.
This removes a bunch of redundant masking in the generated code for SSE2
and SSE3.
In order to avoid the really significant code size growth this would
have triggered, I also factored the completely repeatative logic for
shifting and masking into two lambdas which in turn makes all of this
much easier to read IMO.
llvm-svn: 238637
Chandler Carruth [Sat, 30 May 2015 03:20:59 +0000 (03:20 +0000)]
[x86] Implement a faster vector population count based on the PSHUFB
in-register LUT technique.
Summary:
A description of this technique can be found here:
http://wm.ite.pl/articles/sse-popcount.html
The core of the idea is to use an in-register lookup table and the
PSHUFB instruction to compute the population count for the low and high
nibbles of each byte, and then to use horizontal sums to aggregate these
into vector population counts with wider element types.
On x86 there is an instruction that will directly compute the horizontal
sum for the low 8 and high 8 bytes, giving vNi64 popcount very easily.
Various tricks are used to get vNi32 and vNi16 from the vNi8 that the
LUT computes.
The base implemantion of this, and most of the work, was done by Bruno
in a follow up to D6531. See Bruno's detailed post there for lots of
timing information about these changes.
I have extended Bruno's patch in the following ways:
0) I committed the new tests with baseline sequences so this shows
a diff, and regenerated the tests using the update scripts.
1) Bruno had noticed and mentioned in IRC a redundant mask that
I removed.
2) I introduced a particular optimization for the i32 vector cases where
we use PSHL + PSADBW to compute the the low i32 popcounts, and PSHUFD
+ PSADBW to compute doubled high i32 popcounts. This takes advantage
of the fact that to line up the high i32 popcounts we have to shift
them anyways, and we can shift them by one fewer bit to effectively
divide the count by two. While the PSHUFD based horizontal add is no
faster, it doesn't require registers or load traffic the way a mask
would, and provides more ILP as it happens on different ports with
high throughput.
3) I did some code cleanups throughout to simplify the implementation
logic.
4) I refactored it to continue to use the parallel bitmath lowering when
SSSE3 is not available to preserve the performance of that version on
SSE2 targets where it is still much better than scalarizing as we'll
still do a bitmath implementation of popcount even in scalar code
there.
With #1 and #2 above, I analyzed the result in IACA for sandybridge,
ivybridge, and haswell. In every case I measured, the throughput is the
same or better using the LUT lowering, even v2i64 and v4i64, and even
compared with using the native popcnt instruction! The latency of the
LUT lowering is often higher than the latency of the scalarized popcnt
instruction sequence, but I think those latency measurements are deeply
misleading. Keeping the operation fully in the vector unit and having
many chances for increased throughput seems much more likely to win.
With this, we can lower every integer vector popcount implementation
using the LUT strategy if we have SSSE3 or better (and thus have
PSHUFB). I've updated the operation lowering to reflect this. This also
fixes an issue where we were scalarizing horribly some AVX lowerings.
Finally, there are some remaining cleanups. There is duplication between
the two techniques in how they perform the horizontal sum once the byte
population count is computed. I'm going to factor and merge those two in
a separate follow-up commit.
Differential Revision: http://reviews.llvm.org/D10084
llvm-svn: 238636