oota-llvm.git
8 years agoReapply 239795 - [InstCombine] Propagate non-null facts to call parameters
Philip Reames [Tue, 16 Jun 2015 20:24:25 +0000 (20:24 +0000)]
Reapply 239795 - [InstCombine] Propagate non-null facts to call parameters

The original change broke clang side tests.  I will be submitting those momentarily.  This change includes post commit feedback on the original change from from Pete Cooper.

Original Submission comments:
If a parameter to a function is known non-null, use the existing parameter attributes to record that fact at the call site. This has no optimization benefit by itself - that I know of - but is an enabling change for http://reviews.llvm.org/D9129.

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

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

8 years agoextract some code into a helper function for MergeConsecutiveStores(); NFCI
Sanjay Patel [Tue, 16 Jun 2015 20:05:00 +0000 (20:05 +0000)]
extract some code into a helper function for MergeConsecutiveStores(); NFCI

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

8 years agoImprove handling of end of file in the bitcode reader.
Rafael Espindola [Tue, 16 Jun 2015 20:03:39 +0000 (20:03 +0000)]
Improve handling of end of file in the bitcode reader.

Before this patch the bitcode reader would read a module from a file
that contained in order:

* Any number of non MODULE_BLOCK sub blocks.
* One MODULE_BLOCK
* Any number of non MODULE_BLOCK sub blocks.
* 4 '\n' characters to handle OS X's ranlib.

Since we support lazy reading of modules, any information that is relevant
for the module has to be in the MODULE_BLOCK or before it. We don't gain
anything from checking what is after.

This patch then changes the reader to stop once the MODULE_BLOCK has been
successfully parsed.

This avoids the ugly special case for .bc files in an archive and makes it
easier to embed bitcode files.

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

8 years agoFix PR 23525 - Separate header mass propagation in irregular loops.
Diego Novillo [Tue, 16 Jun 2015 19:10:58 +0000 (19:10 +0000)]
Fix PR 23525 - Separate header mass propagation in irregular loops.

Summary:
When propagating mass through irregular loops, the mass flowing through
each loop header may not be equal. This was causing wrong frequencies
to be computed for irregular loop headers.

Fixed by keeping track of masses flowing through each of the headers in
an irregular loop. To do this, we now keep track of per-header backedge
weights. After the loop mass is distributed through the loop, the
backedge weights are used to re-distribute the loop mass to the loop
headers.

Since each backedge will have a mass proportional to the different
branch weights, the loop headers will end up with a more approximate
weight distribution (as opposed to the current distribution that assumes
that every loop header is the same).

Reviewers: dexonsmith

Subscribers: llvm-commits

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

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

8 years ago[Statepoints] Test only change. Check that statepoint lowering didn't generate more...
Igor Laevsky [Tue, 16 Jun 2015 19:07:05 +0000 (19:07 +0000)]
[Statepoints] Test only change. Check that statepoint lowering didn't generate more than expected amount of spills.
See http://reviews.llvm.org/D10402 for related discussion.

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

8 years agoVirtRegMap: Add undef flag when reading undefined subregisters.
Matthias Braun [Tue, 16 Jun 2015 18:22:28 +0000 (18:22 +0000)]
VirtRegMap: Add undef flag when reading undefined subregisters.

While completely undefined registers are easy to catch and get their
<undef> flag early in ProcessImplicitDefs/RegisterCoalescer reading from
a partially defined register where just the subreg happens to be
undefined is harder to catch so we only add the undef flag in the
virtual register rewriting step.

No testcase as I cannot reproduce the problem on any of the in-tree targets at
the moment.

This fixes rdar://21387089

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

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

8 years agoTargetRegisterInfo: Make the concept of imprecise lane masks explicit
Matthias Braun [Tue, 16 Jun 2015 18:22:26 +0000 (18:22 +0000)]
TargetRegisterInfo: Make the concept of imprecise lane masks explicit

LaneMasks as given by getSubRegIndexLaneMask() have a limited number of
of bits, so for targets with more than 31 disjunct subregister there may
be cases where:

   getSubReg(Reg,A) does not overlap getSubReg(Reg,B)

but we still have

   (getSubRegIndexLaneMask(A) & getSubRegIndexLaneMask(B)) != 0.

I had hoped to keep this an implementation detail of the tablegen but as
my next commit shows we can avoid unnecessary imp-defs operands if we
know that the lane masks in use are precise.

This is in preparation to http://reviews.llvm.org/D10470.

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

8 years ago[X86] Rename some frame lowering variables
Reid Kleckner [Tue, 16 Jun 2015 18:08:57 +0000 (18:08 +0000)]
[X86] Rename some frame lowering variables

Old names, new names, and what they really mean:

- IsWin64 -> IsWin64CC: This is true on non-Windows x86_64 platforms
  when the ms_abi calling convention is used.
- IsWinEH -> IsWin64Prologue: True when the target is Win64, regardless
  of calling convention. Changes the prologue to obey the constraints of
  the Win64 unwinder.
- NeedsWinEH -> NeedsWinCFI: We're using the win64 prologue *and* the we
  want .xdata unwind tables. Analogous to NeedsDwarfCFI.

NFC

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

8 years agoRename Reduction variables/structures to Recurrence.
Tyler Nowicki [Tue, 16 Jun 2015 18:07:34 +0000 (18:07 +0000)]
Rename Reduction variables/structures to Recurrence.

