]> granicus.if.org Git - llvm/log
llvm
8 years agoCodeGenPrepare: Sink addressing modes for atomics
Matt Arsenault [Wed, 15 Mar 2017 22:35:20 +0000 (22:35 +0000)]
CodeGenPrepare: Sink addressing modes for atomics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297903 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTry to fix build break due to template argument deduction.
Zachary Turner [Wed, 15 Mar 2017 22:32:59 +0000 (22:32 +0000)]
Try to fix build break due to template argument deduction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297902 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-pdbdump] Add support for diffing the String Table.
Zachary Turner [Wed, 15 Mar 2017 22:19:30 +0000 (22:19 +0000)]
[llvm-pdbdump] Add support for diffing the String Table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297901 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[pdb] Write the module info and symbol record streams.
Zachary Turner [Wed, 15 Mar 2017 22:18:53 +0000 (22:18 +0000)]
[pdb] Write the module info and symbol record streams.

Previously we did not have support for writing detailed
module information for each module, as well as the symbol
records.  This patch adds support for this, and in doing
so enables the ability to construct minimal PDBs from
just a few lines of YAML.  A test is added to illustrate
this functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297900 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix up grammar in a comment.
Eric Christopher [Wed, 15 Mar 2017 21:50:46 +0000 (21:50 +0000)]
Fix up grammar in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297898 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PGO] Value profile for size of memory intrinsic calls
Rong Xu [Wed, 15 Mar 2017 21:47:27 +0000 (21:47 +0000)]
[PGO] Value profile for size of memory intrinsic calls

This patch adds the value profile support to profile the size parameter of
memory intrinsic calls: memcpy, memcmp, and memmov.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297897 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSecond attempt for fix Hexagon buildbot by moving test to under X86/
Zvi Rackover [Wed, 15 Mar 2017 21:13:45 +0000 (21:13 +0000)]
Second attempt for fix Hexagon buildbot by moving test to under X86/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297893 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PGO] Minor cleanup for count instruction in SelectInstVisitor.
Rong Xu [Wed, 15 Mar 2017 21:05:24 +0000 (21:05 +0000)]
[PGO] Minor cleanup for count instruction in SelectInstVisitor.

Summary:
NSIs can be double-counted by different operations in
SelectInstVisitor. Sink the the update to VM_counting mode only.
Also reset the value for each counting operation.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: xur, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297892 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover.
Vitaly Buka [Wed, 15 Mar 2017 20:59:27 +0000 (20:59 +0000)]
[libFuzzer] Use ChooseUnitIdxToMutate to pick item for crossover.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297891 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd GDB pretty-printer for llvm::Twine type
David Blaikie [Wed, 15 Mar 2017 20:51:44 +0000 (20:51 +0000)]
Add GDB pretty-printer for llvm::Twine type

Patch by Simon Marchi!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297889 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLimit test's triple in attempt to fix broken buildbot
Zvi Rackover [Wed, 15 Mar 2017 20:29:58 +0000 (20:29 +0000)]
Limit test's triple in attempt to fix broken buildbot

Regression test for a target-independent bug keeps failing in the
Hexagon backend due to what appears an unrelated issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297888 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC: Corrects comments that were supposed to go in with earlier commit.
Adrian McCarthy [Wed, 15 Mar 2017 20:29:06 +0000 (20:29 +0000)]
NFC:  Corrects comments that were supposed to go in with earlier commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297887 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[EarlyCSE] reduce indent; NFCI
Sanjay Patel [Wed, 15 Mar 2017 20:25:05 +0000 (20:25 +0000)]
[EarlyCSE] reduce indent; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297886 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[tablegen][globalisel] Trivial changes to reduce size of following patch. NFC.
Daniel Sanders [Wed, 15 Mar 2017 20:18:38 +0000 (20:18 +0000)]
[tablegen][globalisel] Trivial changes to reduce size of following patch. NFC.

