Commit Graph

27543 Commits

Author SHA1 Message Date
Xinliang David Li
a4cc7ae52a Remove runtime specific code from common header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-13 00:23:49 +00:00
Reid Kleckner
30e317fc1e [codeview] Try to handle errors better in record iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 23:26:23 +00:00
Chris Bieneman
78a47bd1b4 [MachO] Extract MachO load command enums into a def file
Having the MachO enums in a def file instead of inline will allow us to write utilities and encoding/decoding methods for load commands without having to write a lot of mechanically repeated code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 23:18:31 +00:00
Reid Kleckner
2eea1812c8 [codeview] Fix dumping VFTables, stop when we see LF_PAD*
Also stop visiting type records when we encounter an error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 22:46:41 +00:00
Chandler Carruth
b6b8f76650 [PM] Port of the DepndenceAnalysis to the new PM.
Ported DA to the new PM by splitting the former DependenceAnalysis Pass
into a DependenceInfo result type and DependenceAnalysisWrapperPass type
and adding a new PM-style DependenceAnalysis analysis pass returning the
DependenceInfo.

Patch by Philip Pfaffe, most of the review by Justin.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 22:19:39 +00:00
Tom Stellard
c37b54dfc5 Revert "LiveIntervalAnalysis: Rework constructMainRangeFromSubranges()"
This reverts commit r269016 and also the follow-up commit r269020.

This patch caused PR27705.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 20:27:40 +00:00
Chris Bieneman
d6f6aaf5e7 [yaml2macho] Handle mach_header_64 reserved field
I've added the reserved field as an "optional" in YAML, but I've added asserts in the yaml2macho code to enforce that the field is present in mach_header_64, but not in mach_header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 18:21:09 +00:00
Zachary Turner
c86d47d6a3 Get rid of CVLeafTypes.def and combine with TypeRecords.def
This merges the functionality of the macros in `CVLeafTypes.def` and the
macros in `TypeRecords.def` into a single set of macros.

Differential Revision: http://reviews.llvm.org/D20190
Reviewed By: rnk, amccarth

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:45:51 +00:00
Zachary Turner
4f4637e6d1 Make CodeView record serialization more generic.
This introduces a variadic template and some helper macros to
safely and correctly deserialize many types of common record
fields while maintaining error checking.

Differential Revision: http://reviews.llvm.org/D20183
Reviewed By: rnk, amccarth

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:45:44 +00:00
Chris Bieneman
dfa9a6bd95 [obj2yaml] Include all mach_header fields in yaml
Since we want to be able to use yaml to describe degenerate object files as well as valid ones, we need to be explicit of some fields in your yaml definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 17:44:43 +00:00
Chris Bieneman
7455ed8edf [ObjectYAML] Support Thin MachO headers to YAML
This patch adds support to ObjectYAML for serializing mach_header structs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 16:04:16 +00:00
Xinliang David Li
b7f191181c [profile] profile writing cleanup
Do not precompute value counts for all sites. This 
eliminates one more use of dynamic allocation 
in profiler writer.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 23:21:12 +00:00
Xinliang David Li
b723fcf640 cleanup: do not recompute size for preallocated buffer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 21:17:10 +00:00
Justin Bogner
e819b3304b SDAG: Add a helper to replace and remove a node during ISel
It's very common to want to replace a node and then remove it since
it's dead, especially as we port backends from the SDNode *Select API
to the void Select one. This helper makes this sequence a bit less
verbose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 21:13:17 +00:00
Sanjay Patel
678ba5a117 fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 20:10:33 +00:00
Vedant Kumar
6d6b3df09a [ProfileData] Use SoftInstrProfErrors to count soft errors, NFC
Differential Revision: http://reviews.llvm.org/D20082

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 19:42:19 +00:00
Rafael Espindola
e973d3f2ce Return a StringRef from getSection.
This is similar to how getName is handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 18:21:59 +00:00
Zachary Turner
f76064565f Refactor CodeView type records to use common code.
Differential Revision: http://reviews.llvm.org/D20138
Reviewed By: rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 17:47:35 +00:00
Filipe Cabecinhas
3e915294ae [NFC] Remove some dead code:
DbgInfoIntrinsic::StripCast() is dead since r79977
The only function that creates Comdat objects seems to be in Module, and always creates them using the default constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 16:38:40 +00:00
Artur Pilipenko
f20a7ef4cf NFC. Introduce Value::isPointerDereferenceable
Extract a part of isDereferenceableAndAlignedPointer functionality to Value:
    
Reviewed By: hfinkel, sanjoy
    
Differential Revision: http://reviews.llvm.org/D17611


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 14:43:28 +00:00
Rafael Espindola
06d92089dd Refactor duplicated check for valid declaration linkage. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 13:51:39 +00:00
Rafael Espindola
4ff35c4e0f Delete mayBeOverridden.
It is the same as isInterposable which seems to be the preferred name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 01:26:06 +00:00
Easwaran Raman
d56f6d6de3 Revert r269131
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 23:26:04 +00:00
Justin Bogner
182dac04e5 SDAG: Make SelectCodeCommon return void
This means SelectCode unconditionally returns nullptr now. I'll follow
up with a change to make that return void as well, but it seems best
to keep that one very mechanical.

