10261 Commits

Author SHA1 Message Date
Sanjay Patel
92b196b1b6 [InstCombine] auto-generate complete checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305474 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 15:13:19 +00:00
Craig Topper
46d1553fcd [InstCombine] Add a test case to show a case where don't handle a partially commuted IR. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 01:01:01 +00:00
Daniel Berlin
e6be55f220 PredicateInfo: Don't insert conditional info when a conditional branch jumps to the same target regardless of condition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 21:19:52 +00:00
Davide Italiano
ea02a02800 [EarlyCSE] Make PhiToCheck in removeMSSA() a set.
This way we end up not looking at PHI args already removed.
MemSSA now goes through the updater so we can prune
it to avoid having redundant MemoryPHI arguments, but that
doesn't quite work for the general case.

Discussed with Daniel Berlin, fixes PR33406.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 19:29:53 +00:00
Craig Topper
996d9b5480 [ValueTracking] Correct early out in computeKnownBitsFromOperator to work with non power of 2 bit widths
There's an early out that's trying to detect when we don't know any bits that make up the legal range of a shift. The code subtracts one from BitWidth which creates a mask in the lower bits for power of 2 bit widths. This is then ANDed with the known bits to see if any of those bits are known. If the bit width isn't a power of 2 this creates a non-sensical mask.

This patch corrects this by rounding up to a power of 2 before doing the subtract and mask.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305400 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 17:04:59 +00:00
Florian Hahn
50963b3b75 Align definition of DW_OP_plus with DWARF spec [3/3]
Summary:
This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things.
 
The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack.
 
This is done in three stages:
• The first patch (LLVM) adds support for DW_OP_plus_uconst.
• The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst.
• The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions.

Patch by Sander de Smalen.

Reviewers: echristo, pcc, aprantl

Reviewed By: aprantl

Subscribers: fhahn, javed.absar, aprantl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 13:14:38 +00:00
Craig Topper
4e62b03844 [InstCombine] Add test cases demonstrating failure to handle (select (icmp eq (and X, C1), 0), Y, (or Y, C2)) when the icmp portion gets turned into a truncate and a signed compare with 0.
InstCombine has an optimization that recognizes an and with the sign bit of legal type size and turns it into a truncate and compare that checks the sign bit. But the select handling code doesn't recognize this idiom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 23:30:41 +00:00
Teresa Johnson
b4c8582172 [PGO] Update VP metadata after memory intrinsic optimization
Summary:
Leave an updated VP metadata on the fallback memcpy intrinsic after
specialization. This can be used for later possible expansion based on
the average of the remaining values.

Reviewers: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 20:44:08 +00:00
David Blaikie
2ed087d093 Inliner: Don't remove calls to readnone+nounwind (but not always_inline) functions in the AlwaysInliner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305245 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:01:17 +00:00
Anna Thomas
8cedcc7579 [RS4GC] Drop invalid metadata after pointers are relocated
Summary:
After RS4GC, we should drop metadata that is no longer valid. These metadata
is used by optimizations scheduled after RS4GC, and can cause a miscompile.
One such metadata is invariant.load which is used by LICM sinking transform.
After rewriting statepoints, the address of a load maybe relocated. With
invariant.load metadata on a load instruction, LICM sinking assumes the
loaded value (from a dererenceable address) to be invariant, and
rematerializes the load operand and the load at the exit block.
This transforms the IR to have an unrelocated use of the
address after a statepoint, which is incorrect.
Other metadata we conservatively remove are related to
dereferenceability and noalias metadata.

This patch drops such metadata on store and load instructions after
rewriting statepoints.

Reviewers: reames, sanjoy, apilipenko

Reviewed by: reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 21:26:53 +00:00
Sanjay Patel
c099bec884 [InstCombine] lshr (sext iM X to iN), N-M --> zext (ashr X, min(N-M, M-1)) to iN
This is a follow-up to https://reviews.llvm.org/D33879 / https://reviews.llvm.org/rL304939 ,
and was discussed in https://reviews.llvm.org/D33338.

We prefer this form because a narrower shift may be cheaper, and we can more easily fold a
zext than a sext.

http://rise4fun.com/Alive/slVe

