Rafael Espindola [Mon, 1 Jun 2015 15:10:51 +0000 (15:10 +0000)]
Fix relocation selection for foo-. on mips.
This handles only the 32 bit case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238751
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 1 Jun 2015 14:58:29 +0000 (14:58 +0000)]
Simplify code, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238750
91177308-0d34-0410-b5e6-
96231b3b80d8
Artur Pilipenko [Mon, 1 Jun 2015 14:53:55 +0000 (14:53 +0000)]
Add isConstant argument to MDBuilder::createTBAAStructTagNode
According to the TBAA description struct-path tag node can have an optional IsConstant field. Add corresponding argument to MDBuilder::createTBAAStructTagNode.
Reviewed By: hfinkel
Differential Revision: http://reviews.llvm.org/D10160
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238749
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 1 Jun 2015 14:51:26 +0000 (14:51 +0000)]
[Hexagon] Adding basic ELF relocation generation and testing advanced relaxation codepath.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238748
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 1 Jun 2015 14:34:40 +0000 (14:34 +0000)]
The fragment implies the section, don't store both.
This reduces MCSymbol from 64 to 56 bytes on x86_64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238747
91177308-0d34-0410-b5e6-
96231b3b80d8
Asaf Badouh [Mon, 1 Jun 2015 13:56:00 +0000 (13:56 +0000)]
First commit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238745
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Bedwell [Mon, 1 Jun 2015 13:40:14 +0000 (13:40 +0000)]
[CMake] Revert commits r238740/r238741 for embedding Windows version info.
The clang Windows bots are showing mysterious failures.
Reverting until I can figure out what's going on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238744
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 1 Jun 2015 13:26:18 +0000 (13:26 +0000)]
AVX-512: Optimized vector shuffle for v16f32 and v16i32 types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238743
91177308-0d34-0410-b5e6-
96231b3b80d8
Luke Cheeseman [Mon, 1 Jun 2015 13:18:53 +0000 (13:18 +0000)]
Removing commited assembly file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238742
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Bedwell [Mon, 1 Jun 2015 13:06:10 +0000 (13:06 +0000)]
remove the use of the LOCATION CMake variable from r238740.
It caused the following failure:
"Policy CMP0026 is not set: Disallow use of the LOCATION target property."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238741
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Bedwell [Mon, 1 Jun 2015 12:41:55 +0000 (12:41 +0000)]
In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
This embeds Windows version information into our executables and DLLs.
The most visible place to view this data is in the details tab of the file
properties window in Windows explorer.
Differential Revision: http://reviews.llvm.org/D7828
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238740
91177308-0d34-0410-b5e6-
96231b3b80d8
Luke Cheeseman [Mon, 1 Jun 2015 12:02:47 +0000 (12:02 +0000)]
Re-commit of r238201 with fix for building with shared libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238739
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 1 Jun 2015 11:05:34 +0000 (11:05 +0000)]
AVX-512: Implemented VRANGEPD and VRANGEPD instructions for SKX.
Implemented DAG lowering for all these forms.
Added tests for encoding.
By Igor Breger (igor.breger@intel.com)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238738
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238735
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238730
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238729
91177308-0d34-0410-b5e6-
96231b3b80d8
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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238728
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238727
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238726
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 1 Jun 2015 06:44:14 +0000 (06:44 +0000)]
[TableGen] Remove unnecessary forward declarations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238725
91177308-0d34-0410-b5e6-
96231b3b80d8
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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238724
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238723
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238716
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 1 Jun 2015 02:18:14 +0000 (02:18 +0000)]
Try to fix the build of IntelJITEventListener.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238709
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238708
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 1 Jun 2015 01:39:15 +0000 (01:39 +0000)]
Remove trivial forwarding function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238707
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238706
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 1 Jun 2015 01:05:07 +0000 (01:05 +0000)]
Use a bitfield. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238705
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238704
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 1 Jun 2015 00:27:26 +0000 (00:27 +0000)]
Simplify another function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238703
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238702
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238701
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sun, 31 May 2015 23:52:50 +0000 (23:52 +0000)]
Simplify interface of function that doesn't fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238700
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238699
91177308-0d34-0410-b5e6-
96231b3b80d8
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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238698
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 31 May 2015 23:05:35 +0000 (23:05 +0000)]
ARMConstantIslandPass.cpp: Prune an empty \brief. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238697
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sun, 31 May 2015 22:29:33 +0000 (22:29 +0000)]
[Hexagon] Including raw_ostream for debug builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238695
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sun, 31 May 2015 22:18:42 +0000 (22:18 +0000)]
[Hexagon] classes are actually structs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238694
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sun, 31 May 2015 22:13:51 +0000 (22:13 +0000)]
Use a range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238693
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sun, 31 May 2015 21:57:09 +0000 (21:57 +0000)]
[Hexagon] Adding MC packet shuffler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238692
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238680
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 31 May 2015 18:49:28 +0000 (18:49 +0000)]
[MC] Simplify code. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238676
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 30 May 2015 22:43:36 +0000 (22:43 +0000)]
Clarify how the binary file checked in was generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238665
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sat, 30 May 2015 20:03:07 +0000 (20:03 +0000)]
[Hexagon] Adding override specifier and removing erroneous assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238664
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238663
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sat, 30 May 2015 18:55:47 +0000 (18:55 +0000)]
[Hexagon] Adding basic relaxation functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238660
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238659
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238658
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238655
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 30 May 2015 13:01:42 +0000 (13:01 +0000)]
Stripped trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238654
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238653
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238652
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238651
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238650
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238648
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 30 May 2015 07:35:21 +0000 (07:35 +0000)]
Fix indentation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238647
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238646
91177308-0d34-0410-b5e6-
96231b3b80d8
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...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238642
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238641
91177308-0d34-0410-b5e6-
96231b3b80d8
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...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238640
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238639
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238638
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238637
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238636
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 30 May 2015 03:20:55 +0000 (03:20 +0000)]
[x86] Restructure the parallel bitmath lowering of popcount into
a separate routine, generalize it to work for all the integer vector
sizes, and do general code cleanups.
This dramatically improves lowerings of byte and short element vector
popcount, but more importantly it will make the introduction of the
LUT-approach much cleaner.
The biggest cleanup I've done is to just force the legalizer to do the
bitcasting we need. We run these iteratively now and it makes the code
much simpler IMO. Other changes were minor, and mostly naming and
splitting things up in a way that makes it more clear what is going on.
The other significant change is to use a different final horizontal sum
approach. This is the same number of instructions as the old method, but
shifts left instead of right so that we can clear everything but the
final sum with a single shift right. This seems likely better than
a mask which will usually have to read the mask from memory. It is
certaily fewer u-ops. Also, this will be temporary. This and the LUT
approach share the need of horizontal adds to finish the computation,
and we have more clever approaches than this one that I'll switch over
to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238635
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Sat, 30 May 2015 01:25:56 +0000 (01:25 +0000)]
MC: Clean up MCExpr naming. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238634
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Sat, 30 May 2015 00:17:20 +0000 (00:17 +0000)]
[BitcodeReader] Change an assert to a call to a call to Error()
It's reachable from user input.
Bug found with AFL fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238633
91177308-0d34-0410-b5e6-
96231b3b80d8
Fiona Glaser [Fri, 29 May 2015 23:37:22 +0000 (23:37 +0000)]
SelectionDAG: fix logic for promoting shift types
r238503 fixed the problem of too-small shift types by promoting them
during legalization, but the correct solution is to promote only the
operands that actually demand promotion.
This fixes a crash on an out-of-tree target caused by trying to
promote an operand that can't be promoted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238632
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 May 2015 22:57:46 +0000 (22:57 +0000)]
[WinEH] Adjust the 32-bit SEH prologue to better match reality
It turns out that _except_handler3 and _except_handler4 really use the
same stack allocation layout, at least today. They just make different
choices about encoding the LSDA.
This is in preparation for lowering the llvm.eh.exceptioninfo().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238627
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 29 May 2015 22:18:03 +0000 (22:18 +0000)]
[docs] fix the declarations of the llvm.nvvm.ptr.gen.to.* intrinsics
Summary:
These intrinsics should take a generic input address space and outputs a
non-generic address space.
Test Plan: no
Reviewers: jholewinski, eliben
Reviewed By: eliben
Subscribers: eliben, jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D10132
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238620
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 May 2015 21:58:11 +0000 (21:58 +0000)]
Disable FP elimination in funcs using 32-bit MSVC EH personalities
The value in 'ebp' acts as an implicit argument to the outlined
handlers, and is recovered with frameaddress(1).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238619
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 21:45:01 +0000 (21:45 +0000)]
Remove getData.
This completes the mechanical part of merging MCSymbol and MCSymbolData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238617
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 May 2015 20:43:10 +0000 (20:43 +0000)]
Only add the EH state insertion pass on 32-bit Windows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238612
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 20:41:47 +0000 (20:41 +0000)]
Remove the MCSymbolData typedef.
The getData member function is next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238611
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 20:31:23 +0000 (20:31 +0000)]
Merge MCSymbol and MCSymbolData.
As a transition hack leave MCSymbolData as a typedef of MCSymbol. I will be
removing that in a second.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238609
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 29 May 2015 20:31:17 +0000 (20:31 +0000)]
[lib/Fuzzer] relax an assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238608
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 20:21:02 +0000 (20:21 +0000)]
Rename getOrCreateSymbolData to registerSymbol and return void.
Another step in merging MCSymbol and MCSymbolData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238607
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 29 May 2015 19:43:39 +0000 (19:43 +0000)]
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.
Call sites were found with the ASTMatcher + some semi-automated cleanup.
memberCallExpr(
argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
hasArgument(0, bindTemporaryExpr(
hasType(recordDecl(hasNonTrivialDestructor())),
has(constructExpr()))),
unless(isInTemplateInstantiation()))
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238602
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 19:07:51 +0000 (19:07 +0000)]
Move Flags from MCSymbolData to MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238598
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 19:04:38 +0000 (19:04 +0000)]
Fix build without asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238597
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 18:47:23 +0000 (18:47 +0000)]
Pass MCSymbols to the helper functions in MCELF.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238596
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 29 May 2015 18:34:41 +0000 (18:34 +0000)]
[CMake] Bug 23468 - LLVM_OPTIMIZED_TABLEGEN does not work with Visual Studio
Summary: Multi-configuration builds put their binaries into ${CMAKE_BINARY_DIR}/Release/bin/. The table-gen cross-compilation support needs to take that into account.
Reviewers: yaron.keren
Reviewed By: yaron.keren
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10102
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238592
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 18:31:17 +0000 (18:31 +0000)]
Use an explicitly defaulted constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238591
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 18:26:09 +0000 (18:26 +0000)]
Pass a MCSymbol to needsRelocateWithSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238589
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 29 May 2015 18:19:25 +0000 (18:19 +0000)]
MachineCopyPropagation: Remove the copies instead of using KILL instructions.
For some history here see the commit messages of r199797 and r169060.
The original intent was to fix cases like:
%EAX<def> = COPY %ECX<kill>, %RAX<imp-def>
%RCX<def> = COPY %RAX<kill>
where simply removing the copies would have RCX undefined as in terms of
machine operands only the ECX part of it is defined. The machine
verifier would complain about this so 169060 changed such COPY
instructions into KILL instructions so some super-register imp-defs
would be preserved. In r199797 it was finally decided to always do this
regardless of super-register defs.
But this is wrong, consider:
R1 = COPY R0
...
R0 = COPY R1
getting changed to:
R1 = KILL R0
...
R0 = KILL R1
It now looks like R0 dies at the first KILL and won't be alive until the
second KILL, while in reality R0 is alive and must not change in this
part of the program.
As this only happens after register allocation there is not much code
still performing liveness queries so the issue was not noticed. In fact
I didn't manage to create a testcase for this, without unrelated changes
I am working on at the moment.
The fix is simple: As of r223896 the MachineVerifier allows reads from
partially defined registers, so the whole transforming COPY->KILL thing
is not necessary anymore. This patch also changes a similar (but more
benign case as the def and src are the same register) case in the
VirtRegRewriter.
Differential Revision: http://reviews.llvm.org/D10117
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238588
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 29 May 2015 18:14:55 +0000 (18:14 +0000)]
YAML traits need to be in the llvm::yaml namespace.
Hope this fixes the bits, eg:
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/27147
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238586
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 29 May 2015 17:56:28 +0000 (17:56 +0000)]
[YAMLIO] Make line-wrapping configurable and test it.
Summary:
We would wrap flow mappings and sequences when they go over a hardcoded 70
characters limit. Make the wrapping column configurable (and default to 70
co the change should be NFC for current users). Passing 0 allows to completely
suppress the wrapping which makes it easier to handle in tools like FileCheck.
Reviewers: bogner
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10109
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238584
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 17:48:04 +0000 (17:48 +0000)]
Move common symbol related information from MCSectionData to MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238583
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 17:41:59 +0000 (17:41 +0000)]
Store MCSymbols in PendingLabels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238582
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 17:24:52 +0000 (17:24 +0000)]
Move SymbolSize from MCSymbolData to MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238580
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 29 May 2015 17:19:11 +0000 (17:19 +0000)]
Fix crash in MCExpr::print.
Symbols are no longer required to be named, but this leads to a crash here if an
unnamed symbol checks that its first character is '$'.
Change the code to first check for a name, then check its first character.
No test case i'm afraid as this is debugging code, but any test case with temp labels
and 'llc --debug --filetype=obj' would have crashed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238579
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Fri, 29 May 2015 17:13:25 +0000 (17:13 +0000)]
Add support for VSX FMA single-precision instructions to the PPC back end
This patch corresponds to review:
http://reviews.llvm.org/D9941
It adds the various FMA instructions introduced in the version 2.07 of
the ISA along with the testing for them. These are operations on single
precision scalar values in VSX registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238578
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 29 May 2015 17:05:41 +0000 (17:05 +0000)]
MIR Serialization: use correct line and column numbers for LLVM IR errors.
This commit translates the line and column numbers for LLVM IR
errors from the numbers in the YAML block scalar to the numbers
in the MIR file so that the MIRParser users can report LLVM IR
errors with the correct line and column numbers.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10108
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238576
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 May 2015 17:00:57 +0000 (17:00 +0000)]
[WinEH] Emit EH tables for __CxxFrameHandler3 on 32-bit x86
Small (really small!) C++ exception handling examples work on 32-bit x86
now.
This change disables the use of .seh_* directives in WinException when
CFI is not in use. It also uses absolute symbol references in the tables
instead of imagerel32 relocations.
Also fixes a cache invalidation bug in MMI personality classification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238575
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 29 May 2015 17:00:27 +0000 (17:00 +0000)]
[NVPTXFavorNonGenericAddrSpaces] recursively trace into GEP and BitCast
Summary:
This patch allows NVPTXFavorNonGenericAddrSpaces to remove addrspacecast
from longer chains consisting of GEPs and BitCasts. For example, it can
now optimize
%0 = addrspacecast [10 x float] addrspace(3)* @a to [10 x float]*
%1 = gep [10 x float]* %0, i64 0, i64 %i
%2 = bitcast float* %1 to i32*
%3 = load i32* %2 ; emits ld.u32
to
%0 = gep [10 x float] addrspace(3)* @a, i64 0, i64 %i
%1 = bitcast float addrspace(3)* %0 to i32 addrspace(3)*
%3 = load i32 addrspace(3)* %1 ; emits ld.shared.f32
Test Plan: @ld_int_from_global_float in access-non-generic.ll
Reviewers: broune, eliben, jholewinski, meheff
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D10074
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238574
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 29 May 2015 16:58:08 +0000 (16:58 +0000)]
[DependenceAnalysis] Extend unifySubscriptType for handling coupled subscript groups.
Summary:
In continuation to an earlier commit to DependenceAnalysis.cpp by jingyue (r222100), the type for all subscripts in a coupled group need to be the same since constraints from one subscript may be propagated to another during testing. During testing, new SCEVs may be created and the operands for these need to be the same.
This patch extends unifySubscriptType() to work on lists of subscript pairs, ensuring a common extended type for all of them.
Test Plan:
Added a test case to NonCanonicalizedSubscript.ll which causes dependence analysis to crash without this fix.
All regression tests pass.
Reviewers: spop, sebpop, jingyue
Reviewed By: jingyue
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9698
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238573
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 15:07:27 +0000 (15:07 +0000)]
Simplify now that symbols contain the correct section.
The complexity in here was because before r233995 variable symbols would report
the incorrect section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238559
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 29 May 2015 14:48:25 +0000 (14:48 +0000)]
[Objdump] Removing unused parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238557
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 29 May 2015 14:44:13 +0000 (14:44 +0000)]
[Hexagon] Disassembling, printing, and emitting instructions a whole-bundle at a time which is the semantic unit for Hexagon. Fixing tests to use the new format. Disabling tests in the direct object emission path for a followup patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238556
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 14:20:40 +0000 (14:20 +0000)]
Fix ELFObjectWriter::isLocal for signature symbols.
And with that simplify the logic for inserting them in ExternalSymbolData or
LocalSymbolData.
No functionality change overall since the old code avoided the isLocal bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238555
91177308-0d34-0410-b5e6-
96231b3b80d8