This is part of the work to have Select return void instead of an
SDNode *, which is in turn part of llvm.org/pr26808.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 22:58:26 +00:00
Easwaran Raman
79f2742cf7 Reapply r266477 and r266488
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 22:03:23 +00:00
Xinliang David Li
e052ee9da4 [PM]: port IR based profUse pass to new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 21:59:52 +00:00
Peter Collingbourne
2b9c136346 Cloning: Clean up the interface to the CloneFunction function.
Remove the ModuleLevelChanges argument, and the ability to create new
subprograms for cloned functions. The latter was added without review in
r203662, but it has no in-tree clients (all non-test callers pass false
for ModuleLevelChanges [1], so it isn't reachable outside of tests). It
also isn't clear that adding a duplicate subprogram to the compile unit is
always the right thing to do when cloning a function within a module. If
this functionality comes back it should be accompanied with a more concrete
use case.

Furthermore, all in-tree clients add the returned function to the module.
Since that's pretty much the only sensible thing you can do with the function,
just do that in CloneFunction.

[1] http://llvm-cs.pcc.me.uk/lib/Transforms/Utils/CloneFunction.cpp/rCloneFunction

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269110 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 20:23:24 +00:00
Peter Collingbourne
aa07a976c3 Re-apply r269081 and r269082 with a fix for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 18:07:21 +00:00
Peter Collingbourne
b6f6e4455c Revert r269081 and r269082 while I try to find the right incantation to fix MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 17:54:43 +00:00
Peter Collingbourne
e7feafb873 Use doxygen style comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269082 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 17:35:30 +00:00
Peter Collingbourne
190db6acaa WholeProgramDevirt: Move logic for finding devirtualizable call sites to Analysis.
The plan is to eventually make this logic simpler, however I expect it to
be a little tricky for the foreseeable future (at least until we're rid of
pointee types), so move it here so that it can be reused to build a summary
index for devirtualization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269081 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 17:34:21 +00:00
Marcin Koscielnicki
9100579a4f [PR27599] [SystemZ] [SelectionDAG] Fix extension of atomic cmpxchg result.
Currently, SelectionDAG assumes 8/16-bit cmpxchg returns either a sign
extended result, or a zero extended result.  SystemZ takes a third
option by returning junk in the high bits (rotated contents of the other
bytes in the memory word).  In that case, don't use Assert*ext, and
zero-extend the result ourselves if a comparison is needed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 16:49:04 +00:00
Teresa Johnson
4b05ce2d0d [ThinLTO] Add option to emit imports files for distributed backends
Summary:
Add support for emission of plaintext lists of the imported files for
each distributed backend compilation. Used for distributed build file
staging.

Invoked with new gold-plugin thinlto-emit-imports-files option, which is
only valid with thinlto-index-only (i.e. for distributed builds), or
from llvm-lto with new -thinlto-action=emitimports value.

Depends on D19556.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269067 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 15:54:09 +00:00
Teresa Johnson
27af205ce1 Restore "[ThinLTO] Emit individual index files for distributed backends"
This restores commit r268627:
    Summary:
    When launching ThinLTO backends in a distributed build (currently
    supported in gold via the thinlto-index-only plugin option), emit
    an individual index file for each backend process as described here:
    http://lists.llvm.org/pipermail/llvm-dev/2016-April/098272.html

    ...

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

Address msan failures by avoiding std::prev on map.end(), the
theory is that this is causing issues due to some known UB problems
in __tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269059 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 13:48:23 +00:00
Daniel Sanders
dd9958f08f Clarify the difference between ISD::BITCAST and the bitcast instruction from LLVM-IR.
Subscribers: llvm-commits, hfinkel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 09:01:54 +00:00
Jonas Paulsson
32db7c31b2 [foldMemoryOperand()] Pass LiveIntervals to enable liveness check.
SystemZ (and probably other targets as well) can fold a memory operand
by changing the opcode into a new instruction that as a side-effect
also clobbers the CC-reg.

In order to do this, liveness of that reg must first be checked. When
LIS is passed, getRegUnit() can be called on it and the right
LiveRange is computed on demand.

Reviewed by Matthias Braun.
http://reviews.llvm.org/D19861

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 08:09:37 +00:00
Elena Demikhovsky
b6e58d8bd0 [LoopVectorize] Handling induction variable with non-constant step.
Allow vectorization when the step is a loop-invariant variable.
This is the loop example that is getting vectorized after the patch:

 int int_inc;
 int bar(int init, int *restrict A, int N) {

  int x = init;
  for (int i=0;i<N;i++){
    A[i] = x;
    x += int_inc;
  }
  return x;
 }

"x" is an induction variable with *loop-invariant* step.
But it is not a primary induction. Primary induction variable with non-constant step is not handled yet.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 07:33:35 +00:00
Denis Zobnin
f459cb2831 [LAA] Rename "isStridedPtr" with "getPtrStride". NFC.
Changing misleading function name was approved in http://reviews.llvm.org/D17268.
Patch by Roman Shirokiy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 05:55:16 +00:00
Matthias Braun
e607e01664 LiveIntervalAnalysis: Rework constructMainRangeFromSubranges()
We now use LiveRangeCalc::extendToUses() instead of a specially designed
algorithm in constructMainRangeFromSubranges():
- The original motivation for constructMainRangeFromSubranges() were
  differences between the main liverange and subranges because of hidden
  dead definitions. This case however cannot happen anymore with the
  DetectDeadLaneMasks pass in place.
- It simplifies the code.
- This fixes a longstanding bug where we did not properly create new SSA
  values on merging control flow (the MachineVerifier missed most of
  these cases).
- Move constructMainRangeFromSubranges() to LiveIntervalAnalysis and
  LiveRangeCalc to better match the implementation/available helper
  functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 04:51:14 +00:00
Matthias Braun
6a6190de10 CodeGen: Move TargetPassConfig from Passes.h to an own header; NFC
Many files include Passes.h but only a fraction needs to know about the
TargetPassConfig class. Move it into an own header. Also rename
Passes.cpp to TargetPassConfig.cpp while we are at it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 03:21:59 +00:00
Matthias Braun
bbeb3ea1ff llc: Rework -run-pass option
We now construct a custom pass pipeline instead of injecting
start-before/stop-after into the default pipeline construction. This
allows to specify any pass known to the pass registry. Previously
specifying indirectly added analysis passes or passes not added to the
pipeline add all would not be added and we would silently do nothing.

This also restricts the -run-pass option to cases with .mir input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 01:32:44 +00:00
Matthias Braun
bf765dfe21 LLVMTargetMachine: Add functions to create MIModuleInfo/MIFunction; NFC
Add convenience function to create MachineModuleInfo and
MachineFunctionAnalysis passes and add them to a pass manager.

Despite factoring out some shared code in
LiveIntervalTest/LLVMTargetMachine this will be used by my upcoming llc
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 01:32:40 +00:00
Evgeniy Stepanov
d3d318a084 Don't inline functions with different SafeStack attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:33:07 +00:00
Sanjoy Das
cbda428c36 [SCEV] Use guards to prove predicates
We can use calls to @llvm.experimental.guard to prove predicates,
relying on the fact that in all locations domianted by a call to
@llvm.experimental.guard the predicate it is guarding is known to be
true.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:31:49 +00:00
Justin Lebar
e598f97f6c [nvvm] Mark ldu and ldg intrinsics as IntrArgMemOnly.
Summary:
Previously these intrinsics were marked as can-read any memory address.
Now they're marked as reading only the pointer they're passed.

Reviewers: rnk

Subscribers: jholewinski, llvm-commits, tra

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268996 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:31:25 +00:00
Justin Lebar
493ba428f1 [NVVM] Add comments to NVVM intrinsics listing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 00:31:20 +00:00
Eugene Zelenko
3d09da3538 Fix some Clang-tidy modernize-deprecated-headers and Include What You Use warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D20042


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 23:11:38 +00:00
Xinliang David Li
05e004f012 Cleanup followup of r268710 - [PM] port IR based PGO prof-gen pass to new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 21:37:12 +00:00
Adrian Prantl
f68fb38629 Separate the Verifier into an analysis and a transformation pass and
allow the transformation to strip invalid debug info.

This patch separates the Verifier into an analysis and a transformation
pass, with the transformation pass optionally stripping malformed
debug info.

The problem I'm trying to solve with this sequence of patches is that
historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about
breaking bitcode compatibility with existing producers. For example, we
don't necessarily want IR produced by an older version of clang to be
rejected by an LTO link just because of malformed debug info, and rather
provide an option to strip it. Note that merely outdated (but well-formed)
debug info would continue to be auto-upgraded in this scenario.

http://reviews.llvm.org/D19988
rdar://problem/25818489

This reapplies r268937 without modifications.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:57:29 +00:00
Adrian Prantl
b6708cf087 Allow the LTO code generator to strip invalid debug info from the input.
This patch introduces a new option -lto-strip-invalid-debug-info, which
drops malformed debug info from the input.

The problem I'm trying to solve with this sequence of patches is that
historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about
breaking bitcode compatibility with existing producers. For example, we
don't necessarily want IR produced by an older version of clang to be
rejected by an LTO link just because of malformed debug info, and rather
provide an option to strip it. Note that merely outdated (but well-formed)
debug info would continue to be auto-upgraded in this scenario.

rdar://problem/25818489
http://reviews.llvm.org/D19987

This reapplies 268936 with a test case fix for Linux (-exported-symbol foo)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 19:57:15 +00:00
Benjamin Kramer
6bb23fcbb9 Unbreak the non-windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 18:05:28 +00:00
Zachary Turner
a95bc25b20 [pdb] Parse the module info stream for each module.
Differential Revision: http://reviews.llvm.org/D20026
Reviewed By: rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:45:21 +00:00
Zachary Turner
5c1193559a Make TypeIterator generic so it can iterate symbols too.
Reviewed By: amccarth
Differential Revision: http://reviews.llvm.org/D20038

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:44:58 +00:00
Adrian Prantl
cfd85505ad Revert "Allow the LTO code generator to strip invalid debug info from the input."
This reverts commit 268936 while investigating buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:43:30 +00:00
Adrian Prantl
0a3572607f Revert "Separate the Verifier into an analysis and a transformation pass and"
This reverts commit 268937 while investigating build bot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:43:24 +00:00
Adrian Prantl
6d99a3d56e Separate the Verifier into an analysis and a transformation pass and
allow the transformation to strip invalid debug info.

This patch separates the Verifier into an analysis and a transformation
pass, with the transformation pass optionally stripping malformed
debug info.

The problem I'm trying to solve with this sequence of patches is that
historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about
breaking bitcode compatibility with existing producers. For example, we
don't necessarily want IR produced by an older version of clang to be
rejected by an LTO link just because of malformed debug info, and rather
provide an option to strip it. Note that merely outdated (but well-formed)
debug info would continue to be auto-upgraded in this scenario.

http://reviews.llvm.org/D19988
rdar://problem/25818489

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:37:42 +00:00
Adrian Prantl
9860b93e07 Allow the LTO code generator to strip invalid debug info from the input.
This patch introduces a new option -lto-strip-invalid-debug-info, which
drops malformed debug info from the input.

The problem I'm trying to solve with this sequence of patches is that
historically we've done a really bad job at verifying debug info. We want
to be able to make the verifier stricter without having to worry about
breaking bitcode compatibility with existing producers. For example, we
don't necessarily want IR produced by an older version of clang to be
rejected by an LTO link just because of malformed debug info, and rather
provide an option to strip it. Note that merely outdated (but well-formed)
debug info would continue to be auto-upgraded in this scenario.

rdar://problem/25818489
http://reviews.llvm.org/D19987

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 17:37:33 +00:00
Sanjay Patel
98959b5434 [TargetLowering] make helper function for SetCC + and optimizations (NFC)
After looking at D19087 again, it occurred to me that we can do better. If we consolidate
the valueHasExactlyOneBitSet() transforms, we won't incur extra overhead from calling it a
2nd time, and we can shrink SimplifySetCC() a bit. No functional change intended.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 16:42:50 +00:00
Rafael Espindola
0c06716f89 Fix bug where temporary file would be left behind every time an archive was updated.
When updating an existing archive, llvm-ar opens the old archive into a
`MemoryBuffer`, does its thing, and writes the results to a temporary
file. That file is then renamed to the original archive filename, thus
replacing it with the updated contents. However, on Windows at least,
what would happen is that the `MemoryBuffer` for the old archive would
actually be an mmap'ed view of the file, so when it came time to do the
rename via Win32's `ReplaceFile`, it would succeed but would be unable
to fully replace the file since there would still be a handle open on
it; instead, the old version got renamed to a random temporary name and
left behind.

Patch by Cameron!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 13:31:11 +00:00
Craig Topper
63eccc2eca [AVX512] Fix up types for arguments of int_x86_avx512_mask_cvtsd2ss_round and int_x86_avx512_mask_cvtss2sd_round. Only the argument being converted should be a different type. The other 2 argument should have the same type as the result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 05:34:12 +00:00
Mehdi Amini
437f2fc22e ThinLTOCodeGenerator: ignore 0 values for the cache settings.
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 05:16:30 +00:00
Bruno Cardoso Lopes
2b1f6c23bc [Bitcode] Fix an unsigned integer overflow while parsing bitcode wrapper header
Specially crafted bitcode wrapper headers can cause unsigned interger
overflow and lead to crashes when wrapping around. Fix the offset check
and avoid such scenarios.

Writing a testcase for this would involve editing the binary to generate
values that trigger the overflow, since this would never happen while
generating the bitcode in regular compilation flows, so there's
currently no feasible way add one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-08 21:27:39 +00:00
Sanjay Patel
2f183e0a89 [x86, BMI] add TLI hook for 'andn' and use it to simplify comparisons
For the sake of minimalism, this patch is x86 only, but I think that at least
PPC, ARM, AArch64, and Sparc probably want to do this too.

We might want to generalize the hook and pattern recognition for a target like
PPC that has a full assortment of negated logic ops (orc, nand).

Note that http://reviews.llvm.org/D18842 will cause this transform to trigger
more often.

For reference, this relates to:
https://llvm.org/bugs/show_bug.cgi?id=27105
https://llvm.org/bugs/show_bug.cgi?id=27202
https://llvm.org/bugs/show_bug.cgi?id=27203
https://llvm.org/bugs/show_bug.cgi?id=27328

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 15:03:40 +00:00
NAKAMURA Takumi
074a68d30b ErrorInfoBase::message(): Don't use raw_string_ostream's buffer, Msg, before closing. Use raw_string_ostream::str() to flush the buffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 08:43:11 +00:00
Xinliang David Li
f05d4a7577 [PM] code refactoring -- preparation for new PM porting /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 05:39:12 +00:00
Lang Hames
c14b8e9703 [Orc] Rename OrcArchitectureSupport to OrcABISupport and add Win32 ABI support.
This enables lazy JITing on Windows x86-64.

Patch by David. Thanks David!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 03:36:38 +00:00
Zachary Turner
b7d84117e3 Make llvm-pdbdump print CV type records
This reuses the CVTypeDumper from libcodeview to dump full
information about type records within a PDB file.

Differential Revision: http://reviews.llvm.org/D20022
Reviewed By: rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 22:15:42 +00:00
Zachary Turner
fdb6da3015 Port DebugInfoPDB over to using llvm::Error.
Differential Revision: http://reviews.llvm.org/D19940
Reviewed By: rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 20:51:57 +00:00
Kevin Enderby
eaa1f084ce Change GenericBinaryError to no longer include a FileName, which is then not
part of the error message.

As the caller is the one that needs to add the name of where the "object file"
comes from to the error message as the object file could be in an archive, or
coming from a slice of a Mach-O universal file or a buffer created by a JIT.

In the cases of a Mach-O universal file the architecture name may or may not
also need to be printed which is up to the tool code.  For example if the tool
code is only selecting the host architecture slice then that architecture name
is never printed.

This patch is the change to the libObject code and there will be follow on
commits for changes to the code for each tool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 20:16:28 +00:00
Daniel Sanders
134705a273 [mips] Correct the ordering of HI/LO pairs in the relocation table.
Summary:
There seems to have been a misunderstanding as to the meaning of 'offset' in
the rules laid down by our ABI. The previous code believed that 'offset' meant
the offset within the section that the relocation is applied to. However, it
should have meant the offset from the symbol used in the relocation expression.

This patch adds two fields to ELFRelocationEntry and uses them to correct the
order of relocations for MIPS. These fields contain:
* The original symbol before shouldRelocateWithSymbol() is considered. This
  ensures that R_MIPS_GOT16 is able to correctly distinguish between local and
  external symbols, allowing us to tell whether %got() requires a matching
  %lo() or not (local symbols require one, external symbols don't). It also
  prevents confusing cases where the fuzzy matching rules cause things like
  %hi(foo)/%lo(foo+3) and %hi(bar)/%lo(bar+1) to swap their %lo()'s.
* The original offset before shouldRelocateWithSymbol() is considered. The
  existing Addend field is always zero when the object uses in place addends
  (because it's already moved it to the encoding) but MIPS needs to use the
  original offset to ensure that the linker correctly calculates the carry-in
  bit for %hi() and %got().

IAS ensures that unmatchable %hi()/%got() relocations are placed at the end of
the table to ensure that the linker rejects the table (we're unable to report
such errors directly). The alternatives to this risk accidental matching
against inappropriate relocations which may silently compute incorrect values
due to an incorrect carry bit between the %lo() and %hi()/%got().

Reviewers: sdardis

Subscribers: dsanders, sdardis, rafael, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 13:49:25 +00:00
Sam Kolton
f117ec1a64 [TableGen] AsmMatcher: support for default values for optional operands
Summary:
This change allows to specify "DefaultMethod" for optional operand (IsOptional = 1) in AsmOperandClass that return default value for operand. This is used in convertToMCInst to set default values in MCInst.
Previously if you wanted to set default value for operand you had to create custom converter method. With this change it is possible to use standard converters even when optional operands presented.

Reviewers: tstellarAMD, ab, craig.topper

Subscribers: jyknight, dsanders, arsenm, nhaustov, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 11:31:17 +00:00
Silviu Baranga
9e112408b2 Attempt to fix the modules builder by declaring SCEV in LoopUtils.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 09:37:14 +00:00
Nikolay Haustov
ac1dd296bc AMDGPU/SI: Add amdgpu_kernel calling convention. Part 1.
Summary:
This will be used for AMDGPU_HSA_KERNEL symbol type in output ELF.

Also, in the future unused non-kernels may be optimized.

For now, also accept SPIR_KERNEL for HCC frontend.

Also, add bitcode compatibility tests for missing calling conventions
except AVR_BUILTIN which doesn't have parse code.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, joker.eph, llvm-commits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 09:07:29 +00:00
Mehdi Amini
d4ecd0d79c ThinLTO: fix assertion and refactor check for hidden use from inline ASM in a helper function
This test was crashing, and currently it breaks bootstrapping clang with debuginfo

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 08:25:33 +00:00
Xinliang David Li
ea2fb7d1dd [PM] port IR based PGO prof-gen pass to new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 05:49:19 +00:00
Xinliang David Li
ccd9cbbd34 [profile] Remove another unneeded field in raw profile reader
DataValueSize is now removed. The change is consolidated
with previous raw version bump.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 02:13:00 +00:00
Xinliang David Li
de6dd3b952 document version change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 01:41:24 +00:00
Rui Ueyama
ecc2a1e20c Make StringTableBuilder to cache hash values.
This change seems to speed up LLD a bit if it has a lot of mergeable
sections. The number is below. It's not too bad for a small patch.

Time to link Clang (debug build):

w/o patch 6.3696 seconds
w/patch   6.2746 seconds (-1.5%)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 00:51:58 +00:00
Justin Bogner
9ed38db20e SDAG: Rename Select->SelectImpl and repurpose Select as returning void
This is a step towards removing the rampant undefined behaviour in
SelectionDAG, which is a part of llvm.org/PR26808.

We rename SelectionDAGISel::Select to SelectImpl and update targets to
match, and then change Select to return void and consolidate the
sketchy behaviour we're trying to get away from there.

Next, we'll update backends to implement `void Select(...)` instead of
SelectImpl and eventually drop the base Select implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268693 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 23:19:08 +00:00
Justin Bogner
5f2e6ee2b7 SDAG: Remove OPC_MarkGlueResults and associated logic. NFC
This opcode never happens in practice, and yet the logic we have in
place to handle it would be undefined behaviour if we ever executed
it. Remove it rather than trying to refactor code that's never
reached.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 22:37:45 +00:00
Eugene Zelenko
8e8ab733c6 Fix some Clang-tidy readability-simplify-boolean-expr and Include What You Use warnings.
Differential revision: reviews.llvm.org/D19946


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268689 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 21:35:47 +00:00
Xinliang David Li
da713ca23f [PM] port Branch Frequency Analaysis pass to new PM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 21:13:27 +00:00
Davide Italiano
2d1483c124 [PM] Port Interprocedural SCCP to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 21:05:36 +00:00
Reid Kleckner
02f474a115 [codeview] Improve some comments
This FIXME was already fixed, and these LF_* enum names were
inconsistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 20:58:46 +00:00
Dehao Chen
d025c697a5 Revert http://reviews.llvm.org/D19926 as it breaks tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 20:47:53 +00:00
Reid Kleckner
8cff4d52c4 Remove unnecessary anonymous namespace from a header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 20:30:48 +00:00
Dehao Chen
8200288f55 Simplify CFG before assigning discriminator.
Summary: We need to clean up CFG before assigning discriminator to minimize the impact of optimization on debug info.

Reviewers: davidxl, dblaikie, dnovillo

Subscribers: dnovillo, danielcdh, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 20:18:49 +00:00
Mehdi Amini
3c3e5086f2 Degrade assertions to a warning in LTOCodeGenerator for preserved linkonce
The assertions were assuming that the linker will not ask to preserve
a global that is internal or available_externally, as it does not
really make sense. In practice this break the bootstrap of clang,
I degrade to a warning for now.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 20:05:33 +00:00
Chris Bieneman
6a6b44f90f Remove LLVM_ENABLE_TIMESTAMPS
Summary:
As per the discussion on LLVM-dev this patch proposes removing LLVM_ENABLE_TIMESTAMPS.

The only complicated bit of this patch is the Windows support. On windows we used to log an error if /INCREMENTAL was passed to the linker when timestamps were disabled.

With this change since timestamps in code are always disabled we will always compile on windows with /Brepro unless /INCREMENTAL is specified, and we will log a warning when /INCREMENTAL is specified to notify the user that the build will be non-deterministic.

See: http://lists.llvm.org/pipermail/llvm-dev/2016-May/098990.html

Reviewers: bogner, silvas, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268670 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 19:57:03 +00:00
Xinliang David Li
8fa402e863 [profile] Remove unneeded field in raw profile reader
Differential Revision: http://reviews.llvm.org/D19956


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 19:41:18 +00:00
Vitaly Buka
eb80fa1253 Revert "[ThinLTO] Emit individual index files for distributed backends"
MemorySanitizer: use-of-uninitialized-value in lib/Bitcode/Writer/BitcodeWriter.cpp:364:70
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/12544/steps/check-llvm%20msan/logs/stdio

This reverts commit 0c4a898ea5.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268660 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 18:31:00 +00:00
Matthias Braun
d170aeaa5b MachineFunction: Add a const modifier to print() parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 18:14:43 +00:00
Kevin Enderby
00e8fc511c Clean up the specific error message for a malformed Mach-O files with bad segment
load commands.

The existing test case in test/Object/macho-invalid.test for
macho-invalid-too-small-segment-load-command has a cmdsize of 55, while
being too small also it is not a multiple of 4.  So when that check is added
this test case will produce a different error. So I constructed a new test case
that will trigger the intended error.

I also changed the error message to be consistent with the other malformed Mach-O
file error messages which prints the load command index.  I also removed both
object_error::macho_load_segment_too_small and
object_error::macho_load_segment_too_many_sections from Object/Error.h
as they are not needed and can just use object_error::parse_failed and let the
error message string distinguish the specific error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268652 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 17:43:35 +00:00
Krzysztof Parzyszek
341096adc6 [Hexagon] Handle operand type differences for A2_tfrpi
The instruction A2_tfrpi has a 64-bit operand, while the corresponding
intrinsic takes a 32-bit value. The actual value has only 8 significant
bits, so the difference is only in the type used to represent it.
In order to map the intrinsic to the instruction, the operand needs to
be extended to the correct type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268635 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 15:29:47 +00:00
Silviu Baranga
debb790c77 [LV] Identify more induction PHIs by coercing expressions to AddRecExprs
Summary:
Some PHIs can have expressions that are not AddRecExprs due to the presence
of sext/zext instructions. In order to prevent the Loop Vectorizer from
bailing out when encountering these PHIs, we now coerce the SCEV
expressions to AddRecExprs using SCEV predicates (when possible).

We only do this when the alternative would be to not vectorize.

Reviewers: mzolotukhin, anemet

Subscribers: mssimpso, sanjoy, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 15:20:39 +00:00
Teresa Johnson
0c4a898ea5 [ThinLTO] Emit individual index files for distributed backends
Summary:
When launching ThinLTO backends in a distributed build (currently
supported in gold via the thinlto-index-only plugin option), emit
an individual index file for each backend process as described here:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098272.html

The individual index file encodes the summary and module information
required for implementing the importing/exporting decisions made
for a given module in the thin link step.
This is in place of the current mechanism that uses the combined index
to make importing decisions in each back end independently. It is an
enabler for doing global summary based optimizations in the thin link
step (which will be recorded in the individual index files), and reduces
the size of the index that must be sent to each backend process, and
the amount of work to scan it in the backends.

Rather than create entirely new ModuleSummaryIndex structures (and all
the included unique_ptrs) for each backend index file, a map is created
to record all of the GUID and summary pointers needed for a particular
index file. The IndexBitcodeWriter walks this map instead of the full
index (hiding the details of managing the appropriate summary iteration
in a new iterator subclass). This is more efficient than walking the
entire combined index and filtering out just the needed summaries during
each backend bitcode index write.

Depends on D19481.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 13:44:56 +00:00
Marcin Koscielnicki
d11ea2f4ad [X86] Extend some Linux special cases to cover kFreeBSD.
Both Linux and kFreeBSD use glibc, so follow similiar code paths.
Add isTargetGlibc to check for this, and use it instead of isTargetLinux
in a few places.

Fixes PR22248 for kFreeBSD.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 11:35:51 +00:00
Xinliang David Li
007644ba3f [Profile] Raw profile header clean up
Remove dead ValueDataBegin field in raw header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268602 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 04:07:30 +00:00
Xinliang David Li
454f7fa94d [PM] Port Branch Probability Analysis pass to the new pass manager.
Differential Revision: http://reviews.llvm.org/D19839


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268601 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 02:59:57 +00:00
Davide Italiano
e44aed739e [PM] Port EliminateAvailableExternally pass to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268599 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 02:37:32 +00:00
Dehao Chen
8b3e014d45 clang-format some files in preparation of coming patch reviews.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268583 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 00:54:54 +00:00
Davide Italiano
0a517713cd [PM] Port ConstantMerge to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 00:51:09 +00:00
Reid Kleckner
1232987170 [codeview] Move dumper into lib/DebugInfo/CodeView
So that we can call it from llvm-pdbdump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268580 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 00:34:33 +00:00
Simon Pilgrim
0c744b02a4 [SelectionDAG] BITREVERSE vector legalization of bit operations (REAPPLIED)
Some vector bit operations are promoted instead of having custom lowering. This patch changes the isOperationLegalOrCustom tests for vector AND/OR operations to use a new TLI helper isOperationLegalOrCustomOrPromote instead, allowing the SSE implementations to stay on the simd unit.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 22:08:51 +00:00
Balaram Makam
94ee5ea0aa "Reapply r268521 "[InstCombine] Canonicalize icmp instructions based on dominating conditions.""
This reapplies commit r268521, that was reverted in r268530 due to a test failure in select-implied.ll
Modified the test case to reflect the new change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268557 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 21:32:14 +00:00
Zachary Turner
c95df94d5d Move pdb code into pdb namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 20:32:13 +00:00
Reid Kleckner
bcfc7d0f75 [codeview] Add a type visitor to help abstract away type stream handling
Summary:
Port the dumper in llvm-readobj over to it.

I'm planning to use this visitor to power type stream merging.

While we're at it, try to switch from StringRef to ArrayRef<uint8_t> in some
places.

Reviewers: zturner, amccarth

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 19:39:28 +00:00
Balaram Makam
30f97f1d5c Revert "[InstCombine] Canonicalize icmp instructions based on dominating conditions."
This reverts commit 573a40f79b35cf3e71db331bb00f6a84f03b835d.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268530 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 18:37:35 +00:00
Simon Pilgrim
c8decc5d85 Fix spelling in comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 18:16:17 +00:00
Balaram Makam
decf72be2d [InstCombine] Canonicalize icmp instructions based on dominating conditions.
Summary:
    This patch canonicalizes conditions based on the constant range information
    of the dominating branch condition.
    For example:

      %cmp = icmp slt i64 %a, 0
      br i1 %cmp, label %land.lhs.true, label %lor.rhs
      lor.rhs:
        %cmp2 = icmp sgt i64 %a, 0

    Would now be canonicalized into:

      %cmp = icmp slt i64 %a, 0
      br i1 %cmp, label %land.lhs.true, label %lor.rhs
      lor.rhs:
        %cmp2 = icmp ne i64 %a, 0

Reviewers: mcrosier, gberry, t.p.northover, llvm-commits, reames, hfinkel, sanjoy, majnemer

Subscribers: MatzeB, majnemer, mcrosier

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 17:34:20 +00:00
Leny Kholodov
f7a03a4ea3 [Support] Creation of minidump after compiler crash on Windows
In the current implementation compiler only prints stack trace
to console after crash. This patch adds saving of minidump
files which contain a useful subset of the information for
further debugging.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 16:56:51 +00:00
Reid Kleckner
d1310b73a3 Reland "Use ScopedPrinter in llvm-pdbdump"
This reverts r268508 and reinstates r268506 with an additional cast from
TypeLeafKind to unsigned to allow conversion to HexNumber.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 16:09:04 +00:00
Chad Rosier
aa48f229ff Typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268513 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 15:42:29 +00:00
Chad Rosier
ea1c623e32 Revert "Use ScopedPrinter in llvm-pdbdump"
This reverts commit r268506 due to build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 15:25:06 +00:00
Zachary Turner
02f1f19dae Use ScopedPrinter in llvm-pdbdump
When printing raw PDB file fields, streams, and records, use the
ScopedPrinter class so we have consistency with llvm-readobj's output
format.

For the most part this is pretty mechanical, but I had to fix up the test
file to conform to the new YAMLesque output format. i added a few
additional helper functions to the ScopedPrinter such as one to print a
dotted version, etc.

Differential Revision: http://reviews.llvm.org/D19897
Reviewed By: rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 15:05:12 +00:00
Igor Laevsky
8a04253827 [RS4GC] Use SetVector/MapVector instead of DenseSet/DenseMap to guarantee stable ordering
Goal of this change is to guarantee stable ordering of the statepoint arguments and other 
newly inserted values such as gc.relocates. Previously we had explicit sorting in a couple
of places. However for unnamed values ordering was partial and overall we didn't have any 
strong invariant regarding it. This change switches all data structures to use SetVector's
and MapVector's which provide possibility for deterministic iteration over them.
Explicit sorting is now redundant and was removed.

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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 14:55:36 +00:00
Zachary Turner
187e0e6397 Make ListScope and DictScope re-use the same code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 01:46:59 +00:00
Richard Smith
11773e9bc3 Remove (unused) "using namespace llvm;" in Support header. This caused the modules build to break.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 00:21:33 +00:00
David Majnemer
fea3ecb60c [GlobalDCE, Misc] Don't remove functions referenced by ifuncs
We forgot to consider the target of ifuncs when considering if a
function was alive or dead.

N.B. Also update a few auxiliary tools like bugpoint and
verify-uselistorder.

This fixes PR27593.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 00:20:48 +00:00
Vedant Kumar
7212e1ee96 [Support] Add a free toString function for Error
toString() consumes an Error and returns a string representation of its
contents. This commit also adds a message() method to ErrorInfoBase for
convenience.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 23:32:31 +00:00
Kevin Enderby
1820caaf98 Produce another specific error message for a malformed Mach-O file when a load
command has a size less than 8 bytes.

I think the existing test case in test/Object/macho-invalid.test for
macho64-invalid-too-small-load-command was trying to test for this but that
test case triggered a different error given how it was constructed.  So I
constructed a new test case that would trigger this specific error.

I also changed the error message to be consistent with the other malformed Mach-O
file error messages.  I also removed object_error::macho_small_load_command from
Object/Error.h as it is not needed and can just use object_error::parse_failed
and let the error message string distinguish the error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 23:13:50 +00:00
Zachary Turner
14c490a90d Move CodeViewTypeStream to DebugInfo/CodeView
Ability to parse codeview type streams is also needed by
DebugInfoPDB for parsing PDBs, so moving this into a library
gives us this option.  Since DebugInfoPDB had already hand
rolled some code to do this, that code is now convereted over
to using this common abstraction.

Differential Revision: http://reviews.llvm.org/D19887
Reviewed By: dblaikie, amccarth

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 22:18:17 +00:00
Justin Bogner
0b059c126c PM: Port LoopRotation to the new loop pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 22:02:31 +00:00
Justin Bogner
cc5bcb5917 PM: Port LoopSimplifyCFG to the new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 21:47:32 +00:00
Justin Bogner
1a7c00aa11 PM: Check that loop passes preserve a basic set of analyses
A loop pass that didn't preserve this entire set of passes wouldn't
play well with other loop passes, since these are generally a basic
requirement to do any interesting transformations to a loop.

Adds a helper to get the set of analyses a loop pass should preserve,
and checks that any loop pass we run satisfies the requirement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 21:35:08 +00:00
Vedant Kumar
dda2c41a94 [Support] Drop template line in favor of 'inline'
Reviewed-by: lhames

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 21:04:42 +00:00
Reid Kleckner
680266ef56 [ADT] Add drop_front method to ArrayRef
We have it for StringRef but not ArrayRef, and ArrayRef has drop_back,
so I see no reason it shouldn't have drop_front. Splitting this out of a
change that I have that will use this funcitonality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268434 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 20:53:20 +00:00
Davide Italiano
82cad6f228 [IPO/GlobalDCE] Port to the new pass manager.
Differential Revision:  http://reviews.llvm.org/D19782

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 19:39:15 +00:00
Davide Italiano
4d144046a7 [Reassociate] Remove unneeded constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 18:34:51 +00:00
Lang Hames
6406486bc6 [ExecutionEngine] Add comment explainging that ExecutionEngine::addGlobalMapping
can only be used on named values.

https://llvm.org/bugs/PR23497



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268415 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 18:19:35 +00:00
Vedant Kumar
707e782733 [ProfileData] Add error codes for compression failures
Be more specific in describing compression failures. Also, check for
this kind of error in emitNameData().

This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268400 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 16:53:17 +00:00
Mehdi Amini
f4c5ea4908 Provide some default values for the ThinLTO Cache pruning
This control how the cache is pruned. The cache still has to
be explicitely enabled/disabled by providing a path.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 15:17:50 +00:00
Daniel Sanders
c8b0a11468 [mips] Use MipsMCExpr instead of MCSymbolRefExpr for all relocations.
Summary:
This is much closer to the way MIPS relocation expressions work
(%hi(foo + 2) rather than %hi(foo) + 2) and removes the need for the
various bodges in MipsAsmParser::evaluateRelocExpr().

Removing those bodges ensures that the constant stored in MCValue is the
full 32 or 64-bit (depending on ABI) offset from the symbol. This will be used
to correct the %hi/%lo matching needed to sort the relocation table correctly.

As part of this:
* Gave MCExpr::print() the ability to omit parenthesis when emitting a
  symbol reference inside a MipsMCExpr operator like %hi(X). Without this
  we print things like %lo(($L1)).
* %hi(%neg(%gprel(X))) is now three MipsMCExpr's instead of one. Most of
  the related special cases have been removed or moved to MipsMCExpr. We
  can remove the rest as we gain support for the less common relocations
  when they are not part of this specific combination.
* Renamed MipsMCExpr::VariantKind and the enum prefix ('VK_') to avoid confusion
  with MCSymbolRefExpr::VariantKind and its prefix (also 'VK_').
* fixup_Mips_GOT_Local and fixup_Mips_GOT_Global were found to be identical
  and merged into fixup_Mips_GOT.
* MO_GOT16 and MO_GOT turned out to be identical and have been merged into
  MO_GOT.
* VK_Mips_GOT and VK_Mips_GOT16 turned out to be the same thing so they
  have been merged into MEK_GOT

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 13:35:44 +00:00
Craig Topper
8d0e28ce95 [CodeGen] Add some space optimized forms of EmitNode and MorphNodeTo that implicitly indicate the number of result VTs. This shaves about 16K off the X86 matching table taking it down to about 470K.
Overall this reduces the llc binary size with all in-tree targets by about 40K.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 05:54:13 +00:00
David Majnemer
67d4f302ed [LoopUnroll] Unroll loops which have exit blocks to EH pads
We were overly cautious in our analysis of loops which have invokes
which unwind to EH pads.  The loop unroll transform is safe because it
only clones blocks in the loop body, it does not try to split critical
edges involving EH pads.  Instead, move the necessary safety check to
LoopUnswitch.

N.B. The safety check for loop unswitch is covered by an existing test
which fails without it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 03:57:40 +00:00
Reid Kleckner
97e4f889df [codeview] Maintain the type enum-to-classname mapping in the .def file
This way it will be easy to stamp out something like a type visitor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268347 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 00:45:14 +00:00
Zachary Turner
84bc70bd9c Parse the TPI (type information) stream of PDB files.
This parses the TPI stream (stream 2) from the PDB file. This stream
contains some header information followed by a series of codeview records.
There is some additional complexity here in that alongside this stream of
codeview records is a serialized hash table in order to efficiently query
the types. We parse the necessary bookkeeping information to allow us to
reconstruct the hash table, but we do not actually construct it yet as
there are still a few things that need to be understood first.

Differential Revision: http://reviews.llvm.org/D19840
Reviewed By: ruiu, rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268343 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 00:28:21 +00:00
Zachary Turner
2448e9f766 Move llvm-readobj/StreamWriter to Support.
We wish to re-use this from llvm-pdbdump, and it provides a nice
way to print structured data in scoped format that could prove
useful for many other dumping tools as well.  Moving to support
and changing name to ScopedPrinter to better reflect its purpose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 00:28:04 +00:00
Mehdi Amini
dd2d6cfee4 ThinLTO: do not import function whose linkage prevents inlining.
There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 00:27:28 +00:00
Matthias Braun
02073cb41c livePhysRegs: Pass MBB by reference in addLive{Ins|Outs}(); NFC
The block must no be nullptr for the addLiveIns()/addLiveOuts()
function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 00:24:32 +00:00
Matthias Braun
b4756d6b2d LivePhysRegs: Automatically determine presence of pristine regs.
Remove the AddPristinesAndCSRs parameters from
addLiveIns()/addLiveOuts().

We need to respect pristine registers after prologue epilogue insertion,
Seeing that we got this wrong in at least two commits already, we should
rather pay the small price to query MachineFrameInfo for it.

There are three cases that did not set AddPristineAndCSRs to true even
after register allocation:
- ExecutionDepsFix: live-out registers are used as a hint that the
  register is used soon. This is not true for pristine registers so
  use the new addLiveOutsNoPristines() to maintain this behaviour.
- SystemZShortenInst: Not setting AddPristineAndCSRs to true looks like
  a bug, should do the right thing automatically now.
- StackMapLivenessAnalysis: Not adding pristine registers looks like a
  bug to me. Added a FIXME comment but maintain the current behaviour
  as a change may need to get coordinated with GC runtimes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 00:08:46 +00:00
Reid Kleckner
7f90dd2353 [MC] Create unique .pdata sections for every .text section
Summary:
This adds a unique ID to the COFF section uniquing map, similar to the
one we have for ELF.  The unique id is not currently exposed via the
assembler because we don't have a use case for it yet. Users generally
create .pdata with the .seh_* family of directives, and the assembler
internally needs to produce .pdata and .xdata sections corresponding to
the code section.

The association between .text sections and the assembler-created .xdata
and .pdata sections is maintained as an ID field of MCSectionCOFF. The
CFI-related sections are created with the given unique ID, so if more
code is added to the same text section, we can find and reuse the CFI
sections that were already created.

Reviewers: majnemer, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 23:22:18 +00:00
Quentin Colombet
a15f9f52c3 [X86] Model FAULTING_LOAD_OP as a terminator and branch.
This operation may branch to the handler block and we do not want it
to happen anywhere within the basic block.
Moreover, by marking it "terminator and branch" the machine verifier
does not wrongly assume (because of AnalyzeBranch not knowing better)
the branch is analyzable. Indeed, the target was seeing only the
unconditional branch and not the faulting load op and thought it was
a simple unconditional block.
The machine verifier was complaining because of that and moreover,
other optimizations could have done wrong transformation!

In the process, simplify the representation of the handler block in
the faulting load op. Now, we directly reference the handler block
instead of using a label. This has the benefits of:
1. MC knows how to issue a label for a BB, so leave that to it.
2. Accessing the target BB from its label is painful, whereas it is
   direct from a MBB operand.

Note: The 2 bytes offset in implicit-null-check.ll comes from the
fact the unconditional jumps are not removed anymore, as the whole
terminator sequence is not analyzable anymore.

Will fix it in a subsequence commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 22:58:54 +00:00
Wolfgang Pieb
844d21c2f6 DebugInfo: Avoid propagating incorrect debug locations in SelectionDAG via CSE.
Summary:
When SelectionDAG performs CSE it is possible that the context's source
location is different from that of the selected node. This can lead to
incorrect line number records. We update the debug location to the
one that occurs earlier in the instruction sequence.

This fixes PR21006.

Reviewers: echristo, sdmitrouk

Subscribers: jevinskie, asl, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 22:50:51 +00:00
Mehdi Amini
2ef976219b Revert "ThinLTO: do not import function whose linkage prevents inlining."
This reverts commit r268315, the tests are not passing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 22:26:04 +00:00
Mehdi Amini
e1cf918848 ThinLTO: do not import function whose linkage prevents inlining.
There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 22:11:27 +00:00
Vedant Kumar
fab330e844 Fix a typo, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 21:32:07 +00:00
Kevin Enderby
a486dcaf36 Thread Expected<...> up from libObject’s getType() for symbols to allow llvm-objdump to produce a good error message.
Produce another specific error message for a malformed Mach-O file when a symbol’s
section index is more than the number of sections.  The existing test case in test/Object/macho-invalid.test
for macho-invalid-section-index-getSectionRawName now reports the error with the message indicating
that a symbol at a specific index has a bad section index and that bad section index value.

Again converting interfaces to Expected<> from ErrorOr<> does involve
touching a number of places. Where the existing code reported the error with a
string message or an error code it was converted to do the same.

Also there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values.  So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comment:
"// TODO: Actually report errors helpfully" and a call something like
consumeError(NameOrErr.takeError()) so the buggy code will not crash
since needed to deal with the Error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 20:28:12 +00:00
John Regehr
98d359ac65 [LVI] Add an API to LazyValueInfo so that it can export ConstantRanges
that it computes. Currently this is used for testing and precision
tuning, but it might be used by optimizations later.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 19:58:00 +00:00
Reid Kleckner
0e77da267e Revert "[SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block including lifetime intrinsics"
This reverts commit r268254.

This change causes assertion failures while building Chromium. Reduced
test case coming soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 19:43:22 +00:00
Zachary Turner
f526e10c7f PDB - Instead of hardcoding stream numbers, use an enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 18:09:21 +00:00
Zachary Turner
0e6ef97ce0 Parse PDB Name Hash Table
PDB has a lot of similar data structures.  We already have code
for parsing a Name Map, but PDB seems to have a different but
very similar structure that is a hash table.  This is the
beginning of code needed in order to parse the name hash table,
but it is not yet complete.  It parses the basic metadata of
the hash table, the bucket array, and the names buffer, but
doesn't use any of these fields yet as the data structure
requires a non-trivial amount of work to understand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 18:09:14 +00:00
Derek Schuff
1e477250a6 [WebAssembly] Rename memory_size intrinsic to current_memory
This follows the recent renaming in the wasm spec.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 17:25:22 +00:00
Hans Wennborg
0c15a0b738 [SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block including lifetime intrinsics
Make it possible that TryToSimplifyUncondBranchFromEmptyBlock merges empty
basic block including lifetime intrinsics as well as phi nodes and
unconditional branch into its successor or predecessor(s).

If successor of empty block has single predecessor, all contents including
lifetime intrinsics are sinked into the successor. Otherwise, they are
hoisted into its predecessor(s) and then merged into the predecessor(s).

Patch by Josh Yoon <josh.yoon@samsung.com>!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 17:22:54 +00:00
Rafael Espindola
4c7d166c37 Expose a getFullName for thin archive members.
It will be used in lld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268226 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 13:45:06 +00:00
Craig Topper
b5bf834f5d [CodeGen] Add OPC_MoveChild0-OPC_MoveChild7 opcodes to isel matching tables to optimize table size. Shaves about 12K off the X86 matcher table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 01:53:30 +00:00
Amaury Sechet
58e9430c5d Properly name LLVMSetIsInBounds's argument. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-01 02:23:14 +00:00
Amaury Sechet
3f89ecd798 Capitalize align argument in the C API as per convention. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-01 01:42:34 +00:00
Lang Hames
6706c34b89 [ORC] Save AArch64 NEON state in the JIT reentry block.
The earlier version of the resolver code did not save NEON state, so it would
have broken any callees that used floating point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-01 00:14:45 +00:00
Sriraman Tallam
540bb24384 Differential Revision: http://reviews.llvm.org/D19753
Delete Target Option PositionIndependentExecutable as PIE is now part of module flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30 04:18:52 +00:00
Lang Hames
1c7deb2e11 [Orc] Fix the AArch64 resolver size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30 00:50:26 +00:00
Vedant Kumar
9759276c58 Fix a typo (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30 00:32:54 +00:00
Xinliang David Li
2f3e898b66 Reapply r268107 after fixing a bug breaks debug build.
Makes the new method to set data needed by debug dump.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 22:59:36 +00:00
Sanjay Patel
0ac37a4267 clean up documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 22:03:27 +00:00
Xinliang David Li
05d883a443 Revert r268107 -- debug build failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268116 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:43:28 +00:00
Lang Hames
d53ff2dcbd [Orc] Add ORC lazy-compilation support for AArch64.
The ORC compile callbacks and indirect stubs APIs will now work for AArc64,
allowing functions to be lazily compiled and/or updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268112 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:32:00 +00:00
Lang Hames
2534484e89 [Orc] Make sure we don't drop the internal error in OrcRemoteTargetClient when
the constructor fails, as this would lead to an 'unchecked error' crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:29:48 +00:00
Xinliang David Li
8c53c612ef [inliner]: Refactor inline deferring logic into its own method /NFC
The implemented heuristic has a large body of code which better sits
in its own function for better readability. It also allows adding more
heuristics easier in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:21:44 +00:00
Sriraman Tallam
7eaa51e95d Differential Revision: http://reviews.llvm.org/D19733
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:19:16 +00:00
Matt Arsenault
de6dea1afa AMDGPU: Add kernarg.segment.ptr intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268105 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:16:52 +00:00
Matt Arsenault
7d02fd4418 Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268102 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:02:04 +00:00
Easwaran Raman
a96d5370cb Move coverage related code into a separate library.
Differential Revision: http://reviews.llvm.org/D19333



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 18:53:05 +00:00
Zachary Turner
a91bcf5593 Put PDB parsing code into a pdb namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:28:47 +00:00
Zachary Turner
64cc1b2eb3 Refactor the PDB Stream reading interface.
The motivation for this change is that PDB has the notion of
streams and substreams.  Substreams often consist of variable
length structures that are convenient to be able to treat as
guaranteed, contiguous byte arrays, whereas the streams they
are contained in are not necessarily so, as a single stream
could be spread across many discontiguous blocks.

So, when processing data from a substream, we want to be able
to assume that we have a contiguous byte array so that we can
cast pointers to variable length arrays and such.

This leads to the question of how to be able to read the same
data structure from either a stream or a substream using the
same interface, which is where this patch comes in.

We separate out the stream's read state from the underlying
representation, and introduce a `StreamReader` class.  Then
we change the name of `PDBStream` to `MappedBlockStream`, and
introduce a second kind of stream called a `ByteStream` which is
simply a sequence of contiguous bytes.  Finally, we update all
of the std::vectors in `PDBDbiStream` to use `ByteStream` instead
as a proof of concept.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268071 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:22:58 +00:00
Filipe Cabecinhas
034b92a7c3 Add operator- to Path's reverse_iterator. Needed for D19666
Reviewers: rafael, craig.topper, bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:48:07 +00:00
Filipe Cabecinhas
2fd54348ae Unify XDEBUG and EXPENSIVE_CHECKS (into the latter), and add an option to the cmake build to enable them.
Summary:
Historically, we had a switch in the Makefiles for turning on "expensive
checks". This has never been ported to the cmake build, but the
(dead-ish) code is still around.

This will also make it easier to turn it on in buildbots.

Reviewers: chandlerc

Subscribers: jyknight, mzolotukhin, RKSimon, gberry, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 15:22:48 +00:00
Sanjay Patel
432a66529d fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 14:53:54 +00:00
David Majnemer
3047183427 [GlobalOpt] Propagate operand bundles
We neglected to transfer operand bundles for some transforms.  These
were found via inspection, I'll try to come up with some test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 08:07:22 +00:00
Zachary Turner
5515858465 Read the rest of the DBI substreams, and parse source info.
We now read out the rest of the substreams from the DBI streams.  One of
these substreams, the FileInfo substream, contains information about which
source files contribute to each module (aka compiland).  This patch
additionally parses out the file information from that substream, and
dumps it in llvm-pdbdump.

Differential Revision: http://reviews.llvm.org/D19634
Reviewed by: ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:05:18 +00:00
Krzysztof Parzyszek
6af1d8fce6 Reset the TopRPTracker's position in ScheduleDAGMILive::initQueues
ScheduleDAGMI::initQueues changes the RegionBegin to the first non-debug
instruction. Since it does not track register pressure, it does not affect
any RP trackers. ScheduleDAGMILive inherits initQueues from ScheduleDAGMI,
and it does reset the TopTPTracker in its schedule method. Any derived,
target-specific scheduler will need to do it as well, but the TopRPTracker
is only exposed as a "const" object to derived classes. Without the ability
to modify the tracker directly, this leaves a derived scheduler with a
potential of having the TopRPTracker out-of-sync with the CurrentTop.

The symptom of the problem:
  void llvm::ScheduleDAGMILive::scheduleMI(llvm::SUnit *, bool):
  Assertion `TopRPTracker.getPos() == CurrentTop && "out of sync"' failed.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 19:17:44 +00:00
Eugene Zelenko
b116cf62de Fix builds broken in r267910.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:27:35 +00:00
Sriraman Tallam
d41672fa69 Add "PIE Level" metadata to module flags.
http://reviews.llvm.org/D19671

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:15:44 +00:00
Eugene Zelenko
aaf3f0426b Fix some Clang-tidy modernize and Include What You Use warnings.
Differential revision: http://reviews.llvm.org/D19673


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:04:41 +00:00
Chad Rosier
c831d1b1ef [GVN] Minor code cleanup. NFC.
Differential Revision: http://reviews.llvm.org/D18828
Patch by Aditya Kumar!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 16:00:15 +00:00
Matthias Braun
e5c4e28d9c CodeGen: Add DetectDeadLanes pass.
The DetectDeadLanes pass performs a dataflow analysis of used/defined
subregister lanes across COPY instructions and instructions that will
get lowered to copies. It detects dead definitions and uses reading
undefined values which are obscured by COPY and subregister usage.

These dead definitions cause trouble in the register coalescer which
cannot deal with definitions suddenly becoming dead after coalescing
COPY instructions.

For now the pass only adds dead and undef flags to machine operands. It
should be possible to extend it in the future to remove the dead
instructions and redo the analysis for the affected virtual
registers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:16 +00:00
Matthias Braun
baad40b586 TableGen: Produce CoveredBySubRegs summary for register classes
This will be used in the upcoming "DetectDeadLanes" pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:11 +00:00
Matthias Braun
89abe6466a TargetRegisterInfo: Introduce reverseComposeSubRegIndexLaneMask()
This function performs the reverse computation of
composeSubRegIndexLaneMask().

It will be used in the upcoming "DetectDeadLanes" pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:07 +00:00
Matthias Braun
3b74a145c8 TableGen: Support lanemasks for classes without subregisters
Previously using lanemasks on registers without any subregisters was not
well defined. This commit extends TargetRegisterInfo/tablegen to:
- Report a lanemask of 1 for regclasses without subregisters
- Do the right thing when mapping a 0/1 lanemask from a class without
  subregisters into a class with subregisters in
  TargetRegisterInfo::composeSubRegIndexLaneMasks().

This will be used in the upcoming "DetectDeadLanes" patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:04 +00:00
Richard Smith
b012212af7 Fix bogus documentation for StringRef::slice in the End < Start case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 00:57:14 +00:00
Zachary Turner
4a4743c8af Parse module information from DBI stream.
This gets more data out of the DBI strema of the PDB.  In
particular it extracts the metadata for the list of modules
(compilands) that this PDB contains info about, and adds support
for dumping these fields to llvm-pdbdump.

Differential Revision: http://reviews.llvm.org/D19570
Reviewed By: ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:41:42 +00:00
Rong Xu
1564d12c82 [PGO] Promote indirect calls to conditional direct calls with value-profile
This patch implements the transformation that promotes indirect calls to
conditional direct calls when the indirect-call value profile meta-data is
available.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:20:27 +00:00
Colin LeMahieu
a6e18c129a [MCAssembler] Allow backend to finalize layout post-relaxation.
Differential revision: http://reviews.llvm.org/D19429

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 21:26:13 +00:00
Lang Hames
54b806a776 [RuntimeDyld] Plumb Error/Expected through the internals of RuntimeDyld.
Also replaces a number of calls to report_fatal_error with Error returns.

The plumbing will make it easier to return errors originating in libObject.

Replacing report_fatal_errors with Error returns will give JIT clients the
opportunity to recover gracefully when the JIT is unable to produce/relocate
code, as well as providing meaningful error messages that can be used to file
bug reports.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:24:48 +00:00
Justin Lebar
ae889d3672 Add TargetMachine::addEarlyAsPossiblePasses, and call it from opt.
Summary:
This is a hook to allow TargetMachine to install passes at the
EP_EarlyAsPossible PassManagerBuilder extension point.

Reviewers: chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:08:24 +00:00
Ahmed Bougacha
76739f43a9 [TLI] Unify LibFunc attribute inference. NFCI.
Now the pass is just a tiny wrapper around the util. This lets us reuse
the logic elsewhere (done here for BuildLibCalls) instead of duplicating
it.

The next step is to have something like getOrInsertLibFunc that also
sets the attributes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:40 +00:00
Ahmed Bougacha
8a8efec992 [TLI] Unify LibFunc signature checking. NFCI.
I tried to be as close as possible to the strongest check that
existed before; cleaning these up properly is left for future work.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:35 +00:00
Gerolf Hoflehner
69bf036617 [DAGCombiner] Follow coding convention for function name (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267745 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 17:27:16 +00:00
Nicolai Haehnle
0493c734a2 AMDGPU/SI: Add llvm.amdgcn.s.waitcnt.all intrinsic
Summary:
So it appears that to guarantee some of the ordering requirements of a GLSL
memoryBarrier() executed in the shader, we need to emit an s_waitcnt.

(We can't use an s_barrier, because memoryBarrier() may appear anywhere in
the shader, in particular it may appear in non-uniform control flow.)

Reviewers: arsenm, mareko, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 15:46:01 +00:00
Matthew Simpson
d0229876a9 [TTI] Add hook for vector extract with extension
This change adds a new hook for estimating the cost of vector extracts followed
by zero- and sign-extensions. The motivating example for this change is the
SMOV and UMOV instructions on AArch64. These instructions move data from vector
to general purpose registers while performing the corresponding extension
(sign-extend for SMOV and zero-extend for UMOV) at the same time. For these
operations, TargetTransformInfo can assume the extensions are free and only
report the cost of the vector extract. The SLP vectorizer has been updated to
make use of the new hook.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267725 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 15:20:21 +00:00
Teresa Johnson
8777897f72 [ThinLTO] Use valueid instead of bitcode offsets in combined index file
Summary:
With the removal of support for lazy parsing of combined index summary
records (e.g. r267344), we no longer need to include the summary record
bitcode offset in the VST entries for definitions. Change the combined
index format to be similar to the per-module index format in using value
ids to cross-reference from the summary record to the VST entry (rather
than the summary record bitcode offset to cross-reference in the other
direction).

The visible changes are:
1) Add the value id to the combined summary records
2) Remove the summary offset from the combined VST records, which has
the following effects:
- No longer need the VST_CODE_COMBINED_GVDEFENTRY record, as all
  combined index VST entries now only contain the value id and
  corresponding GUID.
- No longer have duplicate VST entries in the case where there are
  multiple definitions of a symbol (e.g. weak/linkonce), as they all
  have the same value id and GUID.

An implication of #2 above is that in order to hook up an alias to the
correct aliasee based on the value id of the aliasee recorded in the
combined index alias record, we need to scan the entries in the index
for that GUID to find the one from the same module (i.e. the case where
there are multiple entries for the aliasee). But the reader no longer
has to maintain a special map to hook up the alias/aliasee.

Reviewers: joker.eph

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 13:28:35 +00:00