8 years agoBumpPtrAllocator: use uintptr_t when aligning addresses to avoid undefined behaviour
Hans Wennborg [Tue, 2 Sep 2014 21:51:35 +0000 (21:51 +0000)]
BumpPtrAllocator: use uintptr_t when aligning addresses to avoid undefined behaviour

In theory, alignPtr() could push a pointer beyond the end of the current slab, making
comparisons with that pointer undefined behaviour. Use an integer type to avoid this.

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

8 years ago[asan] Assign a low branch weight to ASan's slow path, patch by Jonas Wagner. This...
Kostya Serebryany [Tue, 2 Sep 2014 21:46:51 +0000 (21:46 +0000)]
[asan]  Assign a low branch weight to ASan's slow path, patch by Jonas Wagner. This speeds up asan (at least on SPEC) by 1%-5% or more. Also fix lint in dfsan.

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

8 years agoR600/SI: Relax some ordering in tests.
Matt Arsenault [Tue, 2 Sep 2014 21:45:50 +0000 (21:45 +0000)]
R600/SI: Relax some ordering in tests.

This will help with enabling misched

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

8 years agoAdd a CFL Alias Analysis implementation
Hal Finkel [Tue, 2 Sep 2014 21:43:13 +0000 (21:43 +0000)]
Add a CFL Alias Analysis implementation

This provides an implementation of CFL alias analysis (including some
supporting data structures). Currently, we don't have any extremely fancy
features, sans some interprocedural analysis (i.e. no field sensitivity, etc.),
and we do best sitting behind BasicAA + TBAA. In such a configuration, we take
~0.6-0.8% of total compile time, and give ~7-8% NoAlias responses to queries
TBAA and BasicAA couldn't answer when bootstrapping LLVM. In testing this on
other projects, we've seen up to 10.5% of queries dropped by BasicAA+TBAA
answered with NoAlias by this algorithm.

Patch by George Burgess IV (with minor modifications by me -- mostly adapting
some BasicAA tests), thanks!

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

8 years ago[FastISel][AArch64] Move over to target-dependent instruction selection only.
Juergen Ributzka [Tue, 2 Sep 2014 21:32:54 +0000 (21:32 +0000)]
[FastISel][AArch64] Move over to target-dependent instruction selection only.

This change moves FastISel for AArch64 to target-dependent instruction selection
only. This change replicates the existing target-independent behavior, therefore
there are no changes to the unit tests or new tests.

Future changes will take advantage of this change and update functionality
and unit tests.

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

8 years ago[FastISel] Provide the option to skip target-independent instruction selection. NFC.
Juergen Ributzka [Tue, 2 Sep 2014 21:07:44 +0000 (21:07 +0000)]
[FastISel] Provide the option to skip target-independent instruction selection. NFC.

This allows the target to disable target-independent instruction selection and
jump directly into the target-dependent instruction selection code.

This can be beneficial for targets, such as AArch64, which could emit much
better code, but never got a chance to do so, because the target-independent
instruction selector was able to find an instruction sequence.

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

8 years agoGenerate extract for in-tree uses if the use is scalar operand in vectorized instruct...
Yi Jiang [Tue, 2 Sep 2014 21:00:39 +0000 (21:00 +0000)]
Generate extract for in-tree uses if the use is scalar operand in vectorized instruction. radar://18144665

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

8 years agoR600/SI: Fix hardcoded register numbers in test
Matt Arsenault [Tue, 2 Sep 2014 20:43:07 +0000 (20:43 +0000)]
R600/SI: Fix hardcoded register numbers in test

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

8 years agoRefactor LowerFABS and LowerFNEG into one function (x86) (NFC)
Sanjay Patel [Tue, 2 Sep 2014 20:24:47 +0000 (20:24 +0000)]
Refactor LowerFABS and LowerFNEG into one function (x86) (NFC)

We duplicate ~30 lines of code to lower FABS and FNEG for x86, so this patch combines them into one function.
No functional change intended, so no additional test cases. Test-suite behavior is unchanged.

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

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

8 years agocmake: Don't reject unknown cpp files that start with .
Matt Arsenault [Tue, 2 Sep 2014 20:20:43 +0000 (20:20 +0000)]
cmake: Don't reject unknown cpp files that start with .

Some editors create hidden file backups in the same
directory as the file, and it's annoying when cmake
errors on them.

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

8 years agoFix MemoryDependenceAnalysis in cases where QueryInstr is a CmpXchg or a AtomicRMW
Robin Morisset [Tue, 2 Sep 2014 20:17:52 +0000 (20:17 +0000)]
Fix MemoryDependenceAnalysis in cases where QueryInstr is a CmpXchg or a AtomicRMW

MemoryDependenceAnalysis is currently cautious when the QueryInstr is an atomic
load or store, but I forgot to check for atomic cmpxchg/atomicrmw. This patch
is a way of fixing that, and making it less brittle (i.e. no risk that I forget
another possible kind of atomic, even if the IR ends up changing in the future),
by adding a fallback checking mayReadOrWriteFromMemory.

Thanks to Philip Reames for finding this bug and suggesting this solution in

Sadly, I don't see how to add a test for this, since the passes depending on
MemoryDependenceAnalysis won't trigger for an atomic rmw anyway. Does anyone
see a way for testing it?

Test Plan: none possible at first sight

Reviewers: jfb, reames

Subscribers: llvm-commits

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

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

8 years agoFix a logic bug when copying fast-math flags.
Sanjay Patel [Tue, 2 Sep 2014 20:03:00 +0000 (20:03 +0000)]
Fix a logic bug when copying fast-math flags.

