Commit Graph

9787 Commits

Author SHA1 Message Date
Craig Topper
3c3df0d82a [InstSimplify] Add test cases for mixing add/sub i1 with xor of i1. Seems we can simplify in one direction but not the other.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299627 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 05:48:06 +00:00
Craig Topper
1194a001b6 [InstSimplify] Teach SimplifyAddInst and SimplifySubInst that vectors of i1 can be treated as Xor too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299626 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 05:28:41 +00:00
Keno Fischer
15bfd0f9a0 [X86 TTI] Implement LSV hook
Summary:
LSV wants to know the maximum size that can be loaded to a vector register.
On X86, this always matches the maximum register width. Implement this
accordingly and add a test to make sure that LSV can vectorize up to the
maximum permissible width on X86.

Reviewers: delena, arsenm

Reviewed By: arsenm

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299589 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 20:51:38 +00:00
Sanjay Patel
bcca3be4b5 [InstCombine] add fold for icmp with or mask of low bits (PR32542)
We already have these 'and' folds:

// X & -C == -C -> X >  u ~C
// X & -C != -C -> X <= u ~C
//   iff C is a power of 2

...but we were missing the 'or' siblings.

http://rise4fun.com/Alive/n6

This should improve:
https://bugs.llvm.org/show_bug.cgi?id=32524
...but there are 2 or more other pieces to fix still.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299570 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 17:57:05 +00:00
Sanjay Patel
81a71c4756 [InstCombine] add tests for missing icmp fold (PR32524)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299557 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 16:21:38 +00:00
Matthew Simpson
a9eefb0375 [LV] Make test case more robust
This test case depends on the loop being vectorized without forcing the
vectorization factor. If the profitability ever changes in the future (due to
cost model improvements), the test may no longer work as intended. Instead of
checking the resulting IR, we should just check the instruction costs. The
costs will be computed regardless if vectorization is profitable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 14:34:13 +00:00
Sanjay Patel
0a06935a2e [InstCombine] add tests for missing add canonicalization; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299539 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 13:33:10 +00:00
James Molloy
3a168569fc [LAA] Correctly return a half-open range in expandBounds
This is a latent bug that's been hanging around for a while. For a loop-invariant
pointer, expandBounds would return the range {Ptr, Ptr}, but this was interpreted
as a half-open range, not a closed range. So we ended up planting incorrect
bounds checks. Even worse, they were tautological, so we ended up incorrectly
executing the optimized loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 09:24:26 +00:00
Akira Hatanaka
1115fbdce4 [ObjCArc] Do not dereference an invalidated iterator.
Fix a bug in ARC contract pass where an iterator that pointed to a
deleted instruction was dereferenced.

It appears that tryToContractReleaseIntoStoreStrong was incorrectly
assuming that a call to objc_retain would not immediately follow a call
to objc_release.

rdar://problem/25276306



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299507 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 03:44:09 +00:00
Bob Haarman
ed735da23f ThinLTOBitcodeWriter: handle aliases first in filterModule
Summary: This change fixes a "local linkage requires default visibility" assert when attempting to build LLVM with ThinLTO on Windows.

Reviewers: pcc, tejohnson, mehdi_amini

Reviewed By: pcc

