16330 Commits

Author SHA1 Message Date
Sanjay Patel
59fe6b08fa [InstCombine] allow non-splat folds of select cond (ext X), C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:49:22 +00:00
Gor Nishanov
40fec41b24 [Coroutines] Part15c: Fix coro-split to correctly handle definitions between coro.save and coro.suspend
Summary:
In the case below, %Result.i19 is defined between coro.save and coro.suspend and used after coro.suspend. We need to correctly place such a value into the coroutine frame.

```
  %save = call token @llvm.coro.save(i8* null)
  %Result.i19 = getelementptr inbounds %"struct.lean_future<int>::Awaiter", %"struct.lean_future<int>::Awaiter"* %ref.tmp7, i64 0, i32 0
  %suspend = call i8 @llvm.coro.suspend(token %save, i1 false)
  switch i8 %suspend, label %exit [
    i8 0, label %await.ready
    i8 1, label %exit
  ]
await.ready:
  %val = load i32, i32* %Result.i19

```

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:24:19 +00:00
Gor Nishanov
b76c0e472e [Coroutines] Part15b: Fix dbg information handling in coro-split.
Summary:
Without the fix, if there was a function inlined into the coroutine with debug information, CloneFunctionInto(NewF, &F, VMap, /*ModuleLevelChanges=*/true, Returns); would duplicate all of the debug information including the DICompileUnit.

We know use VMap to indicate that debug metadata for a File, Unit and FunctionType should not be duplicated when we creating clones that will become f.resume, f.destroy and f.cleanup.

Reviewers: majnemer

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:05:06 +00:00
Gor Nishanov
a7eae488f2 [Coroutines] Part 15a: Lower coro.subfn.addr in CoroCleanup
Summary: Not all coro.subfn.addr intrinsics can be eliminated in CoroElide through devirtualization. Those that remain need to be lowered in CoroCleanup.

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:41:35 +00:00
Dehao Chen
9faad5871f Update loop unroller cost model to make sure debug info does not affect optimization decisions.
Summary: Debug info should *not* affect optimization decisions. This patch updates loop unroller cost model to make it not affected by debug info.

Reviewers: davidxl, mzolotukhin

Subscribers: haicheng, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:30:04 +00:00
Etienne Bergeron
937044fdd2 [asan] Support dynamic shadow address instrumentation
Summary:
This patch is adding the support for a shadow memory with
dynamically allocated address range.

The compiler-rt needs to export a symbol containing the shadow
memory range.

This is required to support ASAN on windows 64-bits.

Reviewers: kcc, rnk, vitalybuka

Subscribers: zaks.anna, kubabrecka, dberris, llvm-commits, chrisha

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 17:46:32 +00:00
Artur Pilipenko
04c171a0c9 CVP. Turn marking adds as no wrap on by default (was turned off by 279082)
With 282650 in tree extra no wrap on adds doesn't cause regressions anymore. Reenable the optimzation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 16:20:08 +00:00
Matthew Simpson
1f0ef7442e [LV] Build all scalar steps for non-uniform induction variables
When building the steps for scalar induction variables, we previously attempted
to determine if all the scalar users of the induction variable were uniform. If
they were, we would only emit the step corresponding to vector lane zero. This
optimization was too aggressive. We generally don't know the entire set of
induction variable users that will be scalar. We have
isScalarAfterVectorization, but this is only a conservative estimate of the
instructions that will be scalarized. Thus, an induction variable may have
scalar users that aren't already known to be scalar. To avoid emitting unused
steps, we can only check that the induction variable is uniform. This should
fix PR30542.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 15:13:52 +00:00
Adam Nemet
91f3caeaf5 [LDist] Port to new streaming API for opt remarks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 04:56:25 +00:00
Adam Nemet
4fa3e14023 [LoopUnroll] Port to the new streaming interface for opt remarks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 03:44:16 +00:00
Piotr Padlewski
a6db8552b8 [thinlto] Don't decay threshold for hot callsites
Summary:
We don't want to decay hot callsites to import chains of hot
callsites. The same mechanism is used in LIPO.

