oota-llvm.git
9 years agoPrune an out-of-date \param since r226476. [-Wdocumentation]
NAKAMURA Takumi [Fri, 23 Jan 2015 01:05:12 +0000 (01:05 +0000)]
Prune an out-of-date \param since r226476. [-Wdocumentation]

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

9 years agoReformat.
NAKAMURA Takumi [Fri, 23 Jan 2015 01:02:07 +0000 (01:02 +0000)]
Reformat.

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

9 years agoMipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]
NAKAMURA Takumi [Fri, 23 Jan 2015 01:01:52 +0000 (01:01 +0000)]
MipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]

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

9 years agoR600: Try to use lower types for 64bit division if possible
Jan Vesely [Thu, 22 Jan 2015 23:42:43 +0000 (23:42 +0000)]
R600: Try to use lower types for 64bit division if possible

v2: add and enable tests for SI

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226881 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSelectionDAG: Add KnownBits and SignBits computation for EXTRACT_ELEMENT
Jan Vesely [Thu, 22 Jan 2015 23:42:41 +0000 (23:42 +0000)]
SelectionDAG: Add KnownBits and SignBits computation for EXTRACT_ELEMENT

v2: use getZExtValue
    add missing break
    codestyle

v3: add few more comments

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226880 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600: Simplify LowerUDIVREM
Jan Vesely [Thu, 22 Jan 2015 23:42:39 +0000 (23:42 +0000)]
R600: Simplify LowerUDIVREM

optimizations can handle removing the Hi part operations.
The generated code is identical for R600, ~10% icount reduction for SI

v2: rebase

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226879 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Change GenericDwarfNode::getHeader() to StringRef
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 23:10:55 +0000 (23:10 +0000)]
IR: Change GenericDwarfNode::getHeader() to StringRef

Simplify the API to use a `StringRef` directly rather than exposing the
`MDString` bits underneath.

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

9 years agoIR: DwarfNode => DebugNode, NFC
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 22:47:44 +0000 (22:47 +0000)]
IR: DwarfNode => DebugNode, NFC

These things are potentially used for non-DWARF data (see the discussion
in PR22235), so take the `Dwarf` out of the name.  Since the new name
gives fewer clues, update the doxygen to properly describe what they
are.

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

9 years ago[X86][AVX] Added (V)MOVDDUP / (V)MOVSLDUP / (V)MOVSHDUP memory folding + tests.
Simon Pilgrim [Thu, 22 Jan 2015 22:39:59 +0000 (22:39 +0000)]
[X86][AVX] Added (V)MOVDDUP / (V)MOVSLDUP / (V)MOVSHDUP memory folding + tests.

Minor tweak now that D7042 is complete, we can enable stack folding for (V)MOVDDUP and do proper testing.

Added missing AVX ymm folding patterns and fixed alignment for AVX VMOVSLDUP / VMOVSHDUP.

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

9 years agoLine endings fixes. NFC.
Simon Pilgrim [Thu, 22 Jan 2015 22:27:37 +0000 (22:27 +0000)]
Line endings fixes. NFC.

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

9 years ago[X86][SSE] Simplified PSUBUS tests
Simon Pilgrim [Thu, 22 Jan 2015 22:19:58 +0000 (22:19 +0000)]
[X86][SSE] Simplified PSUBUS tests

Removed loops from PSUBUS tests - ensures folding is tested. Also renamed SSE2 tests SSSE3 to match cpu.

This is a follow up commit agreed in http://reviews.llvm.org/D7094

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

9 years ago[Object] Fix a bug in a condition introduced in r226217 - visibility can't be
Lang Hames [Thu, 22 Jan 2015 22:04:47 +0000 (22:04 +0000)]
[Object] Fix a bug in a condition introduced in r226217 - visibility can't be
both hidden and default.

Bug found by inspection by Rafael Espindola. No test: As discussed in the commit
message for r226217 we don't have a good way to test this yet.

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

9 years ago[PM] Actually add the new pass manager support for the assumption cache.
Chandler Carruth [Thu, 22 Jan 2015 21:53:09 +0000 (21:53 +0000)]
[PM] Actually add the new pass manager support for the assumption cache.

I had already factored this analysis specifically to enable doing this,
but hadn't actually committed the necessary wiring to get at this from
the new pass manager. This also nicely shows how the separate cache
object can be directly managed by the new pass manager.

This analysis didn't have any direct tests and so I've added a printer
pass and a boring test case. I chose to print the i1 value which is
being assumed rather than the call to llvm.assume as that seems much
more useful for testing... but suggestions on an even better printing
strategy welcome. My main goal was to make sure things actually work. =]

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

9 years agoRemove dead leak detector parts that fell out of use in r224703.
Benjamin Kramer [Thu, 22 Jan 2015 21:43:01 +0000 (21:43 +0000)]
Remove dead leak detector parts that fell out of use in r224703.

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