Summary:
* Move namespace {
* Trivial: Typo
* RuleMatcher: Separate class and definition
* Trivial: const findNodeEquiv

Reviewers: t.p.northover, qcolombet, aditya_nandakumar, ab, rovka

Reviewed By: rovka

Subscribers: dberris, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297884 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIntroduce NativeEnumModules and NativeCompilandSymbol
Adrian McCarthy [Wed, 15 Mar 2017 20:17:58 +0000 (20:17 +0000)]
Introduce NativeEnumModules and NativeCompilandSymbol

Together, these allow lldb-pdbdump to list all the modules from a PDB using a
native reader (rather than DIA).

Note that I'll probably be specializing NativeRawSymbol in a subsequent patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297883 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DAGCombine] Bail out if can't create a vector with at least two elements
Zvi Rackover [Wed, 15 Mar 2017 19:48:36 +0000 (19:48 +0000)]
[DAGCombine] Bail out if can't create a vector with at least two elements

Summary:

Fixes pr32278

Reviewers: igorb, craig.topper, RKSimon, spatel, hfinkel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297878 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Update format of 'names' section.
Derek Schuff [Wed, 15 Mar 2017 19:36:02 +0000 (19:36 +0000)]
[WebAssembly] Update format of 'names' section.

This change updates to the format of the 'names' sectionin the
generated wasm binary to match the latest changesto the design
and 'wabt'.

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

Patch by Sam Clegg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297877 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Add missing BITREVERSE costs for SSE2 vectors and i8/i16/i32/i64 scalars
Simon Pilgrim [Wed, 15 Mar 2017 19:34:55 +0000 (19:34 +0000)]
[X86] Add missing BITREVERSE costs for SSE2 vectors and i8/i16/i32/i64 scalars

Prep work for PR31810

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297876 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel] Avoid translating synthetic constants to new G_CONSTANTS.
Ahmed Bougacha [Wed, 15 Mar 2017 19:21:11 +0000 (19:21 +0000)]
[GlobalISel] Avoid translating synthetic constants to new G_CONSTANTS.

Currently, we create a G_CONSTANT for every "synthetic" integer
constant operand (for instance, for the G_GEP offset).
Instead, share the G_CONSTANTs we might have created by going through
the ValueToVReg machinery.

When we're emitting synthetic constants, we do need to get Constants from
the context.  One could argue that we shouldn't modify the context at
all (for instance, this means that we're going to use a tad more memory
if the constant wasn't used elsewhere), but constants are mostly
harmless.  We currently do this for extractvalue and all.

For constant fcmp, this does mean we'll emit an extra COPY, which is not
necessarily more optimal than an extra materialized constant.
But that preserves the current intended design of uniqued G_CONSTANTs,
and the rematerialization problem exists elsewhere and should be
resolved with a single coherent solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297875 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel][AArch64] Select ADDXri.
Ahmed Bougacha [Wed, 15 Mar 2017 19:20:59 +0000 (19:20 +0000)]
[GlobalISel][AArch64] Select ADDXri.

We're now able to select ADDWri thanks to the new complex pattern
support.  Extend that to ADDXri.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297874 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Fix unnecessary ands when packing f16 vectors
Matt Arsenault [Wed, 15 Mar 2017 19:04:26 +0000 (19:04 +0000)]
AMDGPU: Fix unnecessary ands when packing f16 vectors

computeKnownBits didn't handle fp_to_fp16 to report
the high bits as 0. ARM maps the generic node to an instruction
that does not modify the high bits of the register, so introduce
a target node where the high bits are known 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297873 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoARM: avoid clobbering register in v6 jump-table expansion.
Tim Northover [Wed, 15 Mar 2017 18:38:13 +0000 (18:38 +0000)]
ARM: avoid clobbering register in v6 jump-table expansion.

If we got unlucky with register allocation and actual constpool placement, we
could end up producing a tTBB_JT with an index that's already been clobbered.

Technically, we might be able to fix this situation up with a MOV, but I think
the constant islands pass is complex enough without having to deal with more
weird edge-cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297871 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PGO] Refactor the code for value profile annotation
Rong Xu [Wed, 15 Mar 2017 18:23:39 +0000 (18:23 +0000)]
[PGO] Refactor the code for value profile annotation

This patch refactors the code for value profile annotation to facilitate
of adding other kind of value profiles.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297870 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel] Insert translated switch icmp blocks after switch parent.
Ahmed Bougacha [Wed, 15 Mar 2017 18:22:37 +0000 (18:22 +0000)]
[GlobalISel] Insert translated switch icmp blocks after switch parent.

Now that we preserve the IR layout, we would end up with all the newly
synthesized switch comparison blocks at the end of the function.
Instead, use a hopefully more reasonable layout, with the comparison
blocks immediately following the switch comparison blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297869 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel] Preserve IR block layout.
Ahmed Bougacha [Wed, 15 Mar 2017 18:22:33 +0000 (18:22 +0000)]
[GlobalISel] Preserve IR block layout.

It makes the output function layout more predictable;  the layout has
an effect on performance, we don't want it to be at the mercy of the
translator's visitation order and such.
The predictable output is also easier to digest.

getOrCreateBB isn't appropriately named anymore, as it never needs to
create anything.  Rename it and extract the MBB creation logic out of it.

A couple tests were sensitive to the order. Update them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297868 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel] Use ASCII quote/apostrophe in comment. NFC.
Ahmed Bougacha [Wed, 15 Mar 2017 18:22:24 +0000 (18:22 +0000)]
[GlobalISel] Use ASCII quote/apostrophe in comment. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297867 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Minor SIAnnotateControlFlow cleanups
Matt Arsenault [Wed, 15 Mar 2017 18:00:12 +0000 (18:00 +0000)]
AMDGPU: Minor SIAnnotateControlFlow cleanups