A reduction is a special kind of recurrence. In the loop vectorizer we currently
identify basic reductions. Future patches will extend this to identifying basic
recurrences.

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

8 years agoHave MachOObjectFile::isValidArch() accept armv7
Frederic Riss [Tue, 16 Jun 2015 17:37:03 +0000 (17:37 +0000)]
Have MachOObjectFile::isValidArch() accept armv7

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

8 years agoMIR Parser: Report an error when a machine function doesn't have a corresponding...
Alex Lorenz [Tue, 16 Jun 2015 17:06:29 +0000 (17:06 +0000)]
MIR Parser: Report an error when a machine function doesn't have a corresponding function.

This commit reports an error when a machine function from a MIR file that contains
LLVM IR can't find a function with the same name in the loaded LLVM IR module.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years agoAdd a test for padded bitcode files.
Rafael Espindola [Tue, 16 Jun 2015 16:36:15 +0000 (16:36 +0000)]
Add a test for padded bitcode files.

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

8 years agopropagate IR-level fast-math-flags to DAG nodes, disabled by default
Sanjay Patel [Tue, 16 Jun 2015 16:25:43 +0000 (16:25 +0000)]
propagate IR-level fast-math-flags to DAG nodes, disabled by default

This is an updated version of the patch that was checked in at:
http://reviews.llvm.org/rL237046

but subsequently reverted because it exposed a bug in the DAG Combiner:
http://reviews.llvm.org/D9893

This time, there's an enablement flag ("EnableFMFInDAG") around the code in
SelectionDAGBuilder where we copy the set of FP optimization flags from IR
instructions to DAG nodes. So, in theory, there should be no functional change
from this patch as-is, but it will allow testing with the added functionality
to proceed via "-enable-fmf-dag" passed to llc.

This patch adds the minimum plumbing necessary to use IR-level
fast-math-flags (FMF) in the backend without actually using
them for anything yet. This is a follow-on to:
http://reviews.llvm.org/rL235997

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

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

8 years agoProperly handle the mftb instruction.
Kit Barton [Tue, 16 Jun 2015 16:01:15 +0000 (16:01 +0000)]
Properly handle the mftb instruction.

The mftb instruction was incorrectly marked as deprecated in the PPC
Backend. Instead, it should not be treated as deprecated, but rather be
implemented using the mfspr instruction. A similar patch was put into GCC last
year. Details can be found at:

https://sourceware.org/ml/binutils/2014-11/msg00383.html.
This change will replace instances of the mftb instruction with the mfspr
instruction for all CPUs except 601 and pwr3. This will also be the default
behaviour.

Additional details can be found in:

https://llvm.org/bugs/show_bug.cgi?id=23680

Phabricator review: http://reviews.llvm.org/D10419

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

8 years ago[Hexagon] Alphabetical ordering of functions, NFC.
Colin LeMahieu [Tue, 16 Jun 2015 15:59:53 +0000 (15:59 +0000)]
[Hexagon] Alphabetical ordering of functions, NFC.

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

8 years agoRevert "Revert "Fix merges of non-zero vector stores""
Matt Arsenault [Tue, 16 Jun 2015 15:51:48 +0000 (15:51 +0000)]
Revert "Revert "Fix merges of non-zero vector stores""

Reapply r239539. Don't assume the collected number of
stores is the same vector size. Just take the first N
stores to fill the vector.

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

8 years agoClean up redundant copies of Triple objects. NFC
Daniel Sanders [Tue, 16 Jun 2015 15:44:21 +0000 (15:44 +0000)]
Clean up redundant copies of Triple objects. NFC

Summary:

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin, jholewinski

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

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

8 years ago[InstSimplify] Allow folding of fdiv X, X with just NaNs ignored
Benjamin Kramer [Tue, 16 Jun 2015 14:57:29 +0000 (14:57 +0000)]
[InstSimplify] Allow folding of fdiv X, X with just NaNs ignored

Any combination of +-inf/+-inf is NaN so it's already ignored with
nnan and we can skip checking for ninf. Also rephrase logic in comments
a bit.

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

8 years agoRepair cmake libatomic check.
James Y Knight [Tue, 16 Jun 2015 14:00:01 +0000 (14:00 +0000)]
Repair cmake libatomic check.

The cmake check for whether libatomic could be used had been
unconditionally setting the result to false. Which was somewhat
fortunate, because the prerequisite check for whether it was *needed*
was always claiming it was, even if it was not.

However, this made platforms where libatomic is actually necessary
fail to link.

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

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

8 years ago[mips][ias] Expand on r238751 to cover as many relocs as possible.
Daniel Sanders [Tue, 16 Jun 2015 13:46:26 +0000 (13:46 +0000)]
[mips][ias] Expand on r238751 to cover as many relocs as possible.

Summary:
Relocs that can be converted from absolute to PC-relative now do so if IsPCRel
is true. Relocs that require PC-relative now call llvm_unreachable() if IsPCRel
is false and similarly those that require absolute assert that IsPCRel is false.

Note that while it looks like some relocs (e.g. R_MIPS_26) can be converted into
the MIPS32r6/MIPS64r6 relocs (R_MIPS_PC*_S2), it isn't actually valid to do so.

Placeholders have been left in the testcase for unsupported relocs and relocs
that cannot be generated at the moment.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits, rafael

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

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