9 years agoIR: Update references to temporaries before deleting
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 21:36:45 +0000 (21:36 +0000)]
IR: Update references to temporaries before deleting

During `MDNode::deleteTemporary()`, call `replaceAllUsesWith(nullptr)`
to update all tracking references to `nullptr`.

This fixes PR22280, where inverted destruction order between tracking
references and the temporaries themselves caused a use-after-free in
`LLParser`.

An alternative fix would be to add an assertion that there are no users,
and continue to fix inverted destruction order in clients (like
`LLParser`), but instead I decided to make getting-teardown-right easy.
(If someone disagrees let me know.)

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

9 years agoRefactoring cl::parser construction and initialization.
Chris Bieneman [Thu, 22 Jan 2015 21:01:12 +0000 (21:01 +0000)]
Refactoring cl::parser construction and initialization.

Summary:
Some parsers need references back to the option they are members of. This is used for handling the argument string as well as by the various pass name parsers for making pass names into flags.

Making parsers that need to refer back to the option have a reference to the option eliminates some of the members of various parsers, and enables further code cleanup.

Reviewers: dexonsmith

Subscribers: llvm-commits

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

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

9 years agoDon't use -z,defs on FreeBSD.
Rafael Espindola [Thu, 22 Jan 2015 20:57:30 +0000 (20:57 +0000)]
Don't use -z,defs on FreeBSD.

Looks like environ is defined only in the main binary.

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

9 years ago[emacs] Use c-mode-common-hook, derive from "gnu"
Ramkumar Ramachandra [Thu, 22 Jan 2015 20:56:25 +0000 (20:56 +0000)]
[emacs] Use c-mode-common-hook, derive from "gnu"

Make it clear that the "llvm.org" style is deriving from "gnu" style,
and use the c-mode-common-hook instead of c-mode-hook and c++-mode-hook.

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

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

9 years agoIntrinsics: introduce llvm_any_ty aka ValueType Any
Ramkumar Ramachandra [Thu, 22 Jan 2015 20:14:38 +0000 (20:14 +0000)]
Intrinsics: introduce llvm_any_ty aka ValueType Any

Specifically, gc.result benefits from this greatly. Instead of:

gc.result.int.*
gc.result.float.*
gc.result.ptr.*
...

We now have a gc.result.* that can specialize to literally any type.

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

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

9 years agoRevert "Don't remove a landing pad if the invoke requires a table entry."
Reid Kleckner [Thu, 22 Jan 2015 19:29:46 +0000 (19:29 +0000)]
Revert "Don't remove a landing pad if the invoke requires a table entry."

This reverts commit r176827.

Björn Steinbrink pointed out that this didn't actually fix the bug
(PR15555) it was attempting to fix.

With this reverted, we can now remove landingpad cleanups that
immediately resume unwinding, converting the invoke to a call.

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

9 years agoAdd the option, -indirect-symbols, used with -macho to print the Mach-O indirect...
Kevin Enderby [Thu, 22 Jan 2015 18:55:27 +0000 (18:55 +0000)]
Add the option, -indirect-symbols, used with -macho to print the Mach-O indirect symbol table to llvm-objdump.

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

9 years agomerge consecutive stores of extracted vector elements (PR21711)
Sanjay Patel [Thu, 22 Jan 2015 18:21:26 +0000 (18:21 +0000)]
merge consecutive stores of extracted vector elements (PR21711)

This is a 2nd try at the same optimization as http://reviews.llvm.org/D6698.
That patch was checked in at r224611, but reverted at r225031 because it
caused a failure outside of the regression tests.

The cause of the crash was not recognizing consecutive stores that have mixed
source values (loads and vector element extracts), so this patch adds a check
to bail out if any store value is not coming from a vector element extract.

This patch also refactors the shared logic of the constant source and vector
extracted elements source cases into a helper function.

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

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

9 years agoFix the condition in this assertion, and also make it into an unreachable.
Adrian Prantl [Thu, 22 Jan 2015 17:52:08 +0000 (17:52 +0000)]
Fix the condition in this assertion, and also make it into an unreachable.

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

9 years agoRevert "PR21408: Workaround the appearance of duplicate variables due to problems...
David Blaikie [Thu, 22 Jan 2015 17:49:59 +0000 (17:49 +0000)]
Revert "PR21408: Workaround the appearance of duplicate variables due to problems when inlining two calls to the same function from the same call site."

The underlying bug has been fixed in r226736 so there's no need to
workaround this anymore.

This reverts commit r220923.

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

9 years agoAArch64: decode all MRS/MSR forms early to avoid saving FeatureBits.
Tim Northover [Thu, 22 Jan 2015 17:23:04 +0000 (17:23 +0000)]
AArch64: decode all MRS/MSR forms early to avoid saving FeatureBits.

Currently, we're adding a uint64_t describing the current subtarget so
that matching can check whether the specified register is valid.
However, we want to move to a bitset for those bits (x86 has more than
64 of them).

