oota-llvm.git
8 years agoMake computeSymbolSizes never fail.
Rafael Espindola [Wed, 24 Jun 2015 19:57:32 +0000 (19:57 +0000)]
Make computeSymbolSizes never fail.

On ELF that was already the case since getting the size of a symbol
never fails.

On MachO and COFF we could fail trying to get the section of a symbol. But
we don't really need the section, just the section number to know if two
symbols are in the same section or not.

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

8 years agoMIR Serialization: Serialize simple MachineRegisterInfo attributes.
Alex Lorenz [Wed, 24 Jun 2015 19:56:10 +0000 (19:56 +0000)]
MIR Serialization: Serialize simple MachineRegisterInfo attributes.

This commit serializes the 3 scalar boolean attributes from the
MachineRegisterInfo class: IsSSA, TracksRegLiveness, and
TracksSubRegLiveness. These attributes are serialized as part
of the machine function YAML mapping.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years agoUse Symbol::getValue to simplify object::computeSymbolSizes. NFC.
Rafael Espindola [Wed, 24 Jun 2015 19:32:52 +0000 (19:32 +0000)]
Use Symbol::getValue to simplify object::computeSymbolSizes. NFC.

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

8 years ago[LSR] canonicalize Prod*(1<<C) to Prod<<C
Jingyue Wu [Wed, 24 Jun 2015 19:28:40 +0000 (19:28 +0000)]
[LSR] canonicalize Prod*(1<<C) to Prod<<C

Summary:
Because LSR happens at a late stage where mul of a power of 2 is
typically canonicalized to shl, this canonicalization emits code that
can be better CSE'ed.

Test Plan:
Transforms/LoopStrengthReduce/shl.ll shows how this change makes GVN more
powerful. Fixes some existing tests due to this change.

Reviewers: sanjoy, majnemer, atrick

Reviewed By: majnemer, atrick

Subscribers: majnemer, llvm-commits

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

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

8 years agoUse Symbol.getValue to simplify RuntimeDyldCOFF::getSymbolOffset. NFC.
Rafael Espindola [Wed, 24 Jun 2015 19:27:53 +0000 (19:27 +0000)]
Use Symbol.getValue to simplify RuntimeDyldCOFF::getSymbolOffset. NFC.

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

8 years agoAdd a SymbolRef::getValue.
Rafael Espindola [Wed, 24 Jun 2015 19:11:10 +0000 (19:11 +0000)]
Add a SymbolRef::getValue.

This returns either the symbol offset or address. Since it is not defined which
one, it never has to lookup the section and so never fails.

I will add users in the next commit.

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

8 years agoDevirtualize Constant::replaceUsesOfWithOnConstant.
Pete Cooper [Wed, 24 Jun 2015 18:55:24 +0000 (18:55 +0000)]
Devirtualize Constant::replaceUsesOfWithOnConstant.

This is part of the work to devirtualize Value.

The old pattern was to call replaceUsesOfWithOnConstant which was overridden by
subclasses.  Those could then call replaceUsesOfWithOnConstantImpl on Constant
to handle deleting the current value.

To be consistent with other parts of the code, this has been changed so that we
call the method on Constant, and that dispatches to an Impl on subclasses.

As part of this, it made sense to rename the methods to be more descriptive.  The
new name is Constant::handleOperandChange, and it requires that all subclasses of
Constant implement handleOperandChangeImpl, even if they just throw an error if
they shouldn't be called.

Reviewed by Duncan Exon Smith.

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

8 years agoAsmPrinter: Cleanup DIEValue::EmitValue() API, NFC
Duncan P. N. Exon Smith [Wed, 24 Jun 2015 18:48:11 +0000 (18:48 +0000)]
AsmPrinter: Cleanup DIEValue::EmitValue() API, NFC

Stop taking a `dwarf::Form` in `DIEValue::EmitValue()` and
`DIEValue::SizeOf()`, since they're always passed `DIEValue::getForm()`
anyway.  This is just left over from when `DIEValue` didn't know its own
form.

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

8 years agoRefactor duplicated code. NFC.
Rafael Espindola [Wed, 24 Jun 2015 18:14:41 +0000 (18:14 +0000)]
Refactor duplicated code. NFC.

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

8 years agoObject: Add XFAILed test case for r239560.
Peter Collingbourne [Wed, 24 Jun 2015 18:03:39 +0000 (18:03 +0000)]
Object: Add XFAILed test case for r239560.

We ought to also emit unmangled references to dllimported functions,
but no existing linker needs this.

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

8 years ago[CaptureTracking] Avoid long compilation time on large basic blocks
Bruno Cardoso Lopes [Wed, 24 Jun 2015 17:53:17 +0000 (17:53 +0000)]
[CaptureTracking] Avoid long compilation time on large basic blocks

CaptureTracking becomes very expensive in large basic blocks while
calling PointerMayBeCaptured. PointerMayBeCaptured scans the BB the
number of times equal to the number of uses of 'BeforeHere', which is
currently capped at 20 and bails out with Tracker->tooManyUses().

The bottleneck here is the number of calls to PointerMayBeCaptured * the
basic block scan. In a testcase with a 82k instruction BB,
PointerMayBeCaptured is called 130k times, leading to 'shouldExplore'
taking 527k runs, this currently takes ~12min.