Newline fixes, early return, range loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297865 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[YAML] When outputting, provide the ability to write default values.
Zachary Turner [Wed, 15 Mar 2017 17:47:39 +0000 (17:47 +0000)]
[YAML] When outputting, provide the ability to write default values.

Previously, if you attempted to write a key/value pair and the
value was equal to the key's default value, we would not output
the value.  Sometimes it is useful to be able to see this value
in the output anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297864 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMove some LAST_* enum sentinels out of their enums
Reid Kleckner [Wed, 15 Mar 2017 17:43:40 +0000 (17:43 +0000)]
Move some LAST_* enum sentinels out of their enums

These are not valid values of the enum, so this will improve clang
-Wcovered-switch-default diagnostics. It also fixes some
-Wbitfield-enum-conversion warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297863 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Use APInt::setLowBits/setHighBits/setBitsFrom in more places
Craig Topper [Wed, 15 Mar 2017 16:53:53 +0000 (16:53 +0000)]
[CodeGen] Use APInt::setLowBits/setHighBits/setBitsFrom in more places

This patch replaces ORs with getHighBits/getLowBits etc. with setLowBits/setHighBits/setBitsFrom.

In a few of the places we weren't ORing, but the KnownZero/KnownOne vectors were already initialized to zero. We exploit this in most places already there were just some that were inconsistent.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297860 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel][AArch64] Add back constant select tests. NFC.
Ahmed Bougacha [Wed, 15 Mar 2017 16:51:41 +0000 (16:51 +0000)]
[GlobalISel][AArch64] Add back constant select tests. NFC.

More of r297856.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297859 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel][AArch64] Use appropriate test function names. NFC.
Ahmed Bougacha [Wed, 15 Mar 2017 16:29:40 +0000 (16:29 +0000)]
[GlobalISel][AArch64] Use appropriate test function names. NFC.

These FP tests are on FPR, not GPR.  Don't lie in the name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297857 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel][AArch64] Split out select tests. NFC.
Ahmed Bougacha [Wed, 15 Mar 2017 16:29:37 +0000 (16:29 +0000)]
[GlobalISel][AArch64] Split out select tests. NFC.

The test has grown enough to be annoying to navigate.
While there, Remove unnecessary RUNs, and cleanup a couple comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297856 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel] Remove dead member. NFC.
Ahmed Bougacha [Wed, 15 Mar 2017 16:29:32 +0000 (16:29 +0000)]
[GlobalISel] Remove dead member. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297855 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRe-apply r296730, "cmake: Configure the ThinLTO cache directory when using ELF lld...
Peter Collingbourne [Wed, 15 Mar 2017 16:28:43 +0000 (16:28 +0000)]
Re-apply r296730, "cmake: Configure the ThinLTO cache directory when using ELF lld or gold."

All known cache-related bugs observed when self hosting have been fixed (r296907
and r297853).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297854 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCodeGen: Use the source filename as the argument to .file, rather than the module ID.
Peter Collingbourne [Wed, 15 Mar 2017 16:24:52 +0000 (16:24 +0000)]
CodeGen: Use the source filename as the argument to .file, rather than the module ID.

Using the module ID here is wrong for a couple of reasons:
1) The module ID is not persisted, so we can end up with different
   object file contents given the same input file (for example if the same
   file is accessed via different paths).
2) With ThinLTO the module ID field may contain the path to a bitcode file,
   which is incorrect, as the .file argument is supposed to contain the path to
   a source file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297853 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SelectionDAG] Support BUILD_VECTOR implicit truncation in SelectionDAG::ComputeNumSi...
Simon Pilgrim [Wed, 15 Mar 2017 16:22:24 +0000 (16:22 +0000)]
[SelectionDAG] Support BUILD_VECTOR implicit truncation in SelectionDAG::ComputeNumSignBits (PR32273)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297852 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PowerPC][Altivec] Add mfvrd and mffprd extended mnemonic
Nemanja Ivanovic [Wed, 15 Mar 2017 16:04:53 +0000 (16:04 +0000)]
[PowerPC][Altivec] Add mfvrd and mffprd extended mnemonic

mfvrd and mffprd are both alias to mfvrsd.
This patch enables correct parsing of the aliases, but we still emit a mfvrsd.

Committing on behalf of brunoalr (Bruno Rosa).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297849 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SelectionDAG][AArch64] Add test case showing incorrect SelectionDAG::ComputeNumSignB...
Simon Pilgrim [Wed, 15 Mar 2017 15:40:34 +0000 (15:40 +0000)]
[SelectionDAG][AArch64] Add test case showing incorrect SelectionDAG::ComputeNumSignBits BUILD_VECTOR handling

