133139 Commits

Author SHA1 Message Date
Sanjay Patel
0fce208f3b update test to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 16:29:15 +00:00
Simon Pilgrim
7705b591df [X86][XOP] Added VPERMIL2PD/VPERMIL2PS raw mask decoding for target shuffle combines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 15:21:30 +00:00
Simon Pilgrim
2d63358b82 [X86][XOP] Added VPERMIL2PD/VPERMIL2PS as a target shuffle type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 15:01:45 +00:00
Simon Pilgrim
b8b77a8df5 [X86][XOP] Tidied up DecodeVPERMIL2PMask to more closely match DecodeVPERMILPMask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 14:33:43 +00:00
Craig Topper
3789c0fe24 [AVX512] Add support for lowering PALIGNR for v64i8.
Could do this for other types to, but this is what's needed to replace the instrinsic with native IR in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 06:29:12 +00:00
Craig Topper
4b35a62824 [AVX512] Split command lines and regenerate a test to prepare for a future commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 06:29:08 +00:00
Craig Topper
dd17bc5daa [AVX512] Fix PANDN combining for v4i32/v8i32 when VLX is enabled.
v4i32/v8i32 ANDs aren't promoted to v2i64/v4i64 when VLX is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 05:35:11 +00:00
Xinliang David Li
bb45039fab Fix wrong comment in header /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 05:18:20 +00:00
Xinliang David Li
cb8e2c7de1 Fix pass declaration order /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 05:15:45 +00:00
Xinliang David Li
6b28333324 [PM] Port GCOVProfiler pass to the new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 05:12:23 +00:00
Xinliang David Li
ae19ba5c91 [PM] code refactoring /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 03:40:03 +00:00
Chandler Carruth
68d9575fa0 Disable the use of std::call_once on PowerPC due to an apparent bug in
libstdc++ (or in compilers, or somewhere, I can't track it down) that
causes unittests that use INITIALIZE_PASS to crash.

The analysis I've been able to do is that inside libstdc++'s
implementation of std::call_once, it uses pthread_once, and when that
returns an error code it throws std::system_error which then eventually
calls std::terminate.

Hopefully some of the folks who work on PPC can try to sort out what's
going on here. Until then, they'll have to use the fallback
implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 02:46:01 +00:00
NAKAMURA Takumi
716efbdad9 Threading.h: Update \param. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271819 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 00:15:44 +00:00
Sanjay Patel
6d1e5af20a [InstCombine] less 'CI' confusion; NFC
Change the name of the ICmpInst to 'ICmp' and the Constant (was a ConstantInt) to 'C',
so that it's hopefully clearer that 'CI' refers to CastInst in this context.

While we're scrubbing, fix the documentation comment and use 'auto' with 'dyn_cast'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 00:12:32 +00:00
David Majnemer
8c4b617203 [SimplifyCFG] Don't kill empty cleanuppads with multiple uses
A basic block could contain:
  %cp = cleanuppad []
  cleanupret from %cp unwind to caller

This basic block is empty and is thus a candidate for removal.  However,
there can be other uses of %cp outside of this basic block.  This is
only possible in unreachable blocks.

Make our transform more correct by checking that the pad has a single
user before removing the BB.

This fixes PR28005.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 23:50:03 +00:00
David Majnemer
c6b77e5c06 [DebugInfo, PDB] Use sparse bitfields for the name map
The name map might not be densely packed on disk.  Using a sparse map
will save memory in such situations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 22:47:39 +00:00
Sanjay Patel
4239e23ef8 [InstCombine] allow vector constants for cast+icmp fold
This is step 1 of unknown towards fixing PR28001:
https://llvm.org/bugs/show_bug.cgi?id=28001



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 22:04:05 +00:00
Simon Pilgrim
b6dac61a73 [X86][XOP] Added VPERMIL2PD/VPERMIL2PS shuffle mask comment decoding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 21:44:28 +00:00
Sanjay Patel
a90cde95ff [InstCombine] add test for missing vector optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 21:41:25 +00:00
Sanjay Patel
b06c2a49dd clean-up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271807 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 21:20:44 +00:00
Sanjay Patel
4a233e32d5 [InstCombine] add test for missing vector optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 21:20:03 +00:00
Sanjay Patel
3106fcb0d4 [InstCombine] minimize test case and use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 21:04:59 +00:00
Sanjay Patel
438048ee99 fix formatting, punctuation; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 20:39:22 +00:00
Simon Pilgrim
6cd92a1128 [Analysis] Enabled BITREVERSE as a vectorizable intrinsic
Allows XOP to vectorize BITREVERSE - other targets will follow as their costmodels improve.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 20:21:07 +00:00
Craig Topper
c21f33738d [X86] Add the VR128L/H and VR256L/H to the list of vector register classes for inline asm constraints. Also fix the comment on the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 20:15:08 +00:00
Chandler Carruth
101b01e9b3 [LPM] Reinstate r271781 which reinstated r271652 to replace the
CALL_ONCE_... macro in the legacy pass manager with the new
llvm::call_once facility.

Nothing changed sicne the last attempt in r271781 which I reverted in
r271788. At least one of the failures I saw was spurious, and I want to
make sure the other failures are real before I work around them -- they
appeared to only effect ppc64le and ppc64be.

Original commit message of r271781:
----
[LPM] Reinstate r271652 to replace the CALL_ONCE_... macro in the legacy
pass manager with the new llvm::call_once facility.

This reverts commit r271657 and re-applies r271652 with a fix to
actually work with arguments. In the original version, we just ended up
directly calling std::call_once via ADL because of the std::once_flag
argument. The llvm::call_once never worked with arguments. Now,
llvm::call_once is a variadic template that perfectly forwards
everything. As a part of this it had to move to the header and we use
a generic functor rather than an explict function pointer. It would be
nice to use std::invoke here but we don't have it yet. That means
pointer to members won't work here, but that seems a tolerable
compromise.

I've also tested this by forcing the fallback path, so hopefully it
sticks this time.
----

Original commit message of r271652:
----
[LPM] Replace the CALL_ONCE_... macro in the legacy pass manager with
the new llvm::call_once facility.

This facility matches the standard APIs and when the platform supports
it actually directly uses the standard provided functionality. This is
both more efficient on some platforms and much more TSan friendly.

The only remaining user of the cas_flag and home-rolled atomics is the
fallback implementation of call_once. I have a patch that removes them
entirely, but it needs a Windows patch to land first.

This alone substantially cleans up the macros for the legacy pass
manager, and should subsume some of the work Mehdi was doing to clear
the path for TSan testing of ThinLTO, a really important step to have
reliable upstream testing of ThinLTO in all forms.
----

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 19:57:55 +00:00
Saleem Abdulrasool
9195dbacc0 X86: enable TLS on Windows itanium
Windows itanium is nearly identical to windows-msvc (MS ABI for C, itanium for
C++).  Enable the TLS support for the target similar to the MSVC model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 18:27:22 +00:00
Simon Pilgrim
ebbbdf51f2 [X86][AVX2] Fix v16i16 SHL lowering (PR27730)
The AVX2 v16i16 shift lowering works by unpacking to 2 x v8i32, performing the shift and then truncating the result.

The unpacking is used to place the values in the upper 16-bits so that we can correctly sign-extend for SRA shifts. Unfortunately we weren't ensuring that the lower 16-bits were zero to ensure that SHL correctly shifts in zero bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 16:45:33 +00:00
David Majnemer
180fafda4a [AsmPrinter, CodeView] There are some more ways of getting wchar_t
C++ has a builtin type called wchar_t.  Clang also provides a type
called __wchar_t in C mode.

In C mode, wchar_t can be a typedef to unsigned short.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271793 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 15:40:33 +00:00
David Majnemer
0fddcc6bc2 [CodeView] Fix a busted assert in TypeTableBuilder::writeClass
It was checking for Union when it should have checked for Interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 15:40:31 +00:00
David Majnemer
667f3f9a9e [CodeView] Validate the vftable offset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 15:40:29 +00:00
David Majnemer
5f57dddf37 [TypeStreamMerger] visitUnknownMember was supposed to be visitUnknownType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 15:40:27 +00:00
Simon Pilgrim
30f995aa46 [InstCombine][MMX] Extend SimplifyDemandedUseBits MOVMSK support to MMX
Add the MMX implementation to the SimplifyDemandedUseBits SSE/AVX MOVMSK support added in D19614

Requires a minor tweak as llvm.x86.mmx.pmovmskb takes a x86_mmx argument - so we have to be explicit about the implied v8i8 vector type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 13:42:46 +00:00
Chandler Carruth
f5adc997c2 [LPM] Revert r271781 which was a re-commit of r271652.
There appears to be a strange exception thrown and crash using call_once
on a PPC build bot, and a *really* weird windows link error for
GCMetadata.obj. Still need to investigate the cause of both problems.

Original change summary:
[LPM] Reinstate r271652 to replace the CALL_ONCE_... macro in the legacy
pass manager with the new llvm::call_once facility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 09:36:40 +00:00
Chandler Carruth
a9afed7545 [LPM] Reinstate r271652 to replace the CALL_ONCE_... macro in the legacy
pass manager with the new llvm::call_once facility.

This reverts commit r271657 and re-applies r271652 with a fix to
actually work with arguments. In the original version, we just ended up
directly calling std::call_once via ADL because of the std::once_flag
argument. The llvm::call_once never worked with arguments. Now,
llvm::call_once is a variadic template that perfectly forwards
everything. As a part of this it had to move to the header and we use
a generic functor rather than an explict function pointer. It would be
nice to use std::invoke here but we don't have it yet. That means
pointer to members won't work here, but that seems a tolerable
compromise.

I've also tested this by forcing the fallback path, so hopefully it
sticks this time.

Original commit message:
----
[LPM] Replace the CALL_ONCE_... macro in the legacy pass manager with
the new llvm::call_once facility.

This facility matches the standard APIs and when the platform supports
it actually directly uses the standard provided functionality. This is
both more efficient on some platforms and much more TSan friendly.

The only remaining user of the cas_flag and home-rolled atomics is the
fallback implementation of call_once. I have a patch that removes them
entirely, but it needs a Windows patch to land first.

This alone substantially cleans up the macros for the legacy pass
manager, and should subsume some of the work Mehdi was doing to clear
the path for TSan testing of ThinLTO, a really important step to have
reliable upstream testing of ThinLTO in all forms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 07:25:44 +00:00
Craig Topper
915ac2bcce [X86] Use smaller types to shrink the intrinsic lowering tables by about 12K.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 04:32:17 +00:00
Craig Topper
32e67c3f6b [X86] Use X86ISD::ABS for lowering pabs SSSE3/AVX intrinsics to match AVX512. Should allow those intrinsics to use the EVEX encoded instructions and get the extra registers when available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 04:32:15 +00:00
Petr Hosek
28a52a5d69 [MC] Check the upper bound in truncate assertion
The truncateToSize function already has assertion to check the
lower boundary for the number bytes, but it does not check the
upper boundary which could still lead to usage errors.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 04:02:18 +00:00
Taewook Oh
2c2ab512e8 Revert commit r271704, a patch that enables warnings for non-portable #include and #import paths (Corresponding clang patch has been reverted by r271761). Patches are reverted because they generate lots of unadressable warnings for windows and fail tests under ASAN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 03:36:12 +00:00
Chandler Carruth
abc56db183 [sancov] Revert r271695 which broke all of the PPC bots.
Original commit message:
[sancov] Run sancov tests on more platforms

The only tests that need to be run on Linux are the ones that use C++
demangling. I'm assuming they will fail on Mac, since __cxa_demangle
there won't handle the non-double-underscore prefixed mangled names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 03:28:27 +00:00
Chandler Carruth
557c624777 [llvm-profdata] Revert r271709 and the 3 subsequent commits - the code
and/or tests aren't working on Windows currently.

There seems to be some problem with quoting the file paths. I don't
understand the test structure here or the code well enough to try to
come up with a way to correctly handle paths with back slashes in them,
and this has caused the Windows builds to be failing for 7 hours now, so
I'm reverting the whole thing to bring them back to life. Sorry for the
disruption, but a couple of these were bug fixes anyways that can be
folded into a fresh commit.

Reverts the following patches:

r271756: Clean up the way we create the input filenames buffer (NFC)
r271748: Fix use-after-free from discarded MemoryBuffer (NFC)
r271710: Fix option description (NFC)
r271709: Add option to ingest filepaths from a file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 03:08:01 +00:00
Devin Coughlin
ec59eedf3a STLExtras: Add convenience is_contained() function.
This commit adds a convenience is_contained() function
which checks if an element exists in a container. It is part of a larger
series of patches adding an MPI checker to the clang static analyzer.

Reviewers: dblaikie,bkramer

A patch by Alexander Droste!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 00:49:46 +00:00
Vedant Kumar
ae73627d2a [llvm-profdata] Clean up the way we create the input filenames buffer (NFC)
Create the buffer before calling parseInputFilenamesFile(), and add a
comment explaining why this is done.

Thanks to David Li for the suggestion!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 00:36:28 +00:00
Bruno Cardoso Lopes
909307bfdd [LockFileManager] Improve error output by using better error messages
This is currently used by clang to lock access to modules; improve the
error message so that clang can use better output messages from locking
error issues.

rdar://problem/26529101

Differential Review: http://reviews.llvm.org/D20942

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 00:34:00 +00:00
Adrian Prantl
388a27f992 Testcase cleanup: Remove a redundant test input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 00:10:17 +00:00
Matthias Braun
6cf1b930a7 MIR: Support MachineMemOperands without associated value
This is allowed (though used rarely) and useful to keep your tests
short.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04 00:06:31 +00:00
Xinliang David Li
670f8e5ba8 Replace hard coded probability threshold with parameter /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 23:48:36 +00:00
Vedant Kumar
8288f17aa3 [llvm-profdata] Fix use-after-free from discarded MemoryBuffer (NFC)
Thanks to Justin Bogner for pointing this out!

Caught by ASAN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271748 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 23:12:38 +00:00
Xinliang David Li
8b27d7b65f [pgo] extend r271532 to darwin platform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 23:02:28 +00:00
Easwaran Raman
7ef349f4f7 Reapply r271728 after adding move cobstructor for ProfileSummaryInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271745 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 22:54:26 +00:00