This can't live in a union so it's probably better to do the checks
early (especially as there are only 3 of them).

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

9 years agoRun clang-format on parts of DebugInfo.h
Adrian Prantl [Thu, 22 Jan 2015 16:55:27 +0000 (16:55 +0000)]
Run clang-format on parts of DebugInfo.h

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

9 years agoDocument DIExpression.
Adrian Prantl [Thu, 22 Jan 2015 16:55:24 +0000 (16:55 +0000)]
Document DIExpression.

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

9 years agoRewrite DIExpression::printInternal() to use the iterator interface.
Adrian Prantl [Thu, 22 Jan 2015 16:55:22 +0000 (16:55 +0000)]
Rewrite DIExpression::printInternal() to use the iterator interface.
NFC.

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

9 years agoRename DIExpressionIterator to DIExpression::iterator.
Adrian Prantl [Thu, 22 Jan 2015 16:55:20 +0000 (16:55 +0000)]
Rename DIExpressionIterator to DIExpression::iterator.
Addresses review feedback from Duncan.

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

9 years agoFix a comment.
Adrian Prantl [Thu, 22 Jan 2015 16:55:16 +0000 (16:55 +0000)]
Fix a comment.

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

9 years ago[pr21886] Change MCJIT/ELF to support MSVC C++ mangled symbol.
Rafael Espindola [Thu, 22 Jan 2015 14:20:45 +0000 (14:20 +0000)]
[pr21886] Change MCJIT/ELF to support MSVC C++ mangled symbol.

The ELF format is used on Windows by the MCJIT engine. Thus, on Windows, the
ELFObjectWriter can encounter symbols mangled using the MS Visual Studio C++
name mangling. Symbols mangled using the MSVC C++ name mangling can legally
have "@@@" as a substring. The EFLObjectWriter should not interpret the "@@@"
substring as specifying GNU-style symbol versioning. The ELFObjectWriter
therefore check for the MSVC C++ name mangling prefix which is either "?", "@?",
"imp_?" or "imp_?@".

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

9 years agoPass -Wl,-z,defs when building shared libraries, but not with the sanitizers.
Rafael Espindola [Thu, 22 Jan 2015 14:06:51 +0000 (14:06 +0000)]
Pass -Wl,-z,defs when building shared libraries, but not with the sanitizers.

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

