Commit Graph

93634 Commits

Author SHA1 Message Date
Davide Italiano
c850b51cca [SLC] Emit an intrinsic instead of a libcall for pow.
Differential Revision:  https://reviews.llvm.org/D22104


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 20:27:03 +00:00
Nico Weber
29b5c03449 Revert r277905, it caused PR28894
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 20:18:04 +00:00
Craig Topper
1a28a7107c [AVX-512] Add 512-bit logical operations to load folding tables. Add avx512f stack folding test and move some tests from the avx512vl test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 17:14:09 +00:00
Craig Topper
778de48b67 [AVX-512] Add EVEX encoded floating point MAX/MIN instructions to the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 17:14:05 +00:00
Simon Pilgrim
1223b84c30 [X86] lowerVectorShuffle - ensure that undefined mask elements only use SM_SentinelUndef
Help lowering and combining (which can specify SM_SentinelZero mask elements) share more shuffle matching code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 15:29:12 +00:00
Elena Demikhovsky
661baf2e45 AVX-512: Changed lowering of BITCAST between i1 vectors and i8/i16/i32 integer values
Optimized lowering of BITCAST node. The BITCAST node can be replaced with COPY_TO_REG instead of KMOV.
It allows to suppress two opposite BITCAST operations and avoid redundant "movs".

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 13:05:58 +00:00
David Majnemer
7428509ec4 [InstSimplify] Fold gep (gep V, C), (sub 0, V) to C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 07:58:12 +00:00
David Majnemer
2a07d9fdb3 [InstSimplify] Try hard to simplify pointer comparisons
Simplify ptrtoint comparisons involving operands with different source
types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 07:58:10 +00:00
David Majnemer
0c8a3440d6 [InstCombine] Infer inbounds on geps of allocas
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 07:58:00 +00:00
Craig Topper
facbf764c7 [X86] Add commutable floating point max/min instructions to the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 05:39:51 +00:00
Craig Topper
8b055891ad [X86] Simplify a shuffle mask copy. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277947 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 05:39:46 +00:00
Michael Zolotukhin
0f98731ce6 Revert "Revert "[LoopSimplify] Fix updating LCSSA after separating nested loops.""
This reverts commit r277901. Reaaply the commit as it looks like it has
nothing to do with the bots failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 01:56:54 +00:00
Lang Hames
5a98b5874c [ExecutionEngine][RuntimeDyld] Move JITSymbol from ExecutionEngine to RuntimeDyld.
JITSymbol really belongs in RuntimeDyld. This should fix the llvm-rtdyld link
failures caused by r277943.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277945 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 01:19:37 +00:00
Lang Hames
5ca8eaf661 [RuntimeDyld] Remove symbol that is unused as of r277943.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 01:12:44 +00:00
Lang Hames
fdf5e1ee1e [RuntimeDyld] Replace manual flag checks with JITSymbolFlags::fromObjectSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 00:18:14 +00:00
Lang Hames
9350f3619a [ORC] Re-apply r277896, removing bogus triples and datalayouts that broke tests
on linux last time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 22:36:26 +00:00
Kostya Serebryany
3aa06bae18 [libFuzzer] make libFuzzer work with a bit older clang versions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 21:28:56 +00:00
Kostya Serebryany
1efe1f7b69 [libFuzzer] don't print bogus error message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 21:23:29 +00:00
Simon Pilgrim
2e5c533f85 [X86][AVX2] Improve sign/zero extension on AVX2 targets
Split extensions to large vectors into 256-bit chunks - the equivalent of what we do with pre-AVX2 into 128-bit chunks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 21:21:12 +00:00
Gor Nishanov
303ae673f8 CoroSplit: Squash unused variable FnTrigger warning in NDEBUG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 21:11:10 +00:00
Gor Nishanov
2007f371f4 [Coroutines] Part 5: Add CGSCC restart trigger
Summary:
CoroSplit pass processes the coroutine twice. First, it lets it go through
complete IPO optimization pipeline as a single function. It forces restart
of the pipeline by inserting an indirect call to an empty function "coro.devirt.trigger"
which is devirtualized by CoroElide pass that triggers a restart of the pipeline by CGPassManager.
(In later patches, when CoroSplit pass sees the same coroutine the second time, it splits it up,
adds coroutine subfunctions to the SCC to be processed by IPO pipeline.)