8 years agoReplace string GNU Triples with llvm::Triple in TargetMachine::getTargetTriple()...
Daniel Sanders [Tue, 16 Jun 2015 13:15:50 +0000 (13:15 +0000)]
Replace string GNU Triples with llvm::Triple in TargetMachine::getTargetTriple(). NFC.

Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin

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

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

8 years agoSilence an MSVC warning about not all control paths returning a value; NFC.
Aaron Ballman [Tue, 16 Jun 2015 13:14:59 +0000 (13:14 +0000)]
Silence an MSVC warning about not all control paths returning a value; NFC.

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

8 years agoRecommit r239721: Replace string GNU Triples with llvm::Triple in InitMCObjectFileInf...
Daniel Sanders [Tue, 16 Jun 2015 12:18:07 +0000 (12:18 +0000)]
Recommit r239721: Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.

Summary:
This affects other tools so the previous C++ API has been retained as a
deprecated function for the moment. Clang has been updated with a trivial
patch (not covered by the pre-commit review) to avoid breaking -Werror builds.
Other in-tree tools will be fixed with similar patches.

This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

The first time this was committed it accidentally fixed an inconsistency in
triples in llvm-mc and this caused a failure. This inconsistency was fixed in
r239808.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin

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

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

8 years ago[mips] [IAS] Refactor symbol-address loading code into a helper function. NFC.
Toma Tabacu [Tue, 16 Jun 2015 12:16:24 +0000 (12:16 +0000)]
[mips] [IAS] Refactor symbol-address loading code into a helper function. NFC.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

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

8 years ago[llvm-mc] The object form of the GNU triple should be the same as the string form.
Daniel Sanders [Tue, 16 Jun 2015 09:57:38 +0000 (09:57 +0000)]
[llvm-mc] The object form of the GNU triple should be the same as the string form.

Summary:
GetTarget() may modify TripleName without also updating TheTriple.
This can lead to situations where the MCObjectStreamer has a different triple
to the rest of LLVM.

This inconsistency caused sparc-little-endian.s to pass on Windows because most
of LLVM had sparcel-pc-win32 while MCObjectStreamer had "". I believe the same
kind of thing was also true of Darwin.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin, rafael

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

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

8 years ago[MachineSink] Address post-commit review comments
Arnaud A. de Grandmaison [Tue, 16 Jun 2015 08:57:21 +0000 (08:57 +0000)]
[MachineSink] Address post-commit review comments

The successors cache is now a local variable, making it more visible that it
is only valid for the MBB being processed.

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

8 years ago[AVX512] add integer min/max intrinsics support.
Asaf Badouh [Tue, 16 Jun 2015 08:39:27 +0000 (08:39 +0000)]
[AVX512] add integer min/max intrinsics support.

review:
http://reviews.llvm.org/D10439

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

8 years agoDisable llvm/test/CodeGen/MIR/machine-function.mir on x86 msc18 for now. Investigating.
NAKAMURA Takumi [Tue, 16 Jun 2015 06:57:35 +0000 (06:57 +0000)]
Disable llvm/test/CodeGen/MIR/machine-function.mir on x86 msc18 for now. Investigating.

The emission was as below;

  ---
  name:            foo
  alignment:       31428584
  exposesReturnsTwice: true
  hasInlineAsm:    false
  ...
  ---
  name:            bar
  alignment:       1701667182
  exposesReturnsTwice: false
  hasInlineAsm:    false
  ...
  ---
  name:            func
  alignment:       8
  exposesReturnsTwice: false
  hasInlineAsm:    false
  ...
  ---
  name:            func2
  alignment:       16
  exposesReturnsTwice: true
  hasInlineAsm:    true
  ...

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

8 years agollvm/unittests/Support/Path.cpp: Use <windows.h> instead of <Windows.h>.
NAKAMURA Takumi [Tue, 16 Jun 2015 06:46:16 +0000 (06:46 +0000)]
llvm/unittests/Support/Path.cpp: Use <windows.h> instead of <Windows.h>.

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

8 years agoX86: optimized i64 vector multiply with constant
Elena Demikhovsky [Tue, 16 Jun 2015 06:07:24 +0000 (06:07 +0000)]
X86: optimized i64 vector multiply with constant

When we multiply two 64-bit vectors, we extract lower and upper part and use the PMULUDQ instruction.
When one of the operands is a constant, the upper part may be zero, we know this at compile time.
Example: %a = mul <4 x i64> %b, <4 x i64> < i64 5, i64 5, i64 5, i64 5>.
I'm checking the value of the upper part and prevent redundant "multiply", "shift" and "add" operations.

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

8 years ago[TableGen] Remove unused method declaration. NFC
Craig Topper [Tue, 16 Jun 2015 05:44:06 +0000 (05:44 +0000)]
[TableGen] Remove unused method declaration. NFC

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

8 years agoRevert 239795
Philip Reames [Tue, 16 Jun 2015 01:20:53 +0000 (01:20 +0000)]
Revert 239795

I forgot to update some clang test cases.  I'll fix and resubmit tomorrow.

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

8 years ago[AArch64] Generalize extract-high DUP extension to MOVI/MVNI.
Ahmed Bougacha [Tue, 16 Jun 2015 01:18:14 +0000 (01:18 +0000)]
[AArch64] Generalize extract-high DUP extension to MOVI/MVNI.

These are really immediate DUPs, and suffer from the same problem
with long instructions with a high/2 variant (e.g. smull).

By extending a MOVI (or DUP, before this patch), we can avoid an ext
on the other operand of the long instruction, e.g. turning:
    ext.16b v0, v0, v0, #8
    movi.4h v1, #0x53
    smull.4s  v0, v0, v1
