OSDN Git Service

android-x86/external-llvm.git
8 years agoMachineSched: Cleanup; NFC
Matthias Braun [Thu, 21 Apr 2016 01:54:13 +0000 (01:54 +0000)]
MachineSched: Cleanup; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266946 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd optimization for 'icmp slt (or A, B), A' and some related idioms based on knowled...
Nick Lewycky [Thu, 21 Apr 2016 00:53:14 +0000 (00:53 +0000)]
Add optimization for 'icmp slt (or A, B), A' and some related idioms based on knowledge of the sign bit for A and B.

No matter what value you OR in to A, the result of (or A, B) is going to be UGE A. When A and B are positive, it's SGE too. If A is negative, OR'ing a value into it can't make it positive, but can increase its value closer to -1, therefore (or A, B) is SGE A. Working through all possible combinations produces this truth table:

```
A is
+, -, +/-
F  F   F   +    B is
T  F   ?   -
?  F   ?   +/-
```

The related optimizations are flipping the 'slt' for 'sge' which always NOTs the result (if the result is known), and swapping the LHS and RHS while swapping the comparison predicate.

There are more idioms left to implement (aren't there always!) but I've stopped here because any more would risk becoming unreasonable for reviewers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266939 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRefine instruction weight annotation algorithm for sample profiler.
Dehao Chen [Wed, 20 Apr 2016 23:36:23 +0000 (23:36 +0000)]
Refine instruction weight annotation algorithm for sample profiler.

Summary:
This patch refined the instruction weight anootation algorithm:
1. Do not use dbg_value intrinsics for annotation.
2. Annotate cold calls if the call is inlined in profile, but not inlined before preparation. This indicates that the annotation preparation step found no sample for the inlined callsite, thus the call should be very cold.

Reviewers: dnovillo, davidxl

Subscribers: mgrang, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266936 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix another compilation error from r266919 for clang-atom-d525-fedora-rel which
Kevin Enderby [Wed, 20 Apr 2016 23:10:14 +0000 (23:10 +0000)]
Fix another compilation error from r266919 for clang-atom-d525-fedora-rel which
is another place that libObject’s getName() for symbols returns Expected<...>
that needed to be updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266933 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix compilation error in r266919.
Evgeniy Stepanov [Wed, 20 Apr 2016 22:44:40 +0000 (22:44 +0000)]
Fix compilation error in r266919.

lib/Object/MachOObjectFile.cpp:53:44: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
  return malformedError(Obj.getFileName(), std::move(Msg.str()), ECOverride);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266930 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[test/PGOProfile] Make tests independent of the raw profile version (NFC)
Vedant Kumar [Wed, 20 Apr 2016 22:24:01 +0000 (22:24 +0000)]
[test/PGOProfile] Make tests independent of the raw profile version (NFC)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266928 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump...
Kevin Enderby [Wed, 20 Apr 2016 21:24:34 +0000 (21:24 +0000)]
Thread Expected<...> up from libObject’s getName() 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
string index is past the end of the string table.  The existing test case in test/Object/macho-invalid.test
for macho-invalid-symbol-name-past-eof now reports the error with the message indicating
that a symbol at a specific index has a bad sting index and that bad string 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.  There is some
code for this that could be factored into a routine but I would like to leave that for
the code owners post-commit to do as they want for handling an llvm::Error.  An
example of how this could be done is shown in the diff in
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h which had a Check() routine
already for std::error_code so I added one like it for llvm::Error .

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.

Note there fixes needed to lld that goes along with this that I will commit right after this.
So expect lld not to built after this commit and before the next one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266919 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Add -mv.. options to override CPU selection
Krzysztof Parzyszek [Wed, 20 Apr 2016 21:17:40 +0000 (21:17 +0000)]
[Hexagon] Add -mv.. options to override CPU selection

This is for compatibility with scripts that use -mv5, etc. with the
assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266918 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Use SmallVector instead of std::vector of TrackingMDRef
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 20:14:09 +0000 (20:14 +0000)]
IR: Use SmallVector instead of std::vector of TrackingMDRef

Don't use std::vector<TrackingMDRef>, since (at least in some versions
of libc++) std::vector apparently copies values on grow operations
instead of moving them.  Found this when I was temporarily deleting the
copy constructor for TrackingMDRef to investigate a performance
bottleneck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266909 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Stop copying vectors of TrackingMDRef in DIBuilder
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 20:03:59 +0000 (20:03 +0000)]
IR: Stop copying vectors of TrackingMDRef in DIBuilder

No real functionality change here, just avoiding an unnecessary copy of
std::vector<TrackingMDRef> for every subprogram with variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266907 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRename asan-check-lifetime into asan-stack-use-after-scope
Kostya Serebryany [Wed, 20 Apr 2016 20:02:58 +0000 (20:02 +0000)]
Rename asan-check-lifetime into asan-stack-use-after-scope