9 years agoSilencing a -Wsign-compare warning (all uses of this constant are within unsigned...
Aaron Ballman [Thu, 22 Jan 2015 13:57:41 +0000 (13:57 +0000)]
Silencing a -Wsign-compare warning (all uses of this constant are within unsigned expressions anyway); NFC.

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

9 years ago[DAGCombine] Produce better code for constant splats
Michael Kuperstein [Thu, 22 Jan 2015 13:07:28 +0000 (13:07 +0000)]
[DAGCombine] Produce better code for constant splats

This solves PR22276.
Splats of constants would sometimes produce redundant shuffles, sometimes ridiculously so (see the PR for details). Fold these shuffles into BUILD_VECTORs early on instead.

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

Fixed recommit of r226811.

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

9 years agoMark |TLI| variables used to suppress -Wunused-variable warnings.
Alexander Potapenko [Thu, 22 Jan 2015 13:03:33 +0000 (13:03 +0000)]
Mark |TLI| variables used to suppress -Wunused-variable warnings.
(These vars are only used in assertions)

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

9 years agoRevert r226811, MSVC accepts code sane compilers don't.
Michael Kuperstein [Thu, 22 Jan 2015 12:48:07 +0000 (12:48 +0000)]
Revert r226811, MSVC accepts code sane compilers don't.

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

9 years ago[DAGCombine] Produce better code for constant splats
Michael Kuperstein [Thu, 22 Jan 2015 12:37:23 +0000 (12:37 +0000)]
[DAGCombine] Produce better code for constant splats

This solves PR22276.
Splats of constants would sometimes produce redundant shuffles, sometimes ridiculously so (see the PR for details). Fold these shuffles into BUILD_VECTORs early on instead.

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

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

9 years ago[ASan/Win] Move the shadow to 0x30000000
Timur Iskhodzhanov [Thu, 22 Jan 2015 12:24:21 +0000 (12:24 +0000)]
[ASan/Win] Move the shadow to 0x30000000

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

9 years agoFixed a bug in type legalizer for masked load/store intrinsics.
Elena Demikhovsky [Thu, 22 Jan 2015 12:07:59 +0000 (12:07 +0000)]
Fixed a bug in type legalizer for masked load/store intrinsics.
The problem occurs when after vectorization we have type
<2 x i32>. This type is promoted to <2 x i64> and then requires
additional efforts for expanding loads and truncating stores.
I added EXPAND / TRUNCATE attributes to the masked load/store
SDNodes. The code now contains additional shuffles.
I've prepared changes in the cost estimation for masked memory
operations, it will be submitted separately.

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

9 years agoFixed a comment
Elena Demikhovsky [Thu, 22 Jan 2015 10:01:36 +0000 (10:01 +0000)]
Fixed a comment

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

9 years agoFixed a bug in narrowing store operation.
Elena Demikhovsky [Thu, 22 Jan 2015 09:39:08 +0000 (09:39 +0000)]
Fixed a bug in narrowing store operation.
Type MVT::i1 became legal in KNL, but store operation can't be narrowed to this type,
since the size of VT (1 bit) is not equal to its actual store size(8 bits).

Added a test provided by David (dag@cray.com)

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

9 years ago[NFC] Introduce a 'struct Range' for IRCE
Sanjoy Das [Thu, 22 Jan 2015 09:32:02 +0000 (09:32 +0000)]
[NFC] Introduce a 'struct Range' for IRCE

Use the struct instead of a std::pair<Value *, Value *>.  This makes a
Range an obviously immutable object, and we can now assert that a
range is well-typed (Begin->getType() == End->getType()) on its
construction.

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

9 years agoRevert r226798. Guess I missed the patterns.
Craig Topper [Thu, 22 Jan 2015 09:01:20 +0000 (09:01 +0000)]
Revert r226798. Guess I missed the patterns.

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

9 years agoUse u8imm instead of i32i8imm on a couple instructions that have no patterns and...
Craig Topper [Thu, 22 Jan 2015 08:53:11 +0000 (08:53 +0000)]
Use u8imm instead of i32i8imm on a couple instructions that have no patterns and thus no reason to use a larger operand size.

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

9 years ago[X86] Remove some unused multiclasses from AVX512 instruction file.
Craig Topper [Thu, 22 Jan 2015 08:53:08 +0000 (08:53 +0000)]
[X86] Remove some unused multiclasses from AVX512 instruction file.

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

9 years agoFix crashes in IRCE caused by mismatched types
Sanjoy Das [Thu, 22 Jan 2015 08:29:18 +0000 (08:29 +0000)]
Fix crashes in IRCE caused by mismatched types

There are places where the inductive range check elimination pass
depends on two llvm::Values or llvm::SCEVs to be of the same
llvm::Type when they do not need to be. This patch relaxes those
restrictions (by bailing out of the optimization if the types
mismatch), and adds test cases to trigger those paths.

These issues were found by bootstrapping clang with IRCE running in
the -O3 pass ordering.

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

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

9 years agoSLPVectorizer: add a second limit for the number of alias checks.
Erik Eckstein [Thu, 22 Jan 2015 08:20:51 +0000 (08:20 +0000)]
SLPVectorizer: add a second limit for the number of alias checks.

Even with the current limit on the number of alias checks, the containing loop has quadratic complexity.
This begins to hurt for blocks containing > 1K load/store instructions.
This commit introduces a limit for the loop count. It reduces the runtime for such very large blocks.

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

9 years agoFixed a bug in masked load/store in reversed loop.
Elena Demikhovsky [Thu, 22 Jan 2015 08:20:06 +0000 (08:20 +0000)]
Fixed a bug in masked load/store in reversed loop.
Added a test.

The bug was submitted to bugzilla:
http://llvm.org/bugs/show_bug.cgi?id=22225

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

9 years ago[PM] Rename InstCombine.h to InstCombineInternal.h in preparation for
Chandler Carruth [Thu, 22 Jan 2015 05:25:13 +0000 (05:25 +0000)]
[PM] Rename InstCombine.h to InstCombineInternal.h in preparation for
creating a non-internal header file for the InstCombine pass.

I thought about calling this InstCombiner.h or in some way more clearly
associating it with the InstCombiner clas that it is primarily defining,
but there are several other utility interfaces defined within this for
InstCombine. If, in the course of refactoring, those end up moving
elsewhere or going away, it might make more sense to make this the
combiner's header alone.

Naturally, this is a bikeshed to a certain degree, so feel free to lobby
for a different shade of paint if this name just doesn't suit you.

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

9 years ago[canonicalize] Teach InstCombine to canonicalize loads which are only
Chandler Carruth [Thu, 22 Jan 2015 05:08:12 +0000 (05:08 +0000)]
[canonicalize] Teach InstCombine to canonicalize loads which are only
ever stored to always use a legal integer type if one is available.

Regardless of whether this particular type is good or bad, it ensures we
don't get weird differences in generated code (and resulting
performance) from "equivalent" patterns that happen to end up using
a slightly different type.

After some discussion on llvmdev it seems everyone generally likes this
canonicalization. However, there may be some parts of LLVM that handle
it poorly and need to be fixed. I have at least verified that this
doesn't impede GVN and instcombine's store-to-load forwarding powers in
any obvious cases. Subtle cases are exactly what we need te flush out if
they remain.

Also note that this IR pattern should already be hitting LLVM from Clang
at least because it is exactly the IR which would be produced if you
used memcpy to copy a pointer or floating point between memory instead
of a variable.

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

