133160 Commits

Author SHA1 Message Date
NAKAMURA Takumi
5aabe01ca5 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 00:31:45 +00:00
NAKAMURA Takumi
9b1606d5af Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 00:31:28 +00:00
Eli Friedman
196d83ecbd LICM: Don't sink stores out of loops that may throw.
Summary:
This hasn't been caught before because it requires noalias or similarly
strong alias analysis to actually reproduce.

Fixes http://llvm.org/PR27952 .

Reviewers: hfinkel, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 22:13:52 +00:00
Sanjoy Das
4c21dbd25b Add safety check to InstCombiner::commonIRemTransforms
Since FoldOpIntoPhi speculates the binary operation to potentially each
of the predecessors of the PHI node (pulling it out of arbitrary control
dependence in the process), we can FoldOpIntoPhi only if we know the
operation doesn't have UB.

This also brings up an interesting profitability question -- the way it
is written today, commonIRemTransforms will hoist out work from
dynamically dead code into code that will execute at runtime.  Perhaps
that isn't the best canonicalization?

Fixes PR27968.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 21:17:04 +00:00
Sanjoy Das
1416aa2004 Add test case for InstCombiner::commonIRemTransforms; NFC
The PHI case in commonIRemTransforms was untested; add a trivial test
case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 21:17:00 +00:00
Eli Friedman
87dbdbfb52 Fix deadlock in ThreadPool unittest.
(Yes, this only deadlocks on a computer with a single core; I'm using
a virtual machine.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 21:15:46 +00:00
Davide Italiano
ca2ccc379b [Internalize] Test that __stack_chk_{guard, fail} are not internalized.
r154645 introduced this feature without test. This should have better
coverage now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 19:08:54 +00:00
Filipe Cabecinhas
98090ec9bd [BitCode] Make sure atomicrmw's argument is an actual PointerType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 18:43:40 +00:00
Filipe Cabecinhas
afe713a7cd [BitCode] Make sure storeatomic's argument is an actual PointerType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 18:43:33 +00:00
Filipe Cabecinhas
e8dd99a32a [BitCode] Diagnose GEPs with no indices
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 18:43:26 +00:00
Filipe Cabecinhas
780fc2c617 [BitCode] Don't allow constants of void type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 18:43:17 +00:00
Mike Spertus
0b28fbb3a5 Add Visual Studio Visualizer for ArrayRef
Modeled after visualization of llvm::SmallVec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 18:34:02 +00:00
Sanjoy Das
a55495a2e8 [PM] Port IndVarSimplify to the new pass manager
Summary:
There are some rough corners, since the new pass manager doesn't have
(as far as I can tell) LoopSimplify and LCSSA, so I've updated the
tests to run them separately in the old pass manager in the lit tests.
We also don't have an equivalent for AU.setPreservesCFG() in the new
pass manager, so I've left a FIXME.

Reviewers: bogner, chandlerc, davide

Subscribers: sanjoy, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 18:01:19 +00:00
Sanjoy Das
fa9013b737 [IndVars] Remove -liv-reduce
It is an off-by-default option that no one seems to use[0], and given
that SCEV directly understands the overflow instrinsics there is no real
need for it anymore.

[0]: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098181.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 18:01:12 +00:00
Sanjay Patel
7ae69db193 fix checks
update_test_checks.py got confused matching the variable names. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 17:54:56 +00:00
Sanjay Patel
1518a5c65d [InstCombine] allow vector icmp bool transforms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 17:49:45 +00:00
Sanjay Patel
4023ab727f add tests to show missing vector transforms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 17:32:58 +00:00
Sanjay Patel
be41fdc80a regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 17:29:45 +00:00
Sanjay Patel
af70a2b1ba update test to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 17:13:09 +00:00
Sanjay Patel
83f8846060 fix documentation comments and other clean-ups; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 16:46:18 +00:00
Sanjay Patel
cebbf63c6a update test to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 16:41:20 +00:00
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