Reviewers: tejohnson, eraman, mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 03:01:17 +00:00
Adam Nemet
072d6af36c [LoopDataPrefetch] Port to new streaming API for opt remarks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 00:42:43 +00:00
Adam Nemet
1247d5cd07 [LV] Port the remarks in processLoop to the new streaming API
This completes LV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 00:29:30 +00:00
Adam Nemet
ec6f1559d4 [LV] Port the last opt remark in Hints to the new streaming interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 00:29:25 +00:00
Adam Nemet
858cc931c4 [LAA, LV] Port to new streaming interface for opt remarks. Update LV
(Recommit after making sure IsVerbose gets properly initialized in
DiagnosticInfoOptimizationBase.  See previous commit that takes care of
this.)

OptimizationRemarkAnalysis directly takes the role of the report that is
generated by LAA.

Then we need the magic to be able to turn an LAA remark into an LV
remark.  This is done via a new OptimizationRemark ctor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 00:01:30 +00:00
Sanjay Patel
8a50db91a8 [InstCombine] fix function names; NFC
Also, make foldSelectExtConst() a member of InstCombiner, remove
unnecessary parameters from its interface, and group visitSelectInst
helpers together in the header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 22:18:30 +00:00
Adam Nemet
a9b1465978 Revert "[LAA, LV] Port to new streaming interface for opt remarks. Update LV"
This reverts commit r282758.

There are some clang failures I haven't seen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 20:17:37 +00:00
Adam Nemet
07beb3c041 [LAA, LV] Port to new streaming interface for opt remarks. Update LV
OptimizationRemarkAnalysis directly takes the role of the report that is
generated by LAA.

Then we need the magic to be able to turn an LAA remark into an LV
remark.  This is done via a new OptimizationRemark ctor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 20:12:18 +00:00
Adam Nemet
cb40e05c0d [LV] Port OptimizationRemarkAnalysisFPCommute and
OptimizationRemarkAnalysisAliasing to new streaming API for opt remarks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 18:04:47 +00:00
Adam Nemet
fdd76dc361 [LV] Convert processLoop to new streaming API for opt remarks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:55:13 +00:00
Sanjay Patel
a18c5f6c3f fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:48:19 +00:00
Kostya Serebryany
efa54824a3 [sanitizer-coverage/libFuzzer] make the guards for trace-pc 32-bit; create one array of guards per function, instead of one guard per BB. reorganize the code so that trace-pc-guard does not create unneeded globals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282735 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:43:24 +00:00
Piotr Padlewski
584dba4143 [thinlto] Add cold-callsite import heuristic
Summary:
Not tunned up heuristic, but with this small heuristic there is about
+0.10% improvement on SPEC 2006

Reviewers: tejohnson, mehdi_amini, eraman

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:32:07 +00:00
Adam Nemet
8a6fcf99da [LV] Move static createMissedAnalysis from anonymous to global namespace
This is an attempt to fix a windows bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282730 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:25:00 +00:00
Adam Nemet
3f9be702ed [LV] Convert CostModel to use the new streaming opt remark API
Here we can already remove the member function emitAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:15:48 +00:00
Adam Nemet
89695c8a44 [LV] Split most of createMissedAnalysis into a static function. NFC
This will be shared between Legality and CostModel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:05:35 +00:00
Adam Nemet
bbb8dac111 [LV] Convert all but one opt remark in Legality to new streaming interface
The last one remaining after which emitAnalysis can be removed is when
we convert the LAA's report to a vectorization report.  This requires
converting LAA to the new interface first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 16:49:42 +00:00
Adam Nemet
9ecbf48ff5 [LV] Convert emitRemark to new opt remark streaming interface
Also renamed the function to emitRemarkWithHints to better reflect what
the function actually does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 16:23:12 +00:00
Volkan Keles
e9f2c694e6 Test commit. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 13:04:37 +00:00
Evgeny Stupachenko
6642664652 Wisely choose sext or zext when widening IV.
Summary:
The patch fixes regression caused by two earlier patches D18777 and D18867.