9 years agoARM: fail less catastrophically on invalid Windows input
Saleem Abdulrasool [Thu, 22 Jan 2015 04:03:32 +0000 (04:03 +0000)]
ARM: fail less catastrophically on invalid Windows input

Windows supports a restricted set of relocations (compared to ARM ELF).  In some
cases, we may end up generating an unsupported relocation.  This can occur with
bad input to the assembler in particular (the frontend should never generate
code that cannot be compiled).  Generate an error rather than just aborting.

The change in the API is driven by the desire to provide a slightly more helpful
message for debugging purposes.

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

9 years ago[canonicalize] Move a helper function further up the file so it can be
Chandler Carruth [Thu, 22 Jan 2015 03:34:54 +0000 (03:34 +0000)]
[canonicalize] Move a helper function further up the file so it can be
used earlier. NFC.

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

9 years agoDIBuilder: Make header iterator constructor explicit, NFC
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:20:09 +0000 (03:20 +0000)]
DIBuilder: Make header iterator constructor explicit, NFC

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

9 years agoDIBuilder: Extract header_begin() and header_end(), NFC
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:17:43 +0000 (03:17 +0000)]
DIBuilder: Extract header_begin() and header_end(), NFC

Use begin/end functions so that users don't need to know how these weird
things work.

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

9 years agoDIBuilder: Stop abusing DIExpressionIterator::operator*(), NFC
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:13:35 +0000 (03:13 +0000)]
DIBuilder: Stop abusing DIExpressionIterator::operator*(), NFC

This code was confusing, since it created a `DIExpressionIterator` from
an invalid start point (although it wasn't wrong: it never actually
iterated).  Now that the underlying iterator has `getNumber()`, just use
it directly.

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

9 years agoDIBuilder: Extract DIHeaderFieldIterator::getNumber(), NFC
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:11:13 +0000 (03:11 +0000)]
DIBuilder: Extract DIHeaderFieldIterator::getNumber(), NFC

Reduce code duplication between `DIBuilder` and `DIExpressionIterator`
by implementing a `getNumber()` directly in the iterator.

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

9 years agoDIBuilder: Create a getHeaderIterator() helper, NFC
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 03:00:01 +0000 (03:00 +0000)]
DIBuilder: Create a getHeaderIterator() helper, NFC

Extract this so it can be reused.

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

9 years agoMaking deleted copy constructors and operators to be private for better diagnostics...
Chris Bieneman [Thu, 22 Jan 2015 02:51:33 +0000 (02:51 +0000)]
Making deleted copy constructors and operators to be private for better diagnostics when deleted is not available.

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

9 years agoSEH: Finish writing the catch-all test case
Reid Kleckner [Thu, 22 Jan 2015 02:31:09 +0000 (02:31 +0000)]
SEH: Finish writing the catch-all test case

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

9 years agoWin64 SEH: Emit the constant 1 for catch-all into xdata
Reid Kleckner [Thu, 22 Jan 2015 02:27:44 +0000 (02:27 +0000)]
Win64 SEH: Emit the constant 1 for catch-all into xdata

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

9 years agoAssigning and copying command line option objects shouldn't be allowed.
Chris Bieneman [Thu, 22 Jan 2015 01:49:59 +0000 (01:49 +0000)]
Assigning and copying command line option objects shouldn't be allowed.

Summary:
The default copy and assignment operators for these objects probably don't actually do what the clients intend, so they should be deleted.

Places using the assignment operator to set the value of an option should cast to the option's data type first to call into the override for operator=. Places using the copy constructor just need to be changed to not copy (i.e. passing by const reference instead of value).

Reviewers: dexonsmith, chandlerc

Subscribers: llvm-commits

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

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

9 years agoMake ScalarEvolution less aggressive with respect to no-wrap flags.
Sanjoy Das [Thu, 22 Jan 2015 00:48:47 +0000 (00:48 +0000)]
Make ScalarEvolution less aggressive with respect to no-wrap flags.

ScalarEvolution currently lowers a subtraction recurrence to an add
recurrence with the same no-wrap flags as the subtraction.  This is
incorrect because `sub nsw X, Y` is not the same as `add nsw X, -Y`
and `sub nuw X, Y` is not the same as `add nuw X, -Y`.  This patch
fixes the issue, and adds two test cases demonstrating the bug.

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

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

9 years agoExplicitly describe '///' versus '//' comment delimiters.
Paul Robinson [Thu, 22 Jan 2015 00:19:56 +0000 (00:19 +0000)]
Explicitly describe '///' versus '//' comment delimiters.

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

9 years agoMake DwarfExpression use the new DIExpressionIterator. NFC.
Adrian Prantl [Thu, 22 Jan 2015 00:00:59 +0000 (00:00 +0000)]
Make DwarfExpression use the new DIExpressionIterator. NFC.

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

9 years agoRewrite DIExpression::Verify() using an iterator. NFC.
Adrian Prantl [Thu, 22 Jan 2015 00:00:52 +0000 (00:00 +0000)]
Rewrite DIExpression::Verify() using an iterator. NFC.