Reduced from a mixture of PR32273 and David Green's test cases showing SelectionDAG::ComputeNumSignBits not correctly handling BUILD_VECTOR implicit truncation of inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297847 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCyle -> Cycle; NFCI
Sanjay Patel [Wed, 15 Mar 2017 15:37:42 +0000 (15:37 +0000)]
Cyle -> Cycle; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297846 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "Refactor SimplifyCFG:canSinkInstructions [NFC]"
Eric Liu [Wed, 15 Mar 2017 15:29:42 +0000 (15:29 +0000)]
Revert "Refactor SimplifyCFG:canSinkInstructions [NFC]"

This reverts commit r297839, which breaks Transforms/SimplifyCFG/sink-common-code.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297845 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[Thumb1] Fix the bug when adding/subtracting -2147483648"
Artyom Skrobov [Wed, 15 Mar 2017 14:50:43 +0000 (14:50 +0000)]
Revert "[Thumb1] Fix the bug when adding/subtracting -2147483648"

This reverts r297820 which apparently fails on A15 hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297842 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReverted unintended commit
Simon Pilgrim [Wed, 15 Mar 2017 14:47:30 +0000 (14:47 +0000)]
Reverted unintended commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297841 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix Wint-in-bool-context warning (PR32248)
Simon Pilgrim [Wed, 15 Mar 2017 14:38:19 +0000 (14:38 +0000)]
Fix Wint-in-bool-context warning (PR32248)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297840 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRefactor SimplifyCFG:canSinkInstructions [NFC]
Aditya Kumar [Wed, 15 Mar 2017 14:26:45 +0000 (14:26 +0000)]
Refactor SimplifyCFG:canSinkInstructions [NFC]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297839 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReverting r297821 due to breaking lld test.
Sam Parker [Wed, 15 Mar 2017 14:06:42 +0000 (14:06 +0000)]
Reverting r297821 due to breaking lld test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297838 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Target] fix typo; NFC
Sanjay Patel [Wed, 15 Mar 2017 14:01:28 +0000 (14:01 +0000)]
[Target] fix typo; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297836 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd 'REQUIRES: asserts' to pr32278.ll introduced in r297822
Eric Liu [Wed, 15 Mar 2017 13:37:20 +0000 (13:37 +0000)]
Add 'REQUIRES: asserts' to pr32278.ll introduced in r297822

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297835 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Fixed shuffle MOVSS/MOVSD combining of all zeroable inputs
Simon Pilgrim [Wed, 15 Mar 2017 13:16:46 +0000 (13:16 +0000)]
[X86][SSE] Fixed shuffle MOVSS/MOVSD combining of all zeroable inputs

Turns out it can happen, so the assertion was too harsh

Found during fuzz testing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297833 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Mips] Add support to match more patterns for DEXT and CINS
Petar Jovanovic [Wed, 15 Mar 2017 13:10:08 +0000 (13:10 +0000)]
[Mips] Add support to match more patterns for DEXT and CINS

This patch adds support for recognizing more patterns to match to DEXT and
CINS instructions.
It finds cases where multiple instructions could be replaced with a single
DEXT or CINS instruction.

For example, for the following:

define i64 @dext_and32(i64 zeroext %a) {
entry:

 %and = and i64 %a, 4294967295
 ret i64 %and
}

instead of generating:

 0000000000000088 <dext_and32>:

 88:   64010001        daddiu  at,zero,1
 8c:   0001083c        dsll32  at,at,0x0
 90:   6421ffff        daddiu  at,at,-1
 94:   03e00008        jr      ra
 98:   00811024        and     v0,a0,at
 9c:   00000000        nop

the following gets generated:

 0000000000000068 <dext_and32>:

 68:   03e00008        jr      ra
 6c:   7c82f803        dext    v0,a0,0x0,0x20

Cases that are covered:

DEXT:

 1. and $src, mask where mask > 0xffff
 2. zext $src zero extend from i32 to i64

CINS:

 1. and (shl $src, pos), mask
 2. shl (and $src, mask), pos
 3. zext (shl $src, pos) zero extend from i32 to i64

Patch by Violeta Vukobrat.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297832 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAlign cost model columns. NFCI.
Simon Pilgrim [Wed, 15 Mar 2017 11:57:42 +0000 (11:57 +0000)]
Align cost model columns. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297824 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix malformed XFAIL in previous commit
Zvi Rackover [Wed, 15 Mar 2017 11:44:14 +0000 (11:44 +0000)]
Fix malformed XFAIL in previous commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297823 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DAGCombine] Add reproducer for pr32278
Zvi Rackover [Wed, 15 Mar 2017 11:34:51 +0000 (11:34 +0000)]
[DAGCombine] Add reproducer for pr32278

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297822 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Fix for branch label disassembly for Thumb
Sam Parker [Wed, 15 Mar 2017 10:21:23 +0000 (10:21 +0000)]
[ARM] Fix for branch label disassembly for Thumb