Documentation and overview is here: http://llvm.org/docs/Coroutines.html.

Upstreaming sequence (rough plan)
1.Add documentation. (https://reviews.llvm.org/D22603)
2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
3.Add empty coroutine passes. (https://reviews.llvm.org/D22847)
4.Add coroutine devirtualization + tests.
ab) Lower coro.resume and coro.destroy (https://reviews.llvm.org/D22998)
c) Do devirtualization (https://reviews.llvm.org/D23229)
5.Add CGSCC restart trigger + tests. <= we are here
6.Add coroutine heap elision + tests.
7.Add the rest of the logic (split into more patches)

Reviewers: mehdi_amini, majnemer

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 20:44:39 +00:00
Craig Topper
6bb60d226f [AVX-512] Add SQRT/RCP14/RNDSCALE to hasUndefRegUpdate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 19:31:52 +00:00
Craig Topper
7c9196ad13 [AVX-512] Add AVX-512 scalar CVT instructions to hasUndefRegUpdate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 19:31:50 +00:00
Craig Topper
372fbdfd41 [X86] Add VRCPSSr_Int, VRSQRTSSr_Int, VSQRTSSr_Int, and VSQRTSDr_Int to hasUndefRegUpdate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 19:31:44 +00:00
Simon Pilgrim
39e5fc9030 [X86][SSE] Enable commutation between MOVHLPS and UNPCKHPD
Assuming SSE2 is available then we can safely commute between these, removing some unnecessary register moves and improving memory folding opportunities.

VEX encoded versions don't benefit so I haven't added support to them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 18:40:28 +00:00
Mike Aizatsky
7e8350b8b7 [libfuzzer] do not warn about missing pcbuffer functions: they are new.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 17:03:22 +00:00
Benjamin Kramer
599a666215 [ARM] Don't copy MCInsts in loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 12:58:24 +00:00
Benjamin Kramer
a44f29cdc4 [Inliner] Use function_ref for functors which are never taken ownership of.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 12:33:46 +00:00
Benjamin Kramer
fb0b339283 [LoadCombine] Simplify code with a brace init. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 12:11:11 +00:00
Simon Pilgrim
0f888a7ccd [X86][SSE] Add 2 input shuffle support to matchBinaryVectorShuffle
Not actually used yet...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 11:22:39 +00:00
Benjamin Kramer
284030ab2c Move helpers into anonymous namespaces. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 11:13:10 +00:00
David Majnemer
bc3aa5c56b [CodeGen] Fix a -Wdocumentation warning
A parameter was documented with the wrong name.
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 08:37:12 +00:00
David Majnemer
2982845bcc [ValueTracking] Teach computeKnownBits about [su]min/max
Reasoning about a select in terms of a min or max allows us to derive a
tigher bound on the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 08:16:00 +00:00
David Majnemer
470962f413 [CallGraphSCCPass] Use an ArrayRef instead of a pair of iterators
No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 06:21:02 +00:00
Sanjoy Das
9da24c7e7f [InstCombine] Don't coerce non-integral pointers to integers
Reviewers: majnemer

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 02:58:48 +00:00
Matthias Braun
3f4f33680b Revert "(refs/bisect/bad) GVN-hoist: enable by default"
GVN-Hoist appears to miscompile llvm-testsuite
SingleSource/Benchmarks/Misc/fbench.c at the moment.

I filed http://llvm.org/PR28880

This reverts commit r277786.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 02:23:15 +00:00
Gor Nishanov
fa2883261f Part 4c: Coroutine Devirtualization: Devirtualize coro.resume and coro.destroy.
Summary:
This is the 4c patch of the coroutine series. CoroElide pass now checks if PostSplit coro.begin
is referenced by coro.subfn.addr intrinsics. If so replace coro.subfn.addrs with an appropriate coroutine
subfunction associated with that coro.begin.

Documentation and overview is here: http://llvm.org/docs/Coroutines.html.

Upstreaming sequence (rough plan)
1.Add documentation. (https://reviews.llvm.org/D22603)
2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
3.Add empty coroutine passes. (https://reviews.llvm.org/D22847)
4.Add coroutine devirtualization + tests.
ab) Lower coro.resume and coro.destroy (https://reviews.llvm.org/D22998)
c) Do devirtualization <= we are here
5.Add CGSCC restart trigger + tests.
6.Add coroutine heap elision + tests.
7.Add the rest of the logic (split into more patches)

Reviewers: majnemer

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 02:16:35 +00:00
Nico Weber
84f6a48c0d Revert r277896.
It breaks ExecutionEngine/OrcLazy/weak-function.ll on most bots.

Script:
--
...
--
Exit Code: 1

Command Output (stderr):
--
Could not find main function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 02:00:45 +00:00
Kyle Butt
d9a9f7d3ac CodeGen: If Convert blocks that would form a diamond when tail-merged.
The following function currently relies on tail-merging for if
conversion to succeed. The common tail of cond_true and cond_false is
extracted, and this then forms a diamond pattern that can be
successfully if converted.

If this block does not get extracted, either because tail-merging is
disabled or the threshold is higher, we should still recognize this
pattern and if-convert it.
define i32 @t2(i32 %a, i32 %b) nounwind {
entry:
	%tmp1434 = icmp eq i32 %a, %b		; <i1> [#uses=1]
	br i1 %tmp1434, label %bb17, label %bb.outer

bb.outer:		; preds = %cond_false, %entry
	%b_addr.021.0.ph = phi i32 [ %b, %entry ], [ %tmp10, %cond_false ]
	%a_addr.026.0.ph = phi i32 [ %a, %entry ], [ %a_addr.026.0, %cond_false ]
	br label %bb

bb:		; preds = %cond_true, %bb.outer
	%indvar = phi i32 [ 0, %bb.outer ], [ %indvar.next, %cond_true ]
	%tmp. = sub i32 0, %b_addr.021.0.ph
	%tmp.40 = mul i32 %indvar, %tmp.
	%a_addr.026.0 = add i32 %tmp.40, %a_addr.026.0.ph
	%tmp3 = icmp sgt i32 %a_addr.026.0, %b_addr.021.0.ph
	br i1 %tmp3, label %cond_true, label %cond_false

cond_true:		; preds = %bb
	%tmp7 = sub i32 %a_addr.026.0, %b_addr.021.0.ph
	%tmp1437 = icmp eq i32 %tmp7, %b_addr.021.0.ph
	%indvar.next = add i32 %indvar, 1
	br i1 %tmp1437, label %bb17, label %bb

cond_false:		; preds = %bb
	%tmp10 = sub i32 %b_addr.021.0.ph, %a_addr.026.0
	%tmp14 = icmp eq i32 %a_addr.026.0, %tmp10
	br i1 %tmp14, label %bb17, label %bb.outer

bb17:		; preds = %cond_false, %cond_true, %entry
	%a_addr.026.1 = phi i32 [ %a, %entry ], [ %tmp7, %cond_true ], [ %a_addr.026.0, %cond_false ]
	ret i32 %a_addr.026.1
}

Without tail-merging or diamond-tail if conversion:
LBB1_1:                                 @ %bb
                                        @ =>This Inner Loop Header: Depth=1
        cmp     r0, r1
        ble     LBB1_3
@ BB#2:                                 @ %cond_true
                                        @   in Loop: Header=BB1_1 Depth=1
        subs    r0, r0, r1
        cmp     r1, r0
        it      ne
        cmpne   r0, r1
        bgt     LBB1_4
LBB1_3:                                 @ %cond_false
                                        @   in Loop: Header=BB1_1 Depth=1
        subs    r1, r1, r0
        cmp     r1, r0
        bne     LBB1_1
LBB1_4:                                 @ %bb17
        bx      lr

With diamond-tail if conversion, but without tail-merging:
@ BB#0:                                 @ %entry
        cmp     r0, r1
        it      eq
        bxeq    lr
LBB1_1:                                 @ %bb
                                        @ =>This Inner Loop Header: Depth=1
        cmp     r0, r1
        ite     le
        suble   r1, r1, r0
        subgt   r0, r0, r1
        cmp     r1, r0
        bne     LBB1_1
@ BB#2:                                 @ %bb17
        bx      lr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 01:52:37 +00:00
Kyle Butt
e0b41b59f3 IfConverter: Split ScanInstructions into 2 functions.
ScanInstructions is now 2 functions:
AnalyzeBranches and ScanInstructions. ScanInstructions also now takes a
pair of arguments delimiting the instructions to be scanned. This will
be used for forked diamond support to re-scan only a portion of the
block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 01:52:34 +00:00
Kyle Butt
792628981a IfConversion: Document countDuplicatedInstructions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 01:52:33 +00:00
Kyle Butt
f655859020 IfConversion: factor out 2 functions to skip debug instrs. NFC
Skipping debug instructions occurrs repeatedly, factor it out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 01:52:31 +00:00
Michael Zolotukhin
392ab3662c Revert "[LoopSimplify] Fix updating LCSSA after separating nested loops."
This reverts commit r277877.
Try to appease clang-x64-ninja-win7 buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 01:48:51 +00:00
Lang Hames
38365dac94 [ORC] Add (partial) weak symbol support to the CompileOnDemand layer.
This adds partial support for weak functions to the CompileOnDemandLayer by
modifying the addLogicalModule method to check for existing stub definitions
before building a new stub for a weak function. This scheme is sufficient to
support ODR definitions, but fails for general weak definitions if strong
definition is encountered after the first weak definition. (A more extensive
refactor will be required to fully support weak symbols).

This patch does *not* add weak symbol support to RuntimeDyld: I hope to add
that in the near future.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 00:54:43 +00:00
Sanjoy Das
9c8288602e [IRCE] Remove unused headers; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 00:02:01 +00:00
Sanjoy Das
265e61ad49 [IRCE] Preserve loop-simplify form
Fixes PR28764.  Right now there is no way to test this, but (as
mentioned on the PR) with Michael Zolotukhin's yet to be checked in
LoopSimplify verfier, 8 of the llvm-lit tests for IRCE crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06 00:01:56 +00:00
Sanjay Patel
4b55580c72 [InstCombine] refactor ctlz/cttz folds (NFCI)
Note that this fold really belongs in InstSimplify.
Refactoring here anyway as an intermediate step because
there's a planned addition to this function in D23134.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 22:42:46 +00:00
Daniel Berlin
466b4f2148 [MSSA] Use depth first iterator instead of custom version.
Summary:
Originally the plan was to use the custom worklist to do some block popping,
and because we don't actually need a visited set. The custom one we have
here is slightly broken, and it's not worth fixing vs using depth_first_iterator since we aren't going to go the route we originally
were.

Fixes PR28874
Reviewers: george.burgess.iv

Subscribers: llvm-commits, gberry

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 22:09:14 +00:00
Justin Bogner
4aa9fee76d CodeView: Remove an unused variable
It was breaking the -Werror build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 21:57:10 +00:00
Michael Zolotukhin
41d635e247 [LoopSimplify] Fix updating LCSSA after separating nested loops.
This fixes PR28825. The problem was that we only checked if a value from
a created inner loop is used in the outer loop, and fixed LCSSA for
them. But we missed to fixup LCSSA for values used in exits of the outer
loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 21:52:58 +00:00