Addresses review comments for r226627.

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

9 years ago[canonicalization] Refactor how we create new stores into a helper
Chandler Carruth [Wed, 21 Jan 2015 23:45:01 +0000 (23:45 +0000)]
[canonicalization] Refactor how we create new stores into a helper
function. This is a bit tidier anyways and will make a subsquent patch
simpler as I want to add another case to this combine.

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

9 years ago[X86][SSE] Missing SSE/AVX1 memory folding integer instructions
Simon Pilgrim [Wed, 21 Jan 2015 23:43:30 +0000 (23:43 +0000)]
[X86][SSE] Missing SSE/AVX1 memory folding integer instructions

Added most of the missing integer vector folding patterns for SSE (to SSE42) and AVX1.

The most useful of these are probably the i32/i64 extraction, i8/i16/i32/i64 insertions, zero/sign extension, unsigned saturation subtractions, i64 subtractions and the variable mask blends (pblendvb) - others include CLMUL, SSE42 string comparisons and bit tests.

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

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

9 years agoDAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))
Tim Northover [Wed, 21 Jan 2015 23:17:19 +0000 (23:17 +0000)]
DAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))

It can help with argument juggling on some targets, and is generally a good
idea.

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

9 years agoDebugInfo: Use distinct inlinedAt MDLocations to avoid separate inlined calls being...
David Blaikie [Wed, 21 Jan 2015 22:57:29 +0000 (22:57 +0000)]
DebugInfo: Use distinct inlinedAt MDLocations to avoid separate inlined calls being coalesced

When two calls from the same MDLocation are inlined they currently get
treated as one inlined function call (creating difficulty debugging,
duplicate variables, etc).

Clang worked around this by including column information on inline calls
which doesn't address LTO inlining or calls to the same function from
the same line and column (such as through a macro). It also didn't
address ctor and member function calls.

By making the inlinedAt locations distinct, every call site has an
explicitly distinct location that cannot be coalesced with any other
call.

This can produce linearly (2x in the worst case where every call is
inlined and the call instruction has a non-call instruction at the same
location) more debug locations. Any increase beyond that are in cases
where the Clang workaround was insufficient and the new scheme is
creating necessary distinct nodes that were being erroneously coalesced
previously.

After this change to LLVM the incomplete workarounds in Clang. That
should reduce the number of debug locations (in a build without column
info, the default on Darwin, not the default on Linux) by not creating
pseudo-distinct locations for every call to an inline function.

(oh, and I made the inlined-at chain rebuilding iterative instead of
recursive because I was having trouble wrapping my head around it the
way it was - open to discussion on the right design for that function
(including going back to a recursive solution))

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

9 years agoR600: Add checks for urem/srem by a constant
Matt Arsenault [Wed, 21 Jan 2015 22:56:15 +0000 (22:56 +0000)]
R600: Add checks for urem/srem by a constant

Make sure this uses the faster expansion using magic constants
to avoid the full division path.

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

9 years agoLiveIntervalAnalysis: Mark subregister defs as undef when we determined they are...
Matthias Braun [Wed, 21 Jan 2015 22:55:13 +0000 (22:55 +0000)]
LiveIntervalAnalysis: Mark subregister defs as undef when we determined they are only reading a dead superregister value

This was not necessary before as this case can only be detected when the
liveness analysis is at subregister level.

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

9 years agoAdding a new cl::HideUnrelatedOptions API to allow clang to migrate off cl::getRegist...
Chris Bieneman [Wed, 21 Jan 2015 22:45:52 +0000 (22:45 +0000)]
Adding a new cl::HideUnrelatedOptions API to allow clang to migrate off cl::getRegisteredOptions.

Summary: cl::getRegisteredOptions really exposes some of the innards of how command line parsing is implemented. Exposing new APIs that allow us to disentangle client code from implementation details will allow us to make more extensive changes to command line parsing.

Reviewers: chandlerc, dexonsmith, beanz

Reviewed By: dexonsmith

Subscribers: llvm-commits

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

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

9 years ago[X86][SSE] Added support for SSE3 lane duplication shuffle instructions
Simon Pilgrim [Wed, 21 Jan 2015 22:44:35 +0000 (22:44 +0000)]
[X86][SSE] Added support for SSE3 lane duplication shuffle instructions

This patch adds shuffle matching for the SSE3 MOVDDUP, MOVSLDUP and MOVSHDUP instructions. The big use of these being that they avoid many single source shuffles from needing to use (pre-AVX) dual source instructions such as SHUFPD/SHUFPS: causing extra moves and preventing load folds.

Adding these instructions uncovered an issue in XFormVExtractWithShuffleIntoLoad which crashed on single operand shuffle instructions (now fixed). It also involved fixing getTargetShuffleMask to correctly identify theses instructions as unary shuffles.

Also adds a missing tablegen pattern for MOVDDUP.

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

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

