Commit Graph

141357 Commits

Author SHA1 Message Date
Sanjay Patel
fe998e6ec2 [InstCombine] change bitwise logic type to eliminate bitcasts
In PR27925:
https://llvm.org/bugs/show_bug.cgi?id=27925

...we proposed adding this fold to eliminate a bitcast. In D20774, there was 
some concern about changing the type of a bitwise op as well as creating 
bitcasts that might not be free for a target. However, if we're strictly 
eliminating an instruction (by limiting this to one-use ops), then we should 
be able to do this in InstCombine.

But we're cautiously restricting the transform for now to vector types to
avoid possible backend problems. A transform to make sure the logic op is
legal for the target should be added to reverse this transform and improve
codegen.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:05:48 +00:00
Simon Pilgrim
2d1bdd9d61 [X86][AVX512DQ] Add fp <-> int tests for AVX512DQ/AVX512DQ+VL
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:04:50 +00:00
Chandler Carruth
ecfbd3fb80 [LCG] Add a previously missing assert about the relationship of RefSCCs.
No intended change, everything seems to be in working order already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 21:40:10 +00:00
Peter Collingbourne
15e8caa4f4 LTO: Remove a now-unused InputFile accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 21:25:30 +00:00
Vyacheslav Klochkov
f907632b35 Fixed the lost FastMathFlags in GVN(Global Value Numbering).
Reviewer: Hal Finkel.
Differential Revision: https://reviews.llvm.org/D26952



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:52:53 +00:00
Chandler Carruth
62cfc59ef6 [LCG] Start using SCC relationship predicates in the unittest.
This mostly gives us nice unittesting of the predicates themselves. I'll
start using them further in subsequent commits to help test the actual
operations performed on the graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:35:32 +00:00
Rui Ueyama
66b8dab1a9 Remove PDBFileBuilder::build() and related functions.
PDBFileBuilder supports two different ways to create files.
One is PDBFileBuilder::commit. That function takes a filename
and write a result to the file. The other is PDBFileBuilder::build.
That returns a new PDBFile object.

This patch removes the latter because no one is using it and
in a real life situation we are very unlikely to need it.
Even if you need it, it'd be easy to write a new PDB to a memory
buffer and read it back.

Removing PDBFileBuilder::build enables us to remove other classes
build transitively.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:32:22 +00:00
Vyacheslav Klochkov
f060e3f4bc Fixed the lost FastMathFlags in Reassociate optimization.
Reviewer: Hal Finkel.
Differential Revision: https://reviews.llvm.org/D26957



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287695 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 20:23:04 +00:00
Paul Robinson
abb5e38a8f Restructure DwarfDebug::beginInstruction(). [NFC]
Will help a pending patch.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:46:51 +00:00
Shoaib Meenai
d0843bfa3b [Triple] Add Facebook vendor
Add a compiler vendor for Facebook, to enable future vendor-specific
behavior.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:36:26 +00:00
Chandler Carruth
2fb7ff7c1d [LCG] Add utilities to compute parent and ascestor relationships between
SCCs.

These will be fairly expensive routines to call and might be abused in
real code, but are quite useful when debugging or in asserts and are
reasonable and well formed properties to query.

I've used one of them in an assert that was requested in a code review
here. In subsequent commits I'll start using these routines more
heavily, for example in unittests etc. But this at least gets the
groundwork in place.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:23:31 +00:00
Simon Dardis
b095048959 [mips] seb, seh instruction aliases
Add the single operand form.