Subscribers: llvm-commits, Prazek

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299491 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 00:42:07 +00:00
Craig Topper
862117b6f4 [InstCombine] Add test cases for various add/subtracts of constants(scalar, splat, and vector) with phis and selects. Improvements coming in a future commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 22:22:30 +00:00
Craig Topper
7597f2aad7 [InstCombine] Turn subtract of vectors of i1 into xor like we do for scalar i1. Matches what we already do for add.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299472 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 21:44:56 +00:00
Craig Topper
d6c407ebd6 [InstCombine] Support folding and/or/xor with a constant vector RHS into selects and phis
Currently we only fold with ConstantInt RHS. This generalizes to any Constant RHS.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 20:26:25 +00:00
Craig Topper
80bfe66e42 [InstCombine] Add test cases for missing combines of phis with and/or/xor with constant argument. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299460 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 19:31:21 +00:00
Craig Topper
c1eaf3a1f1 [InstCombine] Add more test cases for missing combines of selects with and/or/xor with constant argument. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 17:48:08 +00:00
Rong Xu
9e52f8ee8b [PGO] Memory intrinsic calls optimization based on profiled size
This patch optimizes two memory intrinsic operations: memset and memcpy based
on the profiled size of the operation. The high level transformation is like:
  mem_op(..., size)
  ==>
  switch (size) {
    case s1:
       mem_op(..., s1);
       goto merge_bb;
    case s2:
       mem_op(..., s2);
       goto merge_bb;
    ...
    default:
       mem_op(..., size);
       goto merge_bb;
    }
  merge_bb:

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 16:42:20 +00:00
Jonas Hahnfeld
ba1514c219 Align all scalar numbers to LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR
Otherwise, yamlize in YAMLTraits.h might be wrongly defined.
This makes some AMDGPU tests fail when LLVM_LINK_LLVM_DYLIB is set.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299415 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 06:02:32 +00:00
Zvi Rackover
07d42b869d InstSimplify: Add a hook for shufflevector
Summary:
Add a hook for simplification of shufflevector's with the following rules:
- Constant folding - NFC, as it was already being done by the default handler.
-  If only one of the operands is constant, constant fold the shuffle if the
    mask does not select elements from the variable operand -  to show the hook is firing and affecting the test-cases.

Reviewers: RKSimon, craig.topper, spatel, sanjoy, nlopes, majnemer

Reviewed By: spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-03 22:05:30 +00:00
Matt Arsenault
513e714dfd AMDGPU: Remove llvm.SI.vs.load.input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299391 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-03 21:45:13 +00:00
Craig Topper
aee31d3e9a [InstCombine] Add test cases showing how we fail to fold vector constants into selects the way we do with scalars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299369 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-03 17:49:15 +00:00
Daniel Berlin
72710465b6 NewGVN: Handle coercion of constant stores, loads, memory insts.
Summary:
Depends on D30928.

This adds support for coercion of stores and memory instructions that do not require insertion to process.
Another few tests down.
I added the relevant tests from rle.ll

Reviewers: davide

Subscribers: llvm-commits, Prazek

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-02 13:23:44 +00:00
Nikolai Bozhenov
650bf3e599 [BypassSlowDivision] Do not bypass division of hash-like values
Disable bypassing if one of the operands looks like a hash value. Slow
division often occurs in hashtable implementations and fast division is
never taken there because a hash value is extremely unlikely to have
enough upper bits set to zero.

A value is considered to be hash-like if it is produced by

1) XOR operation
2) Multiplication by a constant wider than the shorter type
3) PHI node with all incoming values being hash-like

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299329 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-02 13:14:30 +00:00
Zvi Rackover
a544ecba50 Add another interesting shufflevector test case for InstSimplify. NFC.
Test case shows opportunity to constant fold a shuffle with one variable
input vector operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299327 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-02 10:42:21 +00:00
Sanjay Patel
6d5ad7b563 [InstSimplify] add constant folding for fdiv/frem
Also, add a helper function so we don't have to repeat this code for each binop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299309 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 19:05:11 +00:00
Sanjay Patel
08e6f17325 [InstSimplify] add tests for missed constant folding; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 18:44:03 +00:00
Peter Collingbourne
61a230e3a0 Fix a test to check assembly output instead of bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299279 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 23:22:19 +00:00
Craig Topper
cba91e6d22 [InstCombine] Add test case demonstrating missed opportunities for removing add/sub when the LSBs of one input are known to be 0 and MSBs of the output aren't consumed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299263 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 21:08:37 +00:00
Joerg Sonnenberger
3e86a05613 Do not translate rint into nearbyint, but truncate it like nearbyint.
A common way to implement nearbyint is by fiddling with the floating
point environment and calling rint. This is used at least by the BSD
libm and musl. As such, canonicalizing the latter to the former will
create infinite loops for libm and generally pessimize performance, at
least when the generic C versions are used.

This change preserves the rint in the libcall translation and also
handles the domain truncation logic, so that rint with float argument
will be reduced to rintf etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 19:58:07 +00:00
Piotr Padlewski
f580f444f6 [MSSA] Small test fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 17:39:07 +00:00
Dehao Chen
22478be44e Fix the InstCombine to reserve the VP metadata and sets correct call count.
Summary: Currently the VP metadata was dropped when InstCombine converts a call to direct call. This patch converts the VP metadata to branch_weights so that its hotness is recorded.