9 years agoR600: Add missing tests for i64 srem
Matt Arsenault [Wed, 21 Jan 2015 22:43:19 +0000 (22:43 +0000)]
R600: Add missing tests for i64 srem

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

9 years agoFix load-store optimizer on thumbv4t
Jonathan Roelofs [Wed, 21 Jan 2015 22:39:43 +0000 (22:39 +0000)]
Fix load-store optimizer on thumbv4t

Thumbv4t does not have lo->lo copies other than MOVS,
and that can't be predicated. So emit MOVS when needed
and bail if there's a predicate.

http://reviews.llvm.org/D6592

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

9 years agoAdded test to cover the CFLAA bitset indexing bug.
George Burgess IV [Wed, 21 Jan 2015 22:39:35 +0000 (22:39 +0000)]
Added test to cover the CFLAA bitset indexing bug.

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

9 years agoInstCombine: Don't strip bitcasts off of callsites marked 'thunk'
David Majnemer [Wed, 21 Jan 2015 22:32:04 +0000 (22:32 +0000)]
InstCombine: Don't strip bitcasts off of callsites marked 'thunk'

The return type of a thunk is meaningless, we just want the arguments
and return value to be forwarded.

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

9 years ago[X86][SSE] movddup shuffle mask decodes
Simon Pilgrim [Wed, 21 Jan 2015 22:02:30 +0000 (22:02 +0000)]
[X86][SSE] movddup shuffle mask decodes

Patch to provide shuffle decodes and asm comments for the SSE3/AVX1 movddup double duplication instructions.

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

9 years agosimplify expression
Adrian Prantl [Wed, 21 Jan 2015 21:23:35 +0000 (21:23 +0000)]
simplify expression

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

9 years agoFix a compile issue on MSVC and call finalize().
Adrian Prantl [Wed, 21 Jan 2015 19:25:35 +0000 (19:25 +0000)]
Fix a compile issue on MSVC and call finalize().

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

9 years agoLiveIntervalAnalysis: Factor out code to update liveness on vreg def removal
Matthias Braun [Wed, 21 Jan 2015 19:02:30 +0000 (19:02 +0000)]
LiveIntervalAnalysis: Factor out code to update liveness on vreg def removal

This cleans up code and is more in line with the general philosophy of
modifying LiveIntervals through LiveIntervalAnalysis instead of changing
them directly.

This also fixes a case where SplitEditor::removeBackCopies() would miss
the subregister ranges.

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

9 years agoLiveIntervalAnalysis: document removePhysRegDefAt() function.
Matthias Braun [Wed, 21 Jan 2015 19:02:26 +0000 (19:02 +0000)]
LiveIntervalAnalysis: document removePhysRegDefAt() function.

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

9 years agoLiveIntervalAnalysis: Factor out code to update liveness on physreg def removal
Matthias Braun [Wed, 21 Jan 2015 18:50:21 +0000 (18:50 +0000)]
LiveIntervalAnalysis: Factor out code to update liveness on physreg def removal

This cleans up code and is more in line with the general philosophy of
modifying LiveIntervals through LiveIntervalAnalysis instead of changing
them directly.

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

9 years agoLiveIntervalAnalysis: Remove unused pruneValue() variant.
Matthias Braun [Wed, 21 Jan 2015 18:45:57 +0000 (18:45 +0000)]
LiveIntervalAnalysis: Remove unused pruneValue() variant.

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

9 years agoLet subprograms with instructions without parent scopes fail the
Adrian Prantl [Wed, 21 Jan 2015 18:32:56 +0000 (18:32 +0000)]
Let subprograms with instructions without parent scopes fail the
verification. Tested via a unit test.

Follow-up to r226616.

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

9 years agoR600/SI: Custom lower fround
Matt Arsenault [Wed, 21 Jan 2015 18:18:25 +0000 (18:18 +0000)]
R600/SI: Custom lower fround

This fixes it for SI. It also removes the pattern
used previously for Evergreen for f32. I'm not sure
if the the new R600 output is better or not, but it uses
1 fewer instructions if BFI is available.

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

9 years ago[Hexagon] Converting multiply and accumulate with immediate intrinsics to patterns.
Colin LeMahieu [Wed, 21 Jan 2015 18:13:15 +0000 (18:13 +0000)]
[Hexagon] Converting multiply and accumulate with immediate intrinsics to patterns.

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

9 years ago[X86] Declare SSE4.1/AVX2 vector extloads covered by PMOV[SZ]X legal.
Ahmed Bougacha [Wed, 21 Jan 2015 17:07:06 +0000 (17:07 +0000)]
[X86] Declare SSE4.1/AVX2 vector extloads covered by PMOV[SZ]X legal.

Now that we can fully specify extload legality, we can declare them
legal for the PMOVSX/PMOVZX instructions.  This for instance enables
a DAGCombine to fire on code such as
  (and (<zextload-equivalent> ...), <redundant mask>)