Summary:
This is done for consistency with asan-use-after-return.
I see no other users than tests.

Reviewers: aizatsky, kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266906 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTypo.
Chad Rosier [Wed, 20 Apr 2016 19:16:23 +0000 (19:16 +0000)]
Typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266905 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ValueTracking] Make isImpliedCondition return an Optional<bool>. NFC.
Chad Rosier [Wed, 20 Apr 2016 19:15:26 +0000 (19:15 +0000)]
[ValueTracking] Make isImpliedCondition return an Optional<bool>. NFC.

Phabricator Revision: http://reviews.llvm.org/D19277

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266904 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReplace a loop with a for-each loop. No behavior change.
Nico Weber [Wed, 20 Apr 2016 19:09:26 +0000 (19:09 +0000)]
Replace a loop with a for-each loop. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266903 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Avoid mallocs in constructor of ModuleSlotTracker
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 19:05:59 +0000 (19:05 +0000)]
IR: Avoid mallocs in constructor of ModuleSlotTracker

A ModuleSlotTracker can be created without actually being used (e.g.,
r266889 added one to the Verifier).  Create the SlotTracker within it
lazily on the first call to ModuleSlotTracker::getMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266902 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MC] Silence warning due to unused variable in !Debug builds.
Davide Italiano [Wed, 20 Apr 2016 18:45:31 +0000 (18:45 +0000)]
[MC] Silence warning due to unused variable in !Debug builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266901 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoVerifier: Add ModuleSlotTracker to printAsOperand call
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 18:42:51 +0000 (18:42 +0000)]
Verifier: Add ModuleSlotTracker to printAsOperand call

I missed this site in r266889.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266900 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[lanai] Add subword scheduling itineraries.
Jacques Pienaar [Wed, 20 Apr 2016 18:28:55 +0000 (18:28 +0000)]
[lanai] Add subword scheduling itineraries.

Differentiate between word and subword memory operations as they take different
amount of cycles to complete. This just adds a basic model of the subword
latency to the scheduler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266898 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoVerifier: Prefer early continue over if-nesting, NFC
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 18:27:18 +0000 (18:27 +0000)]
Verifier: Prefer early continue over if-nesting, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266897 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MC] EmitNop: Make an assertion more useful.
Davide Italiano [Wed, 20 Apr 2016 17:53:21 +0000 (17:53 +0000)]
[MC] EmitNop: Make an assertion more useful.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266895 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLTO: Verify the input even if optimize() isn't called
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 17:48:22 +0000 (17:48 +0000)]
LTO: Verify the input even if optimize() isn't called

Clients may call writeMergedModules before calling optimize, or call
compileOptimized without calling optimize.  Make sure they don't sneak
past the verifier.  This adds LTOCodeGenerator::verifyMergedModuleOnce,
and calls it from writeMergedModule, optimize, and codegenOptimized.

I couldn't find a good way to test this.  I tried writing broken IR to
send into llvm-lto, but LTOCodeGenerator doesn't understand textual IR,
and assembler runs the verifier itself anyway.  Checking in
valid-but-doesn't-verify bitcode here doesn't seem valuable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266894 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModuleLinker: only import what is in GlobalsToImport, regarless if it is a function...
Mehdi Amini [Wed, 20 Apr 2016 17:47:42 +0000 (17:47 +0000)]
ModuleLinker: only import what is in GlobalsToImport, regarless if it is a function or not.

The alias handling was specific to the old iterative inlining
mechanism, so that is dead now. The variable handling could make a
difference, since we were previously falling through to the normal
selection logic, but we don't observe changes in the validation
because no client seems to rely on it.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266893 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Use a single ModuleSlotTracker in the Verifier
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 17:27:44 +0000 (17:27 +0000)]
IR: Use a single ModuleSlotTracker in the Verifier

Speed up Verifier output by sharing a single ModuleSlotTracker for the
duration.  There should be no functionality change here except for much
faster output when there's more than one statement.

Now the Verifier won't be traversing the full Metadata graph every time
it prints an error.  The TypePrinter is still not shared, but that would
take some extra plumbing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266889 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Don't use raw_null_ostream in Verifier
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 16:17:37 +0000 (16:17 +0000)]
IR: Don't use raw_null_ostream in Verifier

While using a raw_null_ostream meant that the Verifier didn't have to
think about whether to print, it's actually quite expensive to print out
IR.  Only print if the output is going somewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266884 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Use default member initialization in Verifier, NFC
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 15:55:24 +0000 (15:55 +0000)]
IR: Use default member initialization in Verifier, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266883 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Fix handling of lcomm directive
Krzysztof Parzyszek [Wed, 20 Apr 2016 15:54:13 +0000 (15:54 +0000)]
[Hexagon] Fix handling of lcomm directive

