oota-llvm.git
9 years ago[WinEH] Implement support for catch-all
David Majnemer [Wed, 1 Apr 2015 05:20:42 +0000 (05:20 +0000)]
[WinEH] Implement support for catch-all

A catch (...) doesn't have a type descriptor.  Instead, the 'adjectives'
field has bit six set.

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

9 years ago[Orc] Reflect process symbols into the LLI Orc-lazy JIT.
Lang Hames [Wed, 1 Apr 2015 04:42:56 +0000 (04:42 +0000)]
[Orc] Reflect process symbols into the LLI Orc-lazy JIT.

This makes symbol resolution essentially identical between MCJIT and the LLI
Orc-lazy JIT.

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

9 years ago[CMake] Cache LLVM_ABI_BREAKING_CHECKS in LLVMConfig.cmake.
Sanjoy Das [Wed, 1 Apr 2015 03:16:10 +0000 (03:16 +0000)]
[CMake] Cache LLVM_ABI_BREAKING_CHECKS in LLVMConfig.cmake.

Not having this breaks clang builds that use an already-built LLVM.

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

9 years agoFix PR23065. Avoid optimizing bitcast of build_vector with constant input to scalar_t...
Jiangning Liu [Wed, 1 Apr 2015 01:52:38 +0000 (01:52 +0000)]
Fix PR23065. Avoid optimizing bitcast of build_vector with constant input to scalar_to_vector.

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

9 years ago[SimplifyLibCalls] Ignore nobuiltin/unavailable fortified libcalls.
Ahmed Bougacha [Wed, 1 Apr 2015 00:45:09 +0000 (00:45 +0000)]
[SimplifyLibCalls] Ignore nobuiltin/unavailable fortified libcalls.

We used to do this before refactorings around r225640.
Some clang users checked for _chk libcall availability using:
  __has_builtin(__builtin___memcpy_chk)
When compiling with -fno-builtin, this is always true.
When passing -ffreestanding/-mkernel, which both imply -fno-builtin, we
end up with fortified libcalls, which isn't acceptable in a freestanding
environment which only provides their non-fortified counterparts.

Until we change clang and/or teach external users to check for availability
differently, disregard the "nobuiltin" attribute and TLI::has.

Workaround for PR23093.

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

9 years ago[PowerPC] FastISel can't handle i1 return values when using CR bits
Hal Finkel [Wed, 1 Apr 2015 00:40:48 +0000 (00:40 +0000)]
[PowerPC] FastISel can't handle i1 return values when using CR bits

Under normal circumstances, use of CR bits is disabled when running at -O0, but
it is enabled by default otherwise, and if you have optnone functions, they'll
still generally be generated with crbits turned on (because nothing else turns
them off). FastISel can't handle most things dealing with i1 values when using
CR bits, and checks for that, but was not checking the return type on
functions; we can't fast-isel function calls with i1 return values either when
using CR bits for boolean values.

Fixes PR22664.

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

9 years ago[docs] Fix typo.
Sean Silva [Tue, 31 Mar 2015 22:48:45 +0000 (22:48 +0000)]
[docs] Fix typo.

Based on a patch by Stanislav Manilov!

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

9 years ago[WinEH] ExitingScope is vacuously true if !PoppedCatches.empty()
David Majnemer [Tue, 31 Mar 2015 22:43:56 +0000 (22:43 +0000)]
[WinEH] ExitingScope is vacuously true if !PoppedCatches.empty()

Remove a redundant condition, no functional change intended.

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

9 years ago[WinEH] Generate .xdata for catch handlers
David Majnemer [Tue, 31 Mar 2015 22:35:44 +0000 (22:35 +0000)]
[WinEH] Generate .xdata for catch handlers

This lets us catch exceptions in simple cases.

N.B. Things that do not work include (but are not limited to):
- Throwing from within a catch handler.
- Catching an object with a named catch parameter.
- 'CatchHigh' is fictitious, we aren't sure of its purpose.
- We aren't entirely efficient with regards to the number of EH states
  that we generate.
- IP-to-State tables are sensitive to the order of emission.

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

9 years ago[fuzzer] more documentation
Kostya Serebryany [Tue, 31 Mar 2015 21:39:38 +0000 (21:39 +0000)]
[fuzzer] more documentation

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

9 years agotypo; NFC
Sanjay Patel [Tue, 31 Mar 2015 21:24:47 +0000 (21:24 +0000)]
typo; NFC

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

9 years agoIR: Rename replaceWithUniqued() tests from r233751
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 21:05:06 +0000 (21:05 +0000)]
IR: Rename replaceWithUniqued() tests from r233751

replaceWithUniquedUnresolved
replaceWithUniquedUnresolvedChangedOperand
 =>
replaceWithUniquedResolvingOperand
replaceWithUniquedChangingOperand

I find the new names less confusing; they're also more accurate.  Sorry
for the churn.

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

9 years agoVerifier: Add a testcase for verifying type refs
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 20:57:56 +0000 (20:57 +0000)]
Verifier: Add a testcase for verifying type refs

