oota-llvm.git
8 years agoFix typo in comment. NFC
Craig Topper [Tue, 2 Jun 2015 06:19:25 +0000 (06:19 +0000)]
Fix typo in comment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238807 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen] Rename ListInit::getSize to just 'size' to be more consistent.
Craig Topper [Tue, 2 Jun 2015 04:15:57 +0000 (04:15 +0000)]
[TableGen] Rename ListInit::getSize to just 'size' to be more consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238806 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen] Use range-based for loops. NFC.
Craig Topper [Tue, 2 Jun 2015 04:15:51 +0000 (04:15 +0000)]
[TableGen] Use range-based for loops. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238805 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RuntimeDydlELF] Use range-based loop.
Davide Italiano [Tue, 2 Jun 2015 01:52:28 +0000 (01:52 +0000)]
[RuntimeDydlELF] Use range-based loop.

Differential Revision: http://reviews.llvm.org/D10165
Reviewed by: rafael

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238804 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCreate a MCSymbolELF.
Rafael Espindola [Tue, 2 Jun 2015 00:25:12 +0000 (00:25 +0000)]
Create a MCSymbolELF.

This create a MCSymbolELF class and moves SymbolSize since only ELF
needs a size expression.

This reduces the size of MCSymbol from 56 to 48 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238801 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMC: Tidy up LOH naming a bit. NFC.
Jim Grosbach [Mon, 1 Jun 2015 23:55:06 +0000 (23:55 +0000)]
MC: Tidy up LOH naming a bit. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238800 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMC: Tidy up formatting a bit. NFC.
Jim Grosbach [Mon, 1 Jun 2015 23:55:02 +0000 (23:55 +0000)]
MC: Tidy up formatting a bit. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238799 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support] Simplify Triple::getOSVersion
David Majnemer [Mon, 1 Jun 2015 23:45:25 +0000 (23:45 +0000)]
[Support] Simplify Triple::getOSVersion

Those who are interested in the Android version can use
getEnvironmentVersion instead of getOSVersion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238798 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Add Triple::getEnvironmentVersion
David Majnemer [Mon, 1 Jun 2015 23:38:09 +0000 (23:38 +0000)]
[ADT] Add Triple::getEnvironmentVersion

This allows us to extract version numbers from the environment.
getOSVersion is currently overloaded for that purpose, this allows us to
clean it up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238796 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoARM: Thumb2 LDRD/STRD supports independent input/output regs
Matthias Braun [Mon, 1 Jun 2015 23:27:08 +0000 (23:27 +0000)]
ARM: Thumb2 LDRD/STRD supports independent input/output regs

The existing code would unnecessarily break LDRD/STRD apart with
non-adjacent registers, on thumb2 this is not necessary.

Ideally on thumb2 we shouldn't match for ldrd/strd pre-regalloc anymore
as there is not reason to set register hints anymore, changing that is
something for a future patch however.

Differential Revision: http://reviews.llvm.org/D9694

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238795 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAArch64: Use CMP;CCMP sequences for and/or/setcc trees.
Matthias Braun [Mon, 1 Jun 2015 22:31:17 +0000 (22:31 +0000)]
AArch64: Use CMP;CCMP sequences for and/or/setcc trees.

Previously CCMP/FCCMP instructions were only used by the
AArch64ConditionalCompares pass for control flow. This patch uses them
for SELECT like instructions as well by matching patterns in ISelLowering.

PR20927, rdar://18326194

Differential Revision: http://reviews.llvm.org/D8232

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238793 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[bpf] fix build
Alexei Starovoitov [Mon, 1 Jun 2015 22:24:36 +0000 (22:24 +0000)]
[bpf] fix build

fix breakage due to r238634

Patch by Vijay Subramanian.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238792 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMove the name pointer out of Value into a map that lives on the
Owen Anderson [Mon, 1 Jun 2015 22:24:01 +0000 (22:24 +0000)]
Move the name pointer out of Value into a map that lives on the
LLVMContext.  Production builds of clang do not set names on most
Value's, so this is wasted space on almost all subclasses of Value.
This reduces the size of all Value subclasses by 8 bytes on 64 bit
hosts.

The one tricky part of this change is averting compile time regression
by keeping Value::hasName() fast.  This required stealing bits out of
NumOperands.

