Commit Graph

122001 Commits

Author SHA1 Message Date
Simon Pilgrim
41fc6f18d7 [DAGCombiner] Improve FMA support for interpolation patterns
This patch adds support for combining patterns such as (FMUL(FADD(1.0, x), y)) and (FMUL(FSUB(x, 1.0), y)) to their FMA equivalents.

This is useful in particular for linear interpolation cases such as (FADD(FMUL(x, t), FMUL(y, FSUB(1.0, t))))

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 20:32:48 +00:00
Jeroen Ketema
76e7126dd3 [ARM] Do not scale vext with a factor
The vext pseudo-instruction takes the number of elements that need to be
extracted, not the number of bytes. Hence, use the number of elements
directly instead of scaling them with a factor.

Reviewers: Silviu Baranga, James Molloy
(not reflected in the differential revision)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 20:28:04 +00:00
Simon Pilgrim
449957bf42 [DAGCombiner] Tidy up FMA combine helpers. NFCI.
Based on feedback for D13003.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 20:15:03 +00:00
James Molloy
f30ebaced7 [LoopUtils,LV] Propagate fast-math flags on generated FCmp instructions
We're currently losing any fast-math flags when synthesizing fcmps for
min/max reductions. In LV, make sure we copy over the scalar inst's
flags. In LoopUtils, we know we only ever match patterns with
hasUnsafeAlgebra, so apply that to any synthesized ops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 19:41:19 +00:00
Stephen Canon
ff278be8cf Remove roundingMode argument in APFloat::mod
Because mod is always exact, this function should have never taken a rounding mode argument.  The actual implementation still has issues, which I'll look at resolving in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 19:29:25 +00:00
Rafael Espindola
82ede2f136 Avoid SEGFAULT if a requested symbol section is absent.
Patch by Igor Kudrin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248194 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 19:17:18 +00:00
Matt Arsenault
a2259fcf68 Fix accidentally committed debug printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 18:21:10 +00:00
Chandler Carruth
56fa307e51 [ADT] Remove a couple of the always inline attributes I added.
Based on conversations with Justin and a few others, these constructors
are really useful to have in the executable so that you can call them
from the debugger. After some measurements, these *particular* calls
aren't so problematic as to make them a good tradeoff for always inline.

Please let me know if there are other functions really needed for
debugging. The always inline attribute is a hack that we should only
really employ when it doesn't hurt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248188 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 18:02:24 +00:00
Marcello Maggioni
eaf5bf9900 [DivergenceAnalysis] Separated definition of class into header.
The definition of the DivergenceAnalysis pass was in a CPP
file and wasn't accessible to users of the analysis to get it
through "getAnalysis<>()".
This patch extracts the definition into a separate header that
can be used by users of the analysis to fetch the results.

Patch by Volkan Keles (vkeles@apple.com)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 17:58:14 +00:00
Matthias Braun
9f85a3a737 SelectionDAG: Use InsertNode for EntryNode
This fixes problems where two nodes have persistent debug id 0 assigned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 17:41:05 +00:00
Chandler Carruth
a3e49ea99a [FunctionAttrs] Extract a helper function for the core logic used to
evaluate whether 'readonly' or 'readnone' apply to a given function.
This both reduces indentation and will make it easy to share the logic
with a new pass manager implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 17:39:41 +00:00
Ulrich Weigand
eeec957a3d [SystemZ] Fix expansion of ISD::FPOW and ISD::FSINCOS
The ISD::FPOW and ISD::FSINCOS opcodes default to Legal, but there
is no legal instruction for those on SystemZ.  This could cause
LLVM internal errors.  Fixed by setting the operation action to
Expand for those opcodes.