into:
    movi.8h v1, #0x53
    smull2.4s  v0, v0, v1

While there, add a now-necessary combine to fold (VT NVCAST (VT x)).

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

8 years ago[AArch64] Robustize neon-2velem-high test. NFC.
Ahmed Bougacha [Tue, 16 Jun 2015 01:05:39 +0000 (01:05 +0000)]
[AArch64] Robustize neon-2velem-high test. NFC.

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

8 years agoMove logic from JumpThreading into LazyValue info to simplify caller.
Philip Reames [Tue, 16 Jun 2015 00:49:59 +0000 (00:49 +0000)]
Move logic from JumpThreading into LazyValue info to simplify caller.

This change is hopefully NFC. The only tricky part is that I changed the context instruction being used to the branch rather than the comparison. I believe both to be correct, but the branch is strictly more powerful. With the moved code, using the branch instruction is required for the basic block comparison test to return the same result. The previous code was able to directly access both the branch and the comparison where the revised code is not.

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

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

8 years agomodules: Add explicit dependency on intrinsics_gen
Duncan P. N. Exon Smith [Tue, 16 Jun 2015 00:44:12 +0000 (00:44 +0000)]
modules: Add explicit dependency on intrinsics_gen

`LLVM_ENABLE_MODULES` builds sometimes fail because `Intrinsics.td`
needs to regenerate `Instrinsics.h` before anyone can include anything
from the LLVM_IR module.  Represent the dependency explicitly to prevent
that.

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

8 years ago[InstCombine] Propagate non-null facts to call parameters
Philip Reames [Tue, 16 Jun 2015 00:43:54 +0000 (00:43 +0000)]
[InstCombine] Propagate non-null facts to call parameters

If a parameter to a function is known non-null, use the existing parameter attributes to record that fact at the call site. This has no optimization benefit by itself - that I know of - but is an enabling change for http://reviews.llvm.org/D9129.

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

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

8 years agomodules: Mark CodeGen/DIEValues.def as a textual inclusion
Duncan P. N. Exon Smith [Tue, 16 Jun 2015 00:43:52 +0000 (00:43 +0000)]
modules: Mark CodeGen/DIEValues.def as a textual inclusion

Mark CodeGen/DIEValues.def as a textual inclusion to fix the
`LLVM_ENABLE_MODULES` build.

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

8 years agomodules: Move ProfileKinds to an anonymous namespace
Duncan P. N. Exon Smith [Tue, 16 Jun 2015 00:43:04 +0000 (00:43 +0000)]
modules: Move ProfileKinds to an anonymous namespace

Fix a build failure with `LLVM_ENABLE_MODULES` due to
`ProfileData::instr` conflicting with a function `instr()` in
`<curses.h>`.

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

8 years agoMIR Serialization: Print and parse simple machine function attributes.
Alex Lorenz [Tue, 16 Jun 2015 00:10:47 +0000 (00:10 +0000)]
MIR Serialization: Print and parse simple machine function attributes.

This commit serializes the simple, scalar attributes from the
'MachineFunction' class.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years agoMIR Serialization: move the MIR printer out of the MIR printing pass.
Alex Lorenz [Mon, 15 Jun 2015 23:52:35 +0000 (23:52 +0000)]
MIR Serialization: move the MIR printer out of the MIR printing pass.

This commit decouples the MIR printer and the MIR printing pass so
that it will be possible to move the MIR printer into a separate
machine IR library later on.

Reviewers: Duncan P. N. Exon Smith

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

8 years ago[X86] Try to shorten dwarf CFI emission
Reid Kleckner [Mon, 15 Jun 2015 23:45:08 +0000 (23:45 +0000)]
[X86] Try to shorten dwarf CFI emission

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

8 years agoDebug Info IR: Switch DIObjCProperty to use DITypeRef.
Adrian Prantl [Mon, 15 Jun 2015 23:18:03 +0000 (23:18 +0000)]
Debug Info IR: Switch DIObjCProperty to use DITypeRef.
This is a prerequisite for turning on ODR type uniquing for ObjC++.

rdar://problem/21377883

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

8 years agoMIR Serialization: Create dummy functions when the MIR file doesn't have LLVM IR.
Alex Lorenz [Mon, 15 Jun 2015 23:07:38 +0000 (23:07 +0000)]
MIR Serialization: Create dummy functions when the MIR file doesn't have LLVM IR.

This commit creates a dummy LLVM IR function with one basic block and an unreachable
instruction for each parsed machine function when the MIR file doesn't have LLVM IR.
This change is required as the machine function analysis pass creates machine
functions only for the functions that are defined in the current LLVM module.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years agoMIR Serialization: Report an error when machine functions have the same name.
Alex Lorenz [Mon, 15 Jun 2015 22:23:23 +0000 (22:23 +0000)]
MIR Serialization: Report an error when machine functions have the same name.

This commit reports an error when the MIR parser encounters a machine
function with the name that is the same as the name of a different
machine function.

Reviewers: Duncan P. N. Exon Smith

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

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

8 years agoAdd safestack attribute to LLVMAttribute enum and Go bindings. Correct
Peter Collingbourne [Mon, 15 Jun 2015 22:16:51 +0000 (22:16 +0000)]
Add safestack attribute to LLVMAttribute enum and Go bindings. Correct
constants in commented-out part of LLVMAttribute enum. Add tests that verify
that the safestack attribute is only allowed as a function attribute.

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