Name: shz
%s = sext i8 %x to i12
%r = lshr i12 %s, 4
=>
%a = ashr i8 %x, 4
%r = zext i8 %a to i12 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 14:23:43 +00:00
Xinliang David Li
165d46dd6e [PartialInlining] Support shrinkwrap life_range markers
Differential Revision: http://reviews.llvm.org/D33847




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305170 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-11 20:46:05 +00:00
Simon Pilgrim
b1984510d5 [X86][SLM] Add SLM arithmetic vectorization tests
As discussed on D33983, as SLM has so many custom costs its worth testing as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305151 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 19:16:09 +00:00
Andrew Kaylor
b8e9164d09 [InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin
Differential Revision: https://reviews.llvm.org/D33737

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 23:18:11 +00:00
Yaxun Liu
6862a2be05 [SROA] Fix APInt size when load/store have different address space
Currently there is a bug in SROA::presplitLoadsAndStores which causes assertion in
GEPOperator::accumulateConstantOffset.

Basically it does not consider the situation that the pointer operand of load or store
may be in a non-zero address space and its size may be different from the size of
a pointer in address space 0.

This patch fixes assertion when compiling Blender Cycles kernels for amdgpu backend.

Diffferential Revision: https://reviews.llvm.org/D33298


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 20:46:29 +00:00
Keno Fischer
5d860d251e [Sink] Fix predicate in legality check
Summary:
isSafeToSpeculativelyExecute is the wrong predicate to use here.
All that checks for is whether it is safe to hoist a value due to
unaligned/un-dereferencable accesses. However, not only are we doing
sinking rather than hoisting, our concern is that the location
we're loading from may have been modified. Instead forbid sinking
any load across a critical edge.

Reviewers: majnemer

Subscribers: davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305102 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 19:31:10 +00:00
Serguei Katkov
7e14c3da2c [IndVars] Add an option to be able to disable LFTR
This change adds an option disable-lftr to be able to disable Linear Function Test Replace optimization.
By default option is off so current behavior is not changed.

Reviewers: reames, sanjoy, wmi, andreadb, apilipenko
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33979


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305055 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 06:11:59 +00:00
George Burgess IV
9276050d30 [LoopVectorize] Don't preserve nsw/nuw flags on shrunken ops.
If we're shrinking a binary operation, it may be the case that the new
operations wraps where the old didn't. If this happens, the behavior
should be well-defined. So, we can't always carry wrapping flags with us
when we shrink operations.

If we do, we get incorrect optimizations in cases like:

void foo(const unsigned char *from, unsigned char *to, int n) {
  for (int i = 0; i < n; i++)
    to[i] = from[i] - 128;
}

which gets optimized to:

void foo(const unsigned char *from, unsigned char *to, int n) {
  for (int i = 0; i < n; i++)
    to[i] = from[i] | 128;
}

Because:
- InstCombine turned `sub i32 %from.i, 128` into
  `add nuw nsw i32 %from.i, 128`.
- LoopVectorize vectorized the add to be `add nuw nsw <16 x i8>` with a
  vector full of `i8 128`s
- InstCombine took advantage of the fact that the newly-shrunken add
  "couldn't wrap", and changed the `add` to an `or`.

InstCombine seems happy to figure out whether we can add nuw/nsw on its
own, so I just decided to drop the flags. There are already a number of
places in LoopVectorize where we rely on InstCombine to clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305053 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 03:56:15 +00:00
David Blaikie
d38ff39924 Inliner: Don't touch indirect calls
Other comments/implications are that this isn't intended behavior (nor
perserved/reimplemented in the new inliner) & complicates fixing the
'inlining' of trivially dead calls without consulting the cost function
first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305052 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 03:29:20 +00:00
Evgeniy Stepanov
12e8c2aeb5 [CFI] Remove LinkerSubsectionsViaSymbols.
Since D17854 LinkerSubsectionsViaSymbols is unnecessary.

It is interfering with ThinLTO implementation of CFI-ICall, where
the aliases used on the !LinkerSubsectionsViaSymbols branch are
needed to export jump tables to ThinLTO backends.