Reviewers: reames, sanjoy

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

From: Li Huang


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282650 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-28 23:39:39 +00:00
Dehao Chen
b393d828c5 Refactor the ProfileSummaryInfo to use doInitialization and doFinalization to handle Module update.
Summary: This refactors the change in r282616

Reviewers: davidxl, eraman, mehdi_amini

Subscribers: mehdi_amini, davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-28 21:00:58 +00:00
Jonas Paulsson
2db5109945 [SystemZ] Implementation of getUnrollingPreferences().
This commit enables more unrolling for SystemZ by implementing the
SystemZTargetTransformInfo::getUnrollingPreferences() method.

It has been found that it is better to only unroll moderately, so the
DefaultUnrollRuntimeCount has been moved into UnrollingPreferences in order
to set this to a lower value for SystemZ (4).

Reviewers: Evgeny Stupachenko, Ulrich Weigand.
https://reviews.llvm.org/D24451

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282570 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-28 09:41:38 +00:00
Adam Nemet
695f82f13a [Inliner] Port all opt remarks to new streaming API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 23:47:03 +00:00
Adam Nemet
0552c8c45a Shorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFC
With the new streaming interface, these class names need to be typed a
lot and it's way too looong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 22:19:23 +00:00
Adam Nemet
8d5df95c2e [Inliner] Fold the analysis remark into the missed remark
There is really no reason for these to be separate.

The vectorizer started this pretty bad tradition that the text of the
missed remarks is pretty meaningless, i.e. vectorization failed.  There,
you have to query analysis to get the full picture.

I think we should just explain the reason for missing the optimization
in the missed remark when possible.  Analysis remarks should provide
information that the pass gathers regardless whether the optimization is
passing or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 21:58:17 +00:00
Michael Zolotukhin
835827ed95 [LoopSimplify] When simplifying phis in loop-simplify, do it only if it preserves LCSSA form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282541 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 21:03:45 +00:00
Adam Nemet
47c0d49055 Output optimization remarks in YAML
(Re-committed after moving the template specialization under the yaml
namespace.  GCC was complaining about this.)

This allows various presentation of this data using an external tool.
This was first recommended here[1].

As an example, consider this module:

  1 int foo();
  2 int bar();
  3
  4 int baz() {
  5   return foo() + bar();
  6 }

The inliner generates these missed-optimization remarks today (the
hotness information is pulled from PGO):

  remark: /tmp/s.c:5:10: foo will not be inlined into baz (hotness: 30)
  remark: /tmp/s.c:5:18: bar will not be inlined into baz (hotness: 30)

Now with -pass-remarks-output=<yaml-file>, we generate this YAML file:

  --- !Missed
  Pass:            inline
  Name:            NotInlined
  DebugLoc:        { File: /tmp/s.c, Line: 5, Column: 10 }
  Function:        baz
  Hotness:         30
  Args:
    - Callee: foo
    - String:  will not be inlined into
    - Caller: baz
  ...
  --- !Missed
  Pass:            inline
  Name:            NotInlined
  DebugLoc:        { File: /tmp/s.c, Line: 5, Column: 18 }
  Function:        baz
  Hotness:         30
  Args:
    - Callee: bar
    - String:  will not be inlined into
    - Caller: baz
  ...

This is a summary of the high-level decisions:

* There is a new streaming interface to emit optimization remarks.
E.g. for the inliner remark above:

   ORE.emit(DiagnosticInfoOptimizationRemarkMissed(
                DEBUG_TYPE, "NotInlined", &I)
            << NV("Callee", Callee) << " will not be inlined into "
            << NV("Caller", CS.getCaller()) << setIsVerbose());