r233664 fixed the `Verifier` so that it doesn't crash on bad type refs.
This deserves a test!

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

9 years ago[PowerPC] Don't use a vector preferred memory type at -O0
Hal Finkel [Tue, 31 Mar 2015 20:56:09 +0000 (20:56 +0000)]
[PowerPC] Don't use a vector preferred memory type at -O0

Even at -O0, we fall back to SDAG when we hit intrinsics, and if the intrinsic
is a memset/memcpy/etc. we might normally use vector types. At -O0, this is
probably not a good idea (because, if there is a bug in the lowering code,
there would be no good way to turn it off). At -O0, only use scalar preferred
types.

Related to PR22754.

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

9 years ago[AArch64] Enable the codegenprepare optimization that promotes operation to form
Quentin Colombet [Tue, 31 Mar 2015 20:52:32 +0000 (20:52 +0000)]
[AArch64] Enable the codegenprepare optimization that promotes operation to form
extended loads.
Implement the related target lowering hook so that the optimization has a better
estimation of the cost of an extension.

rdar://problem/19267165

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

9 years agoFix AllocationPriority not getting set for derived register classes.
Matthias Braun [Tue, 31 Mar 2015 20:52:25 +0000 (20:52 +0000)]
Fix AllocationPriority not getting set for derived register classes.

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

9 years agoIR: Enable uniquing callbacks during MDNode::replaceWithUniqued()
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 20:50:50 +0000 (20:50 +0000)]
IR: Enable uniquing callbacks during MDNode::replaceWithUniqued()

Uniqued nodes have more complete registration with
`ReplaceableMetadataImpl` so that they can update themselves when
operands change.  Fix a bug where `MDNode::replaceWithUniqued()` wasn't
enabling these callbacks.

The two most obvious ways missing callbacks causes problems is that
auto-resolution fails and re-uniquing (on changed operands) just doesn't
happen.  I've added tests for both -- in both cases, I confirmed that
the final check was failing before the fix.

rdar://problem/20365935

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

9 years ago[MCJIT] Enable MCJIT regression tests on Darwin.
Lang Hames [Tue, 31 Mar 2015 20:48:52 +0000 (20:48 +0000)]
[MCJIT] Enable MCJIT regression tests on Darwin.

Commit r233747 fixed the issue that had been blocking this.

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

9 years ago[SDAG] Handle non-integer preferred memset types for non-constant values
Hal Finkel [Tue, 31 Mar 2015 20:35:26 +0000 (20:35 +0000)]
[SDAG] Handle non-integer preferred memset types for non-constant values

The existing code in getMemsetValue only handled integer-preferred types when
the fill value was not a constant. Make this more robust in two ways:

  1. If the preferred type is a floating-point value, do the mul-splat trick on
     the corresponding integer type and then bitcast.
  2. If the preferred type is a vector, do the mul-splat trick on one vector
     element, and then build a vector out of them.

Fixes PR22754 (although, we should also turn off use of vector types at -O0).

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

9 years ago[ExecutionEngine] Fix MCJIT::addGlobalMapping.
Lang Hames [Tue, 31 Mar 2015 20:31:14 +0000 (20:31 +0000)]
[ExecutionEngine] Fix MCJIT::addGlobalMapping.

This patch fixes MCJIT::addGlobalMapping by changing the implementation of the
ExecutionEngineState class. The new implementation maintains a bidirectional
mapping between symbol names (std::strings) and addresses (uint64_ts), rather
than a mapping between Value*s and void*s.

This has fix has been made for backwards compatibility, however the strongly
preferred way to resolve unknown symbols is by writing a custom
RuntimeDyld::SymbolResolver (formerly RTDyldMemoryManager) and overriding the
findSymbol method. The addGlobalMapping method is a hangover from the legacy JIT
(which has was removed in 3.6), and may be deprecated in a future release as
part of a clean-up of the ExecutionEngine interface.

Patch by Murat Bolat. Thanks Murat!

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

9 years ago[fuzzer] Add support for token-based fuzzing (e.g. for C++). Allow string flags.
Kostya Serebryany [Tue, 31 Mar 2015 20:13:20 +0000 (20:13 +0000)]
[fuzzer] Add support for token-based fuzzing (e.g. for C++). Allow string flags.

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

9 years agoClarify that higher priority means higher values.
Matthias Braun [Tue, 31 Mar 2015 20:04:46 +0000 (20:04 +0000)]
Clarify that higher priority means higher values.

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

9 years agoRegAllocGreedy: Allow target to specify register class ordering.
Matthias Braun [Tue, 31 Mar 2015 19:57:53 +0000 (19:57 +0000)]
RegAllocGreedy: Allow target to specify register class ordering.

Specify an allocation order with a register class. This is used by register
allocators with a greedy heuristic. This is usefull as it is sometimes
beneficial to color more constrained classes first.

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

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

9 years agoRegAllocGreedy: Improve live interval order in ReverseLocal mode
Matthias Braun [Tue, 31 Mar 2015 19:57:49 +0000 (19:57 +0000)]
RegAllocGreedy: Improve live interval order in ReverseLocal mode

