oota-llvm.git
9 years agoAdd a small "usage:" comment at the top of not.cpp
Sean Silva [Wed, 26 Nov 2014 22:53:46 +0000 (22:53 +0000)]
Add a small "usage:" comment at the top of not.cpp

Mostly pulled from Rafael's r185678 commit message.

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

9 years agoObject/COFF: Fix off-by-one error for object having lots of relocations
Rui Ueyama [Wed, 26 Nov 2014 22:17:25 +0000 (22:17 +0000)]
Object/COFF: Fix off-by-one error for object having lots of relocations

llvm-objdump printed out an error message for this off-by-one error,
but because it always exits with 0 whether or not it found an error,
the test (llvm-objdump/coff-many-relocs.test) succeeded.
I made llvm-objdump exit with EXIT_FAILURE when an error is found.

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

9 years agoR600/SI: Use ZeroOrNegativeOneBooleanContent
Matt Arsenault [Wed, 26 Nov 2014 21:23:15 +0000 (21:23 +0000)]
R600/SI: Use ZeroOrNegativeOneBooleanContent

This sort of doesn't matter since the setcc type is i1, but
this previously was using the default UndefinedBooleanContent. This
makes it more consistent with R600. This enables more optimizations
which typically give up on UndefinedBooleanContent. For example,
there is already a special case target DAG combine for
setcc + sext which can be eliminated in favor of what the generic
DAG combiner can do if it assumes boolean values are sign extended.
Since -1 is an inline immediate, using it is basically free and the
backend already uses it when a boolean value is needed in a wider type.

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

9 years ago[Hexagon] Adding cmp* immediate form instructions.
Colin LeMahieu [Wed, 26 Nov 2014 19:43:12 +0000 (19:43 +0000)]
[Hexagon] Adding cmp* immediate form instructions.

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

9 years ago[mips][microMIPS] Implement disassembler support for 16-bit instructions LBU16, LHU16...
Jozef Kolek [Wed, 26 Nov 2014 18:56:38 +0000 (18:56 +0000)]
[mips][microMIPS] Implement disassembler support for 16-bit instructions LBU16, LHU16, LW16, SB16, SH16 and SW16

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

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

9 years ago[Hexagon] Adding and64, or64, and xor64 instructions.
Colin LeMahieu [Wed, 26 Nov 2014 18:55:59 +0000 (18:55 +0000)]
[Hexagon] Adding and64, or64, and xor64 instructions.

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

9 years agoR600/SI: Create e64 versions of and/or/xor in SILowerI1Copies
Matt Arsenault [Wed, 26 Nov 2014 18:18:28 +0000 (18:18 +0000)]
R600/SI: Create e64 versions of and/or/xor in SILowerI1Copies

This fixes moving boolean constants into registers before operating
on them. They get permuted and shrunk down to e32 anyway later. This
is a temporary fix until the patch that removes these pseudos is
committed.

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

9 years ago[MCJIT] Fix missing return statement.
Lang Hames [Wed, 26 Nov 2014 17:21:41 +0000 (17:21 +0000)]
[MCJIT] Fix missing return statement.

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