NV stands for named value and allows the YAML client to process a remark
using its name (NotInlined) and the named arguments (Callee and Caller)
without parsing the text of the message.

Subsequent patches will update ORE users to use the new streaming API.

* I am using YAML I/O for writing the YAML file.  YAML I/O requires you
to specify reading and writing at once but reading is highly non-trivial
for some of the more complex LLVM types.  Since it's not clear that we
(ever) want to use LLVM to parse this YAML file, the code supports and
asserts that we're writing only.

On the other hand, I did experiment that the class hierarchy starting at
DiagnosticInfoOptimizationBase can be mapped back from YAML generated
here (see D24479).

* The YAML stream is stored in the LLVM context.

* In the example, we can probably further specify the IR value used,
i.e. print "Function" rather than "Value".

* As before hotness is computed in the analysis pass instead of
DiganosticInfo.  This avoids the layering problem since BFI is in
Analysis while DiagnosticInfo is in IR.

[1] https://reviews.llvm.org/D19678#419445

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 20:55:07 +00:00
Reid Kleckner
a02ae2b916 [DebugInfo] Add comments to phi dbg.value tracking code, NFC
LLVM developers might be surprised to learn that there are blocks
without valid insertion points (catchswitch), so it seems worth calling
that out explicitly.  Also add a FIXME about what we should really be
doing if we ever need to make optimized Windows EH code debuggable.

While I'm here, make auto usage more consistent with LLVM standards and
avoid an unecessary call to insertBefore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 18:45:31 +00:00
Adam Nemet
2713e77a55 Revert "Output optimization remarks in YAML"
This reverts commit r282499.

The GCC bots are failing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 16:39:24 +00:00
Adam Nemet
3ecd7534da Output optimization remarks in YAML
This allows various presentation of this data using an external tool.
This was first recommended here[1].

As an example, consider this module:

  1 int foo();
  2 int bar();
  3
  4 int baz() {
  5   return foo() + bar();
  6 }

The inliner generates these missed-optimization remarks today (the
hotness information is pulled from PGO):

  remark: /tmp/s.c:5:10: foo will not be inlined into baz (hotness: 30)
  remark: /tmp/s.c:5:18: bar will not be inlined into baz (hotness: 30)

Now with -pass-remarks-output=<yaml-file>, we generate this YAML file:

  --- !Missed
  Pass:            inline
  Name:            NotInlined
  DebugLoc:        { File: /tmp/s.c, Line: 5, Column: 10 }
  Function:        baz
  Hotness:         30
  Args:
    - Callee: foo
    - String:  will not be inlined into
    - Caller: baz
  ...
  --- !Missed
  Pass:            inline
  Name:            NotInlined
  DebugLoc:        { File: /tmp/s.c, Line: 5, Column: 18 }
  Function:        baz
  Hotness:         30
  Args:
    - Callee: bar
    - String:  will not be inlined into
    - Caller: baz
  ...

This is a summary of the high-level decisions:

* There is a new streaming interface to emit optimization remarks.
E.g. for the inliner remark above:

   ORE.emit(DiagnosticInfoOptimizationRemarkMissed(
                DEBUG_TYPE, "NotInlined", &I)
            << NV("Callee", Callee) << " will not be inlined into "
            << NV("Caller", CS.getCaller()) << setIsVerbose());

NV stands for named value and allows the YAML client to process a remark
using its name (NotInlined) and the named arguments (Callee and Caller)
without parsing the text of the message.

Subsequent patches will update ORE users to use the new streaming API.

* I am using YAML I/O for writing the YAML file.  YAML I/O requires you
to specify reading and writing at once but reading is highly non-trivial
for some of the more complex LLVM types.  Since it's not clear that we
(ever) want to use LLVM to parse this YAML file, the code supports and
asserts that we're writing only.

On the other hand, I did experiment that the class hierarchy starting at
DiagnosticInfoOptimizationBase can be mapped back from YAML generated
here (see D24479).