To fix this we locally (within PointerMayBeCaptured) number the
instructions in the basic block using a DenseMap to cache instruction
positions/numbers. We build the cache incrementally every time we need
to scan an unexplored part of the BB, improving compile time to only
take ~2min.

This triggers in the flow: DeadStoreElimination -> MepDepAnalysis ->
CaptureTracking.

Side note: after multiple runs in the test-suite I've seen no
performance nor compile time regressions, but could note a couple of
compile time improvements:

Performance Improvements - Compile Time Delta Previous  Current StdDev
SingleSource/Benchmarks/Misc-C++/bigfib -4.48%  0.8547  0.8164  0.0022
MultiSource/Benchmarks/TSVC/LoopRerolling-dbl/LoopRerolling-dbl -1.47% 1.3912  1.3707  0.0056

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

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

8 years agoMIR Serialization: Serialize the null register operands.
Alex Lorenz [Wed, 24 Jun 2015 17:34:58 +0000 (17:34 +0000)]
MIR Serialization: Serialize the null register operands.

This commit serializes the null register machine operands.
It uses the '_' keyword to represent them, but the parser
also allows the '%noreg' named register syntax.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years ago[LoopVectorizer] Fix bailing-out condition for OptForSize case.
Michael Zolotukhin [Wed, 24 Jun 2015 17:26:24 +0000 (17:26 +0000)]
[LoopVectorizer] Fix bailing-out condition for OptForSize case.

With option OptForSize enabled, the Loop Vectorizer is not supposed to
create tail loop. The condition checking that was invalid and was not
matching to the comment above.

Patch by Marianne Mailhot-Sarrasin.

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

8 years agoSimplify the logic, NFC.
Rafael Espindola [Wed, 24 Jun 2015 17:08:44 +0000 (17:08 +0000)]
Simplify the logic, NFC.

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

8 years agoADTTests: merge #ifdef checks from r240436.
Alex Lorenz [Wed, 24 Jun 2015 17:05:04 +0000 (17:05 +0000)]
ADTTests: merge #ifdef checks from r240436.

This commit merges the #ifdef and #ifndef checks into one #if, as
suggested by Duncan P. N. Exon Smith.

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

8 years agoDon't get confused with sections whose section number is reserved.
Rafael Espindola [Wed, 24 Jun 2015 14:48:54 +0000 (14:48 +0000)]
Don't get confused with sections whose section number is reserved.

It is perfectly possible for SHNDX to contain indexes that have the same value
as reserved st_shndx values.

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

8 years ago[X86][AVX] Added full set of 256-bit vector shift tests.
Simon Pilgrim [Wed, 24 Jun 2015 13:52:25 +0000 (13:52 +0000)]
[X86][AVX] Added full set of 256-bit vector shift tests.

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

8 years agoEliminate additional redundant copies of Triple objects. NFC.
Daniel Sanders [Wed, 24 Jun 2015 13:25:57 +0000 (13:25 +0000)]
Eliminate additional redundant copies of Triple objects. NFC.

Subscribers: rafael, llvm-commits, rengolin

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

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

8 years agoFix instruction scheduling live register tracking
Pawel Bylica [Wed, 24 Jun 2015 12:49:42 +0000 (12:49 +0000)]
Fix instruction scheduling live register tracking

