Commit Graph

108876 Commits

Author SHA1 Message Date
David Blaikie
8730dc16e9 Revert "Fix stuff... again."
Accidental commit.

This reverts commit r219693.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219695 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 17:13:09 +00:00
David Blaikie
2b0657e28f Revert some parts of r196288 that were confusing and untested.
If we figure out why they should be here, let's add some testing of some
kind so we can better demonstrate why it's needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219694 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 17:12:02 +00:00
David Blaikie
8a61781323 Fix stuff... again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219693 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 17:11:59 +00:00
Hal Finkel
2993617e41 [LVI] Check for @llvm.assume dominating the edge branch
When LazyValueInfo uses @llvm.assume intrinsics to provide edge-value
constraints, we should check for intrinsics that dominate the edge's branch,
not just any potential context instructions. An assumption that dominates the
edge's branch represents a truth on that edge. This is specifically useful, for
example, if multiple predecessors assume a pointer to be nonnull, allowing us
to simplify a later null comparison.

The test case, and an initial patch, were provided by Philip Reames. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219688 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 16:04:49 +00:00
NAKAMURA Takumi
65e4aa4656 Revert r219638, (r219640 and r219676), "Removing the static destructor from ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex."
It caused hang-up on msc17 builder, probably deadlock.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219687 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 15:58:16 +00:00
Robert Khasanov
ad5d223cb5 [AVX512] Extended avx512_binop_rm to DQ/VL subsets.
Added encoding tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219686 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 15:13:56 +00:00
Robert Khasanov
33a95f24bb [AVX512] Extended avx512_binop_rm to BW/VL subsets.
Added encoding tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219685 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 14:36:19 +00:00
Bradley Smith
5051f6033d [AArch64] Fix crash with empty/pseudo-only blocks in A53 erratum (835769) workaround
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219684 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 14:02:41 +00:00
Alexander Potapenko
49e7edc0fa [llvm-symbolizer] Minor typedef cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219682 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 13:40:44 +00:00
NAKAMURA Takumi
45ed68789b Threading.h: Use \tparam for template parameters. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219676 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 09:34:16 +00:00
Eric Christopher
0ba4483d01 Grab the subtarget info off of the MachineFunction rather than
indirecting through the TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219674 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 08:44:19 +00:00
Eric Christopher
ff9182749e Use the triple to figure out if this is a darwin target, not
the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219673 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 08:25:26 +00:00
Eric Christopher
ded375f282 Remove unnecessary TargetMachine.h includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219672 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 07:22:08 +00:00
Eric Christopher
1dd55ba94e Grab the subtarget and subtarget dependent variables off of
MachineFunction rather than TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219671 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 07:22:00 +00:00
Eric Christopher
eb271ec9d5 Grab the subtarget and subtarget dependent variables off of
MachineFunction rather than TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219670 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 07:17:23 +00:00
Eric Christopher
188c856c38 Instead of the TargetMachine cache the MachineFunction
and TargetRegisterInfo in the peephole optimizer. This
makes it easier to grab subtarget dependent variables off
of the MachineFunction rather than the TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219669 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 07:17:20 +00:00
Eric Christopher
d879de1ece Access subtarget specific variables off of the MachineFunction's
cached subtarget and not the TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219668 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 07:00:33 +00:00
Eric Christopher
151811c07a Add lld to the parallel set of directories since it doesn't depend
on any of the other tools directories.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219667 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 06:56:28 +00:00
Eric Christopher
cd694819ad Access the subtarget off of the MachineFunction via the DAG
scheduler or via the SelectionDAG if available. Otherwise
grab the subtarget off of the MachineFunction by going up
the parent chain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219666 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 06:56:25 +00:00
Hao Liu
75ad488c41 [AArch64]Select wide immediate offset into [Base+XReg] addressing mode
e.g Currently we'll generate following instructions if the immediate is too wide:
    MOV  X0, WideImmediate
    ADD  X1, BaseReg, X0
    LDR  X2, [X1, 0]

    Using [Base+XReg] addressing mode can save one ADD as following:
    MOV  X0, WideImmediate
    LDR  X2, [BaseReg, X0]

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219665 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 06:50:36 +00:00
Eric Christopher
b15974e996 Remove the use and member variable of the TargetMachine from
MachineLICM as we can get the same data off of the MachineFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219663 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 06:26:57 +00:00
Eric Christopher
c026db75e7 Have MachineInstrBundle use the MachineFunction for subtarget
access rather than the TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219662 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 06:26:55 +00:00
Eric Christopher
3788687f31 Access the subtarget off of the MachineFunction rather than
through the TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219661 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 06:26:53 +00:00
Marcello Maggioni
db9fed93fa Switch to select optimization for two-case switches
This is the same optimization of r219233 with modifications to support PHIs with multiple incoming edges from the same block
and a test to check that this condition is handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219656 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 01:58:26 +00:00
Eric Christopher
07d392bdf2 Don't include DFAPacketizer in TargetInstrInfo, there's no reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219653 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 01:13:53 +00:00
Eric Christopher
9accb10855 Include map into the A15SDOptimizer rather than pick it up
transitively from the DFAPacketizer via TargetInstrInfo.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219652 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 01:13:51 +00:00
Eric Christopher
8ff8c16f58 Remove the TargetMachine from DFAPacketizer since it was only
being used to grab subtarget specific things that we can grab
from the MachineFunction anyhow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219650 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 01:03:16 +00:00
Peter Collingbourne
7c9c49b330 Introduce Go coding standards for LLVM.
Rather than define our own standards, we adopt a set of best practices that
are already in use by the Go community.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219646 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 00:40:53 +00:00
Sanjay Patel
e0a0018345 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219645 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 00:33:23 +00:00
Chandler Carruth
ab1f4ef9a2 Add some optional passes around the vectorizer to both better prepare
the IR going into it and to clean up the IR produced by the vectorizers.