to turn it into:
  (zextload ...)
as seen in the testcase changes.

There is one regression, in widen_load-2.ll: we're no longer able
to do store-to-load forwarding with illegal extload memory types.
This will be addressed separately.

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

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

9 years ago[lit] Format JSONMetricValue strings better.
Eric Fiselier [Wed, 21 Jan 2015 16:38:31 +0000 (16:38 +0000)]
[lit] Format JSONMetricValue strings better.

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

9 years agoFixed a bug with how we determine bitset indices.
George Burgess IV [Wed, 21 Jan 2015 16:37:21 +0000 (16:37 +0000)]
Fixed a bug with how we determine bitset indices.

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

9 years agoAdd missing include guards to WindowsSupport.h.
Yaron Keren [Wed, 21 Jan 2015 16:20:38 +0000 (16:20 +0000)]
Add missing include guards to WindowsSupport.h.

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

9 years agoRevert "DAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))"
Tim Northover [Wed, 21 Jan 2015 15:48:52 +0000 (15:48 +0000)]
Revert "DAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))"

It hadn't gone through review yet, but was still on my local copy.

This reverts commit r226663

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

9 years agoAArch64: add backend option to reserve x18 (platform register)
Tim Northover [Wed, 21 Jan 2015 15:43:31 +0000 (15:43 +0000)]
AArch64: add backend option to reserve x18 (platform register)

AAPCS64 says that it's up to the platform to specify whether x18 is
reserved, and a first step on that way is to add a flag controlling
it.

From: Andrew Turner <andrew@fubar.geek.nz>

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

9 years agoDAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))
Tim Northover [Wed, 21 Jan 2015 15:43:28 +0000 (15:43 +0000)]
DAGCombine: fold (or (and X, M), (and X, N)) -> (and X, (or M, N))

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

9 years ago[x32] Fast ISel should use LEA64_32r instead of LEA32r to adjust addresses in x32...
Michael Kuperstein [Wed, 21 Jan 2015 14:44:05 +0000 (14:44 +0000)]
[x32] Fast ISel should use LEA64_32r instead of LEA32r to adjust addresses in x32 mode.

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

9 years agoUse a smaller pragma unroll threshold to reduce test execution time.
Alexander Potapenko [Wed, 21 Jan 2015 13:52:02 +0000 (13:52 +0000)]
Use a smaller pragma unroll threshold to reduce test execution time.
When opt is compiled with AddressSanitizer it takes more than 30 seconds
to unroll the loop in unroll_1M().

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

9 years ago[msan] Update origin for the entire destination range on memory store.
Evgeniy Stepanov [Wed, 21 Jan 2015 13:21:31 +0000 (13:21 +0000)]
[msan] Update origin for the entire destination range on memory store.

Previously we always stored 4 bytes of origin at the destination address
even for 8-byte (and longer) stores.

This should fix rare missing, or incorrect, origin stacks in MSan reports.

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

9 years ago[mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B
Jozef Kolek [Wed, 21 Jan 2015 12:39:30 +0000 (12:39 +0000)]
[mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B

Implement microMIPS 16-bit unconditional branch instruction B.

Implemented 16-bit microMIPS unconditional instruction has real name B16, and
B is an alias which expands to either B16 or BEQ according to the rules:
b 256 --> b16 256 # R_MICROMIPS_PC10_S1
b 12256 --> beq $zero, $zero, 12256 # R_MICROMIPS_PC16_S1
b label --> beq $zero, $zero, label # R_MICROMIPS_PC16_S1

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

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

9 years ago[mips][microMIPS] Implement ADDIUPC instruction
Jozef Kolek [Wed, 21 Jan 2015 12:10:11 +0000 (12:10 +0000)]
[mips][microMIPS] Implement ADDIUPC instruction

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

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

9 years ago[PM] Refactor the InstCombiner interface to use an external worklist.
Chandler Carruth [Wed, 21 Jan 2015 11:38:17 +0000 (11:38 +0000)]
[PM] Refactor the InstCombiner interface to use an external worklist.

Because in its primary function pass the combiner is run repeatedly over
the same function until doing so produces no changes, it is essentially
to not re-allocate the worklist. However, as a utility, the more common
pattern would be to put a limited set of instructions in the worklist
rather than the entire function body. That is also the more likely
pattern when used by the new pass manager.

The result is a very light weight combiner that does the visiting with
a separable worklist. This can then be wrapped up in a helper function
for users that want a combiner utility, or as I have here it can be
wrapped up in a pass which manages the iterations used when combining an
entire function's instructions.

Hopefully this removes some of the worst of the interface warts that
became apparant with the last patch here. However, there is clearly more
work. I've again left some FIXMEs for the most egregious. The ones that
stick out to me are the exposure of the worklist and IR builder as
public members, and the use of pointers rather than references. However,
fixing these is likely to be much more mechanical and less interesting
so I didn't want to touch them in this patch.

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