Different MCInstrAnalysis classes for arm and thumb mode, each with
their own evaluateBranch implementation. I added a test case and
fixed the coff-relocations test to use '<label>:' rather than
'<label>' in the CHECK-LABEL entries, since the ones without the
colon would match branch targets. Might be worth noticing that
llvm-objdump does not lookup the relocation and thus assigns it a
target depending on the encoded immediate which #0, so it thinks it
branches to the next instruction.

Committed on behalf of Andre Vieira (avieira).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297821 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Thumb1] Fix the bug when adding/subtracting -2147483648
Artyom Skrobov [Wed, 15 Mar 2017 10:19:16 +0000 (10:19 +0000)]
[Thumb1] Fix the bug when adding/subtracting -2147483648

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297820 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agofix gcc -Wmisleading-indentation [NFC]
Nuno Lopes [Wed, 15 Mar 2017 09:33:33 +0000 (09:33 +0000)]
fix gcc -Wmisleading-indentation [NFC]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297816 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support][CommandLine] Make it possible to get error messages from ParseCommandLineOp...
Eric Liu [Wed, 15 Mar 2017 08:41:00 +0000 (08:41 +0000)]
[Support][CommandLine] Make it possible to get error messages from ParseCommandLineOptions when ignoring errors.

Summary:
Previously, ParseCommandLineOptions returns false and ignores error messages
when IgnoreErrors. It would be useful to also return error messages if users
decide to check parsing result instead of having the program exit on error.

Reviewers: chandlerc, mehdi_amini, rnk

Reviewed By: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297810 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Enable SMLAL[B|T] isel
Sam Parker [Wed, 15 Mar 2017 08:27:11 +0000 (08:27 +0000)]
[ARM] Enable SMLAL[B|T] isel

Enable the selection of the 64-bit signed multiply accumulate
instructions which operate on 16-bit operands. These are enabled for
ARMv5TE onwards for ARM and for V6T2 and other DSP enabled Thumb
architectures.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297809 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC: Reformats comments according to the coding guildelines.
Taewook Oh [Wed, 15 Mar 2017 06:29:23 +0000 (06:29 +0000)]
NFC: Reformats comments according to the coding guildelines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297808 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-config] Add minimal sanity tests for path options
Michal Gorny [Wed, 15 Mar 2017 05:57:29 +0000 (05:57 +0000)]
[llvm-config] Add minimal sanity tests for path options

Add minimal tests that check whether path options do not fail and output
directories looking like expected. Requested in
https://reviews.llvm.org/rL291218.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297807 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[BranchFolding] Merge debug locations from common tail instead of removing
Taewook Oh [Wed, 15 Mar 2017 05:44:59 +0000 (05:44 +0000)]
[BranchFolding] Merge debug locations from common tail instead of removing

Summary: D25742 improved the precision of debug locations for PGO by removing debug locations from common tail when tail-merging. However, if identical insturctions that are merged into a common tail have the same debug locations, there's no need to remove them. This patch creates a merged debug location of identical instructions across SameTails and assign it to the instruction in the common tail, so that the debug locations are maintained if they are same across identical instructions.

Reviewers: aprantl, probinson, MatzeB, rob.lougher

Reviewed By: aprantl

Subscribers: andreadb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297805 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoEnsure that prefix data is preserved with subsections-via-symbols
Peter Collingbourne [Wed, 15 Mar 2017 04:18:16 +0000 (04:18 +0000)]
Ensure that prefix data is preserved with subsections-via-symbols

On MachO platforms that use subsections-via-symbols dead code stripping will
drop prefix data. Unfortunately there is no great way to convey the relationship
between a function and its prefix data to the linker. We are forced to use a bit
of a hack: we give the prefix data it’s own symbol, and mark the actual function
entry an .alt_entry.

Patch by Moritz Angermann!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297804 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] remove even more stale code
Kostya Serebryany [Wed, 15 Mar 2017 00:39:06 +0000 (00:39 +0000)]
[libFuzzer] remove even more stale code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297797 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] simplify code a bit
Kostya Serebryany [Wed, 15 Mar 2017 00:34:25 +0000 (00:34 +0000)]
[libFuzzer] simplify code a bit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297796 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineFunction] Fix documentation. NFC
Francis Visoiu Mistrih [Tue, 14 Mar 2017 23:58:57 +0000 (23:58 +0000)]
[MachineFunction] Fix documentation. NFC

MachineFunction::getBlockNumber -> MachineFunction::getNumber.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297795 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel] IRTranslator: Return the scalar for <1 x Ty> constant vectors
Volkan Keles [Tue, 14 Mar 2017 23:45:06 +0000 (23:45 +0000)]
[GlobalISel] IRTranslator: Return the scalar for <1 x Ty> constant vectors

Summary:
<1 x Ty> is not a legal vector type in LLT, we shouldn’t build G_MERGE_VALUES
instruction for them.

Reviewers: qcolombet, aditya_nandakumar, dsanders, t.p.northover, ab, javed.absar

Reviewed By: qcolombet