Patch by Colin LeMahieu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266882 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRe-enable "[gold-plugin] Disable name for values other than GlobalValue"
Teresa Johnson [Wed, 20 Apr 2016 15:16:57 +0000 (15:16 +0000)]
Re-enable "[gold-plugin] Disable name for values other than GlobalValue"

This restores r266871 with a fix for gold tests relying on the value
names, when using a release compiler, by adding a way to disable the
default discarding. Update affected tests to use the new mechanism so
that value names are preserved as expected, regardless of how the
compiler was built.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266881 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ThinLTO] Prevent importing of "llvm.used" values
Teresa Johnson [Wed, 20 Apr 2016 14:39:45 +0000 (14:39 +0000)]
[ThinLTO] Prevent importing of "llvm.used" values

Summary:
This patch prevents importing from (and therefore exporting from) any
module with a "llvm.used" local value. Local values need to be promoted
and renamed when importing, and their presense on the llvm.used variable
indicates that there are opaque uses that won't see the rename. One such
example is a use in inline assembly.

See also the discussion at:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098047.html

As part of this, move collectUsedGlobalVariables out of Transforms/Utils
and into IR/Module so that it can be used more widely. There are several
other places in LLVM that used copies of this code that can be cleaned
up as a follow on NFC patch.

Reviewers: joker.eph

Subscribers: pcc, llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266877 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RDF] Consider register as live if any alias is live
Krzysztof Parzyszek [Wed, 20 Apr 2016 14:33:23 +0000 (14:33 +0000)]
[RDF] Consider register as live if any alias is live

This only affects the recomputation of kill flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266875 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][microMIPS] Implement BGEC, BGEUC, BLTC, BLTUC, BEQC and BNEC instructions
Zoran Jovanovic [Wed, 20 Apr 2016 14:07:46 +0000 (14:07 +0000)]
[mips][microMIPS] Implement BGEC, BGEUC, BLTC, BLTUC, BEQC and BNEC instructions

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266873 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[gold-plugin] Disable name for values other than GlobalValue"
Teresa Johnson [Wed, 20 Apr 2016 13:18:47 +0000 (13:18 +0000)]
Revert "[gold-plugin] Disable name for values other than GlobalValue"

This reverts commit r266871. Setting the default based on the NDEBUG
flag is causing test failures. Need to figure out whether to change this
approach or update tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266872 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[gold-plugin] Disable name for values other than GlobalValue
Teresa Johnson [Wed, 20 Apr 2016 13:01:37 +0000 (13:01 +0000)]
[gold-plugin] Disable name for values other than GlobalValue

Summary:
Applies Mehdi's optimization (r263086) to disable value names other than
for GlobalValues to LTO/ThinLTO performed via the gold-plugin, in the
same manner as it is applied in libLTO.

Reviewers: rafael, joker-eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266871 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: Assembler: improvements to support trap handlers.
Nikolay Haustov [Wed, 20 Apr 2016 09:34:48 +0000 (09:34 +0000)]
AMDGPU/SI: Assembler: improvements to support trap handlers.

Add ParseAMDGPURegister which can be invoked recursively for parsing lists.
Rename getRegForName to getSpecialRegForName.
Support legacy SP3 register list syntax: [s2,s3,s4,s5] or [flat_scratch_lo,flat_scratch_hi].
Add 64-bit registers TBA, TMA where missing.
Add some tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266865 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] enable PIE for functions
Asaf Badouh [Wed, 20 Apr 2016 08:32:57 +0000 (08:32 +0000)]
[X86] enable PIE for functions

Call locally defined function directly for PIE/fPIE

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266863 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][microMIPS]Implement CFC*, CTC* and LDC* instructions
Hrvoje Varga [Wed, 20 Apr 2016 06:34:48 +0000 (06:34 +0000)]
[mips][microMIPS]Implement CFC*, CTC* and LDC* instructions
Differential Revision: http://reviews.llvm.org/D18640

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266861 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX512] Add avx512cd+vl runs to vector-tzcnt-128/256 tests to show using the vplzcnt...
Craig Topper [Wed, 20 Apr 2016 05:19:01 +0000 (05:19 +0000)]
[AVX512] Add avx512cd+vl runs to vector-tzcnt-128/256 tests to show using the vplzcntd/q instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266860 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX512] Update vector-tzcnt-512 test to show how bad v32i16 and v64i8 is with avx512...
Craig Topper [Wed, 20 Apr 2016 05:18:58 +0000 (05:18 +0000)]
[AVX512] Update vector-tzcnt-512 test to show how bad v32i16 and v64i8 is with avx512bw enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266859 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX512] Add popcount support for v32i16 and v64i8.
Craig Topper [Wed, 20 Apr 2016 05:18:55 +0000 (05:18 +0000)]
[AVX512] Add popcount support for v32i16 and v64i8.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266858 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThinLTO: never promote as external weak
Mehdi Amini [Wed, 20 Apr 2016 04:18:11 +0000 (04:18 +0000)]
ThinLTO: never promote as external weak