When allocating live intervals in linear order and all of them are local
to a single basic block you get an optimal coloring. This is also true
if you reverse the order, but it is not true if you sort live ranges
beginnings in reverse order, change to sort live range endings in
reverse order. Take the following live ranges for example:

   |---| |--------|
|----------| |-------|

They get colored suboptimally with 3 registers if you sort the live range
starting points in reverse order (but optimally with live range begins in order,
or live range ends in reverse order).

Apparently the previous strategy was intentional because of allocation
time considerations. I am having a hard time replicating these effects,
while I see substantial improvements in allocation quality with this
change.

No testcase as none of the (in tree) targets use reverse order mode.

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

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

9 years ago[Hexagon] Avoid an unused variable warning when assertions are off
Simon Atanasyan [Tue, 31 Mar 2015 19:43:47 +0000 (19:43 +0000)]
[Hexagon] Avoid an unused variable warning when assertions are off

No functional changes.

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

9 years ago[SystemZ] Address review comments for r233689
Ulrich Weigand [Tue, 31 Mar 2015 19:28:50 +0000 (19:28 +0000)]
[SystemZ] Address review comments for r233689

Change lowerCTPOP to:
- Gracefully handle a known-zero input value
- Simplify computation of significant bit size

Thanks to Jay Foad for the review!

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

9 years ago[X86, AVX] fix zero-extending integer operand load patterns to use integer instructions
Sanjay Patel [Tue, 31 Mar 2015 18:43:43 +0000 (18:43 +0000)]
[X86, AVX] fix zero-extending integer operand load patterns to use integer instructions

This is a follow-on to r233704 and another partial fix for PR22685:
https://llvm.org/bugs/show_bug.cgi?id=22685

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

9 years ago[Orc][MCJIT] Remove the small code model regression tests.
Lang Hames [Tue, 31 Mar 2015 18:19:25 +0000 (18:19 +0000)]
[Orc][MCJIT] Remove the small code model regression tests.

These regression tests are supposed to test small code model support, but have
been XFAIL'd because we don't have an in-tree memory manager that can guarantee
a small-code-model compatible memory layout. Unfortunately, they can
occasionally pass if they get lucky with memory allocation, causing unexpected
passes on the bots. That's not very helpful.

I'm going to remove these until we have the infrastructure (small-code-model
compatible memory manager) to run them properly.

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

9 years agoAArch64: fix v8.1 sqrdmlah tests on Darwin platforms
Tim Northover [Tue, 31 Mar 2015 16:41:38 +0000 (16:41 +0000)]
AArch64: fix v8.1 sqrdmlah tests on Darwin platforms

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

9 years agoRework r233647, "llvm/examples: Suppress building a few JIT examples."
NAKAMURA Takumi [Tue, 31 Mar 2015 16:41:25 +0000 (16:41 +0000)]
Rework r233647, "llvm/examples: Suppress building a few JIT examples."

It didn't work with "install".

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

9 years ago[X86, AVX] try to lowerVectorShuffleAsElementInsertion() for all 256-bit vector sub...
Sanjay Patel [Tue, 31 Mar 2015 16:32:11 +0000 (16:32 +0000)]
[X86, AVX] try to lowerVectorShuffleAsElementInsertion() for all 256-bit vector sub-types