With this change, peak memory usage on verify-uselistorder-nodbg.lto.bc
is decreased by approximately 2.3% (~3MB absolute on my machine).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238791 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[dsymutil] Remove extraneous std::move of local in return statement.
Frederic Riss [Mon, 1 Jun 2015 22:03:05 +0000 (22:03 +0000)]
[dsymutil] Remove extraneous std::move of local in return statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238790 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoR600/SI: Don't hardcode pointer type
Matt Arsenault [Mon, 1 Jun 2015 21:58:24 +0000 (21:58 +0000)]
R600/SI: Don't hardcode pointer type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238789 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoadd missing dependency for ExecutionEngine lib
Sanjay Patel [Mon, 1 Jun 2015 21:56:56 +0000 (21:56 +0000)]
add missing dependency for ExecutionEngine lib

This appears to be masked most of the time, but the problem
was exposed on some bots by r238051.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238788 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLiveRangeEdit: Fix liveranges not shrinking on subrange kill.
Matthias Braun [Mon, 1 Jun 2015 21:26:26 +0000 (21:26 +0000)]
LiveRangeEdit: Fix liveranges not shrinking on subrange kill.

If a dead instruction we may not only have a last-use in the main live
range but also in a subregister range if subregisters are tracked. We
need to partially rebuild live ranges in both cases.

The testcase only broke when subregister liveness was enabled. I
commited it in the current form because there is currently no flag to
enable/disable subregister liveness.

This fixes PR23720.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238785 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoARMLoadStoreOptimizer: Fix doxygen comments; NFC
Matthias Braun [Mon, 1 Jun 2015 21:26:23 +0000 (21:26 +0000)]
ARMLoadStoreOptimizer: Fix doxygen comments; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238784 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[dsymutil] Remove unnecessary ';'
Frederic Riss [Mon, 1 Jun 2015 21:25:53 +0000 (21:25 +0000)]
[dsymutil] Remove unnecessary ';'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238783 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[dsymutil] Use YAMLIO to dump debug map.
Frederic Riss [Mon, 1 Jun 2015 21:12:45 +0000 (21:12 +0000)]
[dsymutil] Use YAMLIO to dump debug map.

Doing so will allow us to also accept a YAML debug map in input as using
YAMLIO gives us the parsing for free. Being able to have textual debug
maps will in turn allow much more control over the tests, because 1/
no need to check-in a binary containing the debug map and 2/ it will allow
to use the same objects/IR files with made-up debug-maps to test
different scenari.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238781 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake the C++ LTO API easier to use from C++ clients.
Peter Collingbourne [Mon, 1 Jun 2015 20:08:30 +0000 (20:08 +0000)]
Make the C++ LTO API easier to use from C++ clients.

Start using C++ types such as StringRef and MemoryBuffer in the C++ LTO
API. In doing so, clarify the ownership of the native object file: the caller
now owns it, not the LTOCodeGenerator. The C libLTO library has been modified
to use a derived class of LTOCodeGenerator that owns the object file.

Differential Revision: http://reviews.llvm.org/D10114

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238776 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[Hexagon] Adding basic ELF relocation generation and testing advanced relaxat...
Rafael Espindola [Mon, 1 Jun 2015 19:20:47 +0000 (19:20 +0000)]
Revert "[Hexagon] Adding basic ELF relocation generation and testing advanced relaxation codepath."

This reverts commit r238748.

It broke the msan bot:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/4372/steps/check-llvm%20msan/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238772 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agolit: Allow configurations to restrict the set of tests to run
Arnold Schwaighofer [Mon, 1 Jun 2015 17:50:03 +0000 (17:50 +0000)]
lit: Allow configurations to restrict the set of tests to run

By setting limit_to_features to a non empty list of features a configuration can
restrict the set of tests to run to only include tests that require a feature in
this list.

rdar://21082253

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238766 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDisable MachineSink on convergent operations, similar to how IR Sink is
Owen Anderson [Mon, 1 Jun 2015 17:26:30 +0000 (17:26 +0000)]
Disable MachineSink on convergent operations, similar to how IR Sink is
restricted.  No test because no in-tree target currently has convergent
MachineInstr's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238763 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTeach the IR Sink pass to (conservatively) respect convergent annotations.
Owen Anderson [Mon, 1 Jun 2015 17:20:31 +0000 (17:20 +0000)]
Teach the IR Sink pass to (conservatively) respect convergent annotations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238762 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][FastISel] Implement bswap.
Vasileios Kalintiris [Mon, 1 Jun 2015 16:40:45 +0000 (16:40 +0000)]
[mips][FastISel] Implement bswap.