This linkage is *not* intended to express that a declaration refers
to a weak symbol, but that the symbol might not be present at link
time. I don't believe it was the intent.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266856 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFunctionImport: make sure we always select the right callee in presence of alias
Mehdi Amini [Wed, 20 Apr 2016 04:17:36 +0000 (04:17 +0000)]
FunctionImport: make sure we always select the right callee in presence of alias

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266854 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Mark some floating point operations that are always expanded for vector types...
Craig Topper [Wed, 20 Apr 2016 01:57:44 +0000 (01:57 +0000)]
[X86] Mark some floating point operations that are always expanded for vector types as Expand in a floating point only loop instead of looping through all vector types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266850 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Don't mark vector loads and shifts Expand in advance. Loads are always marked...
Craig Topper [Wed, 20 Apr 2016 01:57:42 +0000 (01:57 +0000)]
[X86] Don't mark vector loads and shifts Expand in advance. Loads are always marked Legal or Promote for all the legal types later. Shifts are always marked custom. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266849 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Merge the two different SSE2 blocks in the X86TargetLowering constructor. Also...
Craig Topper [Wed, 20 Apr 2016 01:57:40 +0000 (01:57 +0000)]
[X86] Merge the two different SSE2 blocks in the X86TargetLowering constructor. Also qualfiy the XOP block with !useSoftFloat to match the other vector blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266848 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Don't set vector FADD,FSUB,FMUL,FDIV,FNEG,FSQRT to Expand early. For every...
Craig Topper [Wed, 20 Apr 2016 01:57:38 +0000 (01:57 +0000)]
[X86] Don't set vector FADD,FSUB,FMUL,FDIV,FNEG,FSQRT to Expand early. For every legal FP type we either set them to Legal or Custom anyway. So let them stay defaulted to Legal and only change when they need to be Custom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266847 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agollvm-lto: run the module verifier when doing IR level work
Mehdi Amini [Wed, 20 Apr 2016 01:04:26 +0000 (01:04 +0000)]
llvm-lto: run the module verifier when doing IR level work

It seems it was only running during CodeGen previously.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266846 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThinLTO: Move alias importing decision on the summary
Mehdi Amini [Wed, 20 Apr 2016 01:04:20 +0000 (01:04 +0000)]
ThinLTO: Move alias importing decision on the summary

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266845 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SystemZ] Add support for llvm.thread.pointer intrinsic.
Marcin Koscielnicki [Wed, 20 Apr 2016 01:03:48 +0000 (01:03 +0000)]
[SystemZ] Add support for llvm.thread.pointer intrinsic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266844 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd LLVMGetAttrKindID in the C API in order to facilitate migration away from LLVMAtt...
Amaury Sechet [Wed, 20 Apr 2016 01:02:12 +0000 (01:02 +0000)]
Add LLVMGetAttrKindID in the C API in order to facilitate migration away from LLVMAttribute

Summary:
LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values.

See D18749 for reference.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266842 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMipsAsmParser::loadImmediate(): Prune an obsolete \param in r266602. [-Wdocumentation]
NAKAMURA Takumi [Wed, 20 Apr 2016 00:55:38 +0000 (00:55 +0000)]
MipsAsmParser::loadImmediate(): Prune an obsolete \param in r266602. [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266841 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Use HANDLE_METADATA_LEAF to define MetadataKind enum, NFC
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 00:29:48 +0000 (00:29 +0000)]
IR: Use HANDLE_METADATA_LEAF to define MetadataKind enum, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266839 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] added -detect_leaks flag (0 by default for now). When enabled, it will...
Kostya Serebryany [Wed, 20 Apr 2016 00:24:21 +0000 (00:24 +0000)]
[libFuzzer] added -detect_leaks flag (0 by default for now). When enabled, it will help finding leaks while fuzzing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266838 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoScoreboardHazardRecognizer: unbreak TSAN by moving a static mutated variable to a...
Mehdi Amini [Wed, 20 Apr 2016 00:21:24 +0000 (00:21 +0000)]
ScoreboardHazardRecognizer: unbreak TSAN by moving a static mutated variable to a member

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266837 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Use std::vector instead of SmallPtrSet for distinct nodes, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 23:59:13 +0000 (23:59 +0000)]
IR: Use std::vector instead of SmallPtrSet for distinct nodes, NFC