Note that these are *off by default* right now while folks collect data
on whether the performance tradeoff is reasonable.

In a build of the 'opt' binary, I see about 2% compile time regression
due to this change on average. This is in my mind essentially the worst
expected case: very little of the opt binary is going to *benefit* from
these extra passes.

I've seen several benchmarks improve in performance my small amounts due
to running these passes, and there are certain (rare) cases where these
passes make a huge difference by either enabling the vectorizer at all
or by hoisting runtime checks out of the outer loop. My primary
motivation is to prevent people from seeing runtime check overhead in
benchmarks where the existing passes and optimizers would be able to
eliminate that.

I've chosen the sequence of passes based on the kinds of things that
seem likely to be relevant for the code at each stage: rotaing loops for
the vectorizer, finding correlated values, loop invariants, and
unswitching opportunities from any runtime checks, and cleaning up
commonalities exposed by the SLP vectorizer.

I'll be pinging existing threads where some of these issues have come up
and will start new threads to get folks to benchmark and collect data on
whether this is the right tradeoff or we should do something else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219644 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 00:31:29 +00:00
Peter Collingbourne
75202eb0c6 Introduce LLVMWriteBitcodeToMemoryBuffer C API function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219643 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14 00:30:59 +00:00
Chris Bieneman
0df98b6821 Updating documentation as per Chandler's feedback.
This goes with the earlier commit to remove the static destructor from ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex.

Summary: This is part of the ongoing work to remove static constructors and destructors.

Reviewers: chandlerc, rnk

Reviewed By: rnk

Subscribers: rnk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219640 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 23:03:45 +00:00
David Majnemer
af6be11a60 InstCombine: Fix miscompile in X % -Y -> X % Y transform
We assumed that negation operations of the form (0 - %Z) resulted in a
negative number.  This isn't true if %Z was originally negative.
Substituting the negative number into the remainder operation may result
in undefined behavior because the dividend might be INT_MIN.

