OSDN Git Service

android-x86/external-llvm.git
8 years ago[X86][SSE] Added i686 target tests to make sure we are correctly loading consecutive...
Simon Pilgrim [Thu, 4 Feb 2016 15:51:55 +0000 (15:51 +0000)]
[X86][SSE] Added i686 target tests to make sure we are correctly loading consecutive entries as 64-bit integers

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

8 years agoAVX-512: Fixed a bug in FMA instruction selection on KNL
Elena Demikhovsky [Thu, 4 Feb 2016 15:11:11 +0000 (15:11 +0000)]
AVX-512: Fixed a bug in FMA instruction selection on KNL

The FMA instruction was selected from AVX2 set instead of AVX-512

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

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

8 years ago[Power PC] softening long double type
Petar Jovanovic [Thu, 4 Feb 2016 14:43:50 +0000 (14:43 +0000)]
[Power PC] softening long double type

This patch implements softening of long double type (ppcf128) on ppc32
architecture and enables operations for this type for soft float.

Patch by Strahinja Petrovic.

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

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

8 years ago[AArch64] Improve load/store optimizer to handle LDUR + LDR.
Chad Rosier [Thu, 4 Feb 2016 14:42:55 +0000 (14:42 +0000)]
[AArch64] Improve load/store optimizer to handle LDUR + LDR.

This patch allows the mixing of scaled and unscaled load/stores to form
load/store pairs.

PR24465
http://reviews.llvm.org/D12116
Many thanks to Ahmed and Michael for fixes and code review.

This is a reapplication of r246769, which was reverted in r246782 due to a
test-suite failure.  I'm unable to reproduce the issue at this time.

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

8 years ago[AVX512] add vfmadd132ss and vfmadd132sd Intrinsic
Michael Zuckerman [Thu, 4 Feb 2016 14:41:08 +0000 (14:41 +0000)]
[AVX512] add vfmadd132ss and vfmadd132sd Intrinsic

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

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

8 years ago[X86] Add AVX512 vector zext tests
Simon Pilgrim [Thu, 4 Feb 2016 14:06:19 +0000 (14:06 +0000)]
[X86] Add AVX512 vector zext tests

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

8 years ago[ScheduleDagInstrs] Improved comments
Jonas Paulsson [Thu, 4 Feb 2016 13:08:48 +0000 (13:08 +0000)]
[ScheduleDagInstrs] Improved comments

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

8 years ago[X86] Moved SEXT -> SIGN_EXTEND_VECTOR_INREG combine into helper. NFC.
Simon Pilgrim [Thu, 4 Feb 2016 09:27:19 +0000 (09:27 +0000)]
[X86] Moved SEXT -> SIGN_EXTEND_VECTOR_INREG combine into helper. NFC.

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

8 years ago[X86] Use hash table in LEA optimization pass.
Andrey Turetskiy [Thu, 4 Feb 2016 08:57:03 +0000 (08:57 +0000)]
[X86] Use hash table in LEA optimization pass.

Use hash table (key is a memory operand) to store found LEA instructions to reduce compile time.

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

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

8 years agocmake: Add a flag to enable LTO
Justin Bogner [Thu, 4 Feb 2016 07:28:30 +0000 (07:28 +0000)]
cmake: Add a flag to enable LTO

This adds -DLLVM_ENABLE_LTO, rather than forcing people to manually
add -flto to the various _FLAGS variables.

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

8 years ago[Support] Use range-based for loop. NFC
Craig Topper [Thu, 4 Feb 2016 06:51:41 +0000 (06:51 +0000)]
[Support] Use range-based for loop. NFC

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

8 years ago[Support] Use hexdigit instead of manually coding the same thing. NFC
Craig Topper [Thu, 4 Feb 2016 06:51:38 +0000 (06:51 +0000)]
[Support] Use hexdigit instead of manually coding the same thing. NFC

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

8 years ago[PGO] Profile interface cleanup
Xinliang David Li [Thu, 4 Feb 2016 05:29:51 +0000 (05:29 +0000)]
[PGO] Profile interface cleanup
  - Remove unused valuemapper parameter
  - add totalcount optional parameter

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

8 years ago[NVPTX] Disable performance optimizations when OptLevel==None
Jingyue Wu [Thu, 4 Feb 2016 04:15:36 +0000 (04:15 +0000)]
[NVPTX] Disable performance optimizations when OptLevel==None

Reviewers: jholewinski, tra, eliben

Subscribers: jholewinski, llvm-commits

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

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

8 years agoTest case for PR 26381
Nemanja Ivanovic [Thu, 4 Feb 2016 01:58:20 +0000 (01:58 +0000)]
Test case for PR 26381

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

8 years ago[SCEV] Try to reuse existing value during SCEV expansion
Wei Mi [Thu, 4 Feb 2016 01:27:38 +0000 (01:27 +0000)]
[SCEV] Try to reuse existing value during SCEV expansion

Current SCEV expansion will expand SCEV as a sequence of operations
and doesn't utilize the value already existed. This will introduce
redundent computation which may not be cleaned up throughly by
following optimizations.

This patch introduces an ExprValueMap which is a map from SCEV to the
set of equal values with the same SCEV. When a SCEV is expanded, the
set of values is checked and reused whenever possible before generating
a sequence of operations.