9 years ago[MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues.
Lang Hames [Wed, 26 Nov 2014 16:54:40 +0000 (16:54 +0000)]
[MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues.

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

9 years agoReverting r222828 and r222810-r222812 as they broke the build on Windows.
Aaron Ballman [Wed, 26 Nov 2014 15:27:39 +0000 (15:27 +0000)]
Reverting r222828 and r222810-r222812 as they broke the build on Windows.

http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/11753

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

9 years agoRemoving a spurious semicolon; NFC
Aaron Ballman [Wed, 26 Nov 2014 13:55:55 +0000 (13:55 +0000)]
Removing a spurious semicolon; NFC

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

9 years agoAdd missing "override".
Evgeniy Stepanov [Wed, 26 Nov 2014 12:26:03 +0000 (12:26 +0000)]
Add missing "override".

Fixes compilation failure in r222810.

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

9 years agoUpdate AArch64 ELF relocations to ABI 1.0
Will Newton [Wed, 26 Nov 2014 10:49:18 +0000 (10:49 +0000)]
Update AArch64 ELF relocations to ABI 1.0

This mostly entails adding relocations, however there are a couple of
changes to existing relocations:

1. R_AARCH64_NONE is defined to be zero rather than 256

R_AARCH64_NONE has been defined to be zero for a long time elsewhere
e.g. binutils and glibc since the submission of the AArch64 port in
2012 so this is required for compatibility.

2. R_AARCH64_TLSDESC_ADR_PAGE renamed to R_AARCH64_TLSDESC_ADR_PAGE21

I don't think there is any way for relocation names to leak out of LLVM
so this should not break anything.

Tested with check-all with no regressions.

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

9 years agoAVX-512: Scalar ERI intrinsics
Elena Demikhovsky [Wed, 26 Nov 2014 10:46:49 +0000 (10:46 +0000)]
AVX-512: Scalar ERI intrinsics
including SAE mode and memory operand.
Added AVX512_maskable_scalar template, that should cover all scalar instructions in the future.

The main difference between AVX512_maskable_scalar<> and AVX512_maskable<> is using X86select instead of vselect.
I need it, because I can't create vselect node for MVT::i1 mask for scalar instruction.

http://reviews.llvm.org/D6378

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

9 years agoUpdate ARM ELF relocations to ABI 2.09
Will Newton [Wed, 26 Nov 2014 10:36:03 +0000 (10:36 +0000)]
Update ARM ELF relocations to ABI 2.09

Add R_ARM_IRELATIVE.

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

9 years ago[MCJIT] Re-enable GDB registration (temporarily disabled in r222811), but check
Lang Hames [Wed, 26 Nov 2014 07:39:03 +0000 (07:39 +0000)]
[MCJIT] Re-enable GDB registration (temporarily disabled in r222811), but check
that we actually have an object to register first.

For MachO objects, RuntimeDyld::LoadedObjectInfo::getObjectForDebug returns an
empty OwningBinary<ObjectFile> which was causing crashes in the GDB registration
code.

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

9 years ago[MCJIT] Temporarily disable automatic JIT debugger registration.
Lang Hames [Wed, 26 Nov 2014 07:25:26 +0000 (07:25 +0000)]
[MCJIT] Temporarily disable automatic JIT debugger registration.

The RuntimeDyld cleanup patch r222810 turned on GDB registration for MachO
objects. I expected this to be harmless, but it seems to have broken on
MacsOS. Temporarily disabling debugger registration while I dig in to what's
gone wrong.

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

9 years ago[MCJIT] Clean up RuntimeDyld's quirky object-ownership/modification scheme.
Lang Hames [Wed, 26 Nov 2014 06:53:26 +0000 (06:53 +0000)]
[MCJIT] Clean up RuntimeDyld's quirky object-ownership/modification scheme.

Previously, when loading an object file, RuntimeDyld (1) took ownership of the
ObjectFile instance (and associated MemoryBuffer), (2) potentially modified the
object in-place, and (3) returned an ObjectImage that managed ownership of the
now-modified object and provided some convenience methods. This scheme accreted
over several years as features were tacked on to RuntimeDyld, and was both
unintuitive and unsafe (See e.g. http://llvm.org/PR20722).

This patch fixes the issue by removing all ownership and in-place modification
of object files from RuntimeDyld. Existing behavior, including debugger
registration, is preserved.

Noteworthy changes include:

(1) ObjectFile instances are now passed to RuntimeDyld by const-ref.
(2) The ObjectImage and ObjectBuffer classes have been removed entirely, they
    existed to model ownership within RuntimeDyld, and so are no longer needed.
(3) RuntimeDyld::loadObject now returns an instance of a new class,
    RuntimeDyld::LoadedObjectInfo, which can be used to construct a modified
    object suitable for registration with the debugger, following the existing
    debugger registration scheme.
(4) The JITRegistrar class has been removed, and the GDBRegistrar class has been
    re-written as a JITEventListener.

This should fix http://llvm.org/PR20722 .

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

9 years agoRemove neverHasSideEffects support from TableGen CodeGenInstruction. Everyone should...
Craig Topper [Wed, 26 Nov 2014 04:11:14 +0000 (04:11 +0000)]
Remove neverHasSideEffects support from TableGen CodeGenInstruction. Everyone should use hasSideEffects now.

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

9 years agoTry to make the modules buildbot happy again.
Richard Smith [Wed, 26 Nov 2014 03:44:47 +0000 (03:44 +0000)]
Try to make the modules buildbot happy again.

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

9 years agoReformat with gofmt.
Eric Christopher [Wed, 26 Nov 2014 02:57:33 +0000 (02:57 +0000)]
Reformat with gofmt.

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

9 years agoMake SetMCJITOptimizationLevel more of a method and pass options
Eric Christopher [Wed, 26 Nov 2014 02:54:24 +0000 (02:54 +0000)]
Make SetMCJITOptimizationLevel more of a method and pass options
as a reference. Move closer to the type.

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

9 years agoMake sure that the go bindings call LLVMInitializeMCJITCompilerOptions
Eric Christopher [Wed, 26 Nov 2014 02:27:46 +0000 (02:27 +0000)]
Make sure that the go bindings call LLVMInitializeMCJITCompilerOptions
so that they initialize the code generation model to the correct
(non-zero) default model.

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

9 years agoReplace neverHasSideEffects=1 with hasSideEffects=0 in all .td files.
Craig Topper [Wed, 26 Nov 2014 00:46:26 +0000 (00:46 +0000)]
Replace neverHasSideEffects=1 with hasSideEffects=0 in all .td files.

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

9 years ago[X86][SSE] Improvements to byte shift shuffle matching
Simon Pilgrim [Tue, 25 Nov 2014 22:34:59 +0000 (22:34 +0000)]
[X86][SSE] Improvements to byte shift shuffle matching

Since (v)pslldq / (v)psrldq instructions resolve to a single input argument it is useful to match it much earlier than we currently do - this prevents more complicated shuffles (notably insertion into a zero vector) matching before it.

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

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

9 years ago[Hexagon] Adding add64 and sub64 instructions.
Colin LeMahieu [Tue, 25 Nov 2014 22:15:44 +0000 (22:15 +0000)]
[Hexagon] Adding add64 and sub64 instructions.

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

9 years agoReverting 222792
Colin LeMahieu [Tue, 25 Nov 2014 21:39:57 +0000 (21:39 +0000)]
Reverting 222792

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

9 years ago[Hexagon] Adding compare with immediate instructions.
Colin LeMahieu [Tue, 25 Nov 2014 21:30:28 +0000 (21:30 +0000)]
[Hexagon] Adding compare with immediate instructions.

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

9 years ago[Hexagon] Adding NOP encoding bits.
Colin LeMahieu [Tue, 25 Nov 2014 21:23:07 +0000 (21:23 +0000)]
[Hexagon] Adding NOP encoding bits.

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

9 years agoGo bindings: add DIBuilder.InsertValueAtEnd
Peter Collingbourne [Tue, 25 Nov 2014 21:05:04 +0000 (21:05 +0000)]
Go bindings: add DIBuilder.InsertValueAtEnd

Expose llvm::DIBuilder::insertDbgValueIntrinsic as
DIBuilder.InsertValueAtEnd in the Go bindings, to support attaching
debug metadata to register values.

Patch by Andrew Wilkins!

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

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

9 years agoR600/SI: Only use one DEBUG()
Matt Arsenault [Tue, 25 Nov 2014 21:03:22 +0000 (21:03 +0000)]
R600/SI: Only use one DEBUG()

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

9 years agoThis test requires asserts because of -stats.
Rafael Espindola [Tue, 25 Nov 2014 20:56:56 +0000 (20:56 +0000)]
This test requires asserts because of -stats.

Sorry about that.

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

9 years agogold plugin: call llvm_shutdown so that -stats works.
Rafael Espindola [Tue, 25 Nov 2014 20:52:49 +0000 (20:52 +0000)]
gold plugin: call llvm_shutdown so that -stats works.

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

9 years ago[AVX512] Add 512b integer shift by variable intrinsics and patterns.
Cameron McInally [Tue, 25 Nov 2014 20:41:51 +0000 (20:41 +0000)]
[AVX512] Add 512b integer shift by variable intrinsics and patterns.

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

9 years ago[Hexagon] [NFC] Adding trailing whitespace to test files.
Colin LeMahieu [Tue, 25 Nov 2014 20:22:24 +0000 (20:22 +0000)]
[Hexagon] [NFC] Adding trailing whitespace to test files.

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

9 years ago[Hexagon] Adding C2_mux instruction.
Colin LeMahieu [Tue, 25 Nov 2014 20:20:09 +0000 (20:20 +0000)]
[Hexagon] Adding C2_mux instruction.

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

9 years agoRemove unncessary check for Int_* and *_Int in AsmMatcherEmitter. These are all marke...
Craig Topper [Tue, 25 Nov 2014 20:11:34 +0000 (20:11 +0000)]
Remove unncessary check for Int_* and *_Int in AsmMatcherEmitter. These are all marked isCodeGenOnly these days.

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

9 years agoUse range-based for loops.
Craig Topper [Tue, 25 Nov 2014 20:11:31 +0000 (20:11 +0000)]
Use range-based for loops.

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

9 years agoRemove dead code.
Craig Topper [Tue, 25 Nov 2014 20:11:29 +0000 (20:11 +0000)]
Remove dead code.

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

9 years agoRemove unused MaxSize variable.
Craig Topper [Tue, 25 Nov 2014 20:11:27 +0000 (20:11 +0000)]
Remove unused MaxSize variable.

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

9 years agoMove a vector instead of copying it.
Craig Topper [Tue, 25 Nov 2014 20:11:25 +0000 (20:11 +0000)]
Move a vector instead of copying it.

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

9 years agoRemove space before tab in all AVX512 mnemonic strings.
Craig Topper [Tue, 25 Nov 2014 20:11:23 +0000 (20:11 +0000)]
Remove space before tab in all AVX512 mnemonic strings.

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

9 years agoRemove useless rdar:// comment from switch_to_lookup_table.ll test.
Hans Wennborg [Tue, 25 Nov 2014 18:45:23 +0000 (18:45 +0000)]
Remove useless rdar:// comment from switch_to_lookup_table.ll test.

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

9 years ago[Hexagon] Replacing cmp* instructions with ones that contain encoding bits.
Colin LeMahieu [Tue, 25 Nov 2014 18:20:52 +0000 (18:20 +0000)]
[Hexagon] Replacing cmp* instructions with ones that contain encoding bits.

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

9 years agoCleaning out google tests from MC.
Colin LeMahieu [Tue, 25 Nov 2014 18:03:08 +0000 (18:03 +0000)]
Cleaning out google tests from MC.

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

9 years agoLazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue()
Hans Wennborg [Tue, 25 Nov 2014 17:23:05 +0000 (17:23 +0000)]
LazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue()

If solveBlockValue() needs results from predecessors that are not already
computed, it returns false with the intention of resuming when the dependencies
have been resolved. However, the computation would never be resumed since an
'overdefined' result had been placed in the cache, preventing any further
computation.

The point of placing the 'overdefined' result in the cache seems to have been
to break cycles, but we can check for that when inserting work items in the
BlockValue stack instead. This makes the "stop and resume" mechanism of
solveBlockValue() work as intended, unlocking more analysis.

Using this patch shaves 120 KB off a 64-bit Chromium build on Linux.

I benchmarked compiling bzip2.c at -O2 but couldn't measure any difference in
compile time.

Tests by Jiangning Liu from r215343 / PR21238, Pete Cooper, and me.

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

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

9 years agoSmall model and JIT generally don't go well with each other.
Joerg Sonnenberger [Tue, 25 Nov 2014 17:14:22 +0000 (17:14 +0000)]
Small model and JIT generally don't go well with each other.
On LP64 platforms, it will work or not depending on the choosen memory
layout, so neither PASS nor XFAIL is appropiate.
As UNSUPPORTED as per-test target doesn't exist (yet), remove the test
instead to unbreak the builds.

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

9 years agoSet the body of a new struct as soon as it is created.
Rafael Espindola [Tue, 25 Nov 2014 15:33:40 +0000 (15:33 +0000)]
Set the body of a new struct as soon as it is created.

This changes the order in which different types are passed to get, but
one order is not inherently better than the other.

The main motivation is that this simplifies linkDefinedTypeBodies now that
it is only linking "real" opaque types. It is also means that we only have to
call it once and that we don't need getImpl.

A small change in behavior is that we don't copy type names when resolving
opaque types. This is an improvement IMHO, but it can be added back if
desired. A test is included with the new behavior.

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

9 years ago[msan] Annotate zlib functions for MemorySanitizer.
Evgeniy Stepanov [Tue, 25 Nov 2014 15:24:07 +0000 (15:24 +0000)]
[msan] Annotate zlib functions for MemorySanitizer.

Mark destination buffer in zlib::compress and zlib::decompress as fully
initialized.

When building LLVM with system zlib and MemorySanitizer instrumentation,
MSan does not observe memory writes in zlib code and erroneously considers
zlib output buffers as uninitialized, resulting in false use-of-uninitialized
memory reports. This change helps MSan understand the state of that memory
and prevents such reports.

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

9 years agoMisc style fixes. NFC.
Rafael Espindola [Tue, 25 Nov 2014 14:35:53 +0000 (14:35 +0000)]
Misc style fixes. NFC.

This just reduces the noise in the next patch.

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

9 years agoReapply 222538 and update tests to explicitly request small code model
Joerg Sonnenberger [Tue, 25 Nov 2014 13:37:55 +0000 (13:37 +0000)]
Reapply 222538 and update tests to explicitly request small code model
and PIC:

Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise.

Patch from Akos Kiss.

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

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

9 years agoMark as explicit failing on x86-64 -- small memory model doesn't agree
Joerg Sonnenberger [Tue, 25 Nov 2014 13:28:56 +0000 (13:28 +0000)]
Mark as explicit failing on x86-64 -- small memory model doesn't agree
with default address selections.

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

9 years agoRemove a bit of duplicated code.
Rafael Espindola [Tue, 25 Nov 2014 13:19:46 +0000 (13:19 +0000)]
Remove a bit of duplicated code.

Exactly the same checks are present in areTypesIsomorphic.

This might have been a premature performance optimization. I cannot reproduce
any slowdown with this patch.

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

9 years agoRevert r222746: That commit did not update any tests and caused two R600
Chandler Carruth [Tue, 25 Nov 2014 10:50:41 +0000 (10:50 +0000)]
Revert r222746: That commit did not update any tests and caused two R600
tests to start failing.

Original commit log: R600/SI: Disable commutativity for MIN/MAX_LEGACY

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

9 years ago[mips][micromips] Use call instructions with short delay slots
Zoran Jovanovic [Tue, 25 Nov 2014 10:50:00 +0000 (10:50 +0000)]
[mips][micromips] Use call instructions with short delay slots
Differential Revision: http://reviews.llvm.org/D6338

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

9 years ago[InstCombine] Change LLVM To canonicalize toward the value type being
Chandler Carruth [Tue, 25 Nov 2014 10:09:51 +0000 (10:09 +0000)]
[InstCombine] Change LLVM To canonicalize toward the value type being
stored rather than the pointer type.

This change is analogous to r220138 which changed the canonicalization
for loads. The rationale is the same: memory does not have a type,
operations (and thus the values they produce) have a type. We should
match that type as closely as possible rather than reading some form of
semantics into the pointer type.

With this change, loads and stores should no longer be made with
nonsensical types for the values that tehy load and store. This is
particularly important when trying to match specific loaded and stored
types in the process of doing other instcombines, which is what led me
down this twisty maze of miscanonicalization.

I've put quite some effort into looking through IR to find places where
LLVM's optimizer was being unreasonably conservative in the face of
mismatched load and store types, however it is possible (let's say,
likely!) I have missed some. If you see regressions here, or from
r220138, the likely cause is some part of LLVM failing to cope with load
and store types differing. Test cases appreciated, it is important that
we root all of these out of LLVM.

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

9 years agoR600/SI: Disable commutativity for MIN/MAX_LEGACY
Marek Olsak [Tue, 25 Nov 2014 09:49:23 +0000 (09:49 +0000)]
R600/SI: Disable commutativity for MIN/MAX_LEGACY

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

9 years agoCorrectly handle Tag_CPU_arch_profile.
Charlie Turner [Tue, 25 Nov 2014 09:30:09 +0000 (09:30 +0000)]
Correctly handle Tag_CPU_arch_profile.

Fix ARMAttributeParser::CPU_arch_profile so that it doesn't switch on the value
'0' as a legal value of this build attribute.

Change-Id: Ie05a08900a82bb10b78c841b437df747ce3bb38e

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

9 years agoChange the test case file to use FileCheck instead of grep. NFC.
Suyog Sarda [Tue, 25 Nov 2014 08:44:56 +0000 (08:44 +0000)]
Change the test case file to use FileCheck instead of grep. NFC.
Change by Ankur Garg.

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

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

9 years agoRevert r220349 to re-instate r220277 with a fix for PR21330 -- quite
Chandler Carruth [Tue, 25 Nov 2014 08:20:27 +0000 (08:20 +0000)]
Revert r220349 to re-instate r220277 with a fix for PR21330 -- quite
clearly only exactly equal width ptrtoint and inttoptr casts are no-op
casts, it says so right there in the langref. Make the code agree.

Original log from r220277:
Teach the load analysis to allow finding available values which require
inttoptr or ptrtoint cast provided there is datalayout available.
Eventually, the datalayout can just be required but in practice it will
always be there today.

To go with the ability to expose available values requiring a ptrtoint
or inttoptr cast, helpers are added to perform one of these three casts.

These smarts are necessary to finish canonicalizing loads and stores to
the operational type requirements without regressing fundamental
combines.

I've added some test cases. These should actually improve as the load
combining and store combining improves, but they may fundamentally be
highlighting some missing combines for select in addition to exercising
the specific added logic to load analysis.

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

9 years agoR600/SI: Fix allocating flat_scr_lo / flat_scr_hi
Matt Arsenault [Tue, 25 Nov 2014 07:53:06 +0000 (07:53 +0000)]
R600/SI: Fix allocating flat_scr_lo / flat_scr_hi

Only the super register flat_scr was marked as reserved,
so in some cases with high register usage it would still
try to allocate the subregisters.

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

9 years agoForgot to add a file for r222734
David Majnemer [Tue, 25 Nov 2014 07:45:56 +0000 (07:45 +0000)]
Forgot to add a file for r222734

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

9 years agoCOFF: Add back an assertion that is superseded by r222124
David Majnemer [Tue, 25 Nov 2014 07:43:14 +0000 (07:43 +0000)]
COFF: Add back an assertion that is superseded by r222124

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

9 years agoCOFF: Add another test for r222124
David Majnemer [Tue, 25 Nov 2014 07:42:36 +0000 (07:42 +0000)]
COFF: Add another test for r222124

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

9 years agoUse a range loop. NFC.
Rafael Espindola [Tue, 25 Nov 2014 06:16:27 +0000 (06:16 +0000)]
Use a range loop. NFC.

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

9 years agoStyle fix: don't indent inside a namemespace.
Rafael Espindola [Tue, 25 Nov 2014 06:11:24 +0000 (06:11 +0000)]
Style fix: don't indent inside a namemespace.

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

9 years agoRemove a nested anonymous namespace.
Rafael Espindola [Tue, 25 Nov 2014 06:07:51 +0000 (06:07 +0000)]
Remove a nested anonymous namespace.

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

9 years agoFix overly aggressive type merging.
Rafael Espindola [Tue, 25 Nov 2014 05:59:24 +0000 (05:59 +0000)]
Fix overly aggressive type merging.

If we find out that two types are *not* isomorphic, we learn nothing about
opaque sub types in both the source and destination.

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

9 years ago[Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit
Simon Atanasyan [Tue, 25 Nov 2014 05:57:55 +0000 (05:57 +0000)]
[Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit

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

9 years agoLink the type of aliases.
Rafael Espindola [Tue, 25 Nov 2014 04:43:59 +0000 (04:43 +0000)]
Link the type of aliases.

They are not more or less "well typed" than GlobalVariables.

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

9 years agoDon't repeat name in comment or duplicate comment. NFC.
Rafael Espindola [Tue, 25 Nov 2014 04:28:31 +0000 (04:28 +0000)]
Don't repeat name in comment or duplicate comment. NFC.

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

9 years agoUse range loops. NFC.
Rafael Espindola [Tue, 25 Nov 2014 04:26:19 +0000 (04:26 +0000)]
Use range loops. NFC.

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

9 years ago[FastISel][AArch64] Fix and extend the tbz/tbnz pattern matching.
Juergen Ributzka [Tue, 25 Nov 2014 04:16:15 +0000 (04:16 +0000)]
[FastISel][AArch64] Fix and extend the tbz/tbnz pattern matching.

The pattern matching failed to recognize all instances of "-1", because when
comparing against "-1" we didn't use an APInt of the same bitwidth.

This commit fixes this and also adds inverse versions of the conditon to catch
more cases.

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

9 years agoAdd an interesting test that we already get right. NFC.
Rafael Espindola [Tue, 25 Nov 2014 03:47:57 +0000 (03:47 +0000)]
Add an interesting test that we already get right. NFC.

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

9 years agoInstSimplify: Handle some simple tautological comparisons
David Majnemer [Tue, 25 Nov 2014 02:55:48 +0000 (02:55 +0000)]
InstSimplify: Handle some simple tautological comparisons

This handles cases where we are comparing a masked value against itself.
The analysis could be further improved by making it recursive but such
expense is not currently justified.

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

9 years agoRevert "unique_ptrify LLVMContextImpl::CAZConstants"
David Blaikie [Tue, 25 Nov 2014 02:26:22 +0000 (02:26 +0000)]
Revert "unique_ptrify LLVMContextImpl::CAZConstants"

Missed the complexities of how these elements are destroyed.

This reverts commit r222714.

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

9 years agounique_ptrify LLVMContextImpl::CAZConstants
David Blaikie [Tue, 25 Nov 2014 02:13:54 +0000 (02:13 +0000)]
unique_ptrify LLVMContextImpl::CAZConstants

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

9 years ago[PowerPC] Add the 'attn' instruction
Hal Finkel [Tue, 25 Nov 2014 00:30:11 +0000 (00:30 +0000)]
[PowerPC] Add the 'attn' instruction

The attn instruction is not part of the Power ISA, but is documented in the A2
user manual, and is accepted by the GNU assembler for the A2 and the POWER4+.
Reported as part of PR21650.

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

9 years ago[PowerPC] Implement combineRepeatedFPDivisors
Hal Finkel [Mon, 24 Nov 2014 23:45:21 +0000 (23:45 +0000)]
[PowerPC] Implement combineRepeatedFPDivisors

This does not matter on newer cores (where we can use reciprocal estimates in
fast-math mode anyway), but for older cores this allows us to generate better
fast-math code where we have multiple FDIVs with a common divisor.

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

9 years agoFactor check for the assume intrinsic out of checks in computeKnownBitsFromAssume
Philip Reames [Mon, 24 Nov 2014 23:44:28 +0000 (23:44 +0000)]
Factor check for the assume intrinsic out of checks in computeKnownBitsFromAssume

We were matching against the assume intrinsic in every check.  Since we know that it must be an assume, this is just wasted work.  Somewhat surprisingly, matching an intrinsic id is actually relatively expensive.  It devolves to a string construction and comparison in Function::isIntrinsic.

I originally spotted this because it showed up in a performance profile of my compiler.  I've since discovered a separate issue which seems to be the actual root cause, but this is minor perf goodness regardless.

I'm likely to follow up with another change to factor out the comparison matching.  There's no need to match the compare instruction in every single one of the tests.

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

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

9 years agoIncorporate review comments from r221742
Philip Reames [Mon, 24 Nov 2014 23:24:24 +0000 (23:24 +0000)]
Incorporate review comments from r221742

This change implements the comment and style changes Sean requested during post commit review with r221742.  Sorry for the delay.

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

9 years agoBug 21610: Canonicalize min/max fcmp selects to use ordered comparisons
Matt Arsenault [Mon, 24 Nov 2014 23:15:18 +0000 (23:15 +0000)]
Bug 21610: Canonicalize min/max fcmp selects to use ordered comparisons

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

9 years agoConvert test to FileCheck and use CHECK-LABEL
Matt Arsenault [Mon, 24 Nov 2014 23:03:17 +0000 (23:03 +0000)]
Convert test to FileCheck and use CHECK-LABEL

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

9 years agoClarify wording in the LangRef around !invariant.load
Philip Reames [Mon, 24 Nov 2014 22:32:43 +0000 (22:32 +0000)]
Clarify wording in the LangRef around !invariant.load

Clarify the wording around !invariant.load to properly reflect the semantics of such loads with respect to control dependence and location lifetime.  To the best of my knowledge, the revised wording respects the actual implementation and understanding of issues involved highlighted in the recent 'Optimization hints for "constant" loads' thread on LLVMDev.

In particular, I'm aiming for the following results:
- To clarify that an invariant.load can fault and must respect control dependence.  In particular, it is not sound to unconditionally pull an invariant load out of a loop if that loop would potentially never execute.
- To clarify that the invariant nature of a given pointer does not preclude the modification of that location through a pointer which is unrelated to the load operand.  In particular, initializing a location and then passing a pointer through an opaque intrinsic which produces a new unrelated pointer, should behave as expected provided that the intrinsic is memory dependent on the initializing store.
- To clarify that storing a value to an invariant location is defined.  It can not, for example, be considered unreachable.  The value stored can be assumed to be equal to the value of any previous (or following!) invariant load, but the store itself is defined.

I recommend that anyone interested in using !invariant.load, or optimizing for them, read over the discussion in the review thread.  A number of motivating examples are discussed.

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

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

9 years agoAdd a disable-output option to the gold plugin.
Rafael Espindola [Mon, 24 Nov 2014 21:18:14 +0000 (21:18 +0000)]
Add a disable-output option to the gold plugin.

This corresponds to the opt option and is handy for profiling.

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

9 years agoRemove the unused FindUsedTypes pass.
Rafael Espindola [Mon, 24 Nov 2014 20:53:26 +0000 (20:53 +0000)]
Remove the unused FindUsedTypes pass.

It was dead since r134829.

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

9 years agoAdd and use Type::subtypes. NFC.
Rafael Espindola [Mon, 24 Nov 2014 20:44:36 +0000 (20:44 +0000)]
Add and use Type::subtypes. NFC.

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

9 years agoPass the .ll files to llvm-link directly. NFC.
Rafael Espindola [Mon, 24 Nov 2014 20:35:59 +0000 (20:35 +0000)]
Pass the .ll files to llvm-link directly. NFC.

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

9 years agoCorrect path to regression tests in ExtendingLLVM
Sergey Dmitrouk [Mon, 24 Nov 2014 19:40:07 +0000 (19:40 +0000)]
Correct path to regression tests in ExtendingLLVM

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

9 years ago[AArch64] Fix clobber computation in A57LoadBalancing pass.
Chad Rosier [Mon, 24 Nov 2014 18:57:58 +0000 (18:57 +0000)]
[AArch64] Fix clobber computation in A57LoadBalancing pass.

Extremely difficult to reproduce, so no test case included.
PR21637

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

9 years agoRemoving unused variable.
Colin LeMahieu [Mon, 24 Nov 2014 18:55:32 +0000 (18:55 +0000)]
Removing unused variable.

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

9 years ago[asan/coverage] change the way asan coverage instrumentation is done: instead of...
Kostya Serebryany [Mon, 24 Nov 2014 18:49:53 +0000 (18:49 +0000)]
[asan/coverage] change the way asan coverage instrumentation is done: instead of setting the guard to 1 in the generated code, pass the pointer to guard to __sanitizer_cov and set it there. No user-visible functionality change expected

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

9 years ago[PowerPC] Fix PR 21652 - copy st_other bits on symbol assignment
Ulrich Weigand [Mon, 24 Nov 2014 18:09:47 +0000 (18:09 +0000)]
[PowerPC] Fix PR 21652 - copy st_other bits on symbol assignment

When processing an assignment in the integrated assembler that sets
a symbol to the value of another symbol, we need to copy the st_other
bits that encode the local entry point offset.

Modeled after MipsTargetELFStreamer::emitAssignment handling of the
ELF::STO_MIPS_MICROMIPS flag.

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

9 years agoMore long path name support on Windows, this time in program execution.
Paul Robinson [Mon, 24 Nov 2014 18:05:29 +0000 (18:05 +0000)]
More long path name support on Windows, this time in program execution.
Allows long paths for the executable and redirected stdin/stdout/stderr.
Addresses PR21563.

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

9 years ago[Hexagon] Adding asrh instruction, removing unused multiclasses.
Colin LeMahieu [Mon, 24 Nov 2014 18:04:42 +0000 (18:04 +0000)]
[Hexagon] Adding asrh instruction, removing unused multiclasses.

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

9 years ago[Hexagon] Adding aslh instruction.
Colin LeMahieu [Mon, 24 Nov 2014 17:44:19 +0000 (17:44 +0000)]
[Hexagon] Adding aslh instruction.

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

9 years ago[Hexagon] Adding zxth instruction.
Colin LeMahieu [Mon, 24 Nov 2014 17:11:34 +0000 (17:11 +0000)]
[Hexagon] Adding zxth instruction.

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

9 years agoAdding const iterator to MCInst. http://reviews.llvm.org/D6359
Colin LeMahieu [Mon, 24 Nov 2014 16:50:40 +0000 (16:50 +0000)]
Adding const iterator to MCInst. reviews.llvm.org/D6359

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

9 years ago[Hexagon] Adding zxtb instruction.
Colin LeMahieu [Mon, 24 Nov 2014 16:48:43 +0000 (16:48 +0000)]
[Hexagon] Adding zxtb instruction.

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

9 years agoInstCombine: Don't create an unused instruction
David Majnemer [Mon, 24 Nov 2014 16:41:13 +0000 (16:41 +0000)]
InstCombine: Don't create an unused instruction

We would create an instruction but not inserting it.
Not inserting the unused instruction would lead us to verification
failure.

This fixes PR21653.

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