Subscribers: dberris, rovka, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297792 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMemCpyOptimizer: don't create new addrspace casts
Fiona Glaser [Tue, 14 Mar 2017 22:37:38 +0000 (22:37 +0000)]
MemCpyOptimizer: don't create new addrspace casts

This isn't safe on all targets, and since we don't have a way
to know it's safe, avoid doing it for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297788 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[globalisel] LLVM_BUILD_GLOBAL_ISEL=OFF should prevent GlobalISel instruction selecto...
Daniel Sanders [Tue, 14 Mar 2017 22:09:29 +0000 (22:09 +0000)]
[globalisel] LLVM_BUILD_GLOBAL_ISEL=OFF should prevent GlobalISel instruction selector from being declared.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297786 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] remove more stale code
Kostya Serebryany [Tue, 14 Mar 2017 21:47:52 +0000 (21:47 +0000)]
[libFuzzer] remove more stale code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297785 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] don't clear Counters in TracePC::CollectFeatures since they will be clear...
Kostya Serebryany [Tue, 14 Mar 2017 21:40:53 +0000 (21:40 +0000)]
[libFuzzer] don't clear Counters in TracePC::CollectFeatures since they will be cleared anyway in ResetMaps

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297783 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[globalisel][tblgen] Add support for ComplexPatterns
Daniel Sanders [Tue, 14 Mar 2017 21:32:08 +0000 (21:32 +0000)]
[globalisel][tblgen] Add support for ComplexPatterns

Summary:
Adds a new kind of MachineOperand: MO_Placeholder.
This operand must not appear in the MIR and only exists as a way of
creating an 'uninitialized' operand until a matcher function overwrites it.

Depends on D30046, D29712

Reviewers: t.p.northover, ab, rovka, aditya_nandakumar, javed.absar, qcolombet

Reviewed By: qcolombet

Subscribers: dberris, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297782 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] remove stale code
Kostya Serebryany [Tue, 14 Mar 2017 21:30:14 +0000 (21:30 +0000)]
[libFuzzer] remove stale code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297781 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SelectionDAG] Add a signed integer absolute ISD node
Simon Pilgrim [Tue, 14 Mar 2017 21:26:58 +0000 (21:26 +0000)]
[SelectionDAG] Add a signed integer absolute ISD node

Reduced version of D26357 - based on the discussion on llvm-dev about canonicalization of UMIN/UMAX/SMIN/SMAX as well as ABS I've reduced that patch to just the ABS ISD node (with x86/sse support) to improve basic combines and lowering.

ARM/AArch64, Hexagon, PowerPC and NVPTX all have similar instructions allowing us to make this a generic opcode and move away from the hard coded tablegen patterns which makes it tricky to match more complex patterns.

At the moment this patch doesn't attempt legalization as we only create an ABS node if its legal/custom.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297780 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Use LEB encoding for value types
Derek Schuff [Tue, 14 Mar 2017 20:23:22 +0000 (20:23 +0000)]
[WebAssembly] Use LEB encoding for value types

Previously we were using the encoded LEB hex values
for the value types.  This change uses the decoded
negative value and the LEB encoder to write them out.

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

Patch by Sam Clegg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297777 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoArchives require a symbol table on Solaris, even if empty.
Rafael Espindola [Tue, 14 Mar 2017 19:57:13 +0000 (19:57 +0000)]
Archives require a symbol table on Solaris, even if empty.

On Solaris ld (and some other tools that use the underlying utility
libraries, such as elfdump) chokes on an archive library that has no
symbol table. The Solaris tools always create one, even if it's empty.

That bug has been fixed in the latest development line, and can
probably be backported to a supported release, but it would be nice if
LLVM's archiver could emit the empty symbol table, too.

Patch by Danek Duvall!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297773 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix asm printing of associated sections.
Evgeniy Stepanov [Tue, 14 Mar 2017 19:28:51 +0000 (19:28 +0000)]
Fix asm printing of associated sections.

Make MCSectionELF::AssociatedSection be a link to a symbol, because
that's how it works in the assembly, and use it in the asm printer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297769 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Replace some C++ selection code with TableGen patterns. NFC.
Eli Friedman [Tue, 14 Mar 2017 18:43:37 +0000 (18:43 +0000)]
[ARM] Replace some C++ selection code with TableGen patterns. NFC.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297768 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support] Make the SystemZ bot happy by using make_error_code.
Juergen Ributzka [Tue, 14 Mar 2017 18:37:44 +0000 (18:37 +0000)]
[Support] Make the SystemZ bot happy by using make_error_code.

This should fix the last issue on the SystemZ bot related to the broken symlink
test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297767 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DAG] vector div/rem with any zero element in divisor is undef
Sanjay Patel [Tue, 14 Mar 2017 18:06:28 +0000 (18:06 +0000)]
[DAG] vector div/rem with any zero element in divisor is undef

This is the backend counterpart to:
https://reviews.llvm.org/rL297390
https://reviews.llvm.org/rL297409
and follow-up to:
https://reviews.llvm.org/rL297384

