Commit Graph

14476 Commits

Author SHA1 Message Date
Michael Zolotukhin
7da6d8d393 [LoopUnroll] Avoid unnecessary DT recomputation.
Summary:
When we completely unroll a loop, it's pretty easy to update DT in-place and
thus avoid rebuilding it. DT recalculation is one of the most time-consuming
tasks in loop-unroll, so avoiding it at least in case of full unroll should be
beneficial.

On some extreme (but still real-world) tests this patch improves compile time by
~2x.

Reviewers: escha, jmolloy, hfinkel, sanjoy, chandlerc

Subscribers: joker.eph, sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261595 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 00:30:50 +00:00
Dehao Chen
be55cfa5fd Set function entry count as 0 if sample profile is not found for the function.
Summary: This change makes the sample profile's behavior consistent with instr profile.

Reviewers: davidxl, eraman, dnovillo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 22:46:21 +00:00
Adam Nemet
fddbd94e1d [LoopDataPrefetch] Make it testable with opt
Summary:
Since this is an IR pass it's nice to be able to write tests without
llc.  This is the counterpart of the llc test under
CodeGen/PowerPC/loop-data-prefetch.ll.

Reviewers: hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:41:22 +00:00
Michael Zolotukhin
0070b261d7 [LoopUnrolling] Fix a bug introduced in r259869 (PR26688).
The issue was that we only required LCSSA rebuilding if the immediate
parent-loop had values used outside of it. The fix is to enaable the
same logic for all outer loops, not only immediate parent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:21:45 +00:00
Philip Reames
b11315c0e5 [RS4GC] "Constant fold" the rs4gc-split-vector-values flag
This flag was part of a migration to a new means of handling vectors-of-points which was described in the llvm-dev thread "FYI: Relocating vector of pointers".  The old code path has been off by default for a while without complaints, so time to cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261569 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 21:01:28 +00:00
Philip Reames
a40db4f634 [RS4GC] Revert optimization attempt due to memory corruption
This change reverts "246133 [RewriteStatepointsForGC] Reduce the number of new instructions for base pointers" and a follow on bugfix 12575.

As pointed out in pr25846, this code suffers from a memory corruption bug.  Since I'm (empirically) not going to get back to this any time soon, simply reverting the problematic change is the right answer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261565 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 20:45:56 +00:00
Justin Lebar
0bbc549035 Revert "[attrs] Handle convergent CallSites."
This reverts r261544, which was causing a test failure in
Transforms/FunctionAttrs/readattrs.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:24:43 +00:00
Justin Lebar
4644890a51 [attrs] Handle convergent CallSites.
Summary:
Previously we had a notion of convergent functions but not of convergent
calls.  This is insufficient to correctly analyze calls where the target
is unknown, e.g. indirect calls.

Now a call is convergent if it targets a known-convergent function, or
if it's explicitly marked as convergent.  As usual, we can remove
convergent where we can prove that no convergent operations are
performed in the call.

Reviewers: chandlerc, jingyue

Subscribers: hfinkel, jhen, tra, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:51:35 +00:00
Benjamin Kramer
b0ce7c7fb5 Fix some abuse of auto flagged by clang's -Wrange-loop-analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261524 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 13:11:58 +00:00
Elena Demikhovsky
8659296d0e Allow setting MaxRerollIterations above 16
By Ayal Zaks.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 09:38:28 +00:00
Duncan P. N. Exon Smith
8de6150816 ADT: Remove == and != comparisons between ilist iterators and pointers
I missed == and != when I removed implicit conversions between iterators
and pointers in r252380 since they were defined outside ilist_iterator.

Since they depend on getNodePtrUnchecked(), they indirectly rely on UB.
This commit removes all uses of these operators.  (I'll delete the
operators themselves in a separate commit so that it can be easily
reverted if necessary.)

There should be NFC here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 20:39:50 +00:00
Duncan P. N. Exon Smith
d73d33fedf TransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC
Stop relying on `getNodePtrUnchecked()` being useful on invalid
iterators.  This function is documented to be for internal use only, and
the pointer type will eventually have to change to remove UB from
ilist_iterator.  Instead, check the iterator before it has been
invalidated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 20:14:29 +00:00
Sanjay Patel
fa7c411aab fix inaccurate comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:33:31 +00:00
Sanjay Patel
3c1ba0bbaa [InstCombine] add getNegativeIsTrueBoolVec() helper function; NFC
Originally part of:
http://reviews.llvm.org/D17485