I suggested this change in D7898 (http://llvm.org/viewvc/llvm-project?view=revision&revision=231354)

It improves the v4i64 case although not optimally. This AVX codegen:

  vmovq {{.*#+}} xmm0 = mem[0],zero
  vxorpd %ymm1, %ymm1, %ymm1
  vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]

Becomes:

  vmovsd {{.*#+}} xmm0 = mem[0],zero

Unfortunately, this doesn't completely solve PR22685. There are still at least 2 problems under here:

    We're not handling v32i8 / v16i16.
    We're not getting the FP / int domains right for instruction selection.

But since this patch alone appears to do no harm, reduces code duplication, and helps v4i64,
I'm submitting this patch ahead of fixing the above.

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

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

9 years agotypos; NFC
Sanjay Patel [Tue, 31 Mar 2015 16:17:51 +0000 (16:17 +0000)]
typos; NFC

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

9 years ago[SystemZ] Add Analysis to required_libraries (fall-out from r233688)
Ulrich Weigand [Tue, 31 Mar 2015 15:16:13 +0000 (15:16 +0000)]
[SystemZ] Add Analysis to required_libraries (fall-out from r233688)

Should fix build failures with cmake builds

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

9 years ago[docs] add cross-reference
Scott Douglass [Tue, 31 Mar 2015 15:07:53 +0000 (15:07 +0000)]
[docs] add cross-reference

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

9 years agoExpand MUX instructions early on Hexagon
Krzysztof Parzyszek [Tue, 31 Mar 2015 13:35:12 +0000 (13:35 +0000)]
Expand MUX instructions early on Hexagon

This time with all files included.

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

9 years agoRevert 233694. Weak SVN-fu.
Krzysztof Parzyszek [Tue, 31 Mar 2015 13:32:32 +0000 (13:32 +0000)]
Revert 233694.  Weak SVN-fu.

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

9 years agoExpand MUX instructions early on Hexagon
Krzysztof Parzyszek [Tue, 31 Mar 2015 13:29:17 +0000 (13:29 +0000)]
Expand MUX instructions early on Hexagon

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

9 years ago[AArch64] Add v8.1a "Rounding Double Multiply Add/Subtract" extension
Vladimir Sukharev [Tue, 31 Mar 2015 13:15:48 +0000 (13:15 +0000)]
[AArch64] Add v8.1a "Rounding Double Multiply Add/Subtract" extension

Reviewers: t.p.northover, jmolloy

Subscribers: llvm-commits

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

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

9 years ago[SystemZ] Support RISBGN instruction on zEC12
Ulrich Weigand [Tue, 31 Mar 2015 12:58:17 +0000 (12:58 +0000)]
[SystemZ] Support RISBGN instruction on zEC12

So far, we do not yet support any instruction specific to zEC12.
Most of the facilities added with zEC12 are indeed not very useful
to compiler code generation, but there is one exception: the
miscellaneous-extensions facility provides the RISBGN instruction,
which is a variant of RISBG that does not set the condition code.

Add support for this facility, MC support for RISBGN, and CodeGen
support for prefering RISBGN over RISBG on zEC12, unless we can
actually make use of the condition code set by RISBG.

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

9 years ago[SystemZ] Use POPCNT instruction on z196
Ulrich Weigand [Tue, 31 Mar 2015 12:56:33 +0000 (12:56 +0000)]
[SystemZ] Use POPCNT instruction on z196

We already exploit a number of instructions specific to z196,
but not yet POPCNT.  Add support for the population-count
facility, MC support for the POPCNT instruction, CodeGen
support for using POPCNT, and implement the getPopcntSupport
TargetTransformInfo hook.

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

9 years ago[SystemZ] Provide basic TargetTransformInfo implementation
Ulrich Weigand [Tue, 31 Mar 2015 12:52:27 +0000 (12:52 +0000)]
[SystemZ] Provide basic TargetTransformInfo implementation

This hooks up the TargetTransformInfo machinery for SystemZ,
and provides an implementation of getIntImmCost.

In addition, the patch adds the isLegalICmpImmediate and
isLegalAddImmediate TargetLowering overrides, and updates
a couple of test cases where we now generate slightly
better code.

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

9 years agoFix the operand encoding in the test instruction.
Rafael Espindola [Tue, 31 Mar 2015 12:31:55 +0000 (12:31 +0000)]
Fix the operand encoding in the test instruction.

Fixes pr22995.

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

9 years ago[PowerPC] Remove TargetMachine CPU auto-detection
Ulrich Weigand [Tue, 31 Mar 2015 12:01:06 +0000 (12:01 +0000)]
[PowerPC] Remove TargetMachine CPU auto-detection

As was done for X86 in r206094.

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

9 years ago[SDAG] Move TRUNCATE splitting logic into a helper, and use
James Molloy [Tue, 31 Mar 2015 10:20:58 +0000 (10:20 +0000)]
[SDAG] Move TRUNCATE splitting logic into a helper, and use
 it more liberally.

SplitVecOp_TRUNCATE has logic for recursively splitting oversize vectors
that need more than one round of splitting to become legal. There are many
other ISD nodes that could benefit from this logic, so factor it out and
use it for FP_TO_UINT,FP_TO_SINT,SINT_TO_FP,UINT_TO_FP and FTRUNC.

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

9 years ago[X86] Stop changing result of getHostCPUName based on whether the processor supports...
Craig Topper [Tue, 31 Mar 2015 06:18:31 +0000 (06:18 +0000)]
[X86] Stop changing result of getHostCPUName based on whether the processor supports AVX. getHostCPUFeatures should be used instead to determine whether to support AVX.

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

9 years agoMake llc use getHostCPUFeatures when 'native' is specified for cpu.
Craig Topper [Tue, 31 Mar 2015 05:52:57 +0000 (05:52 +0000)]
Make llc use getHostCPUFeatures when 'native' is specified for cpu.

This is necessary for x86 where not all Sandybridge, Ivybrige, Haswell, and Broadwell CPUs support AVX. Currently we modify the CPU name back to Nehalem for this case, but that turns off additional features for these CPUs.

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

9 years ago[X86] Be more robust against unknown Intel family 6 models. Use feature flags to...
Craig Topper [Tue, 31 Mar 2015 05:42:45 +0000 (05:42 +0000)]
[X86] Be more robust against unknown Intel family 6 models. Use feature flags to guess what it might be.

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

9 years ago[X86] Generate MOVNT for all vector types.
Ahmed Bougacha [Tue, 31 Mar 2015 03:16:51 +0000 (03:16 +0000)]
[X86] Generate MOVNT for all vector types.

We used to miss non-Q YMM integer vectors, and, non-Q/D XMM integer
vectors.
While there, change the v4i32 patterns to prefer MOVNTDQ.

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

9 years agotools: Unify how verifyModule() is called
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 03:07:23 +0000 (03:07 +0000)]
tools: Unify how verifyModule() is called

Unify the error messages for the various tools when `verifyModule()`
fails on an input module.  The "brave new way" is:

    lltool: path/to/input.ll: error: input module is broken!

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

9 years ago[bpf] mark mov instructions as ReMaterializable
Alexei Starovoitov [Tue, 31 Mar 2015 02:49:58 +0000 (02:49 +0000)]
[bpf] mark mov instructions as ReMaterializable

loading immediate into register is cheap, so take advantage of remat.

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

9 years agoVerifier: Don't return early from verifyTypeRefs()
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 02:37:13 +0000 (02:37 +0000)]
Verifier: Don't return early from verifyTypeRefs()

We'll no longer crash in the `verifyTypeRefs()` (used to be called
`verifyDebugInfo()`), so there's no reason to return early here.  Remove
the `EverBroken` member since this was the only use!

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

9 years agoVerifier: Explicitly verify type references
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 02:27:32 +0000 (02:27 +0000)]
Verifier: Explicitly verify type references