We never use the set-ness of SmallPtrSet for distinct nodes.  Eventually
we may start garbage-collecting or reference-counting nodes (in which
cases we'd want to remove things from this collection, and a fast erase
would be valuable), but in the meantime a vector is sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266835 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC.
Mandeep Singh Grang [Tue, 19 Apr 2016 23:51:52 +0000 (23:51 +0000)]
[LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC.

Summary: Removed unwanted --check-prefix=CHECK from numerous unit tests.

Reviewers: t.p.northover, dblaikie, uweigand, MatzeB, tstellarAMD, mcrosier

Subscribers: mcrosier, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266834 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Mips] [MSan] VarArgMIPS64Helper: Use target's endian, not host's.
Marcin Koscielnicki [Tue, 19 Apr 2016 23:46:59 +0000 (23:46 +0000)]
[Mips] [MSan] VarArgMIPS64Helper: Use target's endian, not host's.

Ugh.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266833 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] more trophies
Kostya Serebryany [Tue, 19 Apr 2016 22:37:44 +0000 (22:37 +0000)]
[libFuzzer] more trophies

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266830 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoARM: fix assertion failure on -O0 cmpxchg.
Tim Northover [Tue, 19 Apr 2016 22:25:02 +0000 (22:25 +0000)]
ARM: fix assertion failure on -O0 cmpxchg.

Because lowering of CMP_SWAP_64 occurs during type legalization, there can be
i64 types produced by more than just a BUILD_PAIR or similar. My initial tests
used just incoming function args.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266828 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd IntrWrite[Arg]Mem intrinsic property
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:33 +0000 (21:58 +0000)]
Add IntrWrite[Arg]Mem intrinsic property

Summary:
This property is used to mark an intrinsic that only writes to memory, but
neither reads from memory nor has other side effects.

An example where this is useful is the llvm.amdgcn.buffer.store.format.*
intrinsic, which corresponds to a store instruction that goes through a special
buffer descriptor rather than through a plain pointer.

With this property, the intrinsic should still be handled as having side
effects at the LLVM IR level, but machine scheduling can make smarter
decisions.

Reviewers: tstellarAMD, arsenm, joker.eph, reames

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266826 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Guard VOPC instructions against incorrect commute
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:22 +0000 (21:58 +0000)]
AMDGPU: Guard VOPC instructions against incorrect commute

Summary:
The added testcase, which triggered this, was derived from a shader-db case
via bugpoint. A separate question is why scalar branching wasn't used.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266825 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: SGPR accounting in getSIProgramInfo must ignore exec_lo/hi
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:17 +0000 (21:58 +0000)]
AMDGPU/SI: SGPR accounting in getSIProgramInfo must ignore exec_lo/hi

Summary:
A shader stored the live mask (initial exec mask) in an SGPR which was then
spilled during register allocation. The allocator quite reasonably
optimized turned the spill into

  v_writelane_b32 %vgpr, exec_lo, N
  v_writelane_b32 %vgpr, exec_hi, N+1

at the beginning of the shader, confusing the SGPR accounting.

No test case, because si-sgpr-spill.ll together with an upcoming patch for
WQM handling exhibits the problem.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266824 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen] Make an error message slightly more informative
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:10 +0000 (21:58 +0000)]
[TableGen] Make an error message slightly more informative

Reviewers: ab, spop, stoklund

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266823 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove duplicated header contents, NFC
Vedant Kumar [Tue, 19 Apr 2016 21:55:14 +0000 (21:55 +0000)]
Remove duplicated header contents, NFC

It looks like InstrProfiling.h was the victim of a bad merge. The header
guards in the file prevented the build from blowing up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266822 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Fix operand swapping in HexagonPeephole
Krzysztof Parzyszek [Tue, 19 Apr 2016 21:36:24 +0000 (21:36 +0000)]
[Hexagon] Fix operand swapping in HexagonPeephole

Also, disable zero- and size-extend optimizations for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266821 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] [ARM] Make a target-independent llvm.thread.pointer intrinsic.
Marcin Koscielnicki [Tue, 19 Apr 2016 20:51:05 +0000 (20:51 +0000)]
[AArch64] [ARM] Make a target-independent llvm.thread.pointer intrinsic.

Both AArch64 and ARM support llvm.<arch>.thread.pointer intrinsics that
just return the thread pointer.  I have a pending patch that does the same
for SystemZ (D19054), and there are many more targets that could benefit
from one.