Also added test cases for all other LLVM IR intrinsics that should
generate a library call.  (Those already work correctly since the
default operation action is fine.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 17:35:45 +00:00
James Molloy
7d3733cd0d Revert "[ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def"
This was committed without the code review (http://reviews.llvm.org/D12937) being approved.

This reverts commit r248152.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 16:35:08 +00:00
Matt Arsenault
73b56327ef AMDGPU: Move copy handling under switch like other instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 16:27:22 +00:00
Sanjay Patel
94b76f172a add ShouldChangeType() variant that takes bitwidths
This is more efficient for cases like D12965 where we already have widths.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 16:09:37 +00:00
Matt Arsenault
3f80d148b1 DAGCombiner: Replace store of FP constant after attemping store merges
If storing multiple FP constants, some subset of the stores
would be replaced with integers due to visit order, so
MergeConsecutiveStores would only partially merge
these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 15:59:46 +00:00
Matt Arsenault
49b6dc35f7 Factor replacement of stores of FP constants into new function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 15:59:43 +00:00
Matt Arsenault
7c64ca7328 Fix missing C++ mode comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 15:59:41 +00:00
Sanjay Patel
b996e9dccf don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248166 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 15:33:26 +00:00
Chad Rosier
c5d4530d42 [Machine Combiner] Refactor machine reassociation code to be target-independent.
No functional change intended.
Patch by Haicheng Wu <haicheng@codeaurora.org>!

http://reviews.llvm.org/D12887
PR24522

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248164 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 15:09:11 +00:00
Artyom Skrobov
7dfb31c329 [ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def
Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a
hand-rolled tricky condition block in tools/clang/lib/Basic/Targets.cpp, with
a FIXME: attached.

This patch changes the handling of +t2dsp to be in line with other
architecture extensions.

Following review comments, also updating the description of FeatureDSPThumb2
in ARM.td.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248152 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 12:43:10 +00:00
Asaf Badouh
648a027c82 [X86][AVX512] add masked version for RSQRT14 & RCP14 Scalar FP
Differential Revision: http://reviews.llvm.org/D12524

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248147 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 10:23:53 +00:00
Daniel Sanders
99351d8c0e [mips] Allow constant expressions in second argument of .cpsetup.
Summary:
Also tightened up the test and made a trivial fix to prevent double-newline
after emitting .cpsetup directives.

Reviewers: vkalintiris

Subscribers: seanbruno, emaste, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 09:26:55 +00:00
Craig Topper
795a06a046 Use makeArrayRef or None to avoid unnecessarily mentioning the ArrayRef type extra times. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248140 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 05:32:41 +00:00
Craig Topper
2e1b727d8d Don't pass StringRefs around by const reference. Pass by value instead per coding standards. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21 00:18:00 +00:00
Craig Topper
634763c0f5 Cleanup places that passed SMLoc by const reference to pass it by value instead. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248135 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 23:35:59 +00:00
Sanjoy Das
dabf510ba1 [IndVars] Use C++11 style field initialization; NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248131 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 18:42:53 +00:00
Sanjoy Das
ba0b742fe5 [IndVars] Don't add a level of indentation for namespace {. NFC.
Whitespace-only change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248130 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 18:42:50 +00:00
Sanjay Patel
aa5c0021e3 add test file ahead of any functional changes for PR22428
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248123 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 15:58:00 +00:00
Simon Pilgrim
bf48d8543a [X86][SSE] Intrinsics builtins test refresh. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 15:41:35 +00:00
Igor Breger
b0eb8fb69c AVX512: Implemented encoding and intrinsics for vcmpss/sd.
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248121 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 15:15:10 +00:00
Asaf Badouh
fe11ff1d50 [X86][AVX512] extend support in Scalar conversion
add scalar FP to Int conversion with truncation intrinsics
add scalar conversion FP32 from/to FP64 intrinsics
add rounding mode and SAE mode encoding for these intrinsics

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248117 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 14:31:19 +00:00
Igor Breger
0d48c46954 AVX512: vsqrtss/sd encoding and intrinsics implementation.
Added tests for intrinsics and encoding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248116 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 09:13:41 +00:00
Asaf Badouh
d3db2cf572 [X86][AVX512DQ] Add fpclass instruction
Differential Revision: http://reviews.llvm.org/D12931

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248115 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 08:46:07 +00:00
Michael Kuperstein
5610c28853 [X86] Fix sitofp and uitofp instruction matching failures with long double and avx512
The operation action for i32 and i64 cannot be set to legal, as long double 
needs custom lowering.

Patch by: mitch.l.bodart@intel.com
Differential Revision: http://reviews.llvm.org/D12372


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 08:12:17 +00:00
Igor Breger
d425988995 AVX512: Implemented intrinsics for vshuff32x4, vshuff64x2, vshufi64x2, vshufi32x4
Added tests for intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 07:18:53 +00:00
Sanjoy Das
115bb95e68 [IndVars] Don't repeat function names in comment; NFC.
Only changes comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248112 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 06:58:03 +00:00
Igor Breger
28cce2ad25 AVX512: Implement instructions encoding, lowering and intrinsics
vinserti64x4, vinserti64x2, vinserti32x8, vinserti32x4, vinsertf64x4, vinsertf64x2, vinsertf32x8, vinsertf32x4
Added tests for encoding, lowering and intrinsics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248111 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 06:52:42 +00:00
Saleem Abdulrasool
2479d65186 ARM: cleanup formatting
clang-format a line which was poorly formatted.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248110 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 03:19:09 +00:00
Sanjoy Das
8ba782a30c [IndVars] Fix a bug in r248045.
Because -indvars widens induction variables through arithmetic,
`NeverNegative` cannot be a property of the `WidenIV` (a `WidenIV`
manages information for all transitive uses of an IV being widened,
including uses of `-1 * IV`).  Instead it must live on `NarrowIVDefUse`
which manages information for a specific def-use edge in the transitive
use list of an induction variable.

This change also adds a test case that demonstrates the problem with
r248045.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248107 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-20 01:52:18 +00:00
Davide Italiano
d58f92c07d Fixup r248096, commit the *correct* test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248097 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 20:52:47 +00:00
Davide Italiano
e986a9d52e [obj2yaml] Fix "time of check to time of use" bug. Add a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248096 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 20:49:34 +00:00
Simon Pilgrim
0e92420490 [X86][AVX2] Use general sext IR for vpmovsx stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248093 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 17:04:18 +00:00
Simon Pilgrim
afa71f40bf [X86][SSE] Vectorize CTTZ + CTTZ_ZERO_UNDEF
Now that we have fast vector CTPOP implementations we can use this to speed up vector CTTZ using the pattern (cttz(x) = ctpop((x & -x) - 1))

Additionally, for AVX512CD that provides lzcnt instructions we can use the pattern (cttz_undef(x) = (width - 1) - ctlz(x & -x))

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248091 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 13:22:57 +00:00
Simon Pilgrim
02dd54df02 [InstCombine] Use SimplifyDemandedVectorEltsLow helper function. NFCI.
Use the SimplifyDemandedVectorEltsLow helper function introduced in D12680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248089 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 11:41:53 +00:00
NAKAMURA Takumi
7a4660aaa9 [CMake] Update LLVM_TEST_DEPENDS not to use macho-dump. It has been unused since r247235.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248088 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 07:19:30 +00:00
Matt Arsenault
96465eb3e3 AMDGPU: Remove dead code
getCFGStructurizerRegClass is not used for SI, so
move it into R600 specific stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248087 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 06:41:10 +00:00
Bob Wilson
976d66dd2d NFC: Fix indentation and add braces to clarify nested of else-statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248086 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 06:20:59 +00:00
Maksim Panchenko
4e9ce340e6 [PrologEpilogInserter] Minor refactoring.
Differential Revision: http://reviews.llvm.org/D12924


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248084 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 04:42:15 +00:00
Maksim Panchenko
3d047dfbb7 Test commit. Fix comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248082 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-19 04:01:19 +00:00