The original commit triggered regressions in Polly tests. The regressions
exposed two problems which have been fixed in current version.

1. Polly will generate a new function based on the old one. To generate an
instruction for the new function, it builds SCEV for the old instruction,
applies some tranformation on the SCEV generated, then expands the transformed
SCEV and insert the expanded value into new function. Because SCEV expansion
may reuse value cached in ExprValueMap, the value in old function may be
inserted into new function, which is wrong.
   In SCEVExpander::expand, there is a logic to check the cached value to
be used should dominate the insertion point. However, for the above
case, the check always passes. That is because the insertion point is
in a new function, which is unreachable from the old function. However
for unreachable node, DominatorTreeBase::dominates thinks it will be
dominated by any other node.
   The fix is to simply add a check that the cached value to be used in
expansion should be in the same function as the insertion point instruction.

2. When the SCEV is of scConstant type, expanding it directly is cheaper than
reusing a normal value cached. Although in the cached value set in ExprValueMap,
there is a Constant type value, but it is not easy to find it out -- the cached
Value set is not sorted according to the potential cost. Existing reuse logic
in SCEVExpander::expand simply chooses the first legal element from the cached
value set.
   The fix is that when the SCEV is of scConstant type, don't try the reuse
logic. simply expand it.

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

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

8 years agoFix undefined behavior when compiling in C++14 mode (with sized deletion
Richard Smith [Thu, 4 Feb 2016 01:21:16 +0000 (01:21 +0000)]
Fix undefined behavior when compiling in C++14 mode (with sized deletion
enabled): ensure that we do not invoke the sized deallocator for MemoryBuffer
subclasses that have tail-allocated data.

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

8 years ago[codeview] Don't attempt a cross-section label diff
Reid Kleckner [Thu, 4 Feb 2016 00:21:42 +0000 (00:21 +0000)]
[codeview] Don't attempt a cross-section label diff

This only comes up when we're trying to find the next .cv_loc label.

Fixes PR26467

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

8 years ago[libFuzzer] hot fix a test
Kostya Serebryany [Thu, 4 Feb 2016 00:12:28 +0000 (00:12 +0000)]
[libFuzzer] hot fix a test

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

8 years ago[libFuzzer] don't write the test unit when a leak is detected (since we don't know...
Kostya Serebryany [Thu, 4 Feb 2016 00:02:17 +0000 (00:02 +0000)]
[libFuzzer] don't write the test unit when a leak is detected (since we don't know which unit causes the leak)

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