This is the second attempt to land this change after fixing PR33316.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 23:38:22 +00:00
Peter Collingbourne
e74c64e05a Write summaries for merged modules when splitting modules for ThinLTO.
This is to prepare to allow for dead stripping of globals in the
merged modules.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305027 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 23:01:49 +00:00
Sanjay Patel
5c9336eb2b [CGP, x86] add tests for potential memcmp expansion; NFC
No IR tests were added with rL304313 ( https://reviews.llvm.org/D28637 ),
so I want these for extra coverage if we enable memcmp expansion for x86.
As shown, nothing is expanded for x86 in CGP yet.

Also fundamentally, we're doing an IR transform, so we should have IR tests 
for just that part. If something goes wrong, we need to know if the bug is
in CGP or later lowering.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305011 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 20:40:39 +00:00
Dehao Chen
1d3e685c4b Do not early-inline recursive calls in sample profile loader.
Summary: Early-inlining of recursive call makes the code size bloat exponentially. We should not disable it.

Reviewers: davidxl, dnovillo, iteratee

Reviewed By: iteratee

Subscribers: iteratee, llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305009 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 20:11:57 +00:00
Galina Kistanova
6a9071188b Changed a comparison operator for std::stable_sort to implement strict weak ordering.
This is a temporarily fix which needs additional work, as it triggers a test3 failure.
test3 is commented out till then.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304993 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 17:27:40 +00:00
Nirav Dave
d2492e7267 InferAddressSpaces: Avoid assertion failure with replacing identical
cloned constexpr

Have cloneConstantExprWithNewAddressSpaces return nullptr when
returning initial ConstantExpr.

Reviewers: arsenm

Subscribers: jholewinski, wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304975 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 13:20:55 +00:00
Simon Pilgrim
4bdace3fe0 Regenerate test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304973 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 10:24:49 +00:00
Sanjay Patel
7656bbbba0 [InstCombine] fold lshr (sext X), C1 --> zext (lshr X, C2)
This was discussed in D33338. We have larger pattern-matching ending in a truncate that 
we can reduce or remove by handling these smaller patterns first. Further motivation is 
that narrower shift ops are easier for value tracking and zext is better than sext.

http://rise4fun.com/Alive/rhh

Name: boolshift
%sext = sext i1 %x to i8
%r = lshr i8 %sext, 7

=>

%r = zext i1 %x to i8

Name: noboolshift
%sext = sext i3 %x to i8
%r = lshr i8 %sext, 7

=>

%sh = lshr i3 %x, 2
%r = zext i3 %sh to i8

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 20:32:08 +00:00
Xinliang David Li
7ce64309f9 Fix builin_expect lowering bug
PR33346

Skip cases when expected value is not constant int.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 18:32:24 +00:00
Peter Collingbourne
619317ee76 LowerTypeTests: Generate simpler IR for br(llvm.type.test, then, else).
This makes it so that the code quality for CFI checks when compiling
with -O2 and linking with --lto-O0 is similar to that of the rest of
the code.

Reduces the size of a chrome binary built with -O2/--lto-O0 by
about 750KB.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304921 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 15:49:14 +00:00
NAKAMURA Takumi
4e7fb91232 Introduce the new feature "abi-breaking-checks" to satisfy -reverse-iterate in llvm/test/Transforms/Util/PredicateInfo/
A few tests in llvm/test/Transforms/Util/PredicateInfo/ are using -reverse-iterate.
The option -reverse-iterate is enabled with +Asserts in usual cases, but it can be turned on/off regardless of LLVM_ENABLE_ASSERTIONS.

I wonder if this were incompatible to https://reviews.llvm.org/D33908 (r304757).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:22:52 +00:00
Evgeny Stupachenko
fdb83c86c8 Added tests for X86InterleavedStore.
Reviewers: RKSimon, DavidKreitzer

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

Patch by: Aleen Farhana <Farhana.aleen@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 21:08:00 +00:00
Alexey Bataev
32249656e2 [SLP] Change extension of the test, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:27:45 +00:00
Alexey Bataev
d330cb350f [SLP] Add a test for fix of PR32164, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:11:35 +00:00
Evgeny Stupachenko
cfed19098f Fix PR23384 (part 3 of 3)
Summary:
The patch makes instruction count the highest priority for
 LSR solution for X86 (previously registers had highest priority).

Reviewers: qcolombet

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:04:16 +00:00
Anna Thomas
0a378270ee [LoopIdiom] Move X86 specific atomic memcpy test to the X86 directory
Patch https://reviews.llvm.org/rL304806 was causing failures in Aarch64
and multiple other targets since the test should be run on X86 only.

Specifying the target triple is not enough. Moving the testcase to the
X86 target directory in LoopIdiom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 17:46:41 +00:00
Daniel Berlin
2d73c379ee NewGVN: Fix PR/33187. This is a bug caused by two things:
1. When there is no perfect iteration order, we can't let phi nodes
put themselves in terms of things that come later in the iteration
order, or we will endlessly cycle (the normal RPO algorithm clears the
hashtable to avoid this issue).
2. We are sometimes erasing the wrong expression (causing pessimism)
because our equality says loads and stores are the same.
We introduce an exact equality function and use it when erasing to
make sure we erase only identical expressions, not equivalent ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304807 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 17:15:28 +00:00
Anna Thomas
bacc83353b [Atomics][LoopIdiom] Recognize unordered atomic memcpy
Summary:
Expanding the loop idiom test for memcpy to also recognize
unordered atomic memcpy. The only difference for recognizing
an unordered atomic memcpy and instead of a normal memcpy is
that the loads and/or stores involved are unordered atomic operations.

Background:  http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html

Patch by Daniel Neilson!

Reviewers: reames, anna, skatkov

Reviewed By: reames, anna

Subscribers: llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304806 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 16:45:25 +00:00
Anna Thomas
958169b1f8 [IRCE] Canonicalize pre/post loops after the blocks are added into parent loop
Summary:
We were canonizalizing the pre loop (into loop-simplify form) before
the post loop blocks were added into parent loop. This is incorrect when IRCE is
done on a subloop. The post-loop blocks are created, but not yet added to the
parent loop. So, loop-simplification on the pre-loop incorrectly updates
LoopInfo.

This patch corrects the ordering so that pre and post loop blocks are added to
parent loop (if any), and then the loops are canonicalized to LCSSA and
LoopSimplifyForm.

Reviewers: reames, sanjoy, apilipenko

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304800 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 14:54:01 +00:00
Joey Gouly
4d04e9b25e [InstSimplify] Constant fold the new GEP in SimplifyGEPInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304784 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 10:17:14 +00:00
Sven van Haastregt
3303806a3d [InstCombine] Fix extractelement use before def
This fixes a bug that can cause extractelements with operands that
haven't been defined yet to be inserted at a wrong point when
optimising insertelements.

Patch by Karl Hylen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304701 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 09:18:10 +00:00
Craig Topper
be3f63f462 [X86] Replace 'REQUIRES: x86' in tests with 'REQUIRES: x86-registered-target' which seems to be the correct way to make them run on an x86 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-04 08:21:58 +00:00
Craig Topper
d381818c94 [ConstantFolding] Properly support constant folding of vector powi intrinsic. The second argument is not a vector so needs special treatment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304679 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-04 07:30:28 +00:00
Craig Topper
e869716ca3 [InstSimplify] Add test case demonstrating that we fail to constant fold vector llvm.powi intrinsics due to the second argument not being a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304678 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-04 07:30:23 +00:00
Craig Topper
2a4cf84ad2 [InstCombine] Add support for simplifying ctlz/cttz intrinsics based on known bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304669 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 18:50:32 +00:00
Craig Topper
02c1af0c15 [ConstantFolding] Fix constant folding for vector cttz and ctlz intrinsics to understand that the second argument is still a scalar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 18:50:29 +00:00
Craig Topper
a95cc203d8 [InstCombine][InstSimplify] Add various tests for ctlz/cttz with vectors, some showing missed optimizations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304667 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 18:50:26 +00:00
Craig Topper
fb1f3c0c95 [InstCombine] Use cttz instead of ctlz in the cttz_cmp_vec test case. Looks like a copy paste mistake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304666 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 18:50:23 +00:00
Evgeniy Stepanov
0b656a12fb Revert "[CFI] Remove LinkerSubsectionsViaSymbols."
This reverts commit r304582: breaks cfi-devirt :: anon-namespace.cpp on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304626 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:46:27 +00:00
Xinliang David Li
118cef0ca3 [PartialInlining] Minor cost anaysis tuning
Also added a test option and 2 cost analysis related tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304599 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 22:08:04 +00:00
Jun Bum Lim
2961ee384e [InlineCost] Enable the new switch cost heuristic
Summary:
This is to enable the new switch inline cost heuristic (r301649) by removing the
old heuristic as well as the flag itself.
In my experiment for LLVM test suite and spec2000/2006, +17.82% performance and
8% code size reduce was observed in spec2000/vertex with O3 LTO in AArch64.
No significant code size / performance regression was found in O3/O2/Os. No
significant complain was reported from the llvm-dev thread.

Reviewers: hans, chandlerc, eraman, haicheng, mcrosier, bmakam, eastig, ddibyend, echristo

Reviewed By: echristo

Subscribers: javed.absar, kristof.beyls, echristo, aemerson, rengolin, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 20:42:54 +00:00