Reviewers: vkalintiris

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:17:23 +00:00
Andrew Kaylor
a5156e5797 Add IntrInaccessibleMemOnly property for intrinsics
Differential Revision: https://reviews.llvm.org/D26485



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287680 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:16:04 +00:00
Nemanja Ivanovic
aa687a6ca9 [PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LE
This patch corresponds to review:
https://reviews.llvm.org/D26861

It also fixes PR30730.

Committing on behalf of Lei Huang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287679 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 19:02:07 +00:00
Simon Pilgrim
d93dfb18c0 [CostModel][X86] Updated sitofp/uitofp scalar/vector cost tests
Better coverage of all legal types + special cases.

Removed old fptoui tests which are all handled in fptoui.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287678 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 18:55:49 +00:00
Simon Pilgrim
fcc1f76b4d [X86][SSE] Combine UNPCKL(FHADD,FHADD) -> FHADD for v2f64 shuffles.
This occurs during UINT_TO_FP v2f64 lowering. 

We can easily generalize this to other horizontal ops (FHSUB, PACKSS, PACKUS) as required - we are doing something similar with PACKUS in lowerV2I64VectorShuffle

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 17:50:06 +00:00
Vasileios Kalintiris
8cb89db9b1 [mips] Add support for unaligned load/store macros.
Add missing unaligned store macros (ush/usw) and fix the exisiting
implementation of the unaligned load macros in order to generate
identical expansions with the GNU assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 16:43:49 +00:00
Tim Northover
bc347f2914 CodeGen: simplify TargetMachine::getSymbol interface. NFC.
No-one actually had a mangler handy when calling this function, and
getSymbol itself went most of the way towards getting its own mangler
(with a local TLOF variable) so forcing all callers to supply one was
just extra complication.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 16:17:20 +00:00
Zvi Rackover
15f8e68c38 [X86] Change lowerBuildVectorToBitOp() to take a BuildVectorSDNode. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 15:33:28 +00:00
Zvi Rackover
b7c9c25adc [X86] Remove dead code from LowerVectorBroadcast
Summary: Splat vectors are canonicalized to BUILD_VECTOR's so the code can be simplified. NFC-ish.

Reviewers: craig.topper, delena, RKSimon, andreadb

Subscribers: RKSimon, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287643 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 15:17:52 +00:00
Chad Rosier
af9ba45893 [AArch64] Set the max interleave factor for Falkor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287642 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 14:25:02 +00:00
Chad Rosier
691084e03c [AArch64] Maximize 80-column. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287640 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 14:12:09 +00:00
Simon Pilgrim
60c1ebdc81 Fix line endings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 13:27:29 +00:00
Benjamin Kramer
ef60bb05ab [wasm] hack around test failure after r287553.
This test is very brittle as small changes to block layout break the
check patterns. Hack around a change one more time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 13:13:33 +00:00
Simon Pilgrim
3d4bb54474 [SelectionDAG] ComputeNumSignBits of TRUNCATE operations
Add basic ComputeNumSignBits support for TRUNCATE ops for cases where the source's number of sign bits overlaps with the truncated size.

Improves X86 SIGN_EXTEND_IN_REG vector cases which were needlessly sign extending boolean vector results.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287635 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 11:29:19 +00:00
Coby Tayree
b6c1f00e0f [AVX512][inline-asm] Fix AVX512 inline assembly instruction resolution when the size qualifier of a memory operand is not specified explicitly.
This commit handles cases where the size qualifier of an indirect memory reference operand in Intel syntax is missing (e.g. "vaddps xmm1, xmm2, [a]").

GCC will deduce the size qualifier for AVX512 vector and broadcast memory operands based on the possible matches:
"vaddps xmm1, xmm2, [a]" matches only “XMMWORD PTR” qualifier.
"vaddps xmm1, xmm2, [a]{1to4}" matches only “DWORD PTR” qualifier.

This is different from the current behavior of LLVM, which deduces the size qualifier based on the size of the memory operand.
For "vaddps xmm1, xmm2, [a]"
"char a;" will imply "BYTE PTR" qualifier
"short a;" will imply "WORD PTR" qualifier.

This commit aligns LLVM to GCC’s behavior.

This is the LLVM part of the review.
The Clang part of the review: https://reviews.llvm.org/D26587

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 09:30:29 +00:00
Adam Nemet
4208630cb7 Rename option to -lto-pass-remarks-output
The new option -pass-remarks-output broke LLVM_LINK_LLVM_DYLIB because
of the duplicate option name with opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 07:35:14 +00:00
Craig Topper
619a7d461f [TableGen][ISel] When factoring ScopeMatcher, if the child of the ScopeMatcher we're working on is also a ScopeMatcher, merge all its children into the one we're working on.
There were several cases in X86 where we were unable to fully factor a ScopeMatcher but created nested ScopeMatchers for some portions of it. Then we created a SwitchType that split it up and further factored it so that we ended up with something like this:

SwitchType
  Scope
    Scope
      Sequence of matchers
      Some other sequence of matchers
    EndScope
    Another sequence of matchers
  EndScope
...Next type

This change turns it into this:

SwitchType
  Scope
    Sequence of matchers
    Some other sequence of matchers
    Another sequence of matchers
  EndScope
...Next type

Several other in-tree targets had similar nested scopes like this. Overall this doesn't save many bytes, but makes the isel output a little more regular.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 07:00:06 +00:00
Craig Topper
74964ec3da [X86] Remove alternate CodeGenOnly version of (v)movq that declared the load size as i128mem. Change all uses to the use the i64mem version.
I'm sure this caused the load size to misprint in Intel syntax output. We were also inconsistent about which patterns used which instruction between VEX and EVEX.

There are two different reg/reg versions of movq, one from a GPR and one from the lower 64-bits of an XMM register. This changes the loading folding table to use the single i64mem memory form for folding both cases. But we need to use TB_NO_REVERSE to prevent a duplicate entry in the unfolding table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287622 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 05:31:43 +00:00
Craig Topper
aa9982b218 [AVX-512] Add support for commuting VPERMT2(B/W/D/Q/PS/PD) to/from VPERMI2(B/W/D/Q/PS/PD).
Summary:
The index and one of the table operands can be swapped by changing the opcode to the other version. Neither of these operands are the one that can load from memory so this can't be used to increase memory folding opportunities.

We need to handle the unmasked forms and the kz forms. Since the load operand isn't being commuted we can commute the load and broadcast instructions too.

Reviewers: igorb, delena, Ayal, Farhana, RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 04:57:34 +00:00
Saleem Abdulrasool
8edd5b452f MC: ensure that we have a section before accessing it
We would attempt to access the symbol section without ensuring that the symbol
was not absolute.  When the assembler referenced relocation is not evaluated to
the absolute, but when we record the relocation, we would query the section.
Because the symbol is absolute, it does not have a section associated with it,
triggering an assertion.  Just be more careful about the access of the section.

Addresses PR31064!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 04:32:54 +00:00
Craig Topper
000f65d1b1 [AVX-512] Add support for changing the element size of PALIGNR/VALIGND/VALIGNQ shuffles if they feed a vselect with a different type
Summary:
Shuffle lowering widens the element size of a shuffle if elements are contiguous. This is sometimes help because wider element types have more shuffle options. If the shuffle is one of the arguments to a vselect this shuffle widening can introduce a bitcast between the vselect and the shuffle. This will prevent isel from selecting a masked operation. If the shuffle can be written equally efficiently with a different element size to match the vselect type we should change the shuffle type to allow masking.

This patch does this conversion for all VALIGND/VALIGNQ sizes. It also supports turning 128-bit PALIGNR into VALIGND/VALIGNQ. This fixes the case shown in PR31018.

I plan to add support for more operations in future patches.

Reviewers: RKSimon, zvi, delena

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 03:51:53 +00:00
Peter Collingbourne
b9b390899e Object: Make SymbolicFile::symbol_{begin,end}() virtual and remove unnecessary wrappers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287611 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 03:38:40 +00:00
Chandler Carruth
76884e5803 [ADT] Add initializer list support to SmallPtrSet so that sets can be
easily initialized with some initial values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 03:27:43 +00:00
Stanislav Mekhanoshin
64620b1c31 [AMDGPU] Fix multiple vreg definitions in si-lower-control-flow
Differential Revision: https://reviews.llvm.org/D26939

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 01:42:34 +00:00
Peter Collingbourne
d703e44ea8 Analysis: gep inbounds (gep inbounds (...)) is inbounds.
Differential Revision: https://reviews.llvm.org/D26441

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 01:03:40 +00:00
Zachary Turner
7625374502 Remove LLVM_NODISCARD in one more place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287596 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 23:17:15 +00:00
Zachary Turner
cf423ecebd Remove LLVM_NODISCARD from two more StringRef members.
This should be everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287594 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 23:02:28 +00:00
Matt Arsenault
8b1782955d DAG: Ignore call site attributes when emitting target intrinsic
A target intrinsic may be defined as possibly reading memory,
but the call site may have additional knowledge that it doesn't read
memory. The intrinsic lowering will expect the pessimistic
assumption of the intrinsic definition, so the chain should
still be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:56:42 +00:00
Geoff Berry
e6b0810799 [AArch64LoadStoreOptimizer] Don't treat write to XZR/WZR as a clobber.
Summary:
When searching for load/store instructions to pair/merge don't treat
writes to WZR/XZR as clobbers since they don't change the value read
from WZR/XZR (which is always 0).

Reviewers: mcrosier, junbuml, jmolloy, t.p.northover

Subscribers: aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:51:10 +00:00
Justin Lebar
09220c80d3 [CodeGenPrepare] Don't sink non-cheap addrspacecasts.
Summary:
Previously, CGP would unconditionally sink addrspacecast instructions,
even going so far as to sink them into a loop.

Now we check that the cast is "cheap", as defined by TLI.

We introduce a new "is-cheap" function to TLI rather than using
isNopAddrSpaceCast because some GPU platforms want the ability to ask
for non-nop casts to be sunk.

Reviewers: arsenm, tra

Subscribers: jholewinski, wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:49:15 +00:00
Justin Lebar
5db0e4c349 [CodeGenPrepare] Rewrite a loop in terms of llvm::none_of. NFC.
Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287590 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:49:11 +00:00
Zachary Turner
6390da6b04 Remove LLVM_NODISCARD from getAsInteger().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:47:23 +00:00
Eli Friedman
1e10f377b2 [LoopReroll] Make root-finding more aggressive.
Allow using an instruction other than a mul or phi as the base for
root-finding. For example, the included testcase includes a loop
which requires using a getelementptr as the base for root-finding.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:35:34 +00:00
Zachary Turner
9a480090d6 Fix attribute list syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:29:38 +00:00
Zachary Turner
ec8604ff8c Remove LLVM_NODISCARD from StringRef.
This is a bit too aggressive of a warning, as it is forces
ANY function which returns a StringRef to have its return
value checked.  While useful on classes like llvm::Error which
are designed to require checking, this is not the case for
StringRef, and it is perfectly reasonable to have a function
return a StringRef for which the return value is not checked.

Move LLVM_NODISCARD to each of the individual member functions
where it makes sense instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287586 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:19:25 +00:00
Sanjay Patel
fea0530bd5 [InstCombine] canonicalize min/max constant to select's false value
This is a first step towards canonicalization and improved folding/codegen
for integer min/max as discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/106868.html

Here, we're just matching the simplest min/max patterns and adjusting the
icmp predicate while swapping the select operands.

I've included FIXME tests in test/Transforms/InstCombine/select_meta.ll
so it's easier to see how this might be extended (corresponds to the TODO
comment in the code). That's also why I'm using matchSelectPattern()
rather than a simpler check; once the backend is patched, we can just 
remove some of the restrictions to allow the obfuscated min/max patterns
in the FIXME tests to be matched.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287585 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:04:14 +00:00
Evgeny Stupachenko
150a3cafdd LSR debug fix.
Summary:
Dump instruction instead of address.
Reviewers: hfinkel

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287584 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 21:55:03 +00:00
Hubert Tong
7281aa24a7 reassociate-deadinst.ll: avoid accidental match on path
Pipe from stdin to avoid accidentally matching on the path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287583 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 21:53:01 +00:00
Sanjay Patel
52b86bf6c0 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 21:48:36 +00:00