Reviewers: eraman, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 15:59:52 +00:00
Zvi Rackover
0cd81d8a10 Instsimplify: Adding shufflevector test. NFC.
Adding some test-cases demonstrating cases that need to be improved.
To be followed by patches that improve these cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299189 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 07:46:02 +00:00
Mikael Holmen
1fcb6de3bd [Scalarizer] Handle scalar arguments in vector GEP
Summary:
Triggered by commit r298620: "[LV] Vectorize GEPs".

If we encounter a vector GEP with scalar arguments, we splat the scalar
into a vector of appropriate size before we scatter the argument.

Reviewers: arsenm, mehdi_amini, bkramer

Reviewed By: arsenm

Subscribers: bjope, mssimpso, wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299186 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 06:29:49 +00:00
Matt Arsenault
3c1dcddf86 AMDGPU: Add all atomicrmw fields to atomic.inc/dec
Add scope, order, isVolatile

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299122 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 22:21:40 +00:00
Hongbin Zheng
dbc8b93e8a [SimplifyIndvar] Replace the sdiv used by IV if we can prove both of its operands are non-negative
Since there is no sdiv in SCEV, an 'udiv' is a better canonical form than an 'sdiv' as the user of induction variable

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299118 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 21:56:56 +00:00
Adrian Prantl
70eccef966 Teach stripNonLineTableDebugInfo() to remap DILocations in !llvm.loop nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 20:10:56 +00:00
Matthew Simpson
946702101b [InstCombine] Correct the check for vector GEPs
Some of the GEP combines (e.g., descaling) can't handle vector GEPs. We have an
existing check that attempts to bail out if given a vector GEP. However, the
check only tests the GEP's pointer operand. A GEP results in a vector of
pointers if at least one of its operands is vector-typed (e.g., its pointer
operand could be a scalar, but its index could be a vector). We should just
check the type of the GEP itself. This should fix PR32414.

Reference: https://bugs.llvm.org/show_bug.cgi?id=32414
Differential Revision: https://reviews.llvm.org/D31470

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299017 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-29 18:23:08 +00:00
Anna Thomas
495d20631a rename instcombine test file. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 08:34:07 +00:00
Matthew Simpson
fcdf36fabb [LV] Transform truncations of non-primary induction variables
The vectorizer tries to replace truncations of induction variables with new
induction variables having the smaller type. After r295063, this optimization
was applied to all integer induction variables, including non-primary ones.
When optimizing the truncation of a non-primary induction variable, we still
need to transform the new induction so that it has the correct start value.
This should fix PR32419.

Reference: https://bugs.llvm.org/show_bug.cgi?id=32419

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 20:07:38 +00:00
Anna Thomas
e8b81e06e1 [InstCombine] Avoid incorrect folding of select into phi nodes when incoming element is a vector type
Summary:
We are incorrectly folding selects into phi nodes when the incoming value of a phi
node is a constant vector. This optimization is done in `FoldOpIntoPhi` when the
select condition is a phi node with constant incoming values.
Without the fix, we are miscompiling (i.e. incorrectly folding the
select into the phi node) when the vector contains non-zero
elements.
This patch fixes the miscompile and we will correctly fold based on the
select vector operand (see added test cases).

Reviewers: majnemer, sanjoy, spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 13:52:51 +00:00
Serge Pavlov
9f6d8acec1 [LoopUnroll] Remap references in peeled iteration
References in cloned blocks must be remapped prior to dominator
calculation.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298811 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-26 16:46:53 +00:00
Joerg Sonnenberger
3d72b70842 Split the SimplifyCFG pass into two variants.
The first variant contains all current transformations except
transforming switches into lookup tables. The second variant
contains all current transformations.

The switch-to-lookup-table conversion results in code that is more
difficult to analyze and optimize by other passes. Most importantly,
it can inhibit Dead Code Elimination. As such it is often beneficial to
only apply this transformation very late. A common example is inlining,
which can often result in range restrictions for the switch expression.

