Commit Graph

142231 Commits

Author SHA1 Message Date
Yaxun Liu
4ebefd4b3e Attempt to fix llvm-readobj crash on ppc64 due to r289674
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 06:59:23 +00:00
Daniel Jasper
a7bd1c6059 Fix go bindings after r289702 (hopefully, don't really know how to build
them, build.sh seems to be broken).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 06:54:29 +00:00
Kostya Serebryany
abe2ee53b6 [libFuzzer] enable the failure-resistant merge by default (with trace-pc-guard only)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 06:21:21 +00:00
Dylan McKay
9a24ed6ddc [AVR] Whitelist the avrlit config environment variables
This allows us to use `lit` to run on-target execution tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 06:04:53 +00:00
Hal Finkel
d11334d8af Revert part of r289765 that is not necessary
CS.doesNotAccessMemory(ArgNo) and CS.onlyReadsMemory(ArgNo) calls
dataOperandHasImpliedAttr, so revert this part of r289765 because
it should not be necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 05:50:45 +00:00
Hal Finkel
954db62a26 Trying to fix NDEBUG build after r289764
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 05:33:19 +00:00
Hal Finkel
146bbc6051 Fix argument attribute queries with bundle operands
When iterating over data operands in AA, don't make argument-attribute-specific
queries on bundle operands. Trying to fix self hosting...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 05:09:15 +00:00
Sanjoy Das
d0f6642fb6 [MachineBlockPlacement] Don't make blocks "uneditable"
Summary:
This fixes an issue with MachineBlockPlacement due to a badly timed call
to `analyzeBranch` with `AllowModify` set to true.  The timeline is as
follows:

 1. `MachineBlockPlacement::maybeTailDuplicateBlock` calls
    `TailDup.shouldTailDuplicate` on its argument, which in turn calls
    `analyzeBranch` with `AllowModify` set to true.

 2. This `analyzeBranch` call edits the terminator sequence of the block
    based on the physical layout of the machine function, turning an
    unanalyzable non-fallthrough block to a unanalyzable fallthrough
    block.  Normally MBP bails out of rearranging such blocks, but this
    block was unanalyzable non-fallthrough (and thus rearrangeable) the
    first time MBP looked at it, and so it goes ahead and decides where
    it should be placed in the function.

 3. When placing this block MBP fails to analyze and thus update the
    block in keeping with the new physical layout.

Concretely, before (1) we have something like:

```
LBL0:
  < unknown terminator op that may branch to LBL1 >
  jmp LBL1

LBL1:
  ... A

LBL2:
  ... B
```

In (2), analyze branch simplifies this to

```
LBL0:
  < unknown terminator op that may branch to LBL2 >
  ;; jmp LBL1 <- redundant jump removed

LBL1:
  ... A

LBL2:
  ... B
```

In (3), MachineBlockPlacement goes ahead with its plan of putting LBL2
after the first block since that is profitable.

```
LBL0:
  < unknown terminator op that may branch to LBL2 >
  ;; jmp LBL1 <- redundant jump

LBL2:
  ... B

LBL1:
  ... A
```

and the program now has incorrect behavior (we no longer fall-through
from `LBL0` to `LBL1`) because MBP can no longer edit LBL0.

There are several possible solutions, but I went with removing the teeth
off of the `analyzeBranch` calls in TailDuplicator.  That makes thinking
about the result of these calls easier, and breaks nothing in the lit
test suite.

I've also added some bookkeeping to the MachineBlockPlacement pass and
used that to write an assert that would have caught this.