`verifyDebugInfo()` was doing two things:

  - Asserting on unresolved type references.
  - Calling `Verify()` functions for various types of debug info.

The `Verify()` functions have been gutted, so rename the function to
`verifyTypeRefs()` and explicitly check those.  Instead of assertions,
we get nice error messages now.

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

9 years agoVerifier: Move over DISubprogram::Verify()
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 02:09:55 +0000 (02:09 +0000)]
Verifier: Move over DISubprogram::Verify()

Move over the remaining (somewhat complicated) check from
`DISubprogram::Verify()`.  I suspect this check could be optimized --
e.g., it would be nice not to do another full traversal here -- but it's
not exactly obvious how.  For now, just bring it over as is.

Once we have a better model for the "canonical" subprogram of a
`Function`, we should enforce that all `!dbg` attachments lead to the
canonical one.

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

9 years agoDebugInfo: Rewrite llvm::getDISubprogram(), NFC
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 02:06:28 +0000 (02:06 +0000)]
DebugInfo: Rewrite llvm::getDISubprogram(), NFC

Simplify implementation of `llvm::getDISubprogram()`.  I might go
through and see how difficult it is to update the users, since this
function doesn't really seem necessary anymore.

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

9 years agoDebugInfo: Hide isScopeRef() and isTypeRef() behind NDEBUG
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 01:47:55 +0000 (01:47 +0000)]
DebugInfo: Hide isScopeRef() and isTypeRef() behind NDEBUG

The copies of these in `lib/IR/DebugInfo.cpp` are apparently [1] only
used in assertions now, so hide them behind `#ifndef NDEBUG`.

[1]: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/9238

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

9 years agoDebugInfo: Factor out RETURN_FROM_RAW, etc.
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 01:47:37 +0000 (01:47 +0000)]
DebugInfo: Factor out RETURN_FROM_RAW, etc.

Remove the helper macros `RETURN_FROM_RAW()`,
`RETURN_DESCRIPTOR_FROM_RAW()`, and `RETURN_REF_FROM_RAW()`, since they
don't do anything too special anymore.  This loses an `assert(get())`,
but I'm hoping any crashes were shaken out when r232844 landed a few
weeks ago.

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

9 years agoVerifier: Check reference flags in debug info
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 01:28:58 +0000 (01:28 +0000)]
Verifier: Check reference flags in debug info

Move over checks of `&` and `&&` flags.

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

9 years agoVerifier: Move more debug info checks away from Verify()
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 01:28:22 +0000 (01:28 +0000)]
Verifier: Move more debug info checks away from Verify()

Most of these checks were already in the `Verifier` so this is more of a
cleanup.  Now almost everything is over there.

Now that require a `name:` for `MDGlobalVariable`, add a check in
`LLParser` for it.

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

9 years agoDebugInfo: Move debug info flags to the new hierarchy
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 01:19:51 +0000 (01:19 +0000)]
DebugInfo: Move debug info flags to the new hierarchy

Move definition of the debug info flags to the new hierarchy, but leave
them duplicated in `DIDescriptor` for now to reduce code churn.  My
current plan is to remove `DIDescriptor` entirely, so the duplication
should go away naturally.

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

9 years agoVerifier: Move checks over from DIDescriptor::Verify()
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 00:47:15 +0000 (00:47 +0000)]
Verifier: Move checks over from DIDescriptor::Verify()

Move over some more checks from `DIDescriptor::Verify()`, and change
`LLParser` to require non-null `file:` fields in compile units.

I've ignored the comment in test/Assembler/metadata-null-operands.ll
since I disagree with it.  At the time that test was written (r229960),
the debug info verifier wasn't on by default, so my comment there is in
the context of not expecting the verifier to be useful.  It is now, and
besides that, since r233394 we can check when parsing textual IR whether
an operand is null that shouldn't be.

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

9 years ago[AArch64] Fix poor codegen for add immediate.
Quentin Colombet [Tue, 31 Mar 2015 00:31:13 +0000 (00:31 +0000)]
[AArch64] Fix poor codegen for add immediate.
We used to match the register variant before the immediate when the register
argument could be implicitly zero-extended.

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