This fixes PR21256.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219639 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 22:37:51 +00:00
Chris Bieneman
3a143ce2e7 Removing the static destructor from ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex.
This patch adds a new llvm_call_once function which is used by the ManagedStatic implementation to safely initialize a global to avoid static construction and destruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219638 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 22:37:25 +00:00
Eric Christopher
5db6cf4884 Migrate another set of getSubtargetImpl away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219636 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 21:57:44 +00:00
Peter Collingbourne
7adaa03f7e Remove unused debug info constants.
These became unused in r219010.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219635 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 21:50:30 +00:00
David Majnemer
dfe81adbce InstCombine: Don't miscompile (x lshr C1) udiv C2
We have a transform that changes:
  (x lshr C1) udiv C2
into:
  x udiv (C2 << C1)

However, it is unsafe to do so if C2 << C1 discards any of C2's bits.

This fixes PR21255.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219634 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 21:48:30 +00:00
Reed Kotler
2061a56b8a Make first of several changes to bring up to AArch64 fast-isel style
Summary:
Make Mips fast-isel track the form of AArch64 where practical.
This makes it easier for people to review the code, to borrow similar code, and to see how to eventually move a lot of this
 target code for fast-isels into target independent code.

These are just cosmetic changes. Should be no functional difference.

Test Plan:
make check
test-suite for 4 flavors mips32 r1/r2 , -O0/-O2

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: aemerson, llvm-commits, rfuhler

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219633 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 21:46:41 +00:00
Paul Robinson
9de9951e15 Update the example of using a command-line option custom parser to
match the current implementation.

Patch by Douglas Yung!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219631 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 21:11:22 +00:00
Adrian Prantl
2273ca1302 Add an assertion about the integrity of the iterator.
Broken parent scope pointers in inlined DIVariables can cause
ensureAbstractVariableIsCreated to insert new abstract scopes, thus
invalidating the iterator in this loop and leading to hard-to-debug
crashes. Useful when manually reducing IR for testcases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219628 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 20:44:58 +00:00
Adrian Prantl
2400ba69d5 constify the getters in SDNodeDbgValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219627 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 20:43:47 +00:00
Chad Rosier
46eb4d85bf Refactor debug statement and remove dead argument. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219626 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 19:46:39 +00:00
Timur Iskhodzhanov
1dc437cb45 Add VS2012-generated test inputs for test/tools/llvm-readobj/codeview-linetables.test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219621 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 17:03:13 +00:00
Filipe Cabecinhas
40251eb0b0 Fix a broadcast related regression on the vector shuffle lowering.
Summary: Test by Robert Lougher!

Reviewers: chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219617 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 16:16:16 +00:00
Matt Arsenault
162415e8db R600/SI: Minor cleanup of function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219616 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 15:47:59 +00:00
Yuri Gorshenin
ec8aeb0bc1 [asan-asm-instrumentation] Follow-up fixes to r219602: asserts are moved into
function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219610 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 11:44:06 +00:00
Renato Golin
d0c745a9f0 Adds support for the Cortex-A17 to the ARM backend
Patch by Matthew Wahab.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219606 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 10:22:19 +00:00
Daniel Sanders
586e23b51b [mips] Mark redundant instructions with a comment in test/CodeGen/Mips/Fast-ISel/icmpa.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 10:18:02 +00:00
Bradley Smith
7e67a4b0cb [AArch64] Add workaround for Cortex-A53 erratum (835769)
Some early revisions of the Cortex-A53 have an erratum (835769) whereby it is
possible for a 64-bit multiply-accumulate instruction in AArch64 state to
generate an incorrect result.  The details are quite complex and hard to
determine statically, since branches in the code may exist in some
 circumstances, but all cases end with a memory (load, store, or prefetch)
instruction followed immediately by the multiply-accumulate operation.

The safest work-around for this issue is to make the compiler avoid emitting
multiply-accumulate instructions immediately after memory instructions and the
simplest way to do this is to insert a NOP.

This patch implements such work-around in the backend, enabled via the option
-aarch64-fix-cortex-a53-835769.

The work-around code generation is not enabled by default.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219603 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 10:12:35 +00:00
Yuri Gorshenin
eba0a96f8e [asan-asm-instrumentation] Fixed memory references which includes %rsp as a base or an index register.
Summary: [asan-asm-instrumentation] Fixed memory references which includes %rsp as a base or an index register.

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219602 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13 09:37:47 +00:00