8 years ago[SimplifyCFG] Fix for "endless" loop after dead code removal (Alternative to
Gerolf Hoflehner [Wed, 3 Feb 2016 23:54:25 +0000 (23:54 +0000)]
[SimplifyCFG] Fix for "endless" loop after dead code removal (Alternative to
D16251)

Summary:
This is a simpler fix to the problem than the dominator approach in
http://reviews.llvm.org/D16251. It adds only values into the gather() while loop
that have been seen before.

The actual endless loop is in the constant compare gather() routine in
Utils/SimplifyCFG.cpp. The same value ret.0.off0.i is pushed back into the
queue:
%.ret.0.off0.i = or i1 %.ret.0.off0.i, %cmp10.i

Here is what happens at the IR level:

for.cond.i:                                       ; preds = %if.end6.i,
%if.end.i54
%ix.0.i = phi i32 [ 0, %if.end.i54 ], [ %inc.i55, %if.end6.i ]
%ret.0.off0.i = phi i1 [false, %if.end.i54], [%.ret.0.off0.i, %if.end6.i] <<<
%cmp2.i = icmp ult i32 %ix.0.i, %11
br i1 %cmp2.i, label %for.body.i, label %LBJ_TmpSimpleNeedExt.exit

if.end6.i:                                        ; preds = %for.body.i
%cmp10.i = icmp ugt i32 %conv.i, %add9.i
%.ret.0.off0.i = or i1 %ret.0.off0.i, %cmp10.i <<<

When if.end.i54 gets eliminated which removes the definition of ret.0.off0.i.
The result is the expression %.ret.0.off0.i = or i1 %.ret.0.off0.i, %cmp10.i
(Note the first ‘or’ operand is now %.ret.0.off0.i, and *NOT* %ret.0.off0.i).
And
now there is use of .ret.0.off0.i before a definition which triggers the
“endless” loop in gather():

while(!DFT.empty()) {

    V = DFT.pop_back_val();   // V is .ret.0.off0.i

    if (Instruction *I = dyn_cast<Instruction>(V)) {
      // If it is a || (or && depending on isEQ), process the operands.
      if (I->getOpcode() == (isEQ ? Instruction::Or : Instruction::And)) {
        DFT.push_back(I->getOperand(1));  // This is now .ret.0.off0.i also
        DFT.push_back(I->getOperand(0));

        continue; // “endless loop” for .ret.0.off0.i
      }

Reviewers: reames, ahatanak

Subscribers: llvm-commits

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

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

8 years ago[InstrProfiling] Fix a comment (NFC)
Vedant Kumar [Wed, 3 Feb 2016 23:22:43 +0000 (23:22 +0000)]
[InstrProfiling] Fix a comment (NFC)

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

8 years agoUnify the target opcode enum in TargetOpcodes.h and the FixedInstrs array in
David L Kreitzer [Wed, 3 Feb 2016 23:17:32 +0000 (23:17 +0000)]
Unify the target opcode enum in TargetOpcodes.h and the FixedInstrs array in
CodeGenTarget.cpp to avoid the ordering dependence. NFCI.

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

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

8 years agoMinor code cleanups. NFC.
Junmo Park [Wed, 3 Feb 2016 23:16:39 +0000 (23:16 +0000)]
Minor code cleanups. NFC.

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

8 years agoPrint the OffsetStart field's relocation
David Majnemer [Wed, 3 Feb 2016 22:45:21 +0000 (22:45 +0000)]
Print the OffsetStart field's relocation

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

8 years agorangify; NFCI
Sanjay Patel [Wed, 3 Feb 2016 22:44:14 +0000 (22:44 +0000)]
rangify; NFCI

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

8 years agoclean up; NFC
Sanjay Patel [Wed, 3 Feb 2016 22:37:37 +0000 (22:37 +0000)]
clean up; NFC

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

8 years ago[llvm-readobj] Add support for dumping S_DEFRANGE symbols
David Majnemer [Wed, 3 Feb 2016 22:36:46 +0000 (22:36 +0000)]
[llvm-readobj] Add support for dumping S_DEFRANGE symbols

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

8 years agoReplace static const int with enum to fix obnoxious linker errors about a missing...
Reid Kleckner [Wed, 3 Feb 2016 21:45:39 +0000 (21:45 +0000)]
Replace static const int with enum to fix obnoxious linker errors about a missing definition

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

8 years ago[unittests] Move TargetRegistry test from Support to MC
Reid Kleckner [Wed, 3 Feb 2016 21:41:24 +0000 (21:41 +0000)]
[unittests] Move TargetRegistry test from Support to MC

This removes the dependency from SupportTests to all of the LLVM
backends, and makes it link faster.

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

8 years agoSilence -Wsign-conversion issue in ProgramTest.cpp
Reid Kleckner [Wed, 3 Feb 2016 21:41:12 +0000 (21:41 +0000)]
Silence -Wsign-conversion issue in ProgramTest.cpp

Unfortunately, ProgramInfo::ProcessId is signed on Unix and unsigned on
Windows, breaking the standard fix of using '0U' in the gtest
expectation.

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

8 years agoFix pointers to go on the right hand side. NFC.
Ana Pazos [Wed, 3 Feb 2016 21:34:39 +0000 (21:34 +0000)]
Fix pointers to go on the right hand side. NFC.

Summary:
Fixed pointers to go on the right hand side following coding guidelines. NFC.

Patch by Mandeep Singh Grang.

Reviewers: majnemer, arsenm, sanjoy

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

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

8 years ago[LoopStrengthReduce] Don't rewrite PHIs with incoming values from CatchSwitches
David Majnemer [Wed, 3 Feb 2016 21:30:34 +0000 (21:30 +0000)]
[LoopStrengthReduce] Don't rewrite PHIs with incoming values from CatchSwitches

Bail out if we have a PHI on an EHPad that gets a value from a
CatchSwitchInst.  Because the CatchSwitchInst cannot be split, there is
no good place to stick any instructions.

This fixes PR26373.

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

8 years ago[ScalarEvolutionExpander] Simplify findInsertPointAfter
David Majnemer [Wed, 3 Feb 2016 21:30:31 +0000 (21:30 +0000)]
[ScalarEvolutionExpander] Simplify findInsertPointAfter

No functional change is intended.  The loop could only execute, at most,
once.

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

8 years ago[codeview] Remove EmitLabelDiff in favor emitAbsoluteSymbolDiff
Reid Kleckner [Wed, 3 Feb 2016 21:24:42 +0000 (21:24 +0000)]
[codeview] Remove EmitLabelDiff in favor emitAbsoluteSymbolDiff

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

8 years ago[codeview] Use the MCStreamer interface directly instead of AsmPrinter
Reid Kleckner [Wed, 3 Feb 2016 21:15:48 +0000 (21:15 +0000)]
[codeview] Use the MCStreamer interface directly instead of AsmPrinter

This is mostly about having shorter lines and standardizing on one
interface, but it also avoids some needless indirection.

No functional change.

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

8 years ago[DWARFDebug] Fix another case of overlapping ranges
Keno Fischer [Wed, 3 Feb 2016 21:13:33 +0000 (21:13 +0000)]
[DWARFDebug] Fix another case of overlapping ranges

Summary:
In r257979, I added code to ensure that we wouldn't merge DebugLocEntries if
the pieces they describe overlap. Unfortunately, I failed to cover the case,
where there may have multiple active Expressions in the entry, in which case we
need to make sure that no two values overlap before we can perform the merge.

This fixed PR26148.

Reviewers: aprantl
Differential Revision: http://reviews.llvm.org/D16742

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

8 years agoAddress NDEBUG-related linkage issues for Value::assertModuleIsMaterialized()
Todd Fiala [Wed, 3 Feb 2016 21:13:23 +0000 (21:13 +0000)]
Address NDEBUG-related linkage issues for Value::assertModuleIsMaterialized()

The IR/Value class had a linkage issue present when LLVM was built
as a library, and the LLVM library build time had different settings
for NDEBUG than the client of the LLVM library.  Clients could get
into a state where the LLVM lib expected
Value::assertModuleIsMaterialized() to be inline-defined in the header
but clients expected that method to be defined in the LLVM library.

See this llvm-commits thread for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160201/329667.html

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

8 years ago[SelectionDAG] Fix CombineToPreIndexedLoadStore O(n^2) behavior
Tim Shen [Wed, 3 Feb 2016 20:58:55 +0000 (20:58 +0000)]
[SelectionDAG] Fix CombineToPreIndexedLoadStore O(n^2) behavior

This patch consists of two parts: a performance fix in DAGCombiner.cpp
and a correctness fix in SelectionDAG.cpp.

The test case tests the bug that's uncovered by the performance fix, and
fixed by the correctness fix.

The performance fix keeps the containers required by the
hasPredecessorHelper (which is a lazy DFS) and reuse them. Since
hasPredecessorHelper is called in a loop, the overall efficiency reduced
from O(n^2) to O(n), where n is the number of SDNodes.

The correctness fix keeps iterating the neighbor list even if it's time
to early return. It will return after finishing adding all neighbors to
Worklist, so that no neighbors are discarded due to the original early
return.

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

8 years agoMinor performance tweaks to llvm-tblgen (and a few that might be a good idea)
Reid Kleckner [Wed, 3 Feb 2016 19:34:28 +0000 (19:34 +0000)]
Minor performance tweaks to llvm-tblgen (and a few that might be a good idea)

Summary:
This patch adds a reserve call to an expensive function
(`llvm::LoadIntrinsics`), and may fix a few other low hanging
performance fruit (I've put them in comments for now, so we can
discuss).

**Motivation:**

As I'm sure other developers do, when I build LLVM, I build the entire
project with the same config (`Debug`, `MinSizeRel`, `Release`, or
`RelWithDebInfo`). However, the `Debug` config also builds llvm-tblgen
in `Debug` mode. Later build steps that run llvm-tblgen then can
actually be the slowest steps in the entire build. Nobody likes slow
builds.

Reviewers: rnk, dblaikie

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

Patch by Alexander G. Riccio

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

8 years agoARM: support TLS for WoA
Saleem Abdulrasool [Wed, 3 Feb 2016 18:21:59 +0000 (18:21 +0000)]
ARM: support TLS for WoA

Add support for TLS access for Windows on ARM.  This generates a similar access
to MSVC for ARM.

The changes to the tablegen data is needed to support loading an external symbol
global that is not for a call.  The adjustments to the DAG to DAG transforms are
needed to preserve the 32-bit move.

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

8 years agoRevert r259662, which caused regressions on polly tests.
Wei Mi [Wed, 3 Feb 2016 18:05:57 +0000 (18:05 +0000)]
Revert r259662, which caused regressions on polly tests.

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

8 years ago[InstCombine] Revert r238452: Fold IntToPtr and PtrToInt into preceding loads.
Quentin Colombet [Wed, 3 Feb 2016 18:04:13 +0000 (18:04 +0000)]
[InstCombine] Revert r238452: Fold IntToPtr and PtrToInt into preceding loads.

According to git bisect, this is the root cause of a miscompile for Regex in
libLLVMSupport. I am still working on reducing a test case.
The actual bug may be elsewhere and this commit just exposed it.

Anyway, at the moment, to reproduce, follow these steps:
1. Build clang and libLTO in release mode.
2. Create a new build directory <stage2> and cd into it.
3. Use clang and libLTO from #1 to build llvm-extract in Release mode + asserts
   using -O2 -flto
4. Run llvm-extract  -ralias '.*bar' -S test/Other/extract-alias.ll

Result:
program doesn't contain global named '.*bar'!

Expected result:
@a0a0bar = alias void ()* @bar
@a0bar = alias void ()* @bar

declare void @bar()

Note: In step #3, if you don't use lto or asserts, the miscompile disappears.

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

8 years ago[ScheduleDAGInstrs::buildSchedGraph()] Handling of memory dependecies rewritten.
Jonas Paulsson [Wed, 3 Feb 2016 17:52:29 +0000 (17:52 +0000)]
[ScheduleDAGInstrs::buildSchedGraph()] Handling of memory dependecies rewritten.

Recommited, after some fixing with test cases.

Updated test cases:
test/CodeGen/AArch64/arm64-misched-memdep-bug.ll
test/CodeGen/AArch64/tailcall_misched_graph.ll

Temporarily disabled test cases:
test/CodeGen/AMDGPU/split-vector-memoperand-offsets.ll
test/CodeGen/PowerPC/ppc64-fastcc.ll (partially updated)
test/CodeGen/PowerPC/vsx-fma-m.ll
test/CodeGen/PowerPC/vsx-fma-sp.ll

http://reviews.llvm.org/D8705
Reviewers: Hal Finkel, Andy Trick.

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

8 years agoFix comments /NFC
Xinliang David Li [Wed, 3 Feb 2016 17:51:16 +0000 (17:51 +0000)]
Fix comments /NFC

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

8 years ago[Unittest] Clean up formatting, NFC
Joseph Tremoulet [Wed, 3 Feb 2016 17:11:24 +0000 (17:11 +0000)]
[Unittest] Clean up formatting, NFC

Summary:
Use an early return to reduce indentation.
Remove unused local.

Reviewers: dblaikie, lhames

Subscribers: lhames, llvm-commits

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

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

8 years ago[SCEV] Try to reuse existing value during SCEV expansion
Wei Mi [Wed, 3 Feb 2016 17:05:12 +0000 (17:05 +0000)]
[SCEV] Try to reuse existing value during SCEV expansion

Current SCEV expansion will expand SCEV as a sequence of operations
and doesn't utilize the value already existed. This will introduce
redundent computation which may not be cleaned up throughly by
following optimizations.

This patch introduces an ExprValueMap which is a map from SCEV to the
set of equal values with the same SCEV. When a SCEV is expanded, the
set of values is checked and reused whenever possible before generating
a sequence of operations.

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

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

8 years ago[ARM] Move GNUEABI divmod to __aeabi_divmod*
Renato Golin [Wed, 3 Feb 2016 16:10:54 +0000 (16:10 +0000)]
[ARM] Move GNUEABI divmod to __aeabi_divmod*

The GNU toolchain emits __aeabi_divmod for soft-divide on ARM cores
which happens to be a lot faster than __divsi3/__modsi3 when the core
has hardware divide instructions. Do the same here.

Fixes PR26450.

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

8 years ago[MachineCopyPropagation] Fix comment. NFC
Jun Bum Lim [Wed, 3 Feb 2016 15:56:27 +0000 (15:56 +0000)]
[MachineCopyPropagation] Fix comment. NFC

Reviewers: MatzeB, qcolombet, jmolloy, mcrosier

Subscribers: llvm-commits, mcrosier

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

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

8 years ago[mips] Remove redundant inclusions of MipsAnalyzeImmediate.h
Daniel Sanders [Wed, 3 Feb 2016 15:54:12 +0000 (15:54 +0000)]
[mips] Remove redundant inclusions of MipsAnalyzeImmediate.h

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

8 years ago[DemandedBits] Revert r249687 due to PR26071
James Molloy [Wed, 3 Feb 2016 15:05:06 +0000 (15:05 +0000)]
[DemandedBits] Revert r249687 due to PR26071

This regresses a test in LoopVectorize, so I'll need to go away and think about how to solve this in a way that isn't broken.

From the writeup in PR26071:

What's happening is that ComputeKnownZeroes is telling us that all bits except the LSB are zero. We're then deciding that only the LSB needs to be demanded from the icmp's inputs.

This is where we're wrong - we're assuming that after simplification the bits that were known zero will continue to be known zero. But they're not - during trivialization the upper bits get changed (because an XOR isn't shrunk), so the icmp fails.

The fault is in demandedbits - its contract does clearly state that a non-demanded bit may either be zero or one.

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

8 years agoFix for PR 26381
Nemanja Ivanovic [Wed, 3 Feb 2016 12:53:38 +0000 (12:53 +0000)]
Fix for PR 26381

Simple fix - Constant values were not being sign extended in FastIsel.

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

8 years ago[mips] Add SHF_MIPS_GPREL flag to the MIPS .sbss and .sdata sections
Simon Atanasyan [Wed, 3 Feb 2016 11:50:22 +0000 (11:50 +0000)]
[mips] Add SHF_MIPS_GPREL flag to the MIPS .sbss and .sdata sections

MIPS ABI states that .sbss and .sdata sections must have SHF_MIPS_GPREL
flag. See Figure 4–7 on page 69 in the following document:
ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf.

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

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

8 years ago[TableGen] Add 'register alternative name matching' support
Dylan McKay [Wed, 3 Feb 2016 10:30:16 +0000 (10:30 +0000)]
[TableGen] Add 'register alternative name matching' support

Summary:
This adds a new attribute which targets can set in TableGen which causes a function to be generated which matches register alternative names. This is very similar to `ShouldEmitMatchRegisterName`, except it works on alt names.

This patch is currently used by the out of tree part of the AVR backend. It reduces code duplication greatly, and has the effect that you do not need to hardcode altname to register mappings in C++.

It will not work on targets which have registers which share the same aliases.

Reviewers: stoklund, arsenm, dsanders, hfinkel, vkalintiris

Subscribers: hfinkel, dylanmckay, llvm-commits

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

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

8 years ago[X86][AVX] Add support for 64-bit VZEXT_LOAD of 256/512-bit vectors to EltsFromConsec...
Simon Pilgrim [Wed, 3 Feb 2016 09:41:59 +0000 (09:41 +0000)]
[X86][AVX] Add support for 64-bit VZEXT_LOAD of 256/512-bit vectors to EltsFromConsecutiveLoads

Follow up to D16217 and D16729

This change uncovered an odd pattern where VZEXT_LOAD v4i64 was being lowered to a load of the lower v2i64 (so the 2nd i64 destination element wasn't being zeroed), I can't find any use/reason for this and have removed the pattern and replaced it so only the 1st i64 element is loaded and the upper bits all zeroed. This matches the description for X86ISD::VZEXT_LOAD

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

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

8 years agoAdd a compatibility test
Xinliang David Li [Wed, 3 Feb 2016 06:27:38 +0000 (06:27 +0000)]
Add a compatibility test

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

8 years agoFix a typo in comment
Xinliang David Li [Wed, 3 Feb 2016 06:24:11 +0000 (06:24 +0000)]
Fix a typo in comment

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

8 years agoFix uninitiazed variable use problem
Xinliang David Li [Wed, 3 Feb 2016 06:23:16 +0000 (06:23 +0000)]
Fix uninitiazed variable use problem

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

8 years ago[PGO] Profile summary reader/writer support
Xinliang David Li [Wed, 3 Feb 2016 04:08:18 +0000 (04:08 +0000)]
[PGO] Profile summary reader/writer support

With this patch, the profile summary data will be available in indexed
profile data file so that profiler reader/compiler optimizer can start
to make use of.

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

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

8 years agoLowerBitSets: Don't bother to do any work if the llvm.bitset.test intrinsic is unused.
Peter Collingbourne [Wed, 3 Feb 2016 03:48:46 +0000 (03:48 +0000)]
LowerBitSets: Don't bother to do any work if the llvm.bitset.test intrinsic is unused.

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

8 years agoAdd #include "llvm/Support/raw_ostream.h" to fix Windows build.
Peter Collingbourne [Wed, 3 Feb 2016 03:16:37 +0000 (03:16 +0000)]
Add #include "llvm/Support/raw_ostream.h" to fix Windows build.

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

8 years agoTransforms: Move GlobalOpt's Evaluator to Utils where it can be reused.
Peter Collingbourne [Wed, 3 Feb 2016 02:51:00 +0000 (02:51 +0000)]
Transforms: Move GlobalOpt's Evaluator to Utils where it can be reused.

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

8 years agoFix typo in comment. NFC
Nick Lewycky [Wed, 3 Feb 2016 02:15:49 +0000 (02:15 +0000)]
Fix typo in comment. NFC

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

8 years agodocs: Document how bitsets may be used to encode type information.
Peter Collingbourne [Wed, 3 Feb 2016 02:01:08 +0000 (02:01 +0000)]
docs: Document how bitsets may be used to encode type information.

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

8 years agoCodegen: [PPC] Fix PPCVSXFMAMutate to handle duplicates.
Kyle Butt [Wed, 3 Feb 2016 01:41:09 +0000 (01:41 +0000)]
Codegen: [PPC] Fix PPCVSXFMAMutate to handle duplicates.

The purpose of PPCVSXFMAMutate is to elide copies by changing FMA forms
on PPC.

    %vreg6<def> = COPY %vreg96
    %vreg6<def,tied1> = XSMADDASP %vreg6<tied0>, %vreg5<kill>, %vreg7
    ;v6 = v6 + v5 * v7

is replaced by

    %vreg5<def,tied1> = XSMADDMSP %vreg5<tied0>, %vreg7, %vreg96
    ;v5 = v5 * v7 + v96

This was broken in the case where the target register was also used as a
multiplicand. Fix this case by checking for it and replacing both uses
with the copied register.

    %vreg6<def> = COPY %vreg96
    %vreg6<def,tied1> = XSMADDASP %vreg6<tied0>, %vreg5<kill>, %vreg6
    ;v6 = v6 + v5 * v6

is replaced by

    %vreg5<def,tied1> = XSMADDMSP %vreg5<tied0>, %vreg96, %vreg96
    ;v5 = v5 * v96 + v96

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

8 years agoRevert r259576: Disable the vzeroupper insertion pass on PS4.
Yunzhong Gao [Wed, 3 Feb 2016 01:25:12 +0000 (01:25 +0000)]
Revert r259576: Disable the vzeroupper insertion pass on PS4.
Will re-implement based on review feedback.

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

8 years agoRegCoalescer: Making sure re-materialization defines all subranges
Marcello Maggioni [Wed, 3 Feb 2016 00:22:32 +0000 (00:22 +0000)]
RegCoalescer: Making sure re-materialization defines all subranges

The register coalescer can rematerialize constants that define
more of a register than the copy it is going to replace was going
to do.
This is valid in the case the register was undef before the
copy happened.
This patch makes sure that all the subranges defined by the new
rematerialization instructions have at least a dead def.

Review: http://reviews.llvm.org/D16693

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

8 years agoDiagnosticInfoWithDebugLocBase: Appease Twine for now.
NAKAMURA Takumi [Wed, 3 Feb 2016 00:09:22 +0000 (00:09 +0000)]
DiagnosticInfoWithDebugLocBase: Appease Twine for now.

FIXME: We should get rid of Twine in the record.

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

8 years ago[LoopVersioning] Expose loop versioning as a pass too
Adam Nemet [Wed, 3 Feb 2016 00:06:10 +0000 (00:06 +0000)]
[LoopVersioning] Expose loop versioning as a pass too

Summary:
LoopVersioning is a transform utility that transform passes can use to
run-time disambiguate may-aliasing accesses. I'd like to also expose as
pass to allow it to be unit-tested.

I am planning to add support for non-aliasing annotation in
LoopVersioning and I'd like to be able to write tests directly using
this pass.

(After that feature is done, the pass could also be used to look for
optimization opportunities that are hidden behind incomplete alias
information at compile time.)

The pass drives LoopVersioning in its default way which is to fully
disambiguate may-aliasing accesses no matter how many checks are
required.

Reviewers: hfinkel, ashutosh.nema, sbaranga

Subscribers: zzheng, mssimpso, llvm-commits, sanjoy

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

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

8 years agoAttempt #2 to unbreak r259595.
George Burgess IV [Tue, 2 Feb 2016 23:26:01 +0000 (23:26 +0000)]
Attempt #2 to unbreak r259595.

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

8 years ago[codeview] Improve readability of codeview assembly output
David Majnemer [Tue, 2 Feb 2016 23:18:23 +0000 (23:18 +0000)]
[codeview] Improve readability of codeview assembly output

Strictly speaking, this is not an improvement in functionality per se
but a usability improvement to those debugging codeview.

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

8 years ago[libFuzzer] don't create too many trace-based mutations as it may be too slow
Kostya Serebryany [Tue, 2 Feb 2016 23:17:45 +0000 (23:17 +0000)]
[libFuzzer] don't create too many trace-based mutations as it may be too slow

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

8 years agoAttempt to fix builds broken by r259595.
George Burgess IV [Tue, 2 Feb 2016 23:15:26 +0000 (23:15 +0000)]
Attempt to fix builds broken by r259595.

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

8 years agoThis patch adds MemorySSA to LLVM.
George Burgess IV [Tue, 2 Feb 2016 22:46:49 +0000 (22:46 +0000)]
This patch adds MemorySSA to LLVM.

Please see include/llvm/Transforms/Utils/MemorySSA.h for a description
of MemorySSA, and what it does.

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

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

8 years ago[LVI] Fix debug output
Philip Reames [Tue, 2 Feb 2016 22:43:08 +0000 (22:43 +0000)]
[LVI] Fix debug output

Due to staleness in a patch I committed yesterday, the debug output was reporting overdefined cases as being undefined.  Confusing to say the least.  The mistake appears to have only effected the debug output thankfully.

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

8 years ago[asan] Add iOS support to AddressSanitzier
Anna Zaks [Tue, 2 Feb 2016 22:05:07 +0000 (22:05 +0000)]
[asan] Add iOS support to AddressSanitzier

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

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

8 years ago[LVI] Code motion only [NFC]
Philip Reames [Tue, 2 Feb 2016 22:03:19 +0000 (22:03 +0000)]
[LVI] Code motion only [NFC]

I introduced a declaration in 259583 to keep the diff readable.  This change just moves the definition up to remove the declaration again.

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

8 years ago[LVI] Refactor to use newly introduced intersect utility
Philip Reames [Tue, 2 Feb 2016 21:57:37 +0000 (21:57 +0000)]
[LVI] Refactor to use newly introduced intersect utility

This patch uses the newly introduced 'intersect' utility (from 259461: [LVI] Introduce an intersect operation on lattice values) to simplify existing code in LVI.

While not introducing any new concepts, this change is probably not NFC.  The common 'intersect' function is more powerful that the ad-hoc implementations we'd had in a couple of places.  Given that, we may see optimizations triggering a bit more often.

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

8 years agoRemove utils/buildit
Justin Bogner [Tue, 2 Feb 2016 21:56:16 +0000 (21:56 +0000)]
Remove utils/buildit

The autoconf build system was removed - this doesn't even work and
doesn't need to be here.

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

8 years agoCorrect size calculations for ELF files
Hemant Kulkarni [Tue, 2 Feb 2016 21:41:49 +0000 (21:41 +0000)]
Correct size calculations for ELF files

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

8 years agoDisable the vzeroupper insertion pass on PS4.
Yunzhong Gao [Tue, 2 Feb 2016 21:39:23 +0000 (21:39 +0000)]
Disable the vzeroupper insertion pass on PS4.
See comments in test/CodeGen/X86/avx-vzeroupper.ll for more explanation.

Original patch by: Sean Silva

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

8 years ago[Orc] Stub addresses should be based on stub size, not pointer size.
Lang Hames [Tue, 2 Feb 2016 21:38:30 +0000 (21:38 +0000)]
[Orc] Stub addresses should be based on stub size, not pointer size.

This didn't affect X86_64, which is the only client of this code at the moment,
as stubs and pointers are both 8-bytes there. It will affect other platforms
though.

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

8 years agoAMDGPU: Do not promote allocas with non-inbounds GEPs
Matt Arsenault [Tue, 2 Feb 2016 21:16:12 +0000 (21:16 +0000)]
AMDGPU: Do not promote allocas with non-inbounds GEPs

If we can't assume the pointer value isn't within the bounds
of the object, it seems risky to try to replace the pointer
calculations.

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

8 years agoAMDGPU: Handle promoting memmove
Matt Arsenault [Tue, 2 Feb 2016 20:28:10 +0000 (20:28 +0000)]
AMDGPU: Handle promoting memmove

Also add missing tests for the others.

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

8 years ago[X86] Fix the merging of SP updates in prologue/epilogue insertions.
Quentin Colombet [Tue, 2 Feb 2016 20:11:17 +0000 (20:11 +0000)]
[X86] Fix the merging of SP updates in prologue/epilogue insertions.
When the merging was involving LEAs, we were taking the wrong immediate
from the list of operands.

rdar://problem/24446069

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

8 years agoMachineVerifier: Check that defs/uses are live in subregisters as well.
Matthias Braun [Tue, 2 Feb 2016 20:04:51 +0000 (20:04 +0000)]
MachineVerifier: Check that defs/uses are live in subregisters as well.

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

8 years agoAMDGPU: Skip promote alloca with no optimizations
Matt Arsenault [Tue, 2 Feb 2016 19:32:42 +0000 (19:32 +0000)]
AMDGPU: Skip promote alloca with no optimizations

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

8 years agoAMDGPU: Minor cleanups for AMDGPUPromoteAlloca
Matt Arsenault [Tue, 2 Feb 2016 19:32:35 +0000 (19:32 +0000)]
AMDGPU: Minor cleanups for AMDGPUPromoteAlloca

Mostly convert to use range loops.

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

8 years ago[Orc] Turn OrcX86_64::IndirectStubsInfo into a template helper class:
Lang Hames [Tue, 2 Feb 2016 19:31:15 +0000 (19:31 +0000)]
[Orc] Turn OrcX86_64::IndirectStubsInfo into a template helper class:
GenericIndirectStubsInfo.

This will allow architecture support classes for other architectures to re-use
this code.

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

8 years ago[codeview] Correctly handle inlining functions post-dominated by unreachable
David Majnemer [Tue, 2 Feb 2016 19:22:34 +0000 (19:22 +0000)]
[codeview] Correctly handle inlining functions post-dominated by unreachable

CodeView requires us to accurately describe the extent of the inlined
code.  We did this by grabbing the next debug location in source order
and using *that* to denote where we stopped inlining.  However, this is
not sufficient or correct in instances where there is no next debug
location or the next debug location belongs to the start of another
function.

To get this correct, use the end symbol of the function to denote the
last possible place the inlining could have stopped at.

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

8 years agoAMDGPU: Report AMDGPUPromoteAlloca changed the function
Matt Arsenault [Tue, 2 Feb 2016 19:18:57 +0000 (19:18 +0000)]
AMDGPU: Report AMDGPUPromoteAlloca changed the function

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

8 years agoAMDGPU: Whitelist handled intrinsics
Matt Arsenault [Tue, 2 Feb 2016 19:18:53 +0000 (19:18 +0000)]
AMDGPU: Whitelist handled intrinsics

We shouldn't crash on unhandled intrinsics.
Also simplify failure handling in loop.

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

8 years agoAMDGPU: Use inbounds when calculating workitem offset
Matt Arsenault [Tue, 2 Feb 2016 19:18:48 +0000 (19:18 +0000)]
AMDGPU: Use inbounds when calculating workitem offset

When promoting allocas to LDS, we know we are indexing
into a specific area just created, and the calculation
will also never overflow.

Also emit some of the muls as nsw nuw, because instcombine
infers this already from the range metadata. I think
putting this on the other adds and muls might be OK too,
but I'm not 100% sure.

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

8 years agoFix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Eugene Zelenko [Tue, 2 Feb 2016 18:20:45 +0000 (18:20 +0000)]
Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.

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

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

8 years ago[codeview] Wire up the .cv_inline_linetable directive
Reid Kleckner [Tue, 2 Feb 2016 17:41:18 +0000 (17:41 +0000)]
[codeview] Wire up the .cv_inline_linetable directive

This directive emits the binary annotations that describe line and code
deltas in inlined call sites. Single-stepping through inlined frames in
windbg now works.

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

8 years ago[MC] Enable eip-relative addressing on x86-64 for X32 ABI
Derek Schuff [Tue, 2 Feb 2016 17:20:04 +0000 (17:20 +0000)]
[MC] Enable eip-relative addressing on x86-64 for X32 ABI

Summary:
Enables eip-based addressing, e.g.,

lea    constant(%eip), %rax
lea    constant(%eip), %eax

in MC, (used for the x32 ABI). EIP-base addressing is also valid in x86_64,
it is left enabled for that architecture as well.

Patch by João Porto

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

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

8 years ago[AArch64] Add a FIXME comment.
Chad Rosier [Tue, 2 Feb 2016 15:22:55 +0000 (15:22 +0000)]
[AArch64] Add a FIXME comment.

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

8 years ago[AArch64] Allocate the modified and used regs only once per function.
Chad Rosier [Tue, 2 Feb 2016 15:02:30 +0000 (15:02 +0000)]
[AArch64] Allocate the modified and used regs only once per function.

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

8 years agoWebAssembly: update expected GCC torture test failures
JF Bastien [Tue, 2 Feb 2016 14:27:34 +0000 (14:27 +0000)]
WebAssembly: update expected GCC torture test failures

The 3 programs used __attribute__((mode(?))) on enum, which clang r259497 fixed.

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

8 years agoRefactor backend diagnostics for unsupported features
Oliver Stannard [Tue, 2 Feb 2016 13:52:43 +0000 (13:52 +0000)]
Refactor backend diagnostics for unsupported features

Re-commit of r258951 after fixing layering violation.

The BPF and WebAssembly backends had identical code for emitting errors
for unsupported features, and AMDGPU had very similar code. This merges
them all into one DiagnosticInfo subclass, that can be used by any
backend.

There should be minimal functional changes here, but some AMDGPU tests
have been updated for the new format of errors (it used a slightly
different format to BPF and WebAssembly). The AMDGPU error messages will
now benefit from having precise source locations when debug info is
available.

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