135555 Commits

Author SHA1 Message Date
Elena Demikhovsky
87a79055a6 AVX-512: Fixed BT instruction selection.
The following condition expression ( a >> n) & 1 is converted to "bt a, n" instruction. It works on all intel targets.
But on AVX-512 it was broken because the expression is modified to (truncate (a >>n) to i1).

I added the new sequence (truncate (a >>n) to i1) to the BT pattern.

Differential Revision: https://reviews.llvm.org/D22354



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 07:14:21 +00:00
Craig Topper
c61cf90305 [AVX512] Give priority to EVEX encoded PSHUFB over the VEX versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 02:00:38 +00:00
Craig Topper
b120dcdc6a [X86] Remove superfluous parameter from a multiclass. All instantiations passed the same value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 02:00:35 +00:00
George Burgess IV
9906b88abc [MemorySSA] Update to the new shiny walker.
This patch updates MemorySSA's use-optimizing walker to be more
accurate and, in some cases, faster.

Essentially, this changed our core walking algorithm from a
cache-as-you-go DFS to an iteratively expanded DFS, with all of the
caching happening at the end. Said expansion happens when we hit a Phi,
P; we'll try to do the smallest amount of work possible to see if
optimizing above that Phi is legal in the first place. If so, we'll
expand the search to see if we can optimize to the next phi, etc.