It surprised me that we need to duplicate the check in FoldConstantArithmetic and FoldConstantVectorArithmetic,
but one or the other doesn't catch all of the test cases. There is an existing code comment about merging those
someday.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297762 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSamplePGO ThinLTO ICP fix for local functions.
Dehao Chen [Tue, 14 Mar 2017 17:33:01 +0000 (17:33 +0000)]
SamplePGO ThinLTO ICP fix for local functions.

Summary:
In SamplePGO, if the profile is collected from non-LTO binary, and used to drive ThinLTO, the indirect call promotion may fail because ThinLTO adjusts local function names to avoid conflicts. There are two places of where the mismatch can happen:

1. thin-link prepends SourceFileName to front of FuncName to build the GUID (GlobalValue::getGlobalIdentifier). Unlike instrumentation FDO, SamplePGO does not use the PGOFuncName scheme and therefore the indirect call target profile data contains a hash of the OriginalName.
2. backend compiler promotes some local functions to global and appends .llvm.{$ModuleHash} to the end of the FuncName to derive PromotedFunctionName

This patch tries at the best effort to find the GUID from the original local function name (in profile), and use that in ICP promotion, and in SamplePGO matching that happens in the backend after importing/inlining:

1. in thin-link, it builds the map from OriginalName to GUID so that when thin-link reads in indirect call target profile (represented by OriginalName), it knows which GUID to import.
2. in backend compiler, if sample profile reader cannot find a profile match for PromotedFunctionName, it will try to find if there is a match for OriginalFunctionName.
3. in backend compiler, we build symbol table entry for OriginalFunctionName and pointer to the same symbol of PromotedFunctionName, so that ICP can find the correct target to promote.

Reviewers: mehdi_amini, tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits, Prazek

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297757 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] improve readability; NFCI
Sanjay Patel [Tue, 14 Mar 2017 17:27:27 +0000 (17:27 +0000)]
[InstCombine] improve readability; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297755 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] consolidate rem tests and update checks; NFC
Sanjay Patel [Tue, 14 Mar 2017 16:27:46 +0000 (16:27 +0000)]
[InstCombine] consolidate rem tests and update checks; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297747 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] regenerate checks; NFC
Sanjay Patel [Tue, 14 Mar 2017 16:16:40 +0000 (16:16 +0000)]
[InstCombine] regenerate checks; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297746 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Fix a condition in HexagonEarlyIfConv.cpp
Krzysztof Parzyszek [Tue, 14 Mar 2017 15:21:33 +0000 (15:21 +0000)]
[Hexagon] Fix a condition in HexagonEarlyIfConv.cpp

This fixes llvm.org/PR32265.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297745 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix typo in comment
Artyom Skrobov [Tue, 14 Mar 2017 14:13:19 +0000 (14:13 +0000)]
Fix typo in comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297742 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Add extra BITREVERSE tests
Simon Pilgrim [Tue, 14 Mar 2017 14:03:16 +0000 (14:03 +0000)]
[X86] Add extra BITREVERSE tests

Test on 32-bit and 64-bit targets.

Add bitreverse tests for i64, i32 and i16

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297741 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LV] Refactor cross-iteration phi's back-patching; NFC
Gil Rapaport [Tue, 14 Mar 2017 13:50:47 +0000 (13:50 +0000)]
[LV] Refactor cross-iteration phi's back-patching; NFC

This patch refactors the PHisToFix loop as follows:

- The loop itself now resides in its own method.
- The new method iterates on scalar-loop's header; the PHIsToFix map formerly
  propagated as an output parameter and filled during phi widening is removed.
- The code handling reductions is moved into its own method, similar to the
  existing fixFirstOrderRecurrence().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297740 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Diagnose ARM MOVT without :lower16: or :upper16: expression
Oliver Stannard [Tue, 14 Mar 2017 13:50:10 +0000 (13:50 +0000)]
[ARM] Diagnose ARM MOVT without :lower16: or :upper16: expression

This instruction was missing from the list of opcodes that we check, so we were
hitting an llvm_unreachable in ARMMCCodeEmitter.cpp for the ARM MOVT
instruction, rather than the diagnostic that is emitted for the other MOVW/MOVT
instructions.

Differential revision: https://reviews.llvm.org/D30936

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297739 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDe-duplicate the two implementations of ARMBaseInstrInfo::isProfitableToIfCvt() ...
Artyom Skrobov [Tue, 14 Mar 2017 13:38:45 +0000 (13:38 +0000)]
De-duplicate the two implementations of ARMBaseInstrInfo::isProfitableToIfCvt() [NFC]

Reviewers: congh, rengolin

Subscribers: aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297738 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LV] Refactor Cost Model's selectVectorizationFactor(); NFC
Ayal Zaks [Tue, 14 Mar 2017 13:07:04 +0000 (13:07 +0000)]
[LV] Refactor Cost Model's selectVectorizationFactor(); NFC