9 years agoDebugInfo: Remove LexicalBlockFile scope/context distinction
Duncan P. N. Exon Smith [Tue, 31 Mar 2015 00:10:37 +0000 (00:10 +0000)]
DebugInfo: Remove LexicalBlockFile scope/context distinction

Two things here:

 1. I read `getScope()` and `getContext()` backwards in r233640.  There
    was no need for `getScopeOfScope()`.  Obviously not enough test
    coverage here (as I said in that commit, I'm going to come back to
    that), but anyway I'm reverting to the behaviour before r233640.
 2. The callers that use `DILexicalBlockFile::getContext()` don't seem
    to care about the difference.  Just have it redirect to `getScope()`
    so I can't get confused again.

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

9 years agoReplace the MCSubtargetInfo parameter with a Triple when creating
Eric Christopher [Tue, 31 Mar 2015 00:10:04 +0000 (00:10 +0000)]
Replace the MCSubtargetInfo parameter with a Triple when creating
an MCInstPrinter. Update all callers and use where we wanted a Triple
previously.

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

9 years agollvm/examples: Suppress building a few JIT examples.
NAKAMURA Takumi [Tue, 31 Mar 2015 00:03:43 +0000 (00:03 +0000)]
llvm/examples: Suppress building a few JIT examples.

  examples/ExceptionDemo/CMakeFiles/ExceptionDemo.dir/ExceptionDemo.cpp.o:(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager'

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

9 years agollvm/examples: Add RuntimeDyld as libdeps.
NAKAMURA Takumi [Tue, 31 Mar 2015 00:03:36 +0000 (00:03 +0000)]
llvm/examples: Add RuntimeDyld as libdeps.

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

9 years agoLexicalScopes: Cleanup remaining uses of DebugLoc
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 23:58:59 +0000 (23:58 +0000)]
LexicalScopes: Cleanup remaining uses of DebugLoc

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

9 years agoDebugLoc: Remove getFromDILexicalBlock()
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 23:47:26 +0000 (23:47 +0000)]
DebugLoc: Remove getFromDILexicalBlock()

The only user of `DebugLoc::getFromDILexicalBlock()` was creating a new
`MDLocation` as convenient API for passing an `MDScope`.  Stop doing
that, and remove the API.  If in the future we actually *want* to create
new DebugLocs, calling `MDLexicalBlock::get()` makes more sense.

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

9 years agoLexicalScopes: Use debug info hierarchy pervasively
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 23:21:21 +0000 (23:21 +0000)]
LexicalScopes: Use debug info hierarchy pervasively

Pervasively use the types provided by the debug info hierarchy rather
than `MDNode` in `LexicalScopes`.

I noticed (again, I guess, based on comments in the implementation?)
that `DILexicalBlockFile::getScope()` returns something different from
`DILexicalBlockFile::getContext()`.  I created a local helper for
getting the same logic from `MDLexicalBlockFile` called
`getScopeOfScope()`.  I still don't really understand it, but I've added
some FIXMEs and I'll come back to it (I suspect the way we encode these
objects isn't really ideal).

Note that my previous commit r233610 accidentally changed behaviour in
`findLexicalScope()` -- it transitioned from a call to
`DILexicalBlockFile::getScope()` to `MDLexicalBlockFile::getScope()`
(sounds right, doesn't it?) -- so I've fixed that as a drive-by.  No
tests failed with my error, so it looks like we're missing some coverage
here... when I come back to understand the logic, I'll see if I can add
some.

Other than the fix to `findLexicalScope()`, no functionality change.

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

9 years agoSilence an unused variable warning.
David Majnemer [Mon, 30 Mar 2015 23:14:45 +0000 (23:14 +0000)]
Silence an unused variable warning.

No functional change intended.

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

9 years agoMove lib/Fuzzer docs from a README.txt to a proper .rst file.
Kostya Serebryany [Mon, 30 Mar 2015 23:05:30 +0000 (23:05 +0000)]
Move lib/Fuzzer docs from a README.txt to a proper .rst file.

Summary:
Move lib/Fuzzer docs from a README.txt to a proper .rst file.
This change does not add any content, just formatting.

Test Plan: n/a

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

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

9 years ago[fuzzer] when a single unit takes over 1 second to run and it is the slowest one...
Kostya Serebryany [Mon, 30 Mar 2015 23:04:35 +0000 (23:04 +0000)]
[fuzzer] when a single unit takes over 1 second to run and it is the slowest one so far, print it.

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

9 years ago[WinEH] Run cleanup handlers when an exception is thrown
David Majnemer [Mon, 30 Mar 2015 22:58:10 +0000 (22:58 +0000)]
[WinEH] Run cleanup handlers when an exception is thrown

Generate tables in the .xdata section representing what actions to take
when an exception is thrown.  This currently fills in state for
cleanups, catch handlers are still unfinished.

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

9 years agoTransfer implicit operands when expanding the RET_ReallyLR pseudo instruction.
Juergen Ributzka [Mon, 30 Mar 2015 22:45:56 +0000 (22:45 +0000)]
Transfer implicit operands when expanding the RET_ReallyLR pseudo instruction.

When we expand the RET_ReallyLR pseudo instruction we also need to transfer the
implicit operands.

The return register is an implicit operand and without it the liveness
calculation generates an incorrect live-out set for the patchpoint.

This fixes rdar://problem/19068476.

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

9 years ago[fuzzer] print various stats in a unified way
Kostya Serebryany [Mon, 30 Mar 2015 22:44:03 +0000 (22:44 +0000)]
[fuzzer] print various stats in a unified way

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

9 years ago[bpf] add support for bswap instructions
Alexei Starovoitov [Mon, 30 Mar 2015 22:40:40 +0000 (22:40 +0000)]
[bpf] add support for bswap instructions

BPF has cpu_to_be and cpu_to_le instructions.
For now assume little endian and generate cpu_to_be for ISD::BSWAP.

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

9 years ago[bpf] fix build
Alexei Starovoitov [Mon, 30 Mar 2015 22:40:35 +0000 (22:40 +0000)]
[bpf] fix build

fix build broken due to r233599.
Would still need to switch to MDLocation long term.

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

9 years agoRename const char *Triple argument to TT to avoid shadowing llvm::Triple.
Eric Christopher [Mon, 30 Mar 2015 22:31:14 +0000 (22:31 +0000)]
Rename const char *Triple argument to TT to avoid shadowing llvm::Triple.

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

9 years agoRemove unused MCSubtargetInfo argument from the X86 MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 22:16:37 +0000 (22:16 +0000)]
Remove unused MCSubtargetInfo argument from the X86 MCInstPrinter ctors.

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