* The YAML stream is stored in the LLVM context.

* In the example, we can probably further specify the IR value used,
i.e. print "Function" rather than "Value".

* As before hotness is computed in the analysis pass instead of
DiganosticInfo.  This avoids the layering problem since BFI is in
Analysis while DiagnosticInfo is in IR.

[1] https://reviews.llvm.org/D19678#419445

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 16:15:16 +00:00
Kostya Serebryany
30eb92316c [sanitizer-coverage] fix a bug in trace-gep
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282467 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 01:55:08 +00:00
Kostya Serebryany
dbadbd797d [sanitizer-coverage] don't emit the CTOR function if nothing has been instrumented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 01:08:33 +00:00
Ivan Krasin
cf66db4f99 Revert r277556. Add -lowertypetests-bitsets-level to control bitsets generation
Summary:
We don't currently need this facility for CFI. Disabling individual hot methods proved
to be a better strategy in Chrome.

Also, the design of the feature is suboptimal, as pointed out by Peter Collingbourne.

Reviewers: pcc

Subscribers: kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 00:29:53 +00:00
Peter Collingbourne
e07092b299 LowerTypeTests: Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 23:56:17 +00:00
Peter Collingbourne
5b66e90c52 LowerTypeTests: Create LowerTypeTestsModule class and move implementation there. Related simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 23:54:39 +00:00
Piotr Padlewski
fdf7354745 [thinlto] Basic thinlto fdo heuristic
Summary:
This patch improves thinlto importer
by importing 3x larger functions that are called from hot block.

I compared performance with the trunk on spec, and there
were about 2% on povray and 3.33% on milc. These results seems
to be consistant and match the results Teresa got with her simple
heuristic. Some benchmarks got slower but I think they are just
noisy (mcf, xalancbmki, omnetpp)- running the benchmarks again with
more iterations to confirm. Geomean of all benchmarks including the noisy ones
were about +0.02%.

I see much better improvement on google branch with Easwaran patch
for pgo callsite inlining (the inliner actually inline those big functions)
Over all I see +0.5% improvement, and I get +8.65% on povray.
So I guess we will see much bigger change when Easwaran patch will land
(it depends on new pass manager), but it is still worth putting this to trunk
before it.

Implementation details changes:
- Removed CallsiteCount.
- ProfileCount got replaced by Hotness
- hot-import-multiplier is set to 3.0 for now,
didn't have time to tune it up, but I see that we get most of the interesting
functions with 3, so there is no much performance difference with higher, and
binary size doesn't grow as much as with 10.0.

Reviewers: eraman, mehdi_amini, tejohnson

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 20:37:32 +00:00
Daniel Berlin
a50e80efdf Remove pruning of phi nodes in MemorySSA - it makes updating harder
Reviewers: george.burgess.iv

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 17:22:54 +00:00
Matthew Simpson
0749c8e439 [LV] Scalarize instructions marked scalar after vectorization
This patch ensures that we actually scalarize instructions marked scalar after
vectorization. Previously, such instructions may have been vectorized instead.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 17:08:37 +00:00
Gor Nishanov
8a7cd49d0b [Coroutines] Part14: Handle coroutines with no suspend points.
Summary:
If coroutine has no suspend points, remove heap allocation and turn a coroutine into a normal function.

Also, if a pattern is detected that coroutine resumes or destroys itself prior to coro.suspend call, turn the suspend point into a simple jump to resume or cleanup label. This pattern occurs when coroutines are used to propagate errors in functions that return expected<T>.

Reviewers: majnemer

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 15:49:28 +00:00
Alexey Bataev
34552649e8 [InstCombine] Fixed bug introduced in r282237
The index of the new insertelement instruction was evaluated in the
wrong way, it was considered as the index of the inserted value instead
of index of the position, where the value should be inserted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282401 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 13:18:59 +00:00