Refactoring Cost Model's selectVectorizationFactor() so that it handles only the
selection of the best VF from a pre-computed range of candidate VF's, extracting
early-exit criteria and the computation of a MaxVF upper-bound to other methods,
all driven by a newly introduced LoopVectorizationPlanner.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297737 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][MMX] Update FIXME comment. NFCI.
Simon Pilgrim [Tue, 14 Mar 2017 12:13:41 +0000 (12:13 +0000)]
[X86][MMX] Update FIXME comment. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297736 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake PredIteratorCache size() logically const. Do not require copying predecessors...
Daniel Berlin [Tue, 14 Mar 2017 11:25:45 +0000 (11:25 +0000)]
Make PredIteratorCache size() logically const. Do not require copying predecessors to get size.

Summary:
Every single benchmark i can run, on large and small cfgs, fully
connected, etc, across 3 different platforms (x86, arm., and PPC) says
that the current pred iterator cache is a losing proposition.

I can't find a case where it's faster than just walking preds, and in some cases, it's 5-10% slower.

This is due to copying the preds.
It also degrades into copying the entire cfg.

The one operation that is occasionally faster is the cached size.
This makes that operation faster by not relying on having the copies available.

I'm not even sure that is faster enough to be worth it. I, again, have
trouble finding cases where this takes long enough in a pass to be
worth caching compared to a million other things they could cache or
improve.

My suggestion:
We next remove the get() interface.
We do stronger benchmarking of size().
We probably end up killing this entire cache.
/

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits, trentxintong

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297733 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTest commit.
James Henderson [Tue, 14 Mar 2017 10:51:14 +0000 (10:51 +0000)]
Test commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297731 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Fix -Wreorder warning.
Benjamin Kramer [Tue, 14 Mar 2017 10:29:47 +0000 (10:29 +0000)]
[CodeGen] Fix -Wreorder warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297729 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix typos in ADCE comments
Tobias Grosser [Tue, 14 Mar 2017 10:18:11 +0000 (10:18 +0000)]
Fix typos in ADCE comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297726 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ValueTracking] Out of range shifts might be undef
Oliver Stannard [Tue, 14 Mar 2017 10:13:17 +0000 (10:13 +0000)]
[ValueTracking] Out of range shifts might be undef

If it is possible for the RHS of a shift operation to be greater than or equal
to the bit-width, then the result might be undef, and we can't report any known
bits.

In some cases, this was allowing a transformation in instcombine which widened
an undef value from i1 to i32, increasing the range of values that a function
could return.

Differential revision: https://reviews.llvm.org/D30781

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297724 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Move SMULW[B|T] isel to DAG Combine
Sam Parker [Tue, 14 Mar 2017 09:13:22 +0000 (09:13 +0000)]
[ARM] Move SMULW[B|T] isel to DAG Combine

Create nodes for smulwb and smulwt and move their selection from
DAGToDAG to DAG combine. smlawb and smlawt can then be selected
using tablegen. Added some helper functions to detect shift patterns
as well as a wrapper around SimplifyDemandBits. Added a couple of
extra tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297716 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDisable Callee Saved Registers
Oren Ben Simhon [Tue, 14 Mar 2017 09:09:26 +0000 (09:09 +0000)]
Disable Callee Saved Registers

Each Calling convention (CC) defines a static list of registers that should be preserved by a callee function. All other registers should be saved by the caller.
Some CCs use additional condition: If the register is used for passing/returning arguments – the caller needs to save it - even if it is part of the Callee Saved Registers (CSR) list.
The current LLVM implementation doesn’t support it. It will save a register if it is part of the static CSR list and will not care if the register is passed/returned by the callee.
The solution is to dynamically allocate the CSR lists (Only for these CCs). The lists will be updated with actual registers that should be saved by the callee.
Since we need the allocated lists to live as long as the function exists, the list should reside inside the Machine Register Info (MRI) which is a property of the Machine Function and managed by it (and has the same life span).
The lists should be saved in the MRI and populated upon LowerCall and LowerFormalArguments.
The patch will also assist to implement future no_caller_saved_regsiters attribute intended for interrupt handler CC.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297715 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX-512] Use iPTR instead of i64 in patterns for extract_subvector/insert_subvector...
Craig Topper [Tue, 14 Mar 2017 06:40:04 +0000 (06:40 +0000)]
[AVX-512] Use iPTR instead of i64 in patterns for extract_subvector/insert_subvector index.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297707 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX-512] Add test cases that demonstrate some patterns that don't work correctly...
Craig Topper [Tue, 14 Mar 2017 06:40:00 +0000 (06:40 +0000)]
[AVX-512] Add test cases that demonstrate some patterns that don't work correctly in 32-bit mode. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297706 91177308-0d34-0410-b5e6-96231b3b80d8