Reviewers: chandlerc, gberry, MatzeB, iteratee

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 05:08:57 +00:00
Craig Topper
d941d3f22f [AVX-512][InstCombine] Add masked scalar FMA intrinsics to SimplifyDemandedVectorElts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 03:49:45 +00:00
Hal Finkel
c441ca800c Fix iterator-invalidation issue
Inserting a new key into a DenseMap potentially invalidates iterators into that
map. Trying to fix an issue from r289755 triggering this assertion:

  Assertion `isHandleInSync() && "invalid iterator access!"' failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 03:30:40 +00:00
Hal Finkel
bffeba468d Remove the AssumptionCache
After r289755, the AssumptionCache is no longer needed. Variables affected by
assumptions are now found by using the new operand-bundle-based scheme. This
new scheme is more computationally efficient, and also we need much less
code...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 03:02:15 +00:00
Hal Finkel
fe647d2183 Make processing @llvm.assume more efficient by using operand bundles
There was an efficiency problem with how we processed @llvm.assume in
ValueTracking (and other places). The AssumptionCache tracked all of the
assumptions in a given function. In order to find assumptions relevant to
computing known bits, etc. we searched every assumption in the function. For
ValueTracking, that means that we did O(#assumes * #values) work in InstCombine
and other passes (with a constant factor that can be quite large because we'd
repeat this search at every level of recursion of the analysis).

Several of us discussed this situation at the last developers' meeting, and
this implements the discussed solution: Make the values that an assume might
affect operands of the assume itself. To avoid exposing this detail to
frontends and passes that need not worry about it, I've used the new
operand-bundle feature to add these extra call "operands" in a way that does
not affect the intrinsic's signature. I think this solution is relatively
clean. InstCombine adds these extra operands based on what ValueTracking, LVI,
etc. will need and then those passes need only search the users of the values
under consideration. This should fix the computational-complexity problem.

At this point, no passes depend on the AssumptionCache, and so I'll remove
that as a follow-up change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 02:53:42 +00:00
Eli Friedman
f378ca7f59 Add testcases for some shuffle bugs.
See https://llvm.org/bugs/show_bug.cgi?id=31301 and
https://llvm.org/bugs/show_bug.cgi?id=31364 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 01:47:15 +00:00
Nico Weber
30623ab7a7 Fix test/tools/lto/hide-linkonce-odr.ll after r289719
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 01:31:38 +00:00
Justin Lebar
652375a8cc [NVPTX] Remove dead #defines from NVPTXUtilities.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289747 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 00:45:06 +00:00
Joerg Sonnenberger
96f8539f4a Use PIC relocation model as default for PowerPC64 ELF.
Most of the PowerPC64 code generation for the ELF ABI is already PIC.
There are four main exceptions:
(1) Constant pointer arrays etc. should in writeable sections.
(2) The TOC restoration NOP after a call is needed for all global
symbols. While GNU ld has a workaround for questionable GCC self-calls,
we trigger the checks for calls from COMDAT sections as they cross input
sections and are therefore not considered self-calls. The current
decision is questionable and suboptimal, but outside the scope of the
change.
(3) TLS access can not use the initial-exec model.
(4) Jump tables should use relative addresses. Note that the current
encoding doesn't work for the large code model, but it is more compact
than the default for any non-trivial jump table. Improving this is again
beyond the scope of this change.

At least (1) and (3) are assumptions made in target-independent code and
introducing additional hooks is a bit messy. Testing with clang shows
that a -fPIC binary is 600KB smaller than the corresponding -fno-pic
build. Separate testing from improved jump table encodings would explain
only about 100KB or so. The rest is expected to be a result of more
aggressive immediate forming for -fno-pic, where the -fPIC binary just
uses TOC entries.

This change brings the LLVM output in line with the GCC output, other
PPC64 compilers like XLC on AIX are known to produce PIC by default
as well. The relocation model can still be provided explicitly, i.e.
when using MCJIT.

One test case for case (1) is included, other test cases with relocation
mode sensitive behavior are wired to static for now. They will be
reviewed and adjusted separately.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 00:01:53 +00:00
Justin Lebar
9a82bf2b11 [AMDGPU] Fix runtime-metadata.ll test so it doesn't leave an object file in the source tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 23:24:43 +00:00
Justin Lebar
8c54b40add [NVPTX] Remove dead code.
I've chosen to remove NVPTXInstrInfo::CanTailMerge but not
NVPTXInstrInfo::isLoadInstr and isStoreInstr (which are also dead)
because while the latter two are reasonably useful utilities, the former
cannot be used safely: It relies on successful address space inference
to identify writes to shared memory, but addrspace inference is a
best-effort thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 23:20:40 +00:00
Sanjay Patel
61cd9ae50b [DAG] allow more select folding for targets that have 'and not' (PR31175)
The original motivation for this patch comes from wanting to canonicalize 
more IR to selects and also canonicalizing min/max.

If we're going to do that, we need more backend fixups to undo select codegen 
when simpler ops will do. I chose AArch64 for the tests because that shows the
difference in the simplest way. This should fix:
https://llvm.org/bugs/show_bug.cgi?id=31175

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289738 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:59:14 +00:00
Davide Italiano
c545336a42 [gold] Add datalayout to two tests where it was missing.
Reported by: thakis via chromium bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:53:43 +00:00
Eugene Zelenko
b213c3c6a8 [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:50:46 +00:00
Greg Clayton
c64f919f1c Add the ability to get attribute values as Optional<T>
When getting attributes it is sometimes nicer to use Optional<T> some of the time instead of magic values. I tried to cut over to only using the Optional values but it made many of the call sites very messy, so it makes sense the leave in the calls that can return a default value. Otherwise code that looks like this:

uint64_t CallColumn = Die.getAttributeValueAsAddress(DW_AT_call_line, 0);

Has to be turned into:

uint64_t CallColumn = 0;
if (auto CallColumnValue = Die.getAttributeValueAsAddress(DW_AT_call_line))
    CallColumn = *CallColumnValue;

The first snippet of code looks much better. But in cases where you want an offset that may or may not be there, the following code looks better:

if (auto StmtOffset = Die.getAttributeValueAsSectionOffset(DW_AT_stmt_list)) {
  // Use StmtOffset
}

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:38:08 +00:00
Justin Lebar
1df9c48f11 Whitespace cleanup in test/CodeGen/NVPTX/annotations.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289730 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:32:55 +00:00
Justin Lebar
2eea31ff42 [NVPTX] Support .maxnreg annotation.
Reviewers: tra

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:32:50 +00:00
Justin Lebar
55f2c14d62 [NVPTX] Remove string constants from NVPTXBaseInfo.h.
Summary:
Previously they were defined as a 2D char array in a header file.  This
is kind of overkill -- we can let the linker lay out these strings
however it pleases.  While we're at it, we might as well just inline
these constants where they're used, as each of them is used only once.

Also move NVPTXUtilities.{h,cpp} into namespace llvm.

Reviewers: tra

Subscribers: jholewinski, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:32:44 +00:00
Peter Collingbourne
f87c88ec75 LibDriver: Reject inputs that are not COFF objects or bitcode files.
Fixes PR31372.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:19:22 +00:00
Dehao Chen
ca0bb7af02 Only sets profile summary when it was not preset.
Summary: SampleProfileLoader pass may be invoked twice by LTO. The 2nd pass should not append more summary info as it is already preset by the 1st pass.

Reviewers: eraman, davidxl

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:06:49 +00:00
Dehao Chen
f6343833ce Fix the bug in r289714 (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 22:03:08 +00:00
Jan Sjodin
23ae494f90 Revert revision 289721.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:58:42 +00:00
Jan Sjodin
e0b8411b0d Dummy commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289721 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:57:18 +00:00
Davide Italiano
20cda1c383 [LTO] Add the missing datalayout in a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:57:14 +00:00
Davide Italiano
6b673b85ed [LTO] Reject modules without datalayout.
Also, udpate the ~60 failing tests in the tree which did
not contain a valid datalayout.
This fixes PR31123. lld will be updated in a following patch,
immediately after this is committed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:57:04 +00:00
Filipe Cabecinhas
62776a860a [asan] Don't skip instrumentation of masked load/store unless we've seen a full load/store on that pointer.
Reviewers: kcc, RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:57:04 +00:00
Filipe Cabecinhas
9475769a1f [asan] Hook ClInstrumentWrites and ClInstrumentReads to masked operation instrumentation.
Reviewers: kcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:56:59 +00:00
Dehao Chen
932f24fa52 Create SampleProfileLoader pass in llvm instead of clang
Summary: We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO unable to add this pass in the linker plugin. This patch moves the SampleProfileLoader pass creation from clang to llvm pass manager builder.

Reviewers: tejohnson, davidxl, dnovillo

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289714 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:40:47 +00:00
Eli Friedman
85e1264a86 [ARM] Split 128-bit vectors in BUILD_VECTOR lowering
Given that INSERT_VECTOR_ELT operates on D registers anyway, combining
64-bit vectors into a 128-bit vector is basically free. Therefore, try
to split BUILD_VECTOR nodes before giving up and lowering them to a series
of INSERT_VECTOR_ELT instructions. Sometimes this allows dramatically
better lowerings; see testcases for examples. Inspired by similar code
in the x86 backend for AVX.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 20:44:38 +00:00
Nico Weber
10b1aaae5f fix gcc warning about a superfluous ;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 20:33:54 +00:00
Robert Lougher
133b0bceea [InstCombine] Folding of a compare with RHS const should merge debug locations
If all the operands to a phi node are compares that have a RHS constant,
instcombine will try to pull them through the phi node, combining them into
a single operation. When it does this, the debug location of the new op
should be the merged debug locations of the phi node arguments.

Patch 8 of 8 for D26256.  Folding of a compare that has a RHS constant.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289704 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 20:27:22 +00:00
Eli Friedman
c023f9db3f [ARM] Add ARMISD::VLD1DUP to match vld1_dup more consistently.
Currently, there are substantial problems forming vld1_dup even if the
VDUP survives legalization. The lack of an actual node
leads to terrible results: not only can we not form post-increment vld1_dup
instructions, but we form scalar pre-increment and post-increment
loads which force the loaded value into a GPR. This patch fixes that
by combining the vdup+load into an ARMISD node before DAGCombine
messes it up.

Also includes a crash fix for vld2_dup (see testcase @vld2dupi8_postinc_variable).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 20:25:26 +00:00
Amjad Aboud
faaafe58c6 [DebugInfo] Changed DIBuilder::createCompileUnit() to take DIFile instead of FileName and Directory.
This way it will be easier to expand DIFile (e.g., to contain checksum) without the need to modify the createCompileUnit() API.

Reviewers: llvm-commits, rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 20:24:54 +00:00
Yaxun Liu
f55e8a13d7 Fix build failure due to r289674 on certain systems
Removed a useless include which caused conflict.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 20:17:47 +00:00
Robert Lougher
caba5d3de2 [InstCombine] Folding of a binop with RHS const should merge the debug locations
If all the operands to a phi node are a binop with a RHS constant, instcombine
will try to pull them through the phi node, combining them into a single
operation. When it does this, the debug location of the new op should be the
merged debug locations of the phi node arguments.

Patch 7 of 8 for D26256.  Folding of a binop with RHS constant.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289699 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 20:07:49 +00:00
David Blaikie
6cd8528a2d DebugInfo: Improve type safety and simplify some subprogram finalization code
This probably ended up this way aften the subprogram<>function link
inversion and debug info metadata schema changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 19:38:39 +00:00
Geoff Berry
fb953956ab [GVNHoist] Move GVNHoist to function simplification part of pipeline.
Summary:
Move GVNHoist to later in the optimization pipeline, specifically, to
the function simplification part of the pipeline.  The new pipeline
location allows GVNHoist to run on a function after its callees have
been inlined but before the function has been considered for inlining
into its callers, exposing more opportunities for hoisting.

Performance results on AArch64 kryo:
Improvements:
  Benchmarks/CoyoteBench/fftbench  -24.952%
  spec2006/bzip2                    -4.071%
  internal bmark                    -3.177%
  Benchmarks/PAQ8p/paq8p            -1.754%
  spec2000/perlbmk                  -1.328%
  spec2006/h264ref                  -1.140%

Regressions:
  internal bmark                    +1.818%
  Benchmarks/mafft/pairlocalalign   +1.084%

Reviewers: sebpop, dberlin, hiraditya

Subscribers: aemerson, mehdi_amini, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 19:38:22 +00:00
Andrew Kaylor
577bb06589 [WinEH] Avoid holding references to BlockColor (DenseMap) entries while inserting new elements
Differential Revision: https://reviews.llvm.org/D27693



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 19:30:18 +00:00
Robert Lougher
1f177f4a3f [InstCombine] When folding casts through a phi node merge the debug locations
If all the operands to a phi node are a cast, instcombine will try to pull
them through the phi node, combining them into a single cast. When it does
this, the debug location of the new cast should be the merged debug locations
of the phi node arguments.

Patch 6 of 8 for D26256.  Folding of a cast operation.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289693 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 19:24:01 +00:00
Sean Callanan
8846ccb084 Include <cstdarg> in PrettyStackTrace.cpp, fixing the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289691 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 19:19:53 +00:00
Sean Callanan
9ce84d2db8 Prepare PrettyStackTrace for LLDB adoption
This patch fixes the linkage for __crashtracer_info__, making it have the proper mangling (extern "C") and linkage (private extern).
It also adds a new PrettyStackTrace type, allowing LLDB to adopt this instead of Host::SetCrashDescriptionWithFormat().

Without this patch, CrashTracer on macOS won't pick up pretty stack traces from any LLVM client. 
An LLDB commit adopting this API will follow shortly.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 19:09:43 +00:00
Robert Lougher
5bf7eb503f [InstCombine] Folding loads through a phi node should merge the debug locations
If all the operands to a phi node are a load, instcombine will try to pull
them through the phi node, combining them into a single load. When it does
this, the debug location of the new load should be the merged debug locations
of the phi node arguments.

Patch 5 of 8 for D26256.  Folding of a load operation.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 19:02:14 +00:00
Robert Lougher
15e919d001 [InstCombine] When folding GEP through a phi node merge the debug locations
If all the operands to a phi node are getelementptr, instcombine
will try to pull them through the phi node, combining them into a single
operation.  When it does this, the debug location of the new getelementptr
should be the merged debug locations of the phi node arguments.

Patch 4 of 8 for D26256.  Folding of a getelementptr operation.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 18:37:50 +00:00