9 years agoDFSan-based fuzzer (proof of concept).
Kostya Serebryany [Mon, 30 Mar 2015 22:09:51 +0000 (22:09 +0000)]
DFSan-based fuzzer (proof of concept).

Summary:
This adds a simple DFSan-based (i.e. taint-guided) fuzzer mutator,
see the comments for details.

Test Plan: a test added

Reviewers: samsonov, pcc

Reviewed By: samsonov, pcc

Subscribers: llvm-commits

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

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

9 years agoRemove unused MCSubtargetInfo argument from the Sparc MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 22:09:43 +0000 (22:09 +0000)]
Remove unused MCSubtargetInfo argument from the Sparc MCInstPrinter ctors.

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

9 years agoRemove unused MCSubtargetInfo argument from the NVPTX MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 22:03:16 +0000 (22:03 +0000)]
Remove unused MCSubtargetInfo argument from the NVPTX MCInstPrinter ctors.

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

9 years agoLexicalScopes: Use MDLocation directly instead of DebugLoc
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:54:46 +0000 (21:54 +0000)]
LexicalScopes: Use MDLocation directly instead of DebugLoc

There's no benefit to using `DebugLoc` here.  Moreover, this will let a
follow-up commit work with `MDScope` directly instead of `DebugLoc`.

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

9 years agoRemove unused MCSubtargetInfo argument from the ARM MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 21:52:28 +0000 (21:52 +0000)]
Remove unused MCSubtargetInfo argument from the ARM MCInstPrinter ctors.

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

9 years agoRemove unused MCSubtargetInfo argument from the AArch64 MCInstPrinter ctors.
Eric Christopher [Mon, 30 Mar 2015 21:52:26 +0000 (21:52 +0000)]
Remove unused MCSubtargetInfo argument from the AArch64 MCInstPrinter ctors.

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

9 years agoRemove unused Target argument from MCInstPrinter ctor functions.
Eric Christopher [Mon, 30 Mar 2015 21:52:21 +0000 (21:52 +0000)]
Remove unused Target argument from MCInstPrinter ctor functions.

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

9 years ago[RegisterCoalescer] Fix a potential misuse of direct operand index in the
Quentin Colombet [Mon, 30 Mar 2015 21:50:44 +0000 (21:50 +0000)]
[RegisterCoalescer] Fix a potential misuse of direct operand index in the
terminal rule.
Spot by code inspection.

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

9 years ago[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee...
David Blaikie [Mon, 30 Mar 2015 21:41:43 +0000 (21:41 +0000)]
[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type

This pushes the use of PointerType::getElementType up into several
callers - I'll essentially just have to keep pushing that up the stack
until I can eliminate every call to it...

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

9 years agoFix PR23045.
Rafael Espindola [Mon, 30 Mar 2015 21:36:43 +0000 (21:36 +0000)]
Fix PR23045.

Keep a note in the materializer that we are stripping debug info so that
user doing a lazy read of the module don't hit outdated formats.

Thanks to Duncan for suggesting the fix.

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

9 years agoTransforms: Update unit tests to use verifyModule()
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:35:14 +0000 (21:35 +0000)]
Transforms: Update unit tests to use verifyModule()

Since I'm slowly gutting `DISubprogram` and `DICompileUnit`, update the
`CloneFunc` unit tests to call `verifyModule()` (where the checks are
moving to).

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

9 years agoDwarfDebug: Avoid creating new DebugLocs in the backend
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:32:28 +0000 (21:32 +0000)]
DwarfDebug: Avoid creating new DebugLocs in the backend

Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s,
in the backend.  We just want to grab the subprogram here anyway.

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