8 years ago[Hexagon] Using readobj rather than objdump.
Colin LeMahieu [Mon, 15 Jun 2015 21:57:41 +0000 (21:57 +0000)]
[Hexagon] Using readobj rather than objdump.

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

8 years ago[Hexagon] PC-relative offsets are relative to packet start rather than the offset...
Colin LeMahieu [Mon, 15 Jun 2015 21:52:13 +0000 (21:52 +0000)]
[Hexagon] PC-relative offsets are relative to packet start rather than the offset of the relocation.  Set relocation addend and check it's correct in the ELF.

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

8 years ago[X86][SSE] Added tests for vector i8/i16 to f32/f64 conversions
Simon Pilgrim [Mon, 15 Jun 2015 21:49:31 +0000 (21:49 +0000)]
[X86][SSE] Added tests for vector i8/i16 to f32/f64 conversions

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

8 years agoProtection against stack-based memory corruption errors using SafeStack
Peter Collingbourne [Mon, 15 Jun 2015 21:07:11 +0000 (21:07 +0000)]
Protection against stack-based memory corruption errors using SafeStack

This patch adds the safe stack instrumentation pass to LLVM, which separates
the program stack into a safe stack, which stores return addresses, register
spills, and local variables that are statically verified to be accessed
in a safe way, and the unsafe stack, which stores everything else. Such
separation makes it much harder for an attacker to corrupt objects on the
safe stack, including function pointers stored in spilled registers and
return addresses. You can find more information about the safe stack, as
well as other parts of or control-flow hijack protection technique in our
OSDI paper on code-pointer integrity (http://dslab.epfl.ch/pubs/cpi.pdf)
and our project website (http://levee.epfl.ch).

The overhead of our implementation of the safe stack is very close to zero
(0.01% on the Phoronix benchmarks). This is lower than the overhead of
stack cookies, which are supported by LLVM and are commonly used today,
yet the security guarantees of the safe stack are strictly stronger than
stack cookies. In some cases, the safe stack improves performance due to
better cache locality.

Our current implementation of the safe stack is stable and robust, we
used it to recompile multiple projects on Linux including Chromium, and
we also recompiled the entire FreeBSD user-space system and more than 100
packages. We ran unit tests on the FreeBSD system and many of the packages
and observed no errors caused by the safe stack. The safe stack is also fully
binary compatible with non-instrumented code and can be applied to parts of
a program selectively.

This patch is our implementation of the safe stack on top of LLVM. The
patches make the following changes:

- Add the safestack function attribute, similar to the ssp, sspstrong and
  sspreq attributes.

- Add the SafeStack instrumentation pass that applies the safe stack to all
  functions that have the safestack attribute. This pass moves all unsafe local
  variables to the unsafe stack with a separate stack pointer, whereas all
  safe variables remain on the regular stack that is managed by LLVM as usual.

- Invoke the pass as the last stage before code generation (at the same time
  the existing cookie-based stack protector pass is invoked).

- Add unit tests for the safe stack.

Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
Lab at EPFL; updates and upstreaming by myself.

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

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

8 years agoDon't indent inside a namespace. NFC.
Rafael Espindola [Mon, 15 Jun 2015 21:04:27 +0000 (21:04 +0000)]
Don't indent inside a namespace. NFC.

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

8 years agoReplace @ with the more common \. NFC.
Rafael Espindola [Mon, 15 Jun 2015 21:02:49 +0000 (21:02 +0000)]
Replace @ with the more common \. NFC.

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

8 years agoDon't repeat names in comments and start functions with a lower case letter.
Rafael Espindola [Mon, 15 Jun 2015 20:55:37 +0000 (20:55 +0000)]
Don't repeat names in comments and start functions with a lower case letter.

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

8 years agoMIR Serialization: Connect the machine function analysis pass to the MIR parser.
Alex Lorenz [Mon, 15 Jun 2015 20:30:22 +0000 (20:30 +0000)]
MIR Serialization: Connect the machine function analysis pass to the MIR parser.

This commit connects the machine function analysis pass (which creates machine
functions) to the MIR parser, which will initialize the machine functions
with the state from the MIR file and reconstruct the machine IR.

This commit introduces a new interface called 'MachineFunctionInitializer',
which can be used to provide custom initialization for the machine functions.

This commit also introduces a new diagnostic class called
'DiagnosticInfoMIRParser' which is used for MIR parsing errors.
This commit modifies the default diagnostic handling in LLVMContext - now the
the diagnostics are printed directly into llvm::errs() so that the MIR parsing
errors can be printed with colours.

Reviewers: Justin Bogner

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

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

8 years agoRemove duplicate conditional in if-stmt.
Eric Christopher [Mon, 15 Jun 2015 20:16:53 +0000 (20:16 +0000)]
Remove duplicate conditional in if-stmt.

Fixes PR23839.

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

8 years agoCleanup the constructor of BitcodeReader. NFC.
Rafael Espindola [Mon, 15 Jun 2015 20:08:17 +0000 (20:08 +0000)]
Cleanup the constructor of BitcodeReader. NFC.

Use the same argument names as the members.
Use default member initializes.

Extracted from a patch by Karl Schimpf.

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

8 years agoAdd "REQUIRES: asserts" to test case that uses -debug-only
Sanjoy Das [Mon, 15 Jun 2015 20:05:38 +0000 (20:05 +0000)]
Add "REQUIRES: asserts" to test case that uses -debug-only

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

8 years agoUnbreak docs build from r239740.
Sanjoy Das [Mon, 15 Jun 2015 19:38:15 +0000 (19:38 +0000)]
Unbreak docs build from r239740.

Add FaultMaps.rst to toctree.

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

8 years agoUnbreak the build from r239740.
Sanjoy Das [Mon, 15 Jun 2015 19:29:44 +0000 (19:29 +0000)]
Unbreak the build from r239740.

Do not re-use an enum name as a field name.  Some bots don't like this.

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

8 years ago[Hexagon] Moving pass declarations out of header and in to implementation files....
Colin LeMahieu [Mon, 15 Jun 2015 19:05:35 +0000 (19:05 +0000)]
[Hexagon] Moving pass declarations out of header and in to implementation files.  Removing unused function getSubtargetInfo from HexagonMCCodeEmitter.cpp  Removing deletion of copy construction and assignment operator since parent already deletes it.

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

8 years ago[CodeGen] Add a pass to fold null checks into nearby memory operations.
Sanjoy Das [Mon, 15 Jun 2015 18:44:27 +0000 (18:44 +0000)]
[CodeGen] Add a pass to fold null checks into nearby memory operations.

Summary:
This change adds an "ImplicitNullChecks" target dependent pass.  This
pass folds null checks into memory operation using the FAULTING_LOAD
pseudo-op introduced in previous patches.

Depends on D10197
Depends on D10199
Depends on D10200

Reviewers: reames, rnk, pgavlin, JosephTremoulet, atrick

Reviewed By: atrick

Subscribers: ab, JosephTremoulet, llvm-commits

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

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

8 years ago[TargetInstrInfo] Add new hook: AnalyzeBranchPredicate.
Sanjoy Das [Mon, 15 Jun 2015 18:44:21 +0000 (18:44 +0000)]
[TargetInstrInfo] Add new hook: AnalyzeBranchPredicate.

Summary:
NFC: no one uses AnalyzeBranchPredicate yet.

Add TargetInstrInfo::AnalyzeBranchPredicate and implement for x86.  A
later change adding support for page-fault based implicit null checks
depends on this.

Reviewers: reames, ab, atrick

Reviewed By: atrick

Subscribers: llvm-commits

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

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

8 years ago[TargetInstrInfo] Rename getLdStBaseRegImmOfs and implement for x86.
Sanjoy Das [Mon, 15 Jun 2015 18:44:14 +0000 (18:44 +0000)]
[TargetInstrInfo] Rename getLdStBaseRegImmOfs and implement for x86.

Summary:

TargetInstrInfo::getLdStBaseRegImmOfs to
TargetInstrInfo::getMemOpBaseRegImmOfs and implement for x86.  The
implementation only handles a few easy cases now and will be made more
sophisticated in the future.

This is NFCI: the only user of `getLdStBaseRegImmOfs` (now
`getmemOpBaseRegImmOfs`) is `LoadClusterMotion` and `LoadClusterMotion`
is disabled for x86.

Reviewers: reames, ab, MatzeB, atrick

Reviewed By: MatzeB, atrick

Subscribers: llvm-commits

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

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

8 years ago[CodeGen] Introduce a FAULTING_LOAD_OP pseudo-op.
Sanjoy Das [Mon, 15 Jun 2015 18:44:08 +0000 (18:44 +0000)]
[CodeGen] Introduce a FAULTING_LOAD_OP pseudo-op.

Summary:
This instruction encodes a loading operation that may fault, and a label
to branch to if the load page-faults.  The locations of potentially
faulting loads and their "handler" destinations are recorded in a
FaultMap section, meant to be consumed by LLVM's clients.

Nothing generates FAULTING_LOAD_OP instructions yet, but they will be
used in a future change.

The documentation (FaultMaps.rst) needs improvement and I will update
this diff with a more expanded version shortly.

Depends on D10196

Reviewers: rnk, reames, AndyAyers, ab, atrick, pgavlin

Reviewed By: atrick, pgavlin

Subscribers: llvm-commits

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

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

8 years ago[NFC] Extract X86MCInstLower::LowerMachineOperand.
Sanjoy Das [Mon, 15 Jun 2015 18:44:01 +0000 (18:44 +0000)]
[NFC] Extract X86MCInstLower::LowerMachineOperand.

Summary: Refactoring-only change that will be used later.

Reviewers: reames, atrick

Reviewed By: atrick

Subscribers: llvm-commits

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

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

8 years agoDe-duplicate common expression, NFC.
Yaron Keren [Mon, 15 Jun 2015 17:03:35 +0000 (17:03 +0000)]
De-duplicate common expression, NFC.

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

8 years agoRangify several for loops, NFC.
Yaron Keren [Mon, 15 Jun 2015 16:20:16 +0000 (16:20 +0000)]
Rangify several for loops, NFC.

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

8 years agoOn behalf of Alexandros Lamprineas:
Evgeny Astigeevich [Mon, 15 Jun 2015 15:48:44 +0000 (15:48 +0000)]
On behalf of Alexandros Lamprineas:

LLVM targeting aarch64 doesn't correctly produce aligned accesses for non-aligned
data at -O0/fast-isel (-mno-unaligned-access).
The root cause seems to be in fast-isel not producing unaligned access correctly
for -mno-unaligned-access.

The patch just aborts fast-isel for loads and stores when -mno-unaligned-access is
present.
The regression test is updated to check this new test case (-mno-unaligned-access
together with fast-isel).

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

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

8 years ago[LinkerTest] Use LLVMDisposeMessage to free error string.
Benjamin Kramer [Mon, 15 Jun 2015 15:42:26 +0000 (15:42 +0000)]
[LinkerTest] Use LLVMDisposeMessage to free error string.

LLVMDisposeMessage is just a thing wrapper around free at the moment, but it's
the proper API to use here.

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

8 years agoAvoid a "always true" warning from gcc.
Rafael Espindola [Mon, 15 Jun 2015 14:49:41 +0000 (14:49 +0000)]
Avoid a "always true" warning from gcc.

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

8 years agogold-plugin: save the .o when given -save-temps.
Rafael Espindola [Mon, 15 Jun 2015 13:36:27 +0000 (13:36 +0000)]
gold-plugin: save the .o when given -save-temps.

The plugin now save the bitcode before and after optimizations and the
.o that is passed to the linker.

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

8 years agoRevert r239721 - Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo...
Daniel Sanders [Mon, 15 Jun 2015 10:34:38 +0000 (10:34 +0000)]
Revert r239721 - Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.

It appears to cause sparc-little-endian.s to assert on Windows and Darwin.

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

8 years agoReplace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.
Daniel Sanders [Mon, 15 Jun 2015 09:19:41 +0000 (09:19 +0000)]
Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.

Summary:
This affects other tools so the previous C++ API has been retained as a
deprecated function for the moment. Clang has been updated with a trivial
patch (not covered by the pre-commit review) to avoid breaking -Werror builds.
Other in-tree tools will be fixed with similar trivial patches.

This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin

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

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

8 years ago[MachineSink] Improve runtime performance. NFC.
Arnaud A. de Grandmaison [Mon, 15 Jun 2015 09:09:06 +0000 (09:09 +0000)]
[MachineSink] Improve runtime performance. NFC.

This patch fixes a compilation time issue, when MachineSink faces PHIs
with a huge number of operands. This can happen for example in goto table
based interpreters, where some basic blocks can have several of those PHIs,
each one with several hundreds operands. MachineSink was spending a
significant time re-building and re-sorting the list of successors of
the current MachineBasicBlock. The computing and sorting of the current
MachineBasicBlock successors is now cached.

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

8 years ago[ValueTracking] do not overwrite analysis results already computed
Jingyue Wu [Mon, 15 Jun 2015 05:46:29 +0000 (05:46 +0000)]
[ValueTracking] do not overwrite analysis results already computed

Summary:
ValueTracking used to overwrite the analysis results computed from
assumes and dominating conditions. This patch fixes this issue.

Test Plan: test/Analysis/ValueTracking/assume.ll

Reviewers: hfinkel, majnemer

Reviewed By: majnemer

Subscribers: llvm-commits

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

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

8 years ago[Support][Endian] Define |= and &= for u{big,little}{16,32,64}_t.
Rui Ueyama [Mon, 15 Jun 2015 03:00:15 +0000 (03:00 +0000)]
[Support][Endian] Define |= and &= for u{big,little}{16,32,64}_t.

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

8 years ago[AArch64] Delete two empty files, which should be removed by r239713.
Hao Liu [Mon, 15 Jun 2015 02:56:40 +0000 (02:56 +0000)]
[AArch64] Delete two empty files, which should be removed by r239713.

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

8 years ago[AArch64] Revert r239711 again. We need to discuss how to share code between AArch64...
Hao Liu [Mon, 15 Jun 2015 01:56:40 +0000 (01:56 +0000)]
[AArch64] Revert r239711 again. We need to discuss how to share code between AArch64 and ARM backend.

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

8 years ago[AArch64] Match interleaved memory accesses into ldN/stN instructions.
Hao Liu [Mon, 15 Jun 2015 01:35:49 +0000 (01:35 +0000)]
[AArch64] Match interleaved memory accesses into ldN/stN instructions.

Re-commit after adding "-aarch64-neon-syntax=generic" to fix the failure on OS X.
This patch was firstly committed in r239514, then reverted in r239544 because of a syntax incompatible failure on OS X.

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

8 years ago[CMake] Try to fix r239612, not to miss resources/windows_version_resource.rc in...
NAKAMURA Takumi [Sun, 14 Jun 2015 21:47:29 +0000 (21:47 +0000)]
[CMake] Try to fix r239612, not to miss resources/windows_version_resource.rc in clang build.

  - Who defines ${LLVM_SOURCE_DIR} ?
  - Would windows_version_resource.rc be available in an *installed* llvm tree?
    I suggest it may be installed in ${PREFIX}/share.

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

8 years ago[InstSimplify] fsub nnan x, x -> 0.0 is valid without ninf
Benjamin Kramer [Sun, 14 Jun 2015 21:01:20 +0000 (21:01 +0000)]
[InstSimplify] fsub nnan x, x -> 0.0 is valid without ninf

Both inf - inf and (-inf) - (-inf) are NaN, so it's already covered by
nnan.

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

8 years ago[InstSimplify] Add self-fdiv identities for -ffinite-math-only.
Benjamin Kramer [Sun, 14 Jun 2015 18:53:58 +0000 (18:53 +0000)]
[InstSimplify] Add self-fdiv identities for -ffinite-math-only.

When NaNs and Infs are ignored we can fold
 X /  X -> 1.0
-X /  X -> -1.0
 X / -X -> -1.0

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

8 years agoAVX-512: Implemented DAG lowering for shuff62x2/shufi62x2 instuctions ( Shuffle Packe...
Igor Breger [Sun, 14 Jun 2015 13:07:47 +0000 (13:07 +0000)]
AVX-512: Implemented DAG lowering for shuff62x2/shufi62x2 instuctions ( Shuffle Packed Values at 128-bit Granularity )
Tests added , vector-shuffle-512-v8.ll test re-generated.

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

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

8 years agoAdd support for parsing the XOR operator in Intel syntax inline assembly.
Michael Kuperstein [Sun, 14 Jun 2015 12:59:45 +0000 (12:59 +0000)]
Add support for parsing the XOR operator in Intel syntax inline assembly.

Differential Revision: http://reviews.llvm.org/D10385
Patch by marina.yatsina@intel.com

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

8 years agoAVX-512: Implemented cvtsi2ss/d cvtusi2ss/d instructions with round control for KNL.
Igor Breger [Sun, 14 Jun 2015 12:44:55 +0000 (12:44 +0000)]
AVX-512: Implemented cvtsi2ss/d cvtusi2ss/d instructions with round control for KNL.
Added intrinsics for cvtsi2ss/d instructions.
Added tests for intrinsics and encoding.

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

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

8 years agoAsmPrinter.cpp: Avoid crashes for targeting like "arm-mingw32". CurrentFnSym might...
NAKAMURA Takumi [Sun, 14 Jun 2015 00:23:40 +0000 (00:23 +0000)]
AsmPrinter.cpp: Avoid crashes for targeting like "arm-mingw32". CurrentFnSym might not be <MCSymbolELF> here.

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

8 years agoReformat.
NAKAMURA Takumi [Sun, 14 Jun 2015 00:23:33 +0000 (00:23 +0000)]
Reformat.

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

8 years ago[Hexagon] Adding some codegen tests and updating some to match spec.
Colin LeMahieu [Sat, 13 Jun 2015 21:46:39 +0000 (21:46 +0000)]
[Hexagon] Adding some codegen tests and updating some to match spec.

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

8 years ago[Statepoints] Skip a vector copy when uniquing values.
Benjamin Kramer [Sat, 13 Jun 2015 19:50:38 +0000 (19:50 +0000)]
[Statepoints] Skip a vector copy when uniquing values.

No functionality change intended.

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

8 years ago[ExecutionEngine] ArrayRefize argument passing.
Benjamin Kramer [Sat, 13 Jun 2015 19:50:29 +0000 (19:50 +0000)]
[ExecutionEngine] ArrayRefize argument passing.

No functionality change intended.

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

8 years agoC++11 Rangify loops in AssemblyWriter::printModule, NFC.
Yaron Keren [Sat, 13 Jun 2015 17:50:47 +0000 (17:50 +0000)]
C++11 Rangify loops in AssemblyWriter::printModule, NFC.

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

8 years agoDon't use std::errc.
Rafael Espindola [Sat, 13 Jun 2015 17:23:04 +0000 (17:23 +0000)]
Don't use std::errc.

As noted on Errc.h:

// * std::errc is just marked with is_error_condition_enum. This means that
//   common patters like AnErrorCode == errc::no_such_file_or_directory take
//   4 virtual calls instead of two comparisons.

And on some libstdc++ those virtual functions conclude that

------------------------
int main() {
  std::error_code foo = std::make_error_code(std::errc::no_such_file_or_directory);
  return foo == std::errc::no_such_file_or_directory;
}
-------------------------

should exit with 0.

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

8 years ago[DAGCombiner] Added BSWAP(BSWAP(x)) -> x combine pattern.
Simon Pilgrim [Sat, 13 Jun 2015 16:25:12 +0000 (16:25 +0000)]
[DAGCombiner] Added BSWAP(BSWAP(x)) -> x combine pattern.

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

8 years agohoist loop-invariant; NFCI
Sanjay Patel [Sat, 13 Jun 2015 15:33:15 +0000 (15:33 +0000)]
hoist loop-invariant; NFCI

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

8 years agoremove function names from comments and clean up; NFC
Sanjay Patel [Sat, 13 Jun 2015 15:32:45 +0000 (15:32 +0000)]
remove function names from comments and clean up; NFC

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

8 years ago[SelectionDAG] Added assertions + UNDEF handling for BSWAP node creation.
Simon Pilgrim [Sat, 13 Jun 2015 15:23:58 +0000 (15:23 +0000)]
[SelectionDAG] Added assertions + UNDEF handling for BSWAP node creation.

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

8 years agoremove unnecessary casts; NFCI
Sanjay Patel [Sat, 13 Jun 2015 15:06:33 +0000 (15:06 +0000)]
remove unnecessary casts; NFCI

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

8 years ago[DAGCombiner] Added BSWAP vector constant folding support.
Simon Pilgrim [Sat, 13 Jun 2015 14:08:15 +0000 (14:08 +0000)]
[DAGCombiner] Added BSWAP vector constant folding support.

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

8 years agoStripped trailing whitespace. NFC.
Simon Pilgrim [Sat, 13 Jun 2015 12:57:36 +0000 (12:57 +0000)]
Stripped trailing whitespace. NFC.

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

8 years ago[LinkerTest] Don't leak error string.
Benjamin Kramer [Sat, 13 Jun 2015 12:53:21 +0000 (12:53 +0000)]
[LinkerTest] Don't leak error string.

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