We need this when simplifying masked memory ops too.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:29:33 +00:00
Sanjoy Das
745f68cc1a [LoopDeletion] Add an assert that verifies LCSSA
This is inspired by PR24804 -- had this assert been there before,
isolating the root cause for PR24804 would have been far easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:11:59 +00:00
Simon Pilgrim
2e17dfddd0 [InstCombine] SSE/SSE2 (u)comiss/(u)comisd comparison intrinsics only use the lowest vector element
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261460 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:17:35 +00:00
Benjamin Kramer
660d7ba525 [SimplifyCFG] Use pointer identity to simplify predicate.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 10:40:42 +00:00
David Majnemer
1f296bf0b8 [SimplifyCFG] Merge together cleanuppads
Cleanuppads may be merged together if one is the only predecessor of the
other in which case a simple transform can be performed: replace the
a cleanupret with a branch and remove an unnecessary cleanuppad.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 01:07:45 +00:00
Hans Wennborg
1836552368 Revert r255691 "[LoopVectorizer] Refine loop vectorizer's register usage calculator by ignoring specific instructions."
It caused PR26509.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 21:40:12 +00:00
Matthew Simpson
3dd74513a8 [LV] Vectorize first-order recurrences
This patch enables the vectorization of first-order recurrences. A first-order
recurrence is a non-reduction recurrence relation in which the value of the
recurrence in the current loop iteration equals a value defined in the previous
iteration. The load PRE of the GVN pass often creates these recurrences by
hoisting loads from within loops.

In this patch, we add a new recurrence kind for first-order phi nodes and
attempt to vectorize them if possible. Vectorization is performed by shuffling
the values for the current and previous iterations. The vectorization cost
estimate is updated to account for the added shuffle instruction.

Contributed-by: Matthew Simpson and Chad Rosier <mcrosier@codeaurora.org>
Differential Revision: http://reviews.llvm.org/D16197

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 17:56:08 +00:00
Silviu Baranga
865db3895b [LV] Fix PR26600: avoid out of bounds loads for interleaved access vectorization
Summary:
If we don't have the first and last access of an interleaved load group,
the first and last wide load in the loop can do an out of bounds
access. Even though we discard results from speculative loads,
this can cause problems, since it can technically generate page faults
(or worse).

We now discard interleaved load groups that don't have the first and
load in the group.

Reviewers: hfinkel, rengolin

Subscribers: rengolin, llvm-commits, mzolotukhin, anemet

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 15:46:10 +00:00
Chandler Carruth
eca46e623a [LPM] Factor all of the loop analysis usage updates into a common helper
routine.

We were getting this wrong in small ways and generally being very
inconsistent about it across loop passes. Instead, let's have a common
place where we do this. One minor downside is that this will require
some analyses like SCEV in more places than they are strictly needed.
However, this seems benign as these analyses are complete no-ops, and
without this consistency we can in many cases end up with the legacy
pass manager scheduling deciding to split up a loop pass pipeline in
order to run the function analysis half-way through. It is very, very
annoying to fix these without just being very pedantic across the board.

The only loop passes I've not updated here are ones that use
AU.setPreservesAll() such as IVUsers (an analysis) and the pass printer.
They seemed less relevant.

With this patch, almost all of the problems in PR24804 around loop pass
pipelines are fixed. The one remaining issue is that we run simplify-cfg
and instcombine in the middle of the loop pass pipeline. We've recently
added some loop variants of these passes that would seem substantially
cleaner to use, but this at least gets us much closer to the previous
state. Notably, the seven loop pass managers is down to three.

I've not updated the loop passes using LoopAccessAnalysis because that
analysis hasn't been fully wired into LoopSimplify/LCSSA, and it isn't
clear that those transforms want to support those forms anyways. They
all run late anyways, so this is harmless. Similarly, LSR is left alone
because it already carefully manages its forms and doesn't need to get
fused into a single loop pass manager with a bunch of other loop passes.

LoopReroll didn't use loop simplified form previously, and I've updated
the test case to match the trivially different output.

Finally, I've also factored all the pass initialization for the passes
that use this technique as well, so that should be done regularly and
reliably.

Thanks to James for the help reviewing and thinking about this stuff,
and Ben for help thinking about it as well!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 10:45:18 +00:00
Chandler Carruth
1501a642f5 [AA] Preserve the AA results wrapper pass as well as BasicAA in a few
more places to prevent gratuitous re-"runs" of these passes.

The passes themselves don't do any work when run, but we keep spending
time scheduling and running these needlessly when we really don't need
to do so.