9 years agoExplain how to abandon a review.
Paul Robinson [Mon, 30 Mar 2015 21:27:28 +0000 (21:27 +0000)]
Explain how to abandon a review.

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

9 years agoDebugInfo: Remove dead code from old DebugLoc API
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:19:50 +0000 (21:19 +0000)]
DebugInfo: Remove dead code from old DebugLoc API

Remove old API for `DebugLoc` now that all the callers have been
updated.  If this broke your out-of-tree build, here's a quick map from
the old API to the new one:

    DebugLoc DebugLoc::getFromMDLocation(MDNode *)
      => DebugLoc::DebugLoc(MDLocation *)
      => explicit DebugLoc::DebugLoc(MDNode *) // works with broken code

    MDNode *DebugLoc::getAsMDNode(LLVMContext &)
      => MDLocation *DebugLoc::get()
      => DebugLoc::operator MDLocation *()
      => MDNode *DebugLoc::getAsMDNode() // works with broken code

    bool DebugLoc::isUnknown()
      => DebugLoc::operator MDLocation *()
          i.e.: if (MDLocation *DL = ...)
      => DebugLoc::operator bool() // works with broken code
          i.e.: if (DebugLoc DL = ...)

    void DebugLoc::getScopeAndInlinedAt(MDNode *&, MDNode *&)
      => use: MDNode *DebugLoc::getScope()
         and: MDLocation *DebugLoc::getInlinedAt()

    MDNode *DebugLoc::getScopeNode(LLVMContext &)
      => MDNode *DebugLoc::getInlinedAtScope()

    void DebugLoc::dump(LLVMContext &)
      => void DebugLoc::dump()

    void DebugLoc::getFnDebugLoc(LLVMContext &)
      => void DebugLoc::getFnDebugLoc()

    MDNode *DebugLoc::getScope(LLVMContext &)
      => MDNode *DebugLoc::getScope()

    MDNode *DebugLoc::getInlinedAt(LLVMContext &)
      => MDLocation *DebugLoc::getInlinedAt()

I've noted above the only functions that won't crash on broken code (due
to downcasting to `MDLocation`).  If your code could be dealing with
broken IR (i.e., you haven't run the verifier yet, or you've used a
temporary node that will eventually (but not yet) get RAUW'ed to an
`MDLocation`), you need to restrict yourself to those.

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

9 years agoUse range loops and add missing braces.
Rafael Espindola [Mon, 30 Mar 2015 21:18:36 +0000 (21:18 +0000)]
Use range loops and add missing braces.

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

9 years agoTransforms: Fix a use of the old DebugLoc in unittests
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 21:05:29 +0000 (21:05 +0000)]
Transforms: Fix a use of the old DebugLoc in unittests

Missed this one before.

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

9 years ago[opaque pointer type] More IRBuilder::createGEP (non-inbounds) migrations: CodeGenPre...
David Blaikie [Mon, 30 Mar 2015 20:42:56 +0000 (20:42 +0000)]
[opaque pointer type] More IRBuilder::createGEP (non-inbounds) migrations: CodeGenPrepare and SimplifyLibCalls

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

9 years agoMC: For variable symbols, maintain MCSymbol::Section as a cache.
Peter Collingbourne [Mon, 30 Mar 2015 20:41:21 +0000 (20:41 +0000)]
MC: For variable symbols, maintain MCSymbol::Section as a cache.

This fixes the visibility of symbols in certain edge cases involving aliases
with multiple levels of indirection.

Fixes PR19582.

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

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

9 years agollvm-dis: Use the new `DebugLoc` API, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 20:04:06 +0000 (20:04 +0000)]
llvm-dis: Use the new `DebugLoc` API, NFC

Update tools/llvm-dis to use the new `DebugLoc` API.

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

9 years agoTransforms: Use the new DebugLoc API, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 19:49:49 +0000 (19:49 +0000)]
Transforms: Use the new DebugLoc API, NFC

Update lib/Analysis and lib/Transforms to use the new `DebugLoc` API.

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

9 years agoIR: Use the new DebugLoc API, NFC
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 19:40:05 +0000 (19:40 +0000)]
IR: Use the new DebugLoc API, NFC

Update lib/IR and lib/Bitcode to use the new `DebugLoc` API.  Added an
explicit conversion to `bool` (avoiding a conversion to `MDLocation`),
since a couple of these use cases need to handle broken code.

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

9 years agoVerify 'optnone' can run DAG combiner when appropriate.
Paul Robinson [Mon, 30 Mar 2015 19:37:44 +0000 (19:37 +0000)]
Verify 'optnone' can run DAG combiner when appropriate.

Adds a test to verify the behavior that r233153 restored: 'optnone'
does not spuriously disable the DAG combiner, and in fact there are
cases where the DAG combiner must run (even at -O0 or 'optnone') in
order for codegen to succeed.

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

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