141346 Commits

Author SHA1 Message Date
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
Reid Kleckner
131962dc53 [asan] Make ASan compatible with linker dead stripping on Windows
Summary:
This is similar to what was done for Darwin in rL264645 /
http://reviews.llvm.org/D16737, but it uses COFF COMDATs to achive the
same result instead of relying on new custom linker features.

As on MachO, this creates one metadata global per instrumented global.
The metadata global is placed in the custom .ASAN$GL section, which the
ASan runtime will iterate over during initialization. There are no other
references to the metadata, so normal linker dead stripping would
discard it. However, the metadata is put in a COMDAT group with the
instrumented global, so that it will be discarded if and only if the
instrumented global is discarded.

I didn't update the ASan ABI version check since this doesn't affect
non-Windows platforms, and the WinASan ABI isn't really stable yet.

Implementing this for ELF will require extending LLVM IR and MC a bit so
that we can use non-COMDAT section groups.

Reviewers: pcc, kcc, mehdi_amini, kubabrecka

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287576 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 20:40:37 +00:00
Mandeep Singh Grang
21e956f318 [MemorySSA] Fix unit tests broken by D26704
Summary:
D26704 fixed the non-determinism in codegen by sorting basic blocks before
iteration so as to have a defined iteration order. As a result we need to fix
the names (numbers) of the temporaries in the following unit tests:
  test/Transforms/Util/MemorySSA/multi-edges.ll
  test/Transforms/Util/MemorySSA/multiple-backedges-hal.ll

Reviewers: dberlin, david2050, mgrang

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 20:39:08 +00:00
Simon Dardis
981f5857a8 [mips] Add tests for half precision floating point support.
These should have been part of r287349.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287574 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 20:34:10 +00:00
Simon Dardis
426286dbce [mips] seq macro support
This patch adds the seq macro.

This partially resolves PR/30381.

Thanks to Sean Bruno for reporting the issue!

Reviewers: zoran.jovanovic, vkalintiris, seanbruno

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287573 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 20:30:41 +00:00
Krzysztof Parzyszek
f5fef36d3a Check proper live range in extendPHIRanges
The function extendPHIRanges checks the main range of the original live
interval, even when dealing with a subrange. This could also lead to an
assert when the subrange is not live at the extension point, but the
main range is. To avoid this, check the corresponding subrange of the
original live range, instead of always checking the main range.

Review (as a part of a bigger set of changes):
https://reviews.llvm.org/D26359


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 20:24:12 +00:00
Marcin Koscielnicki
b76c6d3856 [TLI] Fix breakage introduced by D21739.
The initialize function has an early return for AMDGPU targets.  If taken,
the ShouldExtI32* initialization code will not be executed, resulting in
invalid values in the corresponding fields.  Fix this by moving the code
to the top of the function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287570 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 20:20:39 +00:00
Shoaib Meenai
e5154e99c3 [AsmPrinter] Enable codeview for windows-itanium
Enable codeview emission for windows-itanium targets. Co-opt an existing
test (which is derived from a C source file and should therefore be
identical across the Itanium and MS ABIs).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287567 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 20:13:32 +00:00
Mandeep Singh Grang
d8c5ecbd82 [MemorySSA] Fix for non-determinism in codegen
This patch fixes the non-determinism caused due to iterating SmallPtrSet's
which was uncovered due to the experimental "reverse iteration order " patch:
https://reviews.llvm.org/D26718

The following unit tests failed because of the undefined order of iteration.
LLVM :: Transforms/Util/MemorySSA/cyclicphi.ll
LLVM :: Transforms/Util/MemorySSA/many-dom-backedge.ll
LLVM :: Transforms/Util/MemorySSA/many-doms.ll
LLVM :: Transforms/Util/MemorySSA/phi-translation.ll

Reviewers: dberlin, mgrang

Subscribers: dberlin, llvm-commits, david2050

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287563 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 19:33:02 +00:00
Simon Pilgrim
da59113748 [VectorLegalizer] Remove EVT::getSizeInBits code duplications. NFCI.
We were calling SVT.getSizeInBits() several times in a row - just call it once and reuse the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287556 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 18:24:44 +00:00
Jun Bum Lim
b68036c70c [CodeGenPrep] Skip merging empty case blocks
Summary: Merging an empty case block into the header block of switch could cause
ISel to add COPY instructions in the header of switch, instead of the case
block, if the case block is used as an incoming block of a PHI. This could
potentially increase dynamic instructions, especially when the switch is in a
loop. I added a test case which was reduced from the benchmark I was targetting.

Reviewers: t.p.northover, mcrosier, manmanren, wmi, davidxl

Subscribers: qcolombet, danielcdh, hfinkel, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287553 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 16:47:28 +00:00
Coby Tayree
bbc769fbf0 small fixup which enables the issuing of the aforementioned instruction (w/o operands), on MS/Intel syntax.
Differential Revision: https://reviews.llvm.org/D26913



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 15:50:56 +00:00