Summary:
This patch fixes PR23405 (https://llvm.org/bugs/show_bug.cgi?id=23405).

During a node unscheduling an entry in LiveRegGens can be replaced with a new value. That corrupts the live reg tracking and LiveReg* structure is not cleared as should be during unscheduling. Problematic condition that enforces Gen replacement is `I->getSUnit()->getHeight() < LiveRegGens[I->getReg()]->getHeight()`. This condition should be checked only if LiveRegGen was set in current node unscheduling.

Test Plan: Regression test included.

Reviewers: hfinkel, atrick

Reviewed By: atrick

Subscribers: llvm-commits

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

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

8 years ago[llvm-stress] Simple refactoring and better style. NFC.
Pawel Bylica [Wed, 24 Jun 2015 11:49:44 +0000 (11:49 +0000)]
[llvm-stress] Simple refactoring and better style. NFC.

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

8 years ago[mips][microMIPS] Implement BREAK, EHB and EI instructions
Zoran Jovanovic [Wed, 24 Jun 2015 10:32:16 +0000 (10:32 +0000)]
[mips][microMIPS] Implement BREAK, EHB and EI instructions
http://reviews.llvm.org/D10090

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

8 years agoChange how symbol sizes are handled in lib/Object.
Rafael Espindola [Wed, 24 Jun 2015 10:20:30 +0000 (10:20 +0000)]
Change how symbol sizes are handled in lib/Object.

COFF and MachO only define symbol sizes for common symbols. Reflect that
in the class hierarchy by having a method for common symbols only in the base
and a general one in ELF.

This avoids the need of using a magic value for the size, which had a few
problems
* Most callers didn't check for it.
* The ones that did could not tell the magic value from a file actually having
  that value.

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

8 years ago[ADT] Teach DenseMap to support StringRef keys.
Chandler Carruth [Wed, 24 Jun 2015 10:06:29 +0000 (10:06 +0000)]
[ADT] Teach DenseMap to support StringRef keys.

While often you want to use something specialized like StringMap, when
the strings already have persistent storage a normal densemap over them
can be more efficient.

This can't go into StringRef.h because of really obnoxious header chains
from the hashing code to the endian detection code to CPU feature
detection code to StringMap.

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

8 years agoHexagon: Paper over the undefined behaviour introduced by r238692
Justin Bogner [Wed, 24 Jun 2015 07:03:07 +0000 (07:03 +0000)]
Hexagon: Paper over the undefined behaviour introduced by r238692

This stops shifting a 32-bit value by such absurd amounts as 96 and
120. We do this by dropping a call to the function that was doing this
entirely, which rather surprisingly doesn't break *any* tests.

I've also added an assert in the misbehaving function to prove that
it's no longer being called with completely invalid arguments.

This change looks pretty bogus and we should probably be reverting
r238692 instead, but this is hard to do with the number of follow ups
that have happened since. It can't be any worse than the undefined
behaviour that was happening before though.

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

8 years agoMILexer.cpp: Try to fix a warning. [-Wsign-compare]
NAKAMURA Takumi [Wed, 24 Jun 2015 06:40:09 +0000 (06:40 +0000)]
MILexer.cpp: Try to fix a warning. [-Wsign-compare]

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

8 years ago[TableGen] Restore the use of the TheInit field in Record to cache the Record's DefIn...
Craig Topper [Wed, 24 Jun 2015 06:19:19 +0000 (06:19 +0000)]
[TableGen] Restore the use of the TheInit field in Record to cache the Record's DefInit. I broke this when I fixed memory leaks recently. Remove the DenseMap that mapped Record's to DefInit.

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

8 years agoDo not treat ARM _MoveToCoprocessor* intrinsics as MSBuiltins.
Bob Wilson [Wed, 24 Jun 2015 06:07:41 +0000 (06:07 +0000)]
Do not treat ARM _MoveToCoprocessor* intrinsics as MSBuiltins.

Those builtins are now handled via ad-hoc code in clang with r240522 to
deal with reordering the arguments to fix PR22560.

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

8 years agoHexagon: Avoid left shifting negative values (it's UB)
Justin Bogner [Wed, 24 Jun 2015 06:00:53 +0000 (06:00 +0000)]
Hexagon: Avoid left shifting negative values (it's UB)

Found by ubsan.

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

8 years agoSystemZ: Rephrase this allOnes calculation to avoid UB
Justin Bogner [Wed, 24 Jun 2015 05:59:19 +0000 (05:59 +0000)]
SystemZ: Rephrase this allOnes calculation to avoid UB

This allOnes function hits undefined behaviour if Count is greater
than 64, but we can avoid that and simplify the calculation by just
saturating if such a value is passed in.

This comes up under ubsan becauseRxSBGOperands is sometimes created
with values that are 128 bits wide. Somebody more familiar with this
code should probably look into whether that's expected, as a 64 bit
mask may or may not be appropriate for such types.

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

8 years agoDon't repeat name in comments.
Rafael Espindola [Wed, 24 Jun 2015 03:19:35 +0000 (03:19 +0000)]
Don't repeat name in comments.

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

8 years ago[X86] Don't generate vbroadcasti128 for v4i64 splats from memory.
Ahmed Bougacha [Wed, 24 Jun 2015 00:07:16 +0000 (00:07 +0000)]
[X86] Don't generate vbroadcasti128 for v4i64 splats from memory.

We used to erroneously match:
    (v4i64 shuffle (v2i64 load), <0,0,0,0>)

Whereas vbroadcasti128 is more like:
    (v4i64 shuffle (v2i64 load), <0,1,0,1>)

This problem doesn't exist for vbroadcastf128, which kept matching
the intrinsic after r231182.  We should perhaps re-introduce the
intrinsic here as well, but that's a separate issue still being
discussed.

While there, add some proper vbroadcastf128 tests.  We don't currently
match those, like for loading vbroadcastsd/ss on AVX (the reg-reg
broadcasts where added in AVX2).

Fixes PR23886.

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

8 years agoRemove unused GlobalVariable::replaceUsesOfWithOnConstant. NFC.
Pete Cooper [Wed, 24 Jun 2015 00:05:07 +0000 (00:05 +0000)]
Remove unused GlobalVariable::replaceUsesOfWithOnConstant.  NFC.

The only caller of this method is Value::replaceAllUsesWith which
explicitly checks that we are not a GlobalValue.  So replace the
body with an unreachable to ensure that we never call it.

The unreachable itself is moved to GlobalValue not GlobalVariable
as that is the base class of all the globals we don't want to call
this method on.

Note, this patch is short lived as i'll soon refactor all callers
of this method.

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

8 years ago[X86] update_llc_test_checks vector-shuffle-*. NFC.
Ahmed Bougacha [Wed, 24 Jun 2015 00:03:48 +0000 (00:03 +0000)]
[X86] update_llc_test_checks vector-shuffle-*. NFC.

Some of them had gone stale.

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

8 years agoMIR Serialization: Serialize immediate machine operands.
Alex Lorenz [Tue, 23 Jun 2015 23:42:28 +0000 (23:42 +0000)]
MIR Serialization: Serialize immediate machine operands.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years agofix typo; NFC
Sanjay Patel [Tue, 23 Jun 2015 23:26:22 +0000 (23:26 +0000)]
fix typo; NFC

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

8 years agodon't repeat function names in comments; NFC
Sanjay Patel [Tue, 23 Jun 2015 23:05:08 +0000 (23:05 +0000)]
don't repeat function names in comments; NFC

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

8 years agoAdd "-mcpu=" option to llvm-rtdyld
Petar Jovanovic [Tue, 23 Jun 2015 22:52:19 +0000 (22:52 +0000)]
Add "-mcpu=" option to llvm-rtdyld

This patch adds the -mcpu= option to llvm-rtdyld. With this option, one
can test relocations for different types of CPUs (e.g. Mips64r6).

Patch by Vladimir Radosavljevic.

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

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

8 years agoMIR Parser: Use correct source locations for machine instruction diagnostics.
Alex Lorenz [Tue, 23 Jun 2015 22:39:23 +0000 (22:39 +0000)]
MIR Parser: Use correct source locations for machine instruction diagnostics.

This commit translates the source locations for MIParser diagnostics from
the locations in the machine instruction string to the locations in the
MIR file.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years agoDevirtualize Constant::destroyConstant.
Pete Cooper [Tue, 23 Jun 2015 21:55:11 +0000 (21:55 +0000)]
Devirtualize Constant::destroyConstant.

This reorganizes destroyConstant and destroyConstantImpl.

Now there is only destroyConstant in Constant itself, while
subclasses are required to implement destroyConstantImpl.

destroyConstantImpl no longer calls delete but is instead only
responsible for removing the constant from any maps in which it
is contained.

Reviewed by Duncan Exon Smith.

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

8 years ago[X86][SSE] Added full set of 128-bit vector shift tests.
Simon Pilgrim [Tue, 23 Jun 2015 21:18:15 +0000 (21:18 +0000)]
[X86][SSE] Added full set of 128-bit vector shift tests.

Removed some old duplicate tests.

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

8 years agoLet llvm::ReplaceInstWithInst copy debug location from old to new instruction.
Alexey Samsonov [Tue, 23 Jun 2015 21:00:08 +0000 (21:00 +0000)]
Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.

Currently some users of this function do this explicitly, and all the
rest forget to do this.

ThreadSanitizer was one of such users, and had missing debug
locations for calls into TSan runtime handling atomic operations,
eventually leading to poorly symbolized stack traces and malfunctioning
suppressions.

This is another change relevant to PR23837.

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

8 years agoPass 2 more variables to lit tests.
Evgeniy Stepanov [Tue, 23 Jun 2015 20:57:26 +0000 (20:57 +0000)]
Pass 2 more variables to lit tests.

Pass ADB and ADB_SERIAL environment variables to lit tests.
This would allow running Android tests in compiler-rt when
there is more than one device attached to the host.

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

8 years agoRevert "[FaultMaps] Move FaultMapParser to Object/"
Sanjoy Das [Tue, 23 Jun 2015 20:09:03 +0000 (20:09 +0000)]
Revert "[FaultMaps] Move FaultMapParser to Object/"

This reverts commit r240364 (git c49542e5bb186).  The issue r240364 was
trying to fix was fixed independently in r240362.

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

8 years agoAdding the missing LTO API to lto.exports
Steven Wu [Tue, 23 Jun 2015 18:56:48 +0000 (18:56 +0000)]
Adding the missing LTO API to lto.exports

Summary:
lto_codegen_set_should_embed_uselists is introduced in r235943 but not
added to lto.exports. Add to export list to expose the API.

Reviewers: dexonsmith

Subscribers: rafael, llvm-commits

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

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

8 years agoDon't pass a 32 bit value to "%08" PRIx64.
Rafael Espindola [Tue, 23 Jun 2015 18:34:25 +0000 (18:34 +0000)]
Don't pass a 32 bit value to "%08" PRIx64.

Should fix the arm bots.

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

8 years agoThis change fixes three bugs in loop unswitching. This change causes an 81% speed...
Mark Heffernan [Tue, 23 Jun 2015 18:26:50 +0000 (18:26 +0000)]
This change fixes three bugs in loop unswitching. This change causes an 81% speed-up on a benchmark that is based on EigenConvolutionKernel2D from Eigen3, where the lack of loop unswitching blocks hoisting of loads out of a nested loop (see bug 23816 for how loop unswitching and load hoisting are related).

Change 1: Unswitching on trivial conditions should always happen regardless of the computed unswitching cost, as really the cost is zero. While there is code to make that happen, the logic that checks the unswitching cost against a threshold was moved to an earlier point (revision 147935) than the point where trivial unswitching is detected, so trivial unswitching is currently blocked by the cost threshold. This change fixes that.

Change 2: Before revision 147935 (from 2012-01-11), the threshold parameter was a per-loop threshold. So an unswitching happened only if the cost of the unswitching was less than the threshold. In an indirect way (and I believe unintentionally), the logic for this since then has been that the threshold is an over-all budget across all loops for all loop unswitching done by a given LoopUnswitch loop pass object. So if an unswitching with cost 100 happens in one function, that in effect reduces the threshold from 100 to 0 for the loops even in another function. This persists for the lifetime of that loop pass object. This makes no difference for most small examples but it is important for large examples. This revision fixes that.

Change 3: The cost is currently calculated as std::min(NumInstructions, 5 * NumBlocks). So a loop with 2 blocks and a million instructions will have an unswitching cost of 10. I changed this to just NumInstructions, as it were before revision 147935, though I'm open to e.g. instead replacing std::min with std::max.

I've tried to make the change minimally invasive while staying with what I think was the original intent of the code.
Submitted on behalf of broune@.

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

8 years ago[NVPTX] Added missing test case for llvm.nvvm.sqrt.f NVPTX intrinsic
Artem Belevich [Tue, 23 Jun 2015 18:22:17 +0000 (18:22 +0000)]
[NVPTX] Added missing test case for llvm.nvvm.sqrt.f NVPTX intrinsic

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

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

8 years agoADT: Add a string APSInt constructor.
Alex Lorenz [Tue, 23 Jun 2015 18:22:10 +0000 (18:22 +0000)]
ADT: Add a string APSInt constructor.

This commit moves the APSInt initialization code that's used by
the LLLexer class into a new APSInt constructor that constructs
APSInts from strings.

This change is useful for MIR Serialization, as it would allow
the MILexer class to use the same APSInt initialization as
LLexer when parsing immediate machine operands.

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

8 years agoPass -m to the linker in this test.
Rafael Espindola [Tue, 23 Jun 2015 18:04:54 +0000 (18:04 +0000)]
Pass -m to the linker in this test.

Fixes the test on a ppc host.

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

8 years agoAsmParser: Extend the API to make the global value and metadata node slot mappings...
Alex Lorenz [Tue, 23 Jun 2015 17:10:10 +0000 (17:10 +0000)]
AsmParser: Extend the API to make the global value and metadata node slot mappings publicly accessible.

This commit creates a new structure called 'SlotMapping' in the AsmParser library.
This structure can be passed into the public parsing APIs from the AsmParser library
in order to extract the data structures that map from slot numbers to unnamed global
values and metadata nodes.

This change is useful for MIR Serialization, as the MIR Parser has to lookup the
unnamed global values and metadata nodes by their slot numbers.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years agoELF: Fix defintion of STT_LOOS and STT_HIOS.
Tom Stellard [Tue, 23 Jun 2015 16:41:57 +0000 (16:41 +0000)]
ELF: Fix defintion of STT_LOOS and STT_HIOS.

Reviewers: chandlerc, Bigcheese, rafael

Subscribers: llvm-commits

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

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

8 years agoMIR Serialization: Serialize physical register machine operands.
Alex Lorenz [Tue, 23 Jun 2015 16:35:26 +0000 (16:35 +0000)]
MIR Serialization: Serialize physical register machine operands.

This commit introduces functionality that's used to serialize machine operands.
Only the physical register operands are serialized by this commit.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years ago[ARM] ARMLoadStoreOpt::UpdateBaseRegUses should stop on def
John Brawn [Tue, 23 Jun 2015 16:02:11 +0000 (16:02 +0000)]
[ARM] ARMLoadStoreOpt::UpdateBaseRegUses should stop on def

When UpdateBaseRegUses sees an instruction that defines the base
register it must stop, as the base register value it is updating is no
longer live. Ideally we would already have seen the register be killed
(which is already checked for), but the kill flags may be inaccurate
and we have to account for this.

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

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

8 years agoobjdump: Don't print a (always 0) size for MachO symbols.
Rafael Espindola [Tue, 23 Jun 2015 15:45:38 +0000 (15:45 +0000)]
objdump: Don't print a (always 0) size for MachO symbols.

Only common symbol on MachO and COFF have a size.

For COFF we already had a custom format.

For MachO, there is no native objdump and we were printing it as ELF. Now
we only print the sizes for symbols that actually have them.

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

8 years agoSystemZ: Avoid left shifting negative values (it's UB)
Justin Bogner [Tue, 23 Jun 2015 15:38:24 +0000 (15:38 +0000)]
SystemZ: Avoid left shifting negative values (it's UB)

Found by ubsan.

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

8 years ago[Option] Plug a leak when move-assigning an InputArgList.
Benjamin Kramer [Tue, 23 Jun 2015 15:28:10 +0000 (15:28 +0000)]
[Option] Plug a leak when move-assigning an InputArgList.

The class has a non-trivial dtor so we have to clean up before we move
in new members. Remove misleading comment as a default move assignment
operator will never be synthesized for this class.

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

8 years agoMake helper functions static. NFC.
Benjamin Kramer [Tue, 23 Jun 2015 14:51:40 +0000 (14:51 +0000)]
Make helper functions static. NFC.

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

8 years ago[BranchFolding] Document why replacing HashMachineInstr with hash_code doesn't work
Benjamin Kramer [Tue, 23 Jun 2015 14:47:36 +0000 (14:47 +0000)]
[BranchFolding] Document why replacing HashMachineInstr with hash_code doesn't work

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

8 years ago[MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstr
Benjamin Kramer [Tue, 23 Jun 2015 14:47:29 +0000 (14:47 +0000)]
[MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstr

Use it in CodeGen where applicable. No functionality change intended.

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

8 years ago[MachineBasicBlock] Use the const_cast(this) trick to reduce duplication
Benjamin Kramer [Tue, 23 Jun 2015 14:47:18 +0000 (14:47 +0000)]
[MachineBasicBlock] Use the const_cast(this) trick to reduce duplication

NFC.

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

8 years agoBe sure to set the DataLayout before checking the cache.
Rafael Espindola [Tue, 23 Jun 2015 14:42:34 +0000 (14:42 +0000)]
Be sure to set the DataLayout before checking the cache.

This makes sure the same mangling is used.

Should fix the OS X bots.

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

8 years ago[mips] [IAS] Add partial support for the ULHU pseudo-instruction.
Toma Tabacu [Tue, 23 Jun 2015 14:39:42 +0000 (14:39 +0000)]
[mips] [IAS] Add partial support for the ULHU pseudo-instruction.

Summary:
This only adds support for ULHU of an immediate address with/without a source register.
It does not include support for ULHU of the address of a symbol.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

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

8 years agoRemove unused arguments and move ManglerPrefixTy to the implementation.
Rafael Espindola [Tue, 23 Jun 2015 14:11:09 +0000 (14:11 +0000)]
Remove unused arguments and move ManglerPrefixTy to the implementation.

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

8 years ago[mips] [IAS] Add support for generating DADDu to createAddu(). NFC.
Toma Tabacu [Tue, 23 Jun 2015 14:00:54 +0000 (14:00 +0000)]
[mips] [IAS] Add support for generating DADDu to createAddu(). NFC.

Summary: This isn't used right now, but it will be in some upcoming changes.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

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

8 years agoSimplify the Mangler interface now that DataLayout is mandatory.
Rafael Espindola [Tue, 23 Jun 2015 13:59:29 +0000 (13:59 +0000)]
Simplify the Mangler interface now that DataLayout is mandatory.

We only need to pass in a DataLayout when mangling a raw string, not when
constructing the mangler.

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

8 years ago[mips64] Emit correct addend for some PC-relative relocations
Petar Jovanovic [Tue, 23 Jun 2015 13:54:42 +0000 (13:54 +0000)]
[mips64] Emit correct addend for some PC-relative relocations

So far, LLVM has not emitted correct addend for N64 and N32 ABI. This patch
fixes that. It also removes fixup from MCJIT for R_MIPS_PC16 relocation.

Patch by Vladimir Radosavljevic.

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

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

8 years ago[Hexagon] Use MF reference from parent class in HexagonPacketizerList
Krzysztof Parzyszek [Tue, 23 Jun 2015 13:50:23 +0000 (13:50 +0000)]
[Hexagon] Use MF reference from parent class in HexagonPacketizerList

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

8 years ago[mips] [IAS] Move some function definitions to MipsTargetStreamer.cpp. NFC.
Toma Tabacu [Tue, 23 Jun 2015 12:34:19 +0000 (12:34 +0000)]
[mips] [IAS] Move some function definitions to MipsTargetStreamer.cpp. NFC.

Summary: For the sake of consistency and to make some upcoming changes a little less noisy.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

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

8 years agoDon't repeat names in comments.
Rafael Espindola [Tue, 23 Jun 2015 12:29:52 +0000 (12:29 +0000)]
Don't repeat names in comments.

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

8 years agoUse MCSymbols for FastISel.
Rafael Espindola [Tue, 23 Jun 2015 12:21:54 +0000 (12:21 +0000)]
Use MCSymbols for FastISel.

The summary is that it moves the mangling earlier and replaces a few
calls to .addExternalSymbol with addSym.

I originally wanted to replace all the uses of addExternalSymbol with
addSym, but noticed it was a lot of work and doesn't need to be done
all at once.

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

8 years agoRevert r240302 ("Bring r240130 back.").
Daniel Jasper [Tue, 23 Jun 2015 11:31:32 +0000 (11:31 +0000)]
Revert r240302 ("Bring r240130 back.").

This causes errors like:

  ld: error: blah.o: requires dynamic R_X86_64_PC32 reloc against '' which
  may overflow at runtime; recompile with -fPIC
  blah.cc:function f(): error: undefined reference to ''
  blah.o:g(): error: undefined reference to ''

I have not yet come up with an appropriate reproduction.

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

8 years agoRevert r240271 (Fixed/added namespace ending comments using clang-tidy. NFC)
Alexander Kornienko [Tue, 23 Jun 2015 10:48:35 +0000 (10:48 +0000)]
Revert r240271 (Fixed/added namespace ending comments using clang-tidy. NFC)

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

8 years ago[mips] llvm-readobj can parse .MIPS.abiflags. No need to check the bytes.
Daniel Sanders [Tue, 23 Jun 2015 10:11:36 +0000 (10:11 +0000)]
[mips] llvm-readobj can parse .MIPS.abiflags. No need to check the bytes.

Summary:

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits

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

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

8 years agoRevert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Alexander Kornienko [Tue, 23 Jun 2015 09:49:53 +0000 (09:49 +0000)]
Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)

Apparently, the style needs to be agreed upon first.

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

8 years agoAVX-512: Added all forms of VPABS instruction
Elena Demikhovsky [Tue, 23 Jun 2015 08:19:46 +0000 (08:19 +0000)]
AVX-512: Added all forms of VPABS instruction
Added all intrinsics, tests for encoding, tests for intrinsics.

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

8 years agoMCExpr: Avoid UB by evaluating this shift as unsigned
Justin Bogner [Tue, 23 Jun 2015 07:32:55 +0000 (07:32 +0000)]
MCExpr: Avoid UB by evaluating this shift as unsigned

We hit undefined behaviour in some MCExpr tests when the LHS of a left
shift is -1. Twos-complement semantics are completely reasonable here,
so we should just do the shift in unsigned.

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

8 years ago[mips] Fix some UB by shifting before sign-extending
Justin Bogner [Tue, 23 Jun 2015 07:28:57 +0000 (07:28 +0000)]
[mips] Fix some UB by shifting before sign-extending

Avoid shifting a negative value by sign-extending after the shift.

Fixes a couple of tests that were failing under ubsan.

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

8 years agotest: Move target dependent test in their own folder for c API test
Justin Bogner [Tue, 23 Jun 2015 06:46:54 +0000 (06:46 +0000)]
test: Move target dependent test in their own folder for c API test

Dissasembly tests depends on target. The problem is that it disable
all tests if all targets are not compiled. This moves things around in
order to get target specific code in a target specific folder.

Patch by Amaury Sechet. Thanks!

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

8 years agoFix PR13851: Preserve metadata for the unswitched branch
Weiming Zhao [Tue, 23 Jun 2015 05:31:09 +0000 (05:31 +0000)]
Fix PR13851: Preserve metadata for the unswitched branch

This patch copies the metadata of the unswitched branch to the newly
crreated branch in loop unswitch pass.

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

8 years agoRemove broken banner.
Rafael Espindola [Tue, 23 Jun 2015 03:45:23 +0000 (03:45 +0000)]
Remove broken banner.

Thanks to Filipe Cabecinhas for noticing.

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

8 years agoAdd a test for the previous commit.
Rafael Espindola [Tue, 23 Jun 2015 03:42:44 +0000 (03:42 +0000)]
Add a test for the previous commit.

This shows how two symbols at the same address are handled.

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

8 years agoHandle multiple symbols having the same address.
Rafael Espindola [Tue, 23 Jun 2015 03:36:08 +0000 (03:36 +0000)]
Handle multiple symbols having the same address.
I will add an explicit test in a second, but this fixes the bots.

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

8 years ago[InstCombine] Optimize subtract of selects into a select of a sub
David Majnemer [Tue, 23 Jun 2015 02:49:24 +0000 (02:49 +0000)]
[InstCombine] Optimize subtract of selects into a select of a sub

This came up when examining some code generated by clang's IRGen for
certain member pointers.

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

8 years agoFix tests when X86 is not enabled.
Rafael Espindola [Tue, 23 Jun 2015 02:45:44 +0000 (02:45 +0000)]
Fix tests when X86 is not enabled.

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

8 years agoCompute correct symbol sizes for MachO and COFF.
Rafael Espindola [Tue, 23 Jun 2015 02:20:37 +0000 (02:20 +0000)]
Compute correct symbol sizes for MachO and COFF.

Before this would dump from the symbol start to the end of the section.

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

8 years agoExtract an utility for computing symbol sizes on MachO and COFF.
Rafael Espindola [Tue, 23 Jun 2015 02:08:48 +0000 (02:08 +0000)]
Extract an utility for computing symbol sizes on MachO and COFF.

I will add a second user in the next commit.

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

8 years agoAMDGPU: Use getAsInteger instead of atoi
Matt Arsenault [Tue, 23 Jun 2015 02:05:55 +0000 (02:05 +0000)]
AMDGPU: Use getAsInteger instead of atoi

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

8 years ago[FaultMaps] Move FaultMapParser to Object/
Sanjoy Das [Tue, 23 Jun 2015 01:05:26 +0000 (01:05 +0000)]
[FaultMaps] Move FaultMapParser to Object/

Summary:
That way llvm-objdump can rely on it without adding an extra dependency
on CodeGen.

This change duplicates the FaultKind enum and the code that serializes
it to a string.  I could not figure out a way to get around this without
adding a new dependency to Object

Reviewers: rafael, ab

Subscribers: llvm-commits

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

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

8 years agoFix a typo in a comment in FaultMaps.h. NFC.
Sanjoy Das [Tue, 23 Jun 2015 01:05:21 +0000 (01:05 +0000)]
Fix a typo in a comment in FaultMaps.h. NFC.

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

8 years agollvm/tools/llvm-objdump/CMakeLists.txt: Update libdeps to fix r240304.
NAKAMURA Takumi [Tue, 23 Jun 2015 00:59:12 +0000 (00:59 +0000)]
llvm/tools/llvm-objdump/CMakeLists.txt: Update libdeps to fix r240304.

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

8 years ago[x86] generalize reassociation optimization in machine combiner to 2 instructions
Sanjay Patel [Tue, 23 Jun 2015 00:39:40 +0000 (00:39 +0000)]
[x86] generalize reassociation optimization in machine combiner to 2 instructions

Currently ( D10321, http://reviews.llvm.org/rL239486 ), we can use the machine combiner pass
to reassociate the following sequence to reduce the critical path:

A = ? op ?
B = A op X
C = B op Y
-->
A = ? op ?
B = X op Y
C = A op B

'op' is currently limited to x86 AVX scalar FP adds (with fast-math on), but in theory, it could
be any associative math/logic op (see TODO in code comment).

This patch generalizes the pattern match to ignore the instruction that defines 'A'. So instead of
a sequence of 3 adds, we now only need to find 2 dependent adds and decide if it's worth
reassociating them.

This generalization has a compile-time cost because we can now match more instruction sequences
and we rely more heavily on the machine combiner to discard sequences where reassociation doesn't
improve the critical path.

For example, in the new test case:

A = M div N
B = A add X
C = B add Y

We'll match 2 reassociation patterns, but this transform doesn't reduce the critical path:

A = M div N
B = A add Y
C = B add X

We need the combiner to reject that pattern but select this:

A = M div N
B = X add Y
C = B add A

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

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

8 years agoRe-apply "InstrProf: When reading, copy the data instead of taking a reference. NFC"
Justin Bogner [Mon, 22 Jun 2015 23:58:05 +0000 (23:58 +0000)]
Re-apply "InstrProf: When reading, copy the data instead of taking a reference. NFC"

This version fixes a missing include that MSVC noticed and
clarifies the ownership of the counter buffer that's passed to
InstrProfRecord.

This restores r240206, which was reverted in r240208.

Patch by Betul Buyukkurt.

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

8 years agoInstrProf: Add a test for multiple copies of the same with different hashes
Justin Bogner [Mon, 22 Jun 2015 23:56:53 +0000 (23:56 +0000)]
InstrProf: Add a test for multiple copies of the same with different hashes

This functionality wasn't being tested.

Patch by Betul Buyukkurt.

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

8 years agoCreate Value.def helper. NFC.
Pete Cooper [Mon, 22 Jun 2015 23:48:35 +0000 (23:48 +0000)]
Create Value.def helper.  NFC.

This is similar to Metadata.def and Instructions.def but for Value's.

It will be used in upcoming commits to devirtualize the Value class.

Reviewed by Duncan Exon Smith.

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

8 years agoFix PR23914.
Evgeniy Stepanov [Mon, 22 Jun 2015 23:36:03 +0000 (23:36 +0000)]
Fix PR23914.

r226830 moved the declaration of Buf to a nested scope, resulting
in a dangling reference (in StringRef Name), and a use-after-free.

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

8 years agoCode cleanup: Remove std::move() around xvalue (NFC)
Logan Chien [Mon, 22 Jun 2015 23:16:02 +0000 (23:16 +0000)]
Code cleanup: Remove std::move() around xvalue (NFC)

Remove std::move() around xvalue so that copy elision is eligible.
In case that copy elision is not appliable, the c++ standard also
guarantees the move semantics on xvalue.  Thus, it is not necessary
to wrap Args with std::move.

This also silence a warning since r240345.

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

8 years ago[LoopDist] Improve variable names and comments in LoopVersioning class, NFC
Adam Nemet [Mon, 22 Jun 2015 22:59:40 +0000 (22:59 +0000)]
[LoopDist] Improve variable names and comments in LoopVersioning class, NFC

As with the previous patch, the goal is to turn the class into a general
loop-versioning class.  This patch removes any references to loop
distribution.

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

8 years agoModify ParseArgs to return the InputArgList by value - there's no need for dynamic...
David Blaikie [Mon, 22 Jun 2015 22:06:37 +0000 (22:06 +0000)]
Modify ParseArgs to return the InputArgList by value - there's no need for dynamic allocation/ownership here

The one caller that does anything other than keep this variable on the
stack is the single use of DerivedArgList in Clang, which is a bit more
interesting but can probably be cleaned up/simplified a bit further
(have DerivedArgList take ownership of the InputArgList rather than
needing to reference its Args indirectly) which I'll try to after this.

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

8 years ago[CMake] Treating LLVM_INCLUDE_TOOLS, which is a bool, as a string to change behaviors...
Chris Bieneman [Mon, 22 Jun 2015 21:58:02 +0000 (21:58 +0000)]
[CMake] Treating LLVM_INCLUDE_TOOLS, which is a bool, as a string to change behaviors of the build is a dirty hack. We shouldn't do it.

Summary: I don't think anyone is relying on this behavior for bootstrapping (because I don't think it works), but if you do need it, speak now or forever hold your peace.

Reviewers: chapuni, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

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

8 years agoRevert r240291: causes problems in self-hosted builds.
Pawel Bylica [Mon, 22 Jun 2015 21:54:07 +0000 (21:54 +0000)]
Revert r240291: causes problems in self-hosted builds.

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