Summary: Implement bswap intrinsic for MIPS FastISel. It's very different for misp32 r1/r2 .

Based on a patch by Reed Kotler.

Test Plan:
bswap1.ll
test-suite

Reviewers: dsanders, rkotler

Subscribers: llvm-commits, rfuhler

Differential Revision: http://reviews.llvm.org/D7219

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238760 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][FastISel] Implement intrinsics memset, memcopy & memmove.
Vasileios Kalintiris [Mon, 1 Jun 2015 16:36:01 +0000 (16:36 +0000)]
[mips][FastISel] Implement intrinsics memset, memcopy & memmove.

Summary:
Implement the intrinsics memset, memcopy and memmove in MIPS FastISel.
Make some needed infrastructure fixes so that this can work.

Based on a patch by Reed Kotler.

Test Plan:
memtest1.ll
The patch passes test-suite for mips32 r1/r2 and at O0/O2

Reviewers: rkotler, dsanders

Subscribers: llvm-commits, rfuhler

Differential Revision: http://reviews.llvm.org/D7158

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238759 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][FastISel] Implement srem/urem and sdiv/udiv instructions.
Vasileios Kalintiris [Mon, 1 Jun 2015 16:17:37 +0000 (16:17 +0000)]
[mips][FastISel] Implement srem/urem and sdiv/udiv instructions.

Summary: Implement the LLVM assembly urem/srem and sdiv/udiv instructions in MIPS FastISel.

Based on a patch by Reed Kotler.

Test Plan:
srem1.ll
div1.ll
test-suite at O0/O2 for mips32 r1/r2

Reviewers: dsanders, rkotler

Subscribers: llvm-commits, rfuhler

Differential Revision: http://reviews.llvm.org/D7028

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238757 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][FastISel] Implement the select statement for MIPS FastISel.
Vasileios Kalintiris [Mon, 1 Jun 2015 15:56:40 +0000 (15:56 +0000)]
[mips][FastISel] Implement the select statement for MIPS FastISel.

Summary: Implement the LLVM IR select statement for MIPS FastISelsel.

Based on a patch by Reed Kotler.

Test Plan:
"Make check" test included now.
Passes test-suite at O2/O0 mips32 r1/r2.

Reviewers: dsanders, rkotler

Subscribers: llvm-commits, rfuhler

Differential Revision: http://reviews.llvm.org/D6774

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238756 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][FastISel] Clobber HI0/LO0 registers in MUL instructions.
Vasileios Kalintiris [Mon, 1 Jun 2015 15:48:09 +0000 (15:48 +0000)]
[mips][FastISel] Clobber HI0/LO0 registers in MUL instructions.

Summary:
The contents of the HI/LO registers are unpredictable after the execution of
the MUL instruction. In addition to implicitly defining these registers in the
MUL instruction definition, we have to mark those registers as dead too.

Without this the fast register allocator is running out of registers when the
MUL instruction is followed by another one that tries to allocate the AC0
register.

Based on a patch by Reed Kotler.

Reviewers: dsanders, rkotler

Subscribers: llvm-commits, rfuhler

Differential Revision: http://reviews.llvm.org/D9825

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238755 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDrop remaining Dragonegg support in release scripts
Hans Wennborg [Mon, 1 Jun 2015 15:37:58 +0000 (15:37 +0000)]
Drop remaining Dragonegg support in release scripts

r236077 and r236081 dropped Dragonegg support from the release scripts
but left some pieces. The most notable change is that Dragonegg won't
be tagged any more.

Patch by David Wiberg <dwiberg@gmail.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238753 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix relocation selection for foo-. on mips.
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

8 years agoSimplify code, NFC.
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

8 years agoAdd isConstant argument to MDBuilder::createTBAAStructTagNode
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

8 years ago[Hexagon] Adding basic ELF relocation generation and testing advanced relaxation...
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

8 years agoThe fragment implies the section, don't store both.
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

8 years agoFirst commit test.
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

8 years ago[CMake] Revert commits r238740/r238741 for embedding Windows version info.
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

8 years agoAVX-512: Optimized vector shuffle for v16f32 and v16i32 types.
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

8 years agoRemoving commited assembly file.
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

8 years agoremove the use of the LOCATION CMake variable from r238740.
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

8 years agoIn MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
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

8 years agoRe-commit of r238201 with fix for building with shared libraries.
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