"Setting" does not equal "copying". This bug has sat dormant for 2 reasons:
1. The unit test was not adequate.
2. Every current user of the "copyFastMathFlags" API is operating on a new instruction.
   (ie, all existing fast-math flags are off). If you copy flags to an existing
   instruction that has some flags on already, you will not necessarily turn them off
   as expected.

I uncovered this bug while trying to implement a fix for PR20802.

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

8 years agoAdd a note about AuroraUX to the release notes.
Rafael Espindola [Tue, 2 Sep 2014 19:49:39 +0000 (19:49 +0000)]
Add a note about AuroraUX to the release notes.

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

8 years agoAdd note to documentation about machine node chains.
Matt Arsenault [Tue, 2 Sep 2014 19:18:52 +0000 (19:18 +0000)]
Add note to documentation about machine node chains.

I've been assuming chain operands were always the first operand,
since the documentation says this. I was confused about why they
were missing after instruction selection. Apparently the convention
changes to using the last operand for MachineSDNodes and I've never
noticed before.

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

8 years agoR600/SI: Add failing testcase.
Matt Arsenault [Tue, 2 Sep 2014 19:12:31 +0000 (19:12 +0000)]
R600/SI: Add failing testcase.

This is broken when 64-bit add is only partially
moved to the VALU.

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

8 years agoFix interference caused by fmul 2, x -> fadd x, x
Matt Arsenault [Tue, 2 Sep 2014 19:02:53 +0000 (19:02 +0000)]
Fix interference caused by fmul 2, x -> fadd x, x

If an fmul was introduced by lowering, it wouldn't be folded
into a multiply by a constant since the earlier combine would
have replaced the fmul with the fadd.

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

8 years agoCode review tweaks
Nick Kledzik [Tue, 2 Sep 2014 18:50:24 +0000 (18:50 +0000)]
Code review tweaks

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

8 years agoFix crash when looking up the addrspace of GEPs with vector types
Matt Arsenault [Tue, 2 Sep 2014 18:47:54 +0000 (18:47 +0000)]
Fix crash when looking up the addrspace of GEPs with vector types

Patch by Björn Steinbrink

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

8 years agoCodeGen: Handle va_start in the entry block
Reid Kleckner [Tue, 2 Sep 2014 18:42:44 +0000 (18:42 +0000)]
CodeGen: Handle va_start in the entry block

Also fix a small copy-paste bug in X86ISelLowering where Chain should
have been used in place of DAG.getEntryToken().

Fixes PR20828.

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

8 years agoFix comment and unnecessary check for FP build_vectors.
Matt Arsenault [Tue, 2 Sep 2014 18:33:51 +0000 (18:33 +0000)]
Fix comment and unnecessary check for FP build_vectors.

This was copy-paste from the integer version, but
FP build_vectors don't truncate.

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

8 years agounique_ptrify LTOCodeGenerator::NativeObjectFile
David Blaikie [Tue, 2 Sep 2014 18:21:06 +0000 (18:21 +0000)]
unique_ptrify LTOCodeGenerator::NativeObjectFile

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

8 years agounique_ptrify the result of SpecialCaseList::create
David Blaikie [Tue, 2 Sep 2014 18:13:54 +0000 (18:13 +0000)]
unique_ptrify the result of SpecialCaseList::create

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

8 years agoMCSchedule.h: fix VS2012 build after r216919
Hans Wennborg [Tue, 2 Sep 2014 18:00:00 +0000 (18:00 +0000)]
MCSchedule.h: fix VS2012 build after r216919

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

8 years agounique_ptrify FileOutputBuffer::FileOutputBuffer
David Blaikie [Tue, 2 Sep 2014 17:49:23 +0000 (17:49 +0000)]
unique_ptrify FileOutputBuffer::FileOutputBuffer

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

8 years agoFix left shifts of negative values in MipsDisassembler.
Alexey Samsonov [Tue, 2 Sep 2014 17:49:16 +0000 (17:49 +0000)]
Fix left shifts of negative values in MipsDisassembler.

This bug was reported by UBSan.

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

8 years agoChange MCSchedModel to be a struct of statically initialized data.
Pete Cooper [Tue, 2 Sep 2014 17:43:54 +0000 (17:43 +0000)]
Change MCSchedModel to be a struct of statically initialized data.

This removes static initializers from the backends which generate this data, and also makes this struct match the other Tablegen generated structs in behaviour

Reviewed by Andy Trick and Chandler C

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

8 years agounique_ptrify PBQPBuilder::build
David Blaikie [Tue, 2 Sep 2014 17:42:01 +0000 (17:42 +0000)]
unique_ptrify PBQPBuilder::build

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

8 years agoFix signed integer overflow in PPCInstPrinter.
Alexey Samsonov [Tue, 2 Sep 2014 17:38:34 +0000 (17:38 +0000)]
Fix signed integer overflow in PPCInstPrinter.

This bug was reported by UBSan.

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

8 years agoCorrect unique_ptr passing in MCObjectDisassembler::setFallbackRegion
David Blaikie [Tue, 2 Sep 2014 17:29:51 +0000 (17:29 +0000)]
Correct unique_ptr passing in MCObjectDisassembler::setFallbackRegion

Rather than passing by lvalue reference, pass by value to ensure that
the caller provides an rvalue (and use move assignment, rather than
release+reset, to assign to the member variable)

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

8 years agoFix left shifts by too large exponents in MCParser
Alexey Samsonov [Tue, 2 Sep 2014 17:25:29 +0000 (17:25 +0000)]
Fix left shifts by too large exponents in MCParser
(which happened only on error recovery path).