This patch merges the ARM and AArch64 intrinsics into a single target
independent one that will also be used by subsequent targets.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266818 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Add move ops for OrcRemoteTargetClient and OrcRemoteTargetServer to
Lang Hames [Tue, 19 Apr 2016 20:22:50 +0000 (20:22 +0000)]
[Orc] Add move ops for OrcRemoteTargetClient and OrcRemoteTargetServer to
appease MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266812 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Fix printing the address operand of S2_storerinewabs
Krzysztof Parzyszek [Tue, 19 Apr 2016 20:20:33 +0000 (20:20 +0000)]
[Hexagon] Fix printing the address operand of S2_storerinewabs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266811 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPC, SSP] Support PowerPC Linux stack protection.
Tim Shen [Tue, 19 Apr 2016 20:14:52 +0000 (20:14 +0000)]
[PPC, SSP] Support PowerPC Linux stack protection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266809 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SSP, 2/2] Create llvm.stackguard() intrinsic and lower it to LOAD_STACK_GUARD
Tim Shen [Tue, 19 Apr 2016 19:40:37 +0000 (19:40 +0000)]
[SSP, 2/2] Create llvm.stackguard() intrinsic and lower it to LOAD_STACK_GUARD

With this change, ideally IR pass can always generate llvm.stackguard
call to get the stack guard; but for now there are still IR form stack
guard customizations around (see getIRStackGuard()). Future SSP
customization should go through LOAD_STACK_GUARD.

There is a behavior change: stack guard values are not CSEed anymore,
since we should never reuse the value in case that it has been spilled (and
corrupted). See ssp-guard-spill.ll. This also cause the change of stack
size and codegen in X86 and AArch64 test cases.

Ideally we'd like to know if the guard created in llvm.stackprotector() gets
spilled or not. If the value is spilled, discard the value and reload
stack guard; otherwise reuse the value. This can be done by teaching
register allocator to know how to rematerialize LOAD_STACK_GUARD and
force a rematerialization (which seems hard), or check for spilling in
expandPostRAPseudo. It only makes sense when the stack guard is a global
variable, which requires more instructions to load. Anyway, this seems to go out
of the scope of the current patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266806 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Add explicit move ops to OrcRemoteTargetRPCAPI for MSVC.
Lang Hames [Tue, 19 Apr 2016 19:35:16 +0000 (19:35 +0000)]
[Orc] Add explicit move ops to OrcRemoteTargetRPCAPI for MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266805 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Fix missing return in RPC move assignment operator.
Lang Hames [Tue, 19 Apr 2016 19:34:46 +0000 (19:34 +0000)]
[Orc] Fix missing return in RPC move assignment operator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266804 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[lanai] Add lowering for SETCCE i32.
Jacques Pienaar [Tue, 19 Apr 2016 19:15:25 +0000 (19:15 +0000)]
[lanai] Add lowering for SETCCE i32.

* Add lowering for SETCCE i32.
* Add test to check lowering of i64 compares uses SETCCE expansion (outside of EQ and NE).
* Fix select.ll test and immediate form selection for RI operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266802 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ValueTracking, VectorUtils] Refactor getIntrinsicIDForCall
David Majnemer [Tue, 19 Apr 2016 19:10:21 +0000 (19:10 +0000)]
[ValueTracking, VectorUtils] Refactor getIntrinsicIDForCall

The functionality contained within getIntrinsicIDForCall is two-fold: it
checks if a CallInst's callee is a vectorizable intrinsic.  If it isn't
an intrinsic, it attempts to map the call's target to a suitable
intrinsic.

Move the mapping functionality into getIntrinsicForCallSite and rename
getIntrinsicIDForCall to getVectorIntrinsicIDForCall while
reimplementing it in terms of getIntrinsicForCallSite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266801 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Simplify StackMapShadowTracker; NFC
Sanjoy Das [Tue, 19 Apr 2016 18:48:16 +0000 (18:48 +0000)]
[X86] Simplify StackMapShadowTracker; NFC

 - Elide trivial contructor and desctructor
 - Move implementation out of an unnecessary explicit llvm namespace
   scope

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266794 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86MCInstLower] Clean up EmitNops; NFC
Sanjoy Das [Tue, 19 Apr 2016 18:48:13 +0000 (18:48 +0000)]
[X86MCInstLower] Clean up EmitNops; NFC

Instead of having a conditional assert inside EmitNops, refactor so that
the caller can have the assert instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266793 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Implement branch relaxation
Krzysztof Parzyszek [Tue, 19 Apr 2016 18:30:18 +0000 (18:30 +0000)]
[Hexagon] Implement branch relaxation

Patch by Sirish Pande.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266792 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Enable debug info type ODR uniquing for forward decls
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 18:00:19 +0000 (18:00 +0000)]
IR: Enable debug info type ODR uniquing for forward decls

Add a new method, DICompositeType::buildODRType, that will create or
mutate the DICompositeType for a given ODR identifier, and use it in
LLParser and BitcodeReader instead of DICompositeType::getODRType.