8 years agoAVX-512: Implemented VRANGEPD and VRANGEPD instructions for SKX.
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

8 years agoAVX-512: Implemented vector shuffle lowering for v8i64 and v8f64 types.
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

8 years ago[WinCOFF] Ignore .safeseh for non-x86 architectures
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

8 years agoAVX-512: added all forms of VPSHUFD and VPSHUFHW, VPSHUFLW
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

8 years agoAVX-512: Implemented VFIXUPIMMPD and VFIXUPIMMPS instructions for KNL and SKX
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

8 years ago[TableGen] Move a couple virtual methods out of line so vtable anchors can be removed...
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

8 years ago[TableGen] Remove unnecessary explicit initialization to null of a unique_ptr. NFC
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

8 years ago[TableGen] Remove unnecessary forward declarations. NFC
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

8 years agoAVX-512: Fixed a bug in compress and expand intrinsics.
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

8 years agoAdd address space argument to isLegalAddressingMode
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

8 years ago[opaque pointer type] Explicitly store the pointee type of the result of a GEP
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

8 years agoTry to fix the build of IntelJITEventListener.
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

8 years agoRename HasData to IsRegistered.
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

8 years agoRemove trivial forwarding function.
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

8 years agoStore a bit in MCSection saying if it was registered with MCAssembler.
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

8 years agoUse a bitfield. NFC.
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

8 years agoUse a 32 bit field for the symbol index.
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

8 years agoSimplify another function that doesn't fail.
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

8 years ago[PHITransAddr] Don't translate unreachable values
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

8 years ago[PHITransAddr] Use std::find instead of std::count
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

8 years agoSimplify interface of function that doesn't fail.
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

8 years ago[DWARF] Fix a bug in line info handling
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

8 years agoFor COFF and MachO, compute the gap between to symbols.
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

8 years agoARMConstantIslandPass.cpp: Prune an empty \brief. [-Wdocumentation]
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

8 years ago[Hexagon] Including raw_ostream for debug builds.
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

8 years ago[Hexagon] classes are actually structs.
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

8 years agoUse a range loop. NFC.
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

8 years ago[Hexagon] Adding MC packet shuffler.
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

8 years agoARM: recommit r237590: allow jump tables to be placed as constant islands.
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

8 years ago[MC] Simplify code. No functionality change intended.
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

8 years agoClarify how the binary file checked in was generated.
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

8 years ago[Hexagon] Adding override specifier and removing erroneous assertion
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

8 years agoAdd RelocVisitor support for MachO
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

8 years ago[Hexagon] Adding basic relaxation functionality.
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

8 years ago[MC] Allow backends to decide relaxation for unresolved fixups.
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

8 years ago[lib/Fuzzer] make assertions more informative and update comments for the user-suppli...
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

8 years ago[MC] Reorder MCSymbol members to reduce padding.
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

8 years agoStripped trailing whitespace. NFC.
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

8 years agoComment change. NFC
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

8 years ago[x86] Unify the horizontal adding used for popcount lowering taking the
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

8 years ago[ARMTargetParser] Move IAS arch ext parser. NFC
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

8 years ago[x86] Split out the horizontal byte sum lowering component of the LUT
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

8 years ago[TableGen] Merge RecTy::typeIsConvertibleTo and RecTy::baseClassOf. NFC
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

8 years agoFix indentation. NFC.
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

8 years ago[TableGen] Remove all the variations of RecTy::convertValue and just handle the conve...
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

8 years ago[x86] Update the order of instructions after I switched to a bitcast
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

8 years ago[WinCOFF] Add support for the .safeseh directive
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

8 years ago[x86] Replace the long spelling of getting a bitcast with the *much*
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

8 years ago[x86] Replace the long spelling of getting a bitcast with the new short
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

8 years ago[sdag] Add the helper I most want to the DAG -- building a bitcast
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

8 years ago[x86] Restore the bitcasts I removed when refactoring this to avoid
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

8 years ago[x86] Implement a faster vector population count based on the PSHUFB
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

8 years ago[x86] Restructure the parallel bitmath lowering of popcount into
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

8 years agoMC: Clean up MCExpr naming. NFC.
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

8 years ago[BitcodeReader] Change an assert to a call to a call to Error()
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

8 years agoSelectionDAG: fix logic for promoting shift types
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

8 years ago[WinEH] Adjust the 32-bit SEH prologue to better match reality
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