This is the first patch towards fixing the really horrible loop pass
pipeline fragmentation pointed out by Sanjoy in PR24804.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261302 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 03:12:14 +00:00
Lawrence Hu
a2cdd47fa5 Bug fix: use dyn_cast_or_null instead of dyn_cast
Differential Revision: http://reviews.llvm.org/D17154



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 02:17:07 +00:00
Richard Trieu
1b96cbe208 Remove uses of builtin comma operator.
Cleanup for upcoming Clang warning -Wcomma.  No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 22:09:30 +00:00
Adam Nemet
b8d9c89680 [PPCLoopDataPrefetch] Move pass to Transforms/Scalar/LoopDataPrefetch. NFC
This patch is part of the work to make PPCLoopDataPrefetch
target-independent
(http://thread.gmane.org/gmane.comp.compilers.llvm.devel/92758).

Obviously the pass still only used from PPC at this point.  Subsequent
patches will start driving this from ARM64 as well.

Due to the previous patch most lines should show up as moved lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 21:38:19 +00:00
Matthew Simpson
fb46056c3a Reapply commit r259357 with a fix for PR26629
Commit r259357 was reverted because it caused PR26629. We were assuming all
roots of a vectorizable tree could be truncated to the same width, which is not
the case in general. This commit reapplies the patch along with a fix and a new
test case to ensure we don't regress because of this issue again. This should
fix PR26629.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261212 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 14:14:40 +00:00
Chandler Carruth
e9afeb0bd1 [PM] Port the PostOrderFunctionAttrs pass to the new pass manager and
convert one test to use this.

This is a particularly significant milestone because it required
a working per-function AA framework which can be queried over each
function from within a CGSCC transform pass (and additionally a module
analysis to be accessible). This is essentially *the* point of the
entire pass manager rewrite. A CGSCC transform is able to query for
multiple different function's analysis results. It works. The whole
thing appears to actually work and accomplish the original goal. While
we were able to hack function attrs and basic-aa to "work" in the old
pass manager, this port doesn't use any of that, it directly leverages
the new fundamental functionality.

For this to work, the CGSCC framework also has to support SCC-based
behavior analysis, etc. The only part of the CGSCC pass infrastructure
not sorted out at this point are the updates in the face of inlining and
running function passes that mutate the call graph.

The changes are pretty boring and boiler-plate. Most of the work was
factored into more focused preperatory patches. But this is what wires
it all together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 11:03:11 +00:00
Junmo Park
4fd1f8da32 Minor code cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 10:09:20 +00:00
Kostya Serebryany
d016c6f389 [sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261159 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 21:34:43 +00:00
Amaury Sechet
ce9c84303a NFC: Fix formating
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 21:21:29 +00:00
Haicheng Wu
432a2b022d [LIR] Avoid turning non-temporal stores into memset
This is to fix PR26645.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 21:00:06 +00:00
Adrian Prantl
465522b1fa Debug Info: Teach LdStHasDebugValue() (Local.cpp) about DIExpressions.
This function is used to check whether a dbg.value intrinsic has already
been inserted, but without comparing the DIExpression, it would erroneously
fire on split aggregates and only the first scalar would survive.

Found via http://reviews.llvm.org/D16867.
<rdar://problem/24456528>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 20:02:25 +00:00
Elena Demikhovsky
2c7551bff2 Create masked gather and scatter intrinsics in Loop Vectorizer.
Loop vectorizer now knows to vectorize GEP and create masked gather and scatter intrinsics for random memory access.

The feature is enabled on AVX-512 target.
Differential Revision: http://reviews.llvm.org/D15690



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 19:23:04 +00:00
Amaury Sechet
7aec751292 Fix load alignement when unpacking aggregates structs
Summary: Store and loads unpacked by instcombine do not always have the right alignement. This explicitely compute the alignement and set it.

Reviewers: dblaikie, majnemer, reames, hfinkel, joker.eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 19:21:28 +00:00
David Majnemer
fcc16ed65e Revert "Reapply commit r258404 with fix."
This reverts commit r259357, it caused PR26629.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 19:02:36 +00:00
Frederic Riss
67e85f751c [ObjCARC] Handle ARCInstKind::ClaimRV in OptimizeIndividualCalls.
When support for objc_unsafeClaimAutoreleasedReturnValue has been added to the
ARC optimizer in r258970, one case was missed which would lead the optimizer
to execute an llvm_unreachable. In this case, just handle ClaimRV in the same
way we handle RetainRV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261134 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 18:51:27 +00:00
Mehdi Amini
f5146973a3 Define the ThinLTO Pipeline (experimental)
Summary:
On the contrary to Full LTO, ThinLTO can afford to shift compile time
from the frontend to the linker: both phases are parallel (even if
it is not totally "free": projects like clang are reusing product
from the "compile phase" for multiple link, think about
libLLVMSupport reused for opt, llc, etc.).

This pipeline is based on the proposal in D13443 for full LTO. We
didn't move forward on this proposal because the LTO link was far too
long after that. We believe that we can afford it with ThinLTO.

The ThinLTO pipeline integrates in the regular O2/O3 flow:

 - The compile phase perform the inliner with a somehow lighter
   function simplification. (TODO: tune the inliner thresholds here)
   This is intendend to simplify the IR and get rid of obvious things
   like linkonce_odr that will be inlined.
 - The link phase will run the pipeline from the start, extended with
   some specific passes that leverage the augmented knowledge we have
   during LTO. Especially after the inliner is done, a sequence of
   globalDCE/globalOpt is performed, followed by another run of the
   "function simplification" passes. It is not clear if this part
   of the pipeline will stay as is, as the split model of ThinLTO
   does not allow the same benefit as FullLTO without added tricks.

The measurements on the public test suite as well as on our internal
suite show an overall net improvement. The binary size for the clang
executable is reduced by 5%. We're still tuning it with the bringup
of ThinLTO and it will evolve, but this should provide a good starting
point.

Reviewers: tejohnson

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 23:02:29 +00:00
Mehdi Amini
e300292233 Refactor the PassManagerBuilder: extract a "addFunctionSimplificationPasses()" (NFC)
It is intended to contains the passes run over a function after the
inliner is done with a function and before it moves to its callers.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 22:54:27 +00:00
Junmo Park
4ee5ab9daf [SCEVExpander] Make findExistingExpansion smarter
Summary:
Extending findExistingExpansion can use existing value in ExprValueMap.
This patch gives 0.3~0.5% performance improvements on 
benchmarks(test-suite, spec2000, spec2006, commercial benchmark)
   
Reviewers: mzolotukhin, sanjoy, zzheng

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 06:46:58 +00:00
Silviu Baranga
23340531a1 [LV] Add support for insertelt/extractelt processing during type truncation
Summary:
While shrinking types according to the required bits, we can
encounter insert/extract element instructions. This will cause us to
reach an llvm_unreachable statement.

This change adds support for truncating insert/extract element
operations, and adds a regression test.

Reviewers: jmolloy

Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 15:38:17 +00:00
Roman Gareev
78d3a49fad Tweak the LICM code to reuse the first sub-loop instead of creating a new one
LICM starts with an *empty* AST, and then merges in each sub-loop. While the
add code is appropriate for sub-loop 2 and up, it's utterly unnecessary for
sub-loop 1. If the AST starts off empty, we can just clone/move the contents
of the subloop into the containing AST.

Reviewed-by: Philip Reames <listmail@philipreames.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 14:48:50 +00:00
Benjamin Kramer
7a3eeaef9e Use ArrayRef to hide SmallVector details, kill a useless vector copy along the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 16:01:12 +00:00
Chandler Carruth
2c37b35a91 [attrs] Move the norecurse deduction to operate on the node set rather
than the SCC object, and have it scan the instruction stream directly
rather than relying on call records.

This makes the behavior of this routine consistent between libc routines
and LLVM intrinsics for libc routines. We can go and start teaching it
about those being norecurse, but we should behave the same for the
intrinsic and the libc routine rather than differently. I chatted with
James Molloy and the inconsistency doesn't seem intentional and likely
is due to intrinsic calls not being modelled in the call graph analyses.

This also fixes a bug where we would deduce norecurse on optnone
functions, when generally we try to handle optnone functions as-if they
were replaceable and thus unanalyzable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 08:47:51 +00:00
Keno Fischer
11adcc4de0 [Cloning] Clone every Function's Debug Info
Summary:
Export the CloneDebugInfoMetadata utility, which clones all debug info
associated with a function into the first module. Also use this function
in CloneModule on each function we clone (the CloneFunction entrypoint
already does this).

Without this, cloning a module will lead to DI quality regressions,
especially since r252219 reversed the Function <-> DISubprogram edge
(before we could get lucky and have this edge preserved if the
DISubprogram itself was, e.g. due to location metadata).

This was verified to fix missing debug information in julia and
a unittest to verify the new behavior is included.

Patch by Yichao Yu! Thanks!

Reviewers: loladiro, pcc
Differential Revision: http://reviews.llvm.org/D17165

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 02:04:29 +00:00
Chad Rosier
676d257cf2 [LIR] Allow merging of memsets in negatively strided loops.
Last part of PR25166.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:03:23 +00:00
Justin Lebar
55d3581e46 Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:01:37 +00:00
Justin Lebar
d7521eeb5d [SimplifyCFG] Don't fold conditional branches that contain calls to convergent functions.
Summary:
Performing this optimization duplicates the call to the convergent
function and adds new control-flow dependencies, which is a no-no.

Reviewers: jingyue

Subscribers: broune, hfinkel, tra, resistor, joker.eph, arsenm, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260730 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:01:36 +00:00
Justin Lebar
2109a5cbf9 [LoopRotate] Don't perform loop rotation if the loop header calls a convergent function.
Summary:
Calls to convergent functions can be duplicated, but only if the
duplicates are not control-flow dependent on any additional values.
Loop rotation doesn't meet the bar.

Reviewers: jingyue

Subscribers: mzolotukhin, llvm-commits, arsenm, joker.eph, resistor, tra, hfinkel, broune

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 21:01:33 +00:00
David Majnemer
c1bf0b56b5 Remove unused variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 20:33:51 +00:00