The logic is as follows:

  - If there's no node, create one with the given arguments.
  - Else, if the current node is a forward declaration and the new
    arguments would create a definition, mutate the node to match the
    new arguments.
  - Else, return the old node.

This adds a missing feature supported by the current DITypeIdentifierMap
(which I'm slowly making redudant).  The only remaining difference is
that the DITypeIdentifierMap has a "the-last-one-wins" rule, whereas
DICompositeType::buildODRType has a "the-first-one-wins" rule.

For now I'm leaving behind DICompositeType::getODRType since it has
obvious, low-level semantics that are convenient for unit testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266786 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPreliminary changes for fixing PR27241. Generalized/restructured some things
David L Kreitzer [Tue, 19 Apr 2016 17:43:44 +0000 (17:43 +0000)]
Preliminary changes for fixing PR27241. Generalized/restructured some things
in preparation for enabling the outgoing parameter store-to-push optimization
for 64-bit targets.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266774 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLinker: Simplify test/Linker/dicompositetype-unique.ll, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 17:43:43 +0000 (17:43 +0000)]
Linker: Simplify test/Linker/dicompositetype-unique.ll, NFC

Simplify the test logic a little, sharing logic between the two linking
directions by specifying -check-prefix multiple times.  Now it's more
obvious what's hte same and different between the two directions, and
there is less CHECK duplication.  This is a prep for expanding the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266773 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-pdbdump] Print a better error message when PDB loading fails.
Zachary Turner [Tue, 19 Apr 2016 17:36:58 +0000 (17:36 +0000)]
[llvm-pdbdump] Print a better error message when PDB loading fails.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266772 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Add move ops to RPC to satisfy MSVC.
Lang Hames [Tue, 19 Apr 2016 17:26:59 +0000 (17:26 +0000)]
[Orc] Add move ops to RPC to satisfy MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266768 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ValueTracking] Improve isImpliedCondition for conditions with matching operands.
Chad Rosier [Tue, 19 Apr 2016 17:19:14 +0000 (17:19 +0000)]
[ValueTracking] Improve isImpliedCondition for conditions with matching operands.

This patch improves SimplifyCFG to catch cases like:

  if (a < b) {
    if (a > b) <- known to be false
      unreachable;
  }

Phabricator Revision: http://reviews.llvm.org/D18905

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266767 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Add pthread dependence to the RPCUtilsTest unit test.
Lang Hames [Tue, 19 Apr 2016 17:13:52 +0000 (17:13 +0000)]
[Orc] Add pthread dependence to the RPCUtilsTest unit test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266766 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: LLVMContextTest => DebugTypeODRUniquingTest, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 17:11:06 +0000 (17:11 +0000)]
IR: LLVMContextTest => DebugTypeODRUniquingTest, NFC

The second test in this file is actually testing DICompositeType API,
not LLVMContext API (after r266742 moved it to a higher level).  This
really doesn't make sense in an LLVMContextTest.  Rename the tests
before adding more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266764 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLinker: Avoid constructing ValueMap::MDMapT
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 16:57:24 +0000 (16:57 +0000)]
Linker: Avoid constructing ValueMap::MDMapT

Calling ValueMap::MD lazily constructs a ValueMap, which mallocs the
buckets.  Instead of swapping constructed maps, move around the
underlying Optional<MDMapT>.  This gets rid of some unnecessary malloc
traffic from r266579 (not that it showed up on a profile).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266761 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DependenceAnalysis] Refactor uses of getConstantPart. NFC.
Brendon Cahoon [Tue, 19 Apr 2016 16:46:57 +0000 (16:46 +0000)]
[DependenceAnalysis] Refactor uses of getConstantPart. NFC.

Rather than checking for the SCEV type prior to calling
getContantPart, perform the checks in the function. This reduces
the number of places where the checks are needed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266759 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix Gold test after r266750 (ModuleLinker: Do not import linkonce/weak as "external_w...
Mehdi Amini [Tue, 19 Apr 2016 16:21:37 +0000 (16:21 +0000)]
Fix Gold test after r266750 (ModuleLinker: Do not import linkonce/weak as "external_weak")

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266752 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Use Optional instead of unique_ptr for Metadata map in ValueMap, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 16:17:48 +0000 (16:17 +0000)]
IR: Use Optional instead of unique_ptr for Metadata map in ValueMap, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266751 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModuleLinker: Do not import linkonce/weak as "external_weak"
Mehdi Amini [Tue, 19 Apr 2016 16:11:05 +0000 (16:11 +0000)]
ModuleLinker: Do not import linkonce/weak as "external_weak"

Summary:
There is no reason to have a weak reference because the external
definition will be weak.

Reviewers: rafael