This bug was reported by UBSan.

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

8 years agoRevert: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'.
Andrea Di Biagio [Tue, 2 Sep 2014 17:22:49 +0000 (17:22 +0000)]
Revert: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'.

This reverts revision 216913; the new test added at revision 216913
caused regression failures on a couple of buildbots.

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

8 years ago[APFloat] Fixed a bug in method 'fusedMultiplyAdd'.
Andrea Di Biagio [Tue, 2 Sep 2014 16:44:56 +0000 (16:44 +0000)]
[APFloat] Fixed a bug in method 'fusedMultiplyAdd'.

When folding a fused multiply-add builtin call, make sure that we propagate the
correct result in the case where the addend is zero, and the two other operands
are finite non-zero.

  define double @test() {
    %1 = call double @llvm.fma.f64(double 7.0, double 8.0, double 0.0)
    ret double %1

Before this patch, the instruction simplifier wrongly folded the builtin call
in function @test to constant 'double 7.0'.
With this patch, method 'fusedMultiplyAdd' correctly evaluates the multiply and
propagates the expected result (i.e. 56.0).

Added test fold-builtin-fma.ll with the reproducible from PR20832 plus extra
test cases to verify the behavior of method 'fusedMultiplyAdd' in the presence
of NaN/Inf operands.

This fixes PR20832.

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

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

8 years agoAdd missing override on ARMAsmBackend's dtor.
JF Bastien [Tue, 2 Sep 2014 16:26:55 +0000 (16:26 +0000)]
Add missing override on ARMAsmBackend's dtor.

Test Plan: ninja check && ninja clang-test

Subscribers: aemerson

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

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

8 years agoLICM: Don't crash when an instruction is used by an unreachable BB
David Majnemer [Tue, 2 Sep 2014 16:22:00 +0000 (16:22 +0000)]
LICM: Don't crash when an instruction is used by an unreachable BB

BBs might contain non-LCSSA'd values after the LCSSA pass is run if they
are unreachable from the entry block.

Normally, the users of the instruction would be PHIs but the unreachable
BBs have normal users; rewrite their uses to be undef values.

An alternative fix could involve fixing this at LCSSA but that would
require this invariant to hold after subsequent transforms.  If a BB
created an unreachable block, they would be in violation of this.

This fixes PR19798.

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

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

8 years agoFix left shifts of negative integers in AArch64 InstPrinter/Disassembler
Alexey Samsonov [Tue, 2 Sep 2014 16:19:41 +0000 (16:19 +0000)]
Fix left shifts of negative integers in AArch64 InstPrinter/Disassembler

Left shift of negative integer is an undefined behavior, and
is reported by UBSan. It's ok for imm values to be negative, so we can
just replace left shifts with multiplications.

Test Plan: check-llvm test suite

Reviewers: t.p.northover

Reviewed By: t.p.northover

Subscribers: aemerson, mcrosier, llvm-commits

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

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

8 years agoEnable splitting indexing from loads with TargetConstants
Hal Finkel [Tue, 2 Sep 2014 16:05:23 +0000 (16:05 +0000)]
Enable splitting indexing from loads with TargetConstants

When I recommitted r208640 (in r216898) I added an exclusion for TargetConstant
offsets, as there is no guarantee that a backend can handle them on generic
ADDs (even if it generates them during address-mode matching) -- and,
specifically, applying this transformation directly with TargetConstants caused
a self-hosting failure on PPC64. Ignoring all TargetConstants, however, is less
than ideal. Instead, for non-opaque constants, we can convert them into regular
constants for use with the generated ADD (or SUB).

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

8 years agoReplace -use-init-array with -use-ctors.
Rafael Espindola [Tue, 2 Sep 2014 13:54:53 +0000 (13:54 +0000)]
Replace -use-init-array with -use-ctors.

We have been using .init-array for most systems for quiet some time,
but tools like llc are still defaulting to .ctors because the old
option was never changed.

This patch makes llc default to .init-array and changes the option to
be -use-ctors.

Clang is not affected by this. It has its own fancier logic.

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

8 years agoSilencing an MSVC C4334 warning ('<<' : result of 32-bit shift implicitly converted...
Aaron Ballman [Tue, 2 Sep 2014 12:19:02 +0000 (12:19 +0000)]
Silencing an MSVC C4334 warning ('<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)). NFC.

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

8 years agoMerge Extend and Shift into a UBFX
David Xu [Tue, 2 Sep 2014 09:33:56 +0000 (09:33 +0000)]
Merge Extend and Shift into a UBFX

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

8 years agoRevert "Revert '[DAGCombiner] Split up an indexed load if only the base pointer value...
Hal Finkel [Tue, 2 Sep 2014 06:24:04 +0000 (06:24 +0000)]
Revert "Revert '[DAGCombiner] Split up an indexed load if only the base pointer value is live'"

I reverted r208640 in r209747 because r208640 broke self-hosting on PPC64. The
underlying cause of the failure is that pre-inc loads with increments
represented by ISD::TargetConstants were being transformed into ISD:::ADDs with
ISD::TargetConstant operands. PPC doesn't have a pattern for those, and so they
were selected as invalid r+r adds.

This recommits r208640, rebased and with an exclusion for ISD::TargetConstant
increments. This behavior seems correct, although in the future we might want
to ask the target to split out the indexing that uses ISD::TargetConstants.

Unfortunately, I don't yet have small test case where the relevant invalid
'add' instruction is not itself dead (and thus eliminated by
DeadMachineInstructionElim -- sometimes bugpoint is too good at removing things)

Original commit message (by Adam Nemet):

Right now the load may not get DCE'd because of the side-effect of updating
the base pointer.

This can happen if we lower a read-modify-write of an illegal larger type
(e.g. i48) such that the modification only affects one of the subparts (the
lower i32 part but not the higher i16 part).  See the testcase.

In order to spot the dead load we need to revisit it when SimplifyDemandedBits
decided that the value of the load is masked off.  This is the
CommitTargetLoweringOpt piece.

I checked compile time with ARM64 by sending SPEC bitcode files through llc.
No measurable change.

Fixes <rdar://problem/16031651>

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

8 years ago[PowerPC] Guard against illegal selection of add for TargetConstant operands
Hal Finkel [Tue, 2 Sep 2014 06:23:54 +0000 (06:23 +0000)]
[PowerPC] Guard against illegal selection of add for TargetConstant operands

r208640 was reverted because it caused a self-hosting failure on ppc64. The
underlying cause was the formation of ISD::ADD nodes with ISD::TargetConstant
operands. Because we have no patterns for 'add' taking 'timm' nodes, these are
selected as r+r add instructions (which is a miscompile). Guard against this
kind of behavior in the future by making the backend crash should this occur
(instead of silently generating invalid output).

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

8 years agoCodeGen: indicate Windows unwind data format
Saleem Abdulrasool [Mon, 1 Sep 2014 23:48:39 +0000 (23:48 +0000)]
CodeGen: indicate Windows unwind data format

The structures for Windows unwinding are shared across multiple platforms.
Indicate the encoding to be used for the particular target.  Use this to switch
the unwind emitter instantiated by the AsmPrinter.

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

8 years agoCodeGen: split out the Win64Exception emitter
Saleem Abdulrasool [Mon, 1 Sep 2014 23:48:34 +0000 (23:48 +0000)]
CodeGen: split out the Win64Exception emitter

Move the Windows unwind information emitter into a separate header.  This is not
related to DWARF based emission.  NFC.

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

8 years agoMC: remove unnecessary enumeration prefix
Saleem Abdulrasool [Mon, 1 Sep 2014 23:48:29 +0000 (23:48 +0000)]
MC: remove unnecessary enumeration prefix

This is an enum class, and will be appropriately prefixed, making the encoding
type prefix redundant.  No change to any uses as the use of this was not yet

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

8 years agoSROA: Don't insert instructions before a PHI
David Majnemer [Mon, 1 Sep 2014 21:20:14 +0000 (21:20 +0000)]
SROA: Don't insert instructions before a PHI

SROA may decide that it needs to insert a bitcast and would set it's
insertion point before a PHI.  This will create an invalid module
right quick.

Instead, choose the first insertion point in the basic block that holds
our PHI.

This fixes PR20822.

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

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

8 years agoRevert "Revert two GEP-related InstCombine commits"
David Majnemer [Mon, 1 Sep 2014 21:10:02 +0000 (21:10 +0000)]
Revert "Revert two GEP-related InstCombine commits"

This reverts commit r216698 which reverted r216523 and r216598.

We would attempt to perform the transformation even if the match()
failed because, as a side effect, it would set V.  This would trick us
into believing that we correctly found a place to correctly apply the

An additional test case was added to getelementptr.ll so that we might
not regress in the future.

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

8 years agoUse an integer constant for FABS / FNEG (x86).
Sanjay Patel [Mon, 1 Sep 2014 19:01:47 +0000 (19:01 +0000)]
Use an integer constant for FABS / FNEG (x86).

This change will ease refactoring LowerFABS() and LowerFNEG()
since they have a lot of overlap.

Remove the creation of a floating point constant from an integer
because it's going to be used for a bitwise integer op anyway.

No change to codegen expected, but the verbose comment string
for asm output may change from float values to hex (integer),
depending on whether the constant already exists or not.

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

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

8 years agoAdd a convenience method to copy wrapping, exact, and fast-math flags (NFC).
Sanjay Patel [Mon, 1 Sep 2014 18:44:57 +0000 (18:44 +0000)]
Add a convenience method to copy wrapping, exact, and fast-math flags (NFC).

The loop vectorizer preserves wrapping, exact, and fast-math properties of scalar instructions.
This patch adds a convenience method to make that operation easier because we need to do this
in the loop vectorizer, SLP vectorizer, and possibly other places.

Although this is a 'no functional change' patch, I've added a testcase to verify that the exact
flag is preserved by the loop vectorizer. The wrapping and fast-math flags are already checked
in existing testcases.

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

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

8 years agoFix a typo in comments in r216862, NFC
Jingyue Wu [Mon, 1 Sep 2014 14:55:04 +0000 (14:55 +0000)]
Fix a typo in comments in r216862, NFC

PR20766 -> PR20776. Thanks Roman Divacky for the catch!

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

8 years ago[ARM] Add Thumb-2 code size optimization regression test for EOR.
Tilmann Scheller [Mon, 1 Sep 2014 12:59:34 +0000 (12:59 +0000)]
[ARM] Add Thumb-2 code size optimization regression test for EOR.

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

8 years agoARM] Add Thumb-2 code size optimization regression test for BIC.
Tilmann Scheller [Mon, 1 Sep 2014 12:53:29 +0000 (12:53 +0000)]
ARM] Add Thumb-2 code size optimization regression test for BIC.

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

8 years ago[asan-assembly-instrumentation] Prologue and epilogue are moved out from InstrumentMe...
Yuri Gorshenin [Mon, 1 Sep 2014 12:51:00 +0000 (12:51 +0000)]
[asan-assembly-instrumentation] Prologue and epilogue are moved out from InstrumentMemOperand().

Reviewers: eugenis

Subscribers: llvm-commits

Differential revision: http://reviews.llvm.org/D4923

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

8 years agoThumb2 M-class MSR instruction support changes
Renato Golin [Mon, 1 Sep 2014 11:25:07 +0000 (11:25 +0000)]
Thumb2 M-class MSR instruction support changes

This patch implements a few changes related to the Thumb2 M-class MSR instruction:
 * better handling of unpredictable encodings,
 * recognition of the _g and _nzcvqg variants by the asm parser only if the DSP
   extension is available, preferred output of MSR APSR moves with the _<bits>
   suffix for v7-M.

Patch by Petr Pavlu.

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

8 years agoFix in InlineSpiller to make the rematerilization loop also consider
Patrik Hagglund [Mon, 1 Sep 2014 11:04:07 +0000 (11:04 +0000)]
Fix in InlineSpiller to make the rematerilization loop also consider
implicit uses of the whole register when a sub register is defined.

Now the same iterator is used in the rematerilization loop as in the
spill loop later.

Patch provided by Mikael Holmen.

This fix was proposed and reviewed by Quentin Colombet,

Unfortunately, this error in the rematerilization code has only been
seen in a large test case for an out-of-tree target, and is probably
hard to reproduce on an in-tree target. Therefore, no testcase is

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

8 years agoRevert "[asan-assembly-instrumentation] Prologue and epilogue are moved out from...
Yuri Gorshenin [Mon, 1 Sep 2014 10:24:04 +0000 (10:24 +0000)]
Revert "[asan-assembly-instrumentation] Prologue and epilogue are moved out from InstrumentMemOperand()."

This reverts commit 895aa397038b8de86d83ac0997a70949a486e112.

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

8 years agoFix a really bad miscompile introduced in r216865 - the else-if logic
Chandler Carruth [Mon, 1 Sep 2014 10:09:18 +0000 (10:09 +0000)]
Fix a really bad miscompile introduced in r216865 - the else-if logic
chain became completely broken here as *all* intrinsic users ended up
being skipped, and the ones that seemed to be singled out were actually
the exact wrong set.

This is a great example of why long else-if chains can be easily
confusing. Switch the entire code to use early exits and early continues
to have simpler (and more importantly, correct) logic here, as well as
fixing the reversed logic for detecting and continuing on lifetime

I've also significantly cleaned up the test case and added another test
case demonstrating an example where the optimization is not (trivially)
safe to perform.

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

8 years agoSmall refactor on VectorizerHint for deduplication
Renato Golin [Mon, 1 Sep 2014 10:00:17 +0000 (10:00 +0000)]
Small refactor on VectorizerHint for deduplication

Previously, the hint mechanism relied on clean up passes to remove redundant
metadata, which still showed up if running opt at low levels of optimization.
That also has shown that multiple nodes of the same type, but with different
values could still coexist, even if temporary, and cause confusion if the
next pass got the wrong value.

This patch makes sure that, if metadata already exists in a loop, the hint
mechanism will never append a new node, but always replace the existing one.
It also enhances the algorithm to cope with more metadata types in the future
by just adding a new type, not a lot of code.

Re-applying again due to MSVC 2013 being minimum requirement, and this patch
having C++11 that MSVC 2012 didn't support.

Fixes PR20655.

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

8 years ago[asan-assembly-instrumentation] Prologue and epilogue are moved out from InstrumentMe...
Yuri Gorshenin [Mon, 1 Sep 2014 09:56:45 +0000 (09:56 +0000)]
[asan-assembly-instrumentation] Prologue and epilogue are moved out from InstrumentMemOperand().

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

8 years agoFeed AA to the inliner and use AA->getModRefBehavior in AddAliasScopeMetadata
Hal Finkel [Mon, 1 Sep 2014 09:01:39 +0000 (09:01 +0000)]
Feed AA to the inliner and use AA->getModRefBehavior in AddAliasScopeMetadata

This feeds AA through the IFI structure into the inliner so that
AddAliasScopeMetadata can use AA->getModRefBehavior to figure out which
functions only access their arguments (instead of just hard-coding some
knowledge of memory intrinsics). Most of the information is only available from
BasicAA; this is important for preserving alias scoping information for
target-specific intrinsics when doing the noalias parameter attribute to
metadata conversion.

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

8 years agoIgnore lifetime intrinsics in use list for MemCpyOptimizer. Patch by Luqman Aden...
Nick Lewycky [Mon, 1 Sep 2014 06:03:11 +0000 (06:03 +0000)]
Ignore lifetime intrinsics in use list for MemCpyOptimizer. Patch by Luqman Aden, review by Hal Finkel.

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

8 years agoRemove an errant outer loop that contains nothing but an inner loop over exactly...
Nick Lewycky [Mon, 1 Sep 2014 05:17:15 +0000 (05:17 +0000)]
Remove an errant outer loop that contains nothing but an inner loop over exactly the same elements. While no functionality is change intended (and hence there are no changes to tests), you don't want to skip this revision if bisecting for errors.

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

8 years agoFix AddAliasScopeMetadata again - alias.scope must be a complete description
Hal Finkel [Mon, 1 Sep 2014 04:26:40 +0000 (04:26 +0000)]
Fix AddAliasScopeMetadata again - alias.scope must be a complete description

I thought that I had fixed this problem in r216818, but I did not do a very
good job. The underlying issue is that when we add alias.scope metadata we are
asserting that this metadata completely describes the aliasing relationships
within the current aliasing scope domain, and so in the context of translating
noalias argument attributes, the pointers must all be based on noalias
arguments (as underlying objects) and have no other kind of underlying object.
In r216818 excluding appropriate accesses from getting alias.scope metadata is
done by looking for underlying objects that are not identified function-local
objects -- but that's wrong because allocas, etc. are also function-local
objects and we need to explicitly check that all underlying objects are the
noalias arguments for which we're adding metadata aliasing scopes.

This fixes the underlying-object check for adding alias.scope metadata, and
does some refactoring of the related capture-checking eligibility logic (and
adds more comments; hopefully making everything a bit clearer).

Fixes self-hosting on x86_64 with -mllvm -enable-noalias-to-md-conversion (the
feature is still disabled by default).

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

8 years ago[MachineSink] Use the real post dominator tree
Jingyue Wu [Mon, 1 Sep 2014 03:47:25 +0000 (03:47 +0000)]
[MachineSink] Use the real post dominator tree

Fixes a FIXME in MachineSinking. Instead of using the simple heuristics
in isPostDominatedBy, use the real MachinePostDominatorTree. The old
heuristics caused instructions to sink unnecessarily, and might create
register pressure.

Test Plan:
Added a NVPTX codegen test to verify that our change is in effect. It also
shows the unnecessary register pressure caused by over-sinking. Updated
affected tests in AArch64 and X86.

Reviewers: eliben, meheff, Jiangning

Reviewed By: Jiangning

Subscribers: jholewinski, aemerson, mcrosier, llvm-commits

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

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

8 years agoDebugInfo: Elide lexical scopes which only contain other (inline or lexical) scopes.
David Blaikie [Sun, 31 Aug 2014 21:26:22 +0000 (21:26 +0000)]
DebugInfo: Elide lexical scopes which only contain other (inline or lexical) scopes.

DW_TAG_lexical_scopes inform debuggers about the instruction range for
which a given variable (or imported declaration/module/etc) is valid. If
the scope doesn't itself contain any such entities, it's a waste of
space and should be omitted.

We were correctly doing this for entirely empty leaves, but not for
intermediate nodes.

Reduces total (not just debug sections) .o file size for a bootstrap
-gmlt LLVM by 22% and bootstrap -gmlt clang executable by 13%. The wins
for a full -g build will be less as a % (and in absolute terms), but
should still be substantial - with some of that win being fewer
relocations, thus more substantiall reducing link times than fewer bytes
alone would have.

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

8 years agoConsider addrspaces in canLosslesslyBitCastTo()
Matt Arsenault [Sun, 31 Aug 2014 19:19:57 +0000 (19:19 +0000)]
Consider addrspaces in canLosslesslyBitCastTo()

Make this conservatively correct and report false for different
address spaces, which might require a nontrivial translation.

Based on the few uses of this, I don't think this currently
breaks anything.

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

8 years agoDebugInfo: Move argument creation up into the caller that's unambiguously handling...
David Blaikie [Sun, 31 Aug 2014 18:04:28 +0000 (18:04 +0000)]
DebugInfo: Move argument creation up into the caller that's unambiguously handling the subprogram scope (replacing a conditional with an assertion in the process)

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

8 years agoDelay adding imported entity DIEs to the lexical scope, streamlining the check for...
David Blaikie [Sun, 31 Aug 2014 05:46:17 +0000 (05:46 +0000)]
Delay adding imported entity DIEs to the lexical scope, streamlining the check for "this scope has nothing in it"

This makes the emptiness of the scope with regards to variables and
nested scopes is the same as with regards to imported entities. Just
check if we had nothing at all before we build the node.

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

8 years agoModify DwarfDebug::constructImportedEntityDIE to return rather than insert into the...
David Blaikie [Sun, 31 Aug 2014 05:41:15 +0000 (05:41 +0000)]
Modify DwarfDebug::constructImportedEntityDIE to return rather than insert into the scope

Another step towards improving lexical_scope handling

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

8 years agoRefactor constructImportedEntityDIE(DwarfUnit, DIImportedEntity) to return a DIE...
David Blaikie [Sun, 31 Aug 2014 05:32:06 +0000 (05:32 +0000)]
Refactor constructImportedEntityDIE(DwarfUnit, DIImportedEntity) to return a DIE rather than inserting it into a specified context.

First of many steps to improve lexical scope construction (to omit
trivial lexical scopes - those without any direct variables). To that
end it's easier not to create imported entities directly into the
lexical scope node, but to build them, then add them if necessary.

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

8 years agoSimplify expression using container's front() rather than begin()->
David Blaikie [Sun, 31 Aug 2014 02:14:26 +0000 (02:14 +0000)]
Simplify expression using container's front() rather than begin()->

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

8 years agoAdd some negative (and positive) static_assert checks for ArrayRef-of-pointer convers...
David Blaikie [Sun, 31 Aug 2014 01:33:41 +0000 (01:33 +0000)]
Add some negative (and positive) static_assert checks for ArrayRef-of-pointer conversions introduced in r216709

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

8 years ago[PATCH][Interpreter] Add missing FP intrinsic lowering.
Josh Klontz [Sat, 30 Aug 2014 18:33:35 +0000 (18:33 +0000)]
[PATCH][Interpreter] Add missing FP intrinsic lowering.

This extends the work done in [1], adding missing intrinsic lowering for floor, trunc, round and copysign.

[1] http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/199372

Test Plan: Extended `test/ExecutionEngine/Interpreter/intrinsics.ll` to test the additional missing intrinsics. All tests pass.

Reviewers: dexonsmith

Subscribers: llvm-commits

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

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

8 years agoTeach llvm-bcanalyzer to use one stream's BLOCKINFO to read another stream.
Jordan Rose [Sat, 30 Aug 2014 17:07:55 +0000 (17:07 +0000)]
Teach llvm-bcanalyzer to use one stream's BLOCKINFO to read another stream.

This allows streams that only use BLOCKINFO for debugging purposes to omit
the block entirely. As long as another stream is available with the correct
BLOCKINFO, the first stream can still be analyzed and dumped.

As part of this commit, BitstreamReader gets a move constructor and move
assignment operator, as well as a takeBlockInfo method.

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

8 years agoRemove 'virtual' keyword from methods markedwith 'override' keyword.
Craig Topper [Sat, 30 Aug 2014 16:48:34 +0000 (16:48 +0000)]
Remove 'virtual' keyword from methods markedwith 'override' keyword.

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

8 years agoUse StringRef to avoid copies and simplify code.
Craig Topper [Sat, 30 Aug 2014 16:48:22 +0000 (16:48 +0000)]
Use StringRef to avoid copies and simplify code.

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

8 years agoAdd a test for converting ArrayRef<T *> to ArrayRef<const T *>.
Craig Topper [Sat, 30 Aug 2014 16:48:19 +0000 (16:48 +0000)]
Add a test for converting ArrayRef<T *> to ArrayRef<const T *>.

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

8 years agoFix some cases where StringRef was being passed by const reference. Remove const...
Craig Topper [Sat, 30 Aug 2014 16:48:02 +0000 (16:48 +0000)]
Fix some cases where StringRef was being passed by const reference. Remove const from some other StringRefs since its implicitly const already.

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

8 years agoJIT support has been added awhile ago.
Brad Smith [Sat, 30 Aug 2014 14:52:34 +0000 (14:52 +0000)]
JIT support has been added awhile ago.

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

8 years agoFix AddAliasScopeMetadata to not add scopes when deriving from unknown pointers
Hal Finkel [Sat, 30 Aug 2014 12:48:33 +0000 (12:48 +0000)]
Fix AddAliasScopeMetadata to not add scopes when deriving from unknown pointers

The previous implementation of AddAliasScopeMetadata, which adds noalias
metadata to preserve noalias parameter attribute information when inlining had
a flaw: it would add alias.scope metadata to accesses which might have been
derived from pointers other than noalias function parameters. This was
incorrect because even some access known not to alias with all noalias function
parameters could easily alias with an access derived from some other pointer.
Instead, when deriving from some unknown pointer, we cannot add alias.scope
metadata at all. This fixes a miscompile of the test-suite's tramp3d-v4.
Furthermore, we cannot add alias.scope to functions unless we know they
access only argument-derived pointers (currently, we know this only for
memory intrinsics).

Also, we fix a theoretical problem with using the NoCapture attribute to skip
the capture check. This is incorrect (as explained in the comment added), but
would not matter in any code generated by Clang because we get only inferred
nocapture attributes in Clang-generated IR.

This functionality is not yet enabled by default.

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

8 years agoInstCombine: Respect recursion depth in visitUDivOperand
David Majnemer [Sat, 30 Aug 2014 09:19:05 +0000 (09:19 +0000)]
InstCombine: Respect recursion depth in visitUDivOperand

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

8 years agoInstCombine: Try harder to combine icmp instructions
David Majnemer [Sat, 30 Aug 2014 06:18:20 +0000 (06:18 +0000)]
InstCombine: Try harder to combine icmp instructions

consider: (and (icmp X, Y), (and Z, (icmp A, B)))
It may be possible to combine (icmp X, Y) with (icmp A, B).
If we successfully combine, create an 'and' instruction with Z.

This fixes PR20814.

N.B. There is room for improvement after this change but I'm not
convinced it's worth chasing yet.

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

8 years agoRevert r216805 "[MachineCombiner][AArch64] Use the correct register class for MADD...
Juergen Ributzka [Sat, 30 Aug 2014 06:16:26 +0000 (06:16 +0000)]
Revert r216805 "[MachineCombiner][AArch64] Use the correct register class for MADD, SUB, and OR."

I think this broke the build bot. Reverting it for now until I have time to take a closer look.

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

8 years agoFixed a build problem when there were headers
Sean Callanan [Sat, 30 Aug 2014 02:30:02 +0000 (02:30 +0000)]
Fixed a build problem when there were headers
for a different LLVM present in the system header
lookup path.

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

8 years agoAdd missing const to StringRef.copy()
Nick Kledzik [Sat, 30 Aug 2014 02:29:49 +0000 (02:29 +0000)]
Add missing const to StringRef.copy()

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

8 years agoFix typo and formatting
Nick Kledzik [Sat, 30 Aug 2014 01:57:34 +0000 (01:57 +0000)]
Fix typo and formatting

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

8 years agoObject/llvm-objdump: allow dumping of mach-o exports trie
Nick Kledzik [Sat, 30 Aug 2014 00:20:14 +0000 (00:20 +0000)]
Object/llvm-objdump: allow dumping of mach-o exports trie

MachOObjectFile in lib/Object currently has no support for parsing the rebase,
binding, and export information from the LC_DYLD_INFO load command in final
linked mach-o images. This patch adds support for parsing the exports trie data
structure. It also adds an option to llvm-objdump to dump that export info.

I did the exports parsing first because it is the hardest. The information is
encoded in a trie structure, but the standard ObjectFile way to inspect content
is through iterators. So I needed to make an iterator that would do a
non-recursive walk through the trie and maintain the concatenation of edges
needed for the current string prefix.

I plan to add similar support in MachOObjectFile and llvm-objdump to
parse/display the rebasing and binding info too.

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

8 years ago[MachineCombiner][AArch64] Use the correct register class for MADD, SUB, and OR.
Juergen Ributzka [Fri, 29 Aug 2014 23:48:09 +0000 (23:48 +0000)]
[MachineCombiner][AArch64] Use the correct register class for MADD, SUB, and OR.

Select the correct register class for the various instructions that are
generated when combining instructions and constrain the registers to the
appropriate register class.

This fixes rdar://problem/18183707.

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

8 years ago[FastISel][AArch64] Use the correct register class for branches.
Juergen Ributzka [Fri, 29 Aug 2014 23:48:06 +0000 (23:48 +0000)]
[FastISel][AArch64] Use the correct register class for branches.

Also constrain the register class for branches.

This fixes rdar://problem/18181496.

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

8 years ago[MachineSinking] Clear kill flag of all operands at all their uses.
Juergen Ributzka [Fri, 29 Aug 2014 23:48:03 +0000 (23:48 +0000)]
[MachineSinking] Clear kill flag of all operands at all their uses.

When sinking an instruction it might be moved past the original last use of one
of its operands. This last use has the kill flag set and the verifier will
obviously complain about this.

Before Machine Sinking (AArch64):
%vreg3<def> = ASRVXr %vreg1, %vreg2<kill>
%XZR<def> = SUBSXrs %vreg4, %vreg1<kill>, 160, %NZCV<imp-def>

After Machine Sinking:
%XZR<def> = SUBSXrs %vreg4, %vreg1<kill>, 160, %NZCV<imp-def>
%vreg3<def> = ASRVXr %vreg1, %vreg2<kill>

This fix clears all the kill flags in all instruction that use the same operands
as the instruction that is being sunk.

This fixes rdar://problem/18180996.

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

8 years ago[MCJIT] Move endian-aware read/writes from RuntimeDyldMachO into
Lang Hames [Fri, 29 Aug 2014 23:17:47 +0000 (23:17 +0000)]
[MCJIT] Move endian-aware read/writes from RuntimeDyldMachO into

These are platform independent, and moving them to the base class allows
RuntimeDyldChecker to use them too.

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

8 years agoDebug info: Add a new explicit DIDescriptor flag for the "public" access
Adrian Prantl [Fri, 29 Aug 2014 22:44:07 +0000 (22:44 +0000)]
Debug info: Add a new explicit DIDescriptor flag for the "public" access
specifier and change the default behavior to only emit the
DW_AT_accessibility(public) attribute when the isPublic() is explicitly


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

8 years agoComment only: Annotate loop as per mailing list discussion
Jean-Luc Duprat [Fri, 29 Aug 2014 22:43:30 +0000 (22:43 +0000)]
Comment only: Annotate loop as per mailing list discussion

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

8 years agoMake isValidMCLOHType take unsigned instead of enum to avoid loading invalid enum...
Alexey Samsonov [Fri, 29 Aug 2014 22:34:28 +0000 (22:34 +0000)]
Make isValidMCLOHType take unsigned instead of enum to avoid loading invalid enum values

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

8 years agoNext bit of support for llvm-objdump’s -private-headers for Mach-O files.
Kevin Enderby [Fri, 29 Aug 2014 22:30:52 +0000 (22:30 +0000)]
Next bit of support for llvm-objdump’s -private-headers for Mach-O files.

This adds the printing of the LC_SEGMENT load command and sections,
LC_SYMTAB and LC_DYSYMTAB load commands.

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

8 years agoAArch64: Silence -Wabsolute-value warning with std::abs
Reid Kleckner [Fri, 29 Aug 2014 22:14:26 +0000 (22:14 +0000)]
AArch64: Silence -Wabsolute-value warning with std::abs

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

8 years agoSpeculative build fix for const, gcc, and ArrayRef overloads
Reid Kleckner [Fri, 29 Aug 2014 22:12:08 +0000 (22:12 +0000)]
Speculative build fix for const, gcc, and ArrayRef overloads

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

8 years agoRevert accidentally committed patches r216787-r216789
David Blaikie [Fri, 29 Aug 2014 22:10:52 +0000 (22:10 +0000)]
Revert accidentally committed patches r216787-r216789

Rushed when I realized I hadn't committed the FreeDeleter for a clang
change I'd committed, and didn't check that I had things lying around in
my client.

Apologies for the noise.

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

8 years agoAdd a trivial functor for use with unique_ptrs managing memory that needs to be freed...
David Blaikie [Fri, 29 Aug 2014 22:05:31 +0000 (22:05 +0000)]
Add a trivial functor for use with unique_ptrs managing memory that needs to be freed rather than deleted.

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

8 years agoOmit DW_AT_artificial, DW_AT_external, and similar attributes under -gmlt
David Blaikie [Fri, 29 Aug 2014 22:05:29 +0000 (22:05 +0000)]
Omit DW_AT_artificial, DW_AT_external, and similar attributes under -gmlt

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

8 years agoOmit dwarf::DW_AT_frame_base under -gmlt
David Blaikie [Fri, 29 Aug 2014 22:05:27 +0000 (22:05 +0000)]
Omit dwarf::DW_AT_frame_base under -gmlt

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