An iteratively expanded DFS lets us potentially quit earlier (because we
don't assume that we can optimize above all phis) than our old walker.
Additionally, because we don't cache as we go, we can now optimize above
loops.

As an added bonus, this patch adds a ton of verification (if
EXPENSIVE_CHECKS are enabled), so finding bugs is easier.

Differential Revision: https://reviews.llvm.org/D21777


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 01:29:15 +00:00
Craig Topper
dbee0bfd2b [X86] Rename VINSERTzrr to use a capital Z to match other instructions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 01:26:19 +00:00
Vedant Kumar
d91d378e3a Retry: [llvm-profdata] Speed up merging by using a thread pool
Add a "-j" option to llvm-profdata to control the number of threads used.
Auto-detect NumThreads when it isn't specified, and avoid spawning threads when
they wouldn't be beneficial.

I tested this patch using a raw profile produced by clang (147MB). Here is the
time taken to merge 4 copies together on my laptop:

  No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total
  With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total

Changes since the initial commit:

  - When handling odd-length inputs, call ThreadPool::wait() before merging the
    last profile. Should fix a race/off-by-one (see r275937).

Differential Revision: https://reviews.llvm.org/D22438

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 01:17:20 +00:00
Vedant Kumar
40a2c5247c Revert "[llvm-profdata] Speed up merging by using a thread pool"
This reverts commit r275921. It broke the ppc64be bot:

  http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/3537

I'm not sure why it broke, but based on the output, it looks like an
off-by-one (one profile left un-merged).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:57:09 +00:00
Wei Mi
92a8d601a3 Recommit the patch "Use uniforms set to populate VecValuesToIgnore".
For instructions in uniform set, they will not have vector versions so
add them to VecValuesToIgnore.
For induction vars, those only used in uniform instructions or consecutive
ptrs instructions have already been added to VecValuesToIgnore above. For
those induction vars which are only used in uniform instructions or
non-consecutive/non-gather scatter ptr instructions, the related phi and
update will also be added into VecValuesToIgnore set.

The change will make the vector RegUsages estimation less conservative.

Differential Revision: https://reviews.llvm.org/D20474

The recommit fixed the testcase global_alias.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:50:43 +00:00
Matt Arsenault
530f0c21c6 AMDGPU/SI: Fix SI scheduler refcount issue
Without this fix, releaseSuccessors when InOrOutBlock is
false could release SUs outside the schedule BasicBlock.

Patch by Axel Davy

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:35:22 +00:00
Matt Arsenault
4cead0b564 AMDGPU: Expand register indexing pseudos in custom inserter
This is to help moveSILowerControlFlow to before regalloc.
There are a couple of tradeoffs with this. The complete CFG
is visible to more passes, the loop body avoids an extra copy of m0,
vcc isn't required, and immediate offsets can be shrunk into s_movk_i32.

The disadvantage is the register allocator doesn't understand that
the single lane's vector is dead within the loop body, so an extra
register is used to outlive the loop block when expanding the
VGPR -> m0 loop. This also now results in worse waitcnt insertion
before the loop instead of after for pending operations at the point
of the indexing, but that should be fixed by future improvements to
cross block waitcnt insertion.

v_movreld_b32's operands are now modeled more correctly since vdst
is not a true output. This is kind of a hack to treat vdst as a
use operand. Extra checking is required in the verifier since
I can't seem to get tablegen to emit an implicit operand for a
virtual register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:35:03 +00:00
Lang Hames
5a04b09d43 [Kaleidoscope][BuildingAJIT] More work on the text for Chapter 3.
Add an overview of stubs and compile callbacks before the discussion of the
source changes.

-- This line, and those below, will be ignored--

M    docs/tutorial/BuildingAJIT3.rst


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:25:52 +00:00
Sanjoy Das
aaf3f191a5 [LoopReroll] Reroll loops with unordered atomic memory accesses
Reviewers: hfinkel, jfb, reames

Subscribers: mcrosier, mzolotukhin, llvm-commits

Differential Revision: https://reviews.llvm.org/D22385

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:23:54 +00:00
Matt Arsenault
2d37e256fe TableGen: Allow custom register operand decoder method
This is for a situation where the encoding for a register may be
different depending on the specific operand. For some instructions,
we want to apply additional restrictions beyond the encoding's
constraints.

In AMDGPU some operands are VSrc_32, using the VS_32 pseudo register
class which accept VGPRs, SGPRs, or immediates in the encoding.
Some specific instructions with the same encoding operand do not want
to allow immediates or SGPRs, but the encoding format is different
in this case than a regular VGPR_32 operand.

This allows specifying the encoding should be treated the same
without introducing yet another dummy register class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 23:20:46 +00:00
Matt Arsenault
f36ea238a4 AMDGPU: Fix test name and broken CHECK-LABEL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 23:09:51 +00:00
Vedant Kumar
27e3ea1706 [utils] Generate html reports with the code coverage utility script
Instead of extracting raw coverage mappings into an artifact directory,
actually generate useful html reports for a given list of binaries with
symbol demangling turned on.

No tests, but this is actively being used to drive the (still nascent)
coverage bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 22:50:10 +00:00
Matt Arsenault
ec2cddd2d1 Fix -Wreturn-type with gcc 4.8 and libc++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 22:12:46 +00:00
Vedant Kumar
94471e314e [llvm-profdata] Speed up merging by using a thread pool
Add a "-j" option to llvm-profdata to control the number of threads
used. Auto-detect NumThreads when it isn't specified, and avoid spawning
threads when they wouldn't be beneficial.

I tested this patch using a raw profile produced by clang (147MB). Here is the
time taken to merge 4 copies together on my laptop:

  No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total
  With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total

Differential Revision: https://reviews.llvm.org/D22438

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 22:02:39 +00:00
Artem Belevich
09080a9732 [NVPTX] Make sure we adjust alignment at all call sites
.. including calls from kernel functions that were
ignored by mistake before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 21:58:48 +00:00
Dehao Chen
e7eb2d5c54 [PM] Convert Loop Strength Reduce pass to new PM
Summary: Convert Loop String Reduce pass to new PM

Reviewers: davidxl, silvas

Subscribers: junbuml, sanjoy, mzolotukhin, llvm-commits

Differential Revision: https://reviews.llvm.org/D22468

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 21:41:50 +00:00
Mehdi Amini
829ba4277a Update doxygen description for WriteBitcodeToFile() API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 21:29:24 +00:00
Teresa Johnson
385d70633e [PM] Port FunctionImport Pass to new PM
Summary: Port FunctionImport Pass to new PM.

Reviewers: mehdi_amini, davide

Subscribers: davidxl, llvm-commits

Differential Revision: https://reviews.llvm.org/D22475

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 21:22:24 +00:00
Wei Mi
fba236f858 Revert rL275912.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 21:14:43 +00:00
Wei Mi
1938056381 Use uniforms set to populate VecValuesToIgnore.
For instructions in uniform set, they will not have vector versions so
add them to VecValuesToIgnore.
For induction vars, those only used in uniform instructions or consecutive
ptrs instructions have already been added to VecValuesToIgnore above. For
those induction vars which are only used in uniform instructions or
non-consecutive/non-gather scatter ptr instructions, the related phi and
update will also be added into VecValuesToIgnore set.

The change will make the vector RegUsages estimation less conservative.

Differential Revision: https://reviews.llvm.org/D20474


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 20:59:53 +00:00
Sanjay Patel
dba9c3285e refactor SimplifySelectInst; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 20:56:53 +00:00
Justin Lebar
dd7a28e89b Write isUInt using template specializations to work around an incorrect MSVC warning.
Summary:
Per D22441, MSVC warns on our old implementation of isUInt<64>.  It sees
uint64_t(1) << 64 and doesn't realize that it's not going to be
executed.  Writing as a template specialization is ugly, but prevents
the warning.

Reviewers: RKSimon

Subscribers: majnemer, llvm-commits

Differential Revision: https://reviews.llvm.org/D22472

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 20:40:35 +00:00
Sanjay Patel
cc7cb1cb65 add tests for missed sext transform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 20:37:51 +00:00
Hans Wennborg
9beed5373e build_llvm_package.bat: update version to 4.0.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 20:26:46 +00:00
Sanjay Patel
52f3fd0660 auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 20:06:51 +00:00
Hans Wennborg
394b671724 Revert r273099 "If the revision number starts with r, drop it. It will get added back"
This doesn't seem to work with Bash:

$ /work/llvm/utils/release/merge.sh --proj llvm --rev r275870
/work/llvm/utils/release/merge.sh: line 34: ${$1#r}: bad substitution

I get the same error with and without a leading 'r'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 20:06:27 +00:00
Artem Belevich
67e73ac68f [NVPTX] Force minimum alignment of 4 for byval arguments of device-side functions.
Taking address of a byval variable in PTX is legal, but currently runs
into miscompilation by ptxas on sm_50+ (NVIDIA issue 1789042).
Work around the issue by enforcing minimum alignment on byval arguments
of device functions.

The change is a no-op on SASS level for sm_3x where ptxas already aligns
local copy by at least 4.

Differential Revision: https://reviews.llvm.org/D22428

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:54:56 +00:00
Michael Zolotukhin
1bf3e6c4f5 [LoopSimplify] Update LCSSA after separating nested loops.
Summary:
Usually LCSSA survives this transformation, but in some cases (see
attached test) it doesn't: values from the original loop after
separating might be used from the outer loop. Before the transformation
it was the same loop, so LCSSA phis were not required.

This fixes PR28272.

Reviewers: sanjoy, hfinkel, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:44:19 +00:00
Vitaly Buka
2d1ffcc163 Revert "[ARM] Skip inline asm memory operands in DAGToDAGISel"
Breaks asan, see https://reviews.llvm.org/D22103

This reverts commit r275776.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:44:01 +00:00
Vitaly Buka
8b25cc98c0 Revert "[ARM] Update test to use CHECK-LABEL. NFCI."
Breaks asan, see https://reviews.llvm.org/D22103

This reverts commit r275777.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:43:58 +00:00
Nirav Dave
8c782052e9 [MC] Separate non-parsing operations from conditional chains. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:35:21 +00:00
David Majnemer
cf907e040e [GVNHoist] Remove a home-grown version of replaceUsesOfWith
replaceUsesOfWith will, on average, consider fewer values when trying
to do the replacement.

No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:14:14 +00:00
Michael Zolotukhin
a2def1bba4 [LCSSA] Post-process PHI-nodes created by SSAUpdate when constructing LCSSA form.
Summary:
SSAUpdate might insert PHI-nodes inside loops, which can break LCSSA
form unless we fix it up.

This fixes PR28424.

Reviewers: sanjoy, chandlerc, hfinkel

Subscribers: uabelho, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:05:08 +00:00
Matt Arsenault
1b96f3c048 AMDGPU: Remove pointless dyn_cast_or_null
This is already casted above so non-null

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 19:00:07 +00:00
Reid Kleckner
a554d4075b Fix -Wmicrosoft-enum-value in GVNHoist.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:53:50 +00:00
Simon Pilgrim
93695a4ee8 [X86][SSE] Regenerate extraction from promotion test
Added tests for SSE2 as well as SSE41

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:53:15 +00:00
Simon Pilgrim
6bb6adf1c4 [X86][SSE] Regenerate extraction+store memop tests
Added tests for SSE2 as well as SSE41+AVX

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:44:01 +00:00
Simon Pilgrim
d57926e3c8 [X86][SSE] Regenerate truncate+extension memop tests
Added tests for SSE2 as well as SSE41

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:42:33 +00:00
Matt Arsenault
dddc5303e9 AMDGPU: Fix missing switch case warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:40:51 +00:00
Simon Pilgrim
9a118f07b8 Regenerate test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:38:51 +00:00
Matt Arsenault
bb09cfd86f AMDGPU: Add intrinsic for s_flbit_i32/v_ffbh_i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:35:05 +00:00
Matt Arsenault
40ca91a07a AMDGPU/R600: Replace barrier intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:34:59 +00:00
Matt Arsenault
865e2fa1dc AMDGPU: Remove dead check in AMDGPUPromoteAlloca
This is currently only called with GEP users. A direct
alloca would only happen with current typed pointers
for arrays which are a perverse case.

Also fix crashes on 0 x and 1 x arrays.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275869 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:34:53 +00:00
Matt Arsenault
797b9ee060 AMDGPU: Remove dead code and redundant check
Non intrinsic calls aren't really handled, and this
IntrinsicInst dyn_cast checks for the function for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:34:48 +00:00
Teresa Johnson
5e89a802f2 [ThinLTO] Address review comments from PGO indirect call promotion (NFC)
Address a couple of post-commit review comments from r275707.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:31:50 +00:00
Tim Northover
d7c16ef558 CodeGenPrep: use correct function to determine Global's alignment.
Elsewhere (particularly computeKnownBits) we assume that a global will be
aligned to the value returned by Value::getPointerAlignment. This is used to
boost the alignment on memcpy/memset, so any target-specific request can only
increase that value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:28:52 +00:00
Vedant Kumar
ee8657416e [llvm-cov] Re-write a very opaque comment (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 18:02:54 +00:00