Subscribers: llvm-commits, tejohnson

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266750 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Use Optional instead of unique_ptr for debug info ODR type map, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 16:06:50 +0000 (16:06 +0000)]
IR: Use Optional instead of unique_ptr for debug info ODR type map, NFC

Save a level of malloc indirection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266749 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoEnable ODR uniquing of DITypes in more places
Teresa Johnson [Tue, 19 Apr 2016 15:48:30 +0000 (15:48 +0000)]
Enable ODR uniquing of DITypes in more places

Summary:
This is a follow-on to apply Duncan's new DIType ODR uniquing from
r266549 and r266713 in more places.

Enable enableDebugTypeODRUniquing() for ThinLTO backends invoked via
libLTO, similar to the way r266549 enabled this for ThinLTO backend
threads launched from gold-plugin.

Also enable enableDebugTypeODRUniquing in opt, similar to the way
r266549 enabled this for llvm-link (on by default, can be disabled with
new -disable-debug-info-type-map option), since we may perform ThinLTO
importing from opt.

Reviewers: dexonsmith, joker.eph

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266746 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: getOrInsertODRUniquedType => DICompositeType::getODRType, NFC
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 14:55:09 +0000 (14:55 +0000)]
IR: getOrInsertODRUniquedType => DICompositeType::getODRType, NFC

Lift the API for debug info ODR type uniquing up a layer.  Instead of
clients managing the map directly on the LLVMContext, add a static
method to DICompositeType called getODRType and handle the map in the
background.  Also adds DICompositeType::getODRTypeIfExists, so far just
for convenience in the unit tests.

This simplifies the logic in LLParser and BitcodeReader.  Because of
argument spam there are actually a few more lines of code now; I'll see
if I come up with a reasonable way to clean that up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266742 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Require DICompositeType for ODR uniquing type map
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 14:42:55 +0000 (14:42 +0000)]
IR: Require DICompositeType for ODR uniquing type map

Tighten up the API for debug info ODR type uniquing in LLVMContext.  The
only reason to allow other DIType subclasses is to make the unit tests
prettier :/.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266737 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine][X86] Added extra tests introduced for D17490
Simon Pilgrim [Tue, 19 Apr 2016 12:59:52 +0000 (12:59 +0000)]
[InstCombine][X86] Added extra tests introduced for D17490

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266732 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine][X86] Regenerate SSE combine tests as part of setup for D17490
Simon Pilgrim [Tue, 19 Apr 2016 12:56:46 +0000 (12:56 +0000)]
[InstCombine][X86] Regenerate SSE combine tests as part of setup for D17490

Regenerated with utils/update_test_checks.py

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266731 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][AVX2] Prefer VPERMQ/VPERMPD over VINSERTI128/VINSERTF128 for unary shuffles
Simon Pilgrim [Tue, 19 Apr 2016 12:26:40 +0000 (12:26 +0000)]
[X86][AVX2] Prefer VPERMQ/VPERMPD over VINSERTI128/VINSERTF128 for unary shuffles

Using VPERMQ/VPERMPD allows memory folding of the (repeated) input where VINSERTI128/VINSERTF128 can not.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266728 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMinor improvement to debug output for Function Importer (NFC)
Mehdi Amini [Tue, 19 Apr 2016 09:21:30 +0000 (09:21 +0000)]
Minor improvement to debug output for Function Importer (NFC)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266723 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a description for the PatchableFunction pass; NFC
Sanjoy Das [Tue, 19 Apr 2016 06:25:02 +0000 (06:25 +0000)]
Add a description for the PatchableFunction pass; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266721 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDisable the PatchableFunction pass for NVPTX & Wasm
Sanjoy Das [Tue, 19 Apr 2016 06:24:58 +0000 (06:24 +0000)]
Disable the PatchableFunction pass for NVPTX & Wasm

PatchableFunction requires AllVRegsAllocated that these targets don't
provide.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266720 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCorrect IDF calculator for ReverseIDF
Daniel Berlin [Tue, 19 Apr 2016 06:13:28 +0000 (06:13 +0000)]
Correct IDF calculator for ReverseIDF

Summary:
Need to use predecessors for reverse graph, successors for forward graph.
succ_iterator/pred_iterator are not compatible, this patch is all the work necessary to work around that (which is what everywhere else does).  Not sure if there is a better way, so cc'ing some random folks to take a gander :)

Reviewers: dblaikie, qcolombet, echristo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266718 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Orc] Disable RPC callST unit test until the S390 failures encountered during
Lang Hames [Tue, 19 Apr 2016 06:01:51 +0000 (06:01 +0000)]
[Orc] Disable RPC callST unit test until the S390 failures encountered during
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3459 can be
debugged/fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266717 91177308-0d34-0410-b5e6-96231b3b80d8