Changes in execution time according to LNT:
SingleSource/Benchmarks/Misc/fp-convert +3.03%
MultiSource/Benchmarks/ASC_Sequoia/CrystalMk/CrystalMk -11.20%
MultiSource/Benchmarks/Olden/perimeter/perimeter -10.43%
and a couple of smaller changes. For perimeter it also results 2.6%
a smaller binary.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-26 06:44:08 +00:00
Chandler Carruth
627e0f9985 [IR] Make SwitchInst::CaseIt almost a normal iterator.
This moves it to the iterator facade utilities giving it full random
access semantics, etc. It can also now be used with standard algorithms
like std::all_of and std::any_of and range adaptors like llvm::reverse.

Also make the semantics of iterating match what every other iterator
uses and forbid decrementing past the begin iterator. This was used as
a hacky way to work around iterator invalidation. However, every
instance trying to do this failed to actually avoid touching invalid
iterators despite the clear documentation that the removed and all
subsequent iterators become invalid including the end iterator. So I've
added a return of the next iterator to removeCase and rewritten the
loops that were doing this to correctly follow the iterator pattern of
either incremneting or removing and assigning fresh values to the
iterator and the end.

In one case we were trying to go backwards to make this cleaner but it
doesn't actually work. I've made that code match the code we use
everywhere else to remove cases as we iterate. This changes the order of
cases in one test output and I moved that test to CHECK-DAG so it
wouldn't care -- the order isn't semantically meaningful anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298791 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-26 02:49:23 +00:00
Eric Christopher
d8caf85d6d Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonly
so that we can perform some optimizations across it.

Fixes PR32365

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298781 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-25 20:20:23 +00:00
Ivan Krasin
76f79b8934 Revert r298620: [LV] Vectorize GEPs
Reason: breaks linking Chromium with LLD + ThinLTO (a pass crashes)
LLVM bug: https://bugs.llvm.org//show_bug.cgi?id=32413

Original change description:

[LV] Vectorize GEPs

This patch adds support for vectorizing GEPs. Previously, we only generated
vector GEPs on-demand when creating gather or scatter operations. All GEPs from
the original loop were scalarized by default, and if a pointer was to be stored
to memory, we would have to build up the pointer vector with insertelement
instructions.

With this patch, we will vectorize all GEPs that haven't already been marked
for scalarization.

The patch refines collectLoopScalars to more exactly identify the scalar GEPs.
The function now more closely resembles collectLoopUniforms. And the patch
moves vector GEP creation out of vectorizeMemoryInstruction and into the main
vectorization loop. The vector GEPs needed for gather and scatter operations
will have already been generated before vectoring the memory accesses.

Original Differential Revision: https://reviews.llvm.org/D30710



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298735 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 20:49:43 +00:00
Matt Arsenault
f9d04c6fdc AMDGPU: Fold rcp/rsq of undef to undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 19:04:57 +00:00
Teresa Johnson
cf5d3caaab [ThinLTO] Correct counting of functions in inliner stats
Summary: Declarations need to be filtered out when counting functions.

Reviewers: eraman

Subscribers: Prazek, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 17:59:06 +00:00
Daniel Berlin
fdd2b65197 NewGVN: Fix PR32403 - Handling of undef in phis was not quite correct
due to LLVM's view of phi nodes.  It would cause NewGVN not to fixpoint
in some interesting edge cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298687 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 05:30:34 +00:00
Dehao Chen
f62637a837 Set the prof weight correctly for call instructions in DeadArgumentElimination.
Summary: In DeadArgumentElimination, the call instructions will be replaced. We also need to set the prof weights so that function inlining can find the correct profile.

Reviewers: eraman

Reviewed By: eraman

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298660 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 23:26:00 +00:00
Bryant Wong
69af69a8ff [MetaRenamer] Don't rename library functions.
Library functions can have specific semantics that affect the behavior of
certain passes. DSE, for instance, gives special treatment to malloc-ed pointers
but not to pointers returned from an equivalently typed (but differently named)
function.

MetaRenamer ought not to alter program semantics, so library functions must
remain untouched.

Reviewers: mehdi_amini, majnemer, chandlerc, davide

Reviewed By: davide

Subscribers: davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298659 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 23:21:07 +00:00
Dehao Chen
261eb1f850 Use isFunctionHotInCallGraph to set the function section prefix.
Summary: The current prefix based function layout algorithm only looks at function's entry count, which is not sufficient. A function should be grouped together if its entry count or any call edge count is hot.

Reviewers: davidxl, eraman

Reviewed By: eraman

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298656 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 23:14:11 +00:00