oota-llvm.git
9 years agoAvoid using Loop::getSubLoopsVector.
Benjamin Kramer [Mon, 13 Jul 2015 17:21:14 +0000 (17:21 +0000)]
Avoid using Loop::getSubLoopsVector.

Passes should never modify it, just use the const version. While there
reduce copying in LoopInterchange. No functional change intended.

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

9 years agoFix handling of the 'n' asm constraint with invalid operands.
James Y Knight [Mon, 13 Jul 2015 16:36:22 +0000 (16:36 +0000)]
Fix handling of the 'n' asm constraint with invalid operands.

It had accidently accepted a symbol+offset value (and emitted
incorrect code for it, keeping only the offset part) instead of
properly reporting the constraint as invalid.

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

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

9 years agoAMDGPU/SI: Select mad patterns to v_mac_f32
Tom Stellard [Mon, 13 Jul 2015 15:47:57 +0000 (15:47 +0000)]
AMDGPU/SI: Select mad patterns to v_mac_f32

The two-address instruction pass will convert these back to v_mad_f32
if necessary.

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

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

9 years agoARM: Fix cttz expansion on vector types.
Logan Chien [Mon, 13 Jul 2015 15:37:30 +0000 (15:37 +0000)]
ARM: Fix cttz expansion on vector types.

The 64/128-bit vector types are legal if NEON instructions are
available.  However, there was no matching patterns for @llvm.cttz.*()
intrinsics and result in fatal error.

This commit fixes the problem by lowering cttz to:
a. ctpop((x & -x) - 1)
b. width - ctlz(x & -x) - 1

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

9 years ago[ARM] Handle commutativity when converting to tADDhirr in Thumb2
Scott Douglass [Mon, 13 Jul 2015 15:31:48 +0000 (15:31 +0000)]
[ARM] Handle commutativity when converting to tADDhirr in Thumb2

Also, run thumb_rewrite.s tests in Thumb2 now that they pass.

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

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

9 years ago[ARM] Add Thumb2 ADD with SP narrowing from 3 operand to 2
Scott Douglass [Mon, 13 Jul 2015 15:31:40 +0000 (15:31 +0000)]
[ARM] Add Thumb2 ADD with SP narrowing from 3 operand to 2

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

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

9 years ago[ARM] Small refactor of tryConvertingToTwoOperandForm (nfc)
Scott Douglass [Mon, 13 Jul 2015 15:31:33 +0000 (15:31 +0000)]
[ARM] Small refactor of tryConvertingToTwoOperandForm (nfc)

Also, add more Thumb2 ADD tests requested during review of
http://reviews.llvm.org/D11053.

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

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

9 years agoCleanup after r241809 - remove uncessary call to std::sort
Silviu Baranga [Mon, 13 Jul 2015 14:48:24 +0000 (14:48 +0000)]
Cleanup after r241809 - remove uncessary call to std::sort

Summary:
The iteration order within a member of DepCands is deterministic
and therefore we don't have to sort the accesses within a member.
We also don't have to copy the indices of the pointers into a
vector, since we can iterate over the members of the class.

Subscribers: llvm-commits

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

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

9 years agoRemove unused variable.
Rafael Espindola [Mon, 13 Jul 2015 14:43:33 +0000 (14:43 +0000)]
Remove unused variable.

Sorry I missed it in the previous commit.

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

9 years agoAliases don't have available_externally linkage.
Rafael Espindola [Mon, 13 Jul 2015 14:39:02 +0000 (14:39 +0000)]
Aliases don't have available_externally linkage.

Allowing that is probably a good idea, but currently we don't, so
this is dead code.

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

9 years agoDon't change the visibility when converting a definition to a declaration.
Rafael Espindola [Mon, 13 Jul 2015 14:18:22 +0000 (14:18 +0000)]
Don't change the visibility when converting a definition to a declaration.

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

9 years agoRemoving several -Wunused-but-set-variable warnings; NFC intended.
Aaron Ballman [Mon, 13 Jul 2015 14:04:30 +0000 (14:04 +0000)]
Removing several -Wunused-but-set-variable warnings; NFC intended.

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

9 years agoPrint the visibility of available_externally functions.
Rafael Espindola [Mon, 13 Jul 2015 13:55:18 +0000 (13:55 +0000)]
Print the visibility of available_externally functions.

We were already printing it for declarations, but not available_externally.

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

9 years agoRevert r241981 "Revert "Revert r236894 "[BasicAA] Fix zext & sext handling"""
Manuel Klimek [Mon, 13 Jul 2015 13:50:55 +0000 (13:50 +0000)]
Revert r241981 "Revert "Revert r236894 "[BasicAA] Fix zext & sext handling"""

The repros from PR23626 still fail.

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

9 years agoAVX-512: Added all AVX-512 forms of Vector Convert for Float/Double/Int/Long types.
Elena Demikhovsky [Mon, 13 Jul 2015 13:26:20 +0000 (13:26 +0000)]
AVX-512: Added all AVX-512 forms of Vector Convert for Float/Double/Int/Long types.
In this patch I have only encoding. Intrinsics and DAG lowering will be in the next patch.
I temporary removed the old intrinsics test (just to split this patch).
Half types are not covered here.

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

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

9 years ago[llvm-stress] Remove unneeded llvm:: prefix. NFC.
Pawel Bylica [Mon, 13 Jul 2015 11:25:56 +0000 (11:25 +0000)]
[llvm-stress] Remove unneeded llvm:: prefix. NFC.

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

9 years ago[mips] Explained the 'w' modifier in the Inline Assembler documentation.
Daniel Sanders [Mon, 13 Jul 2015 09:24:21 +0000 (09:24 +0000)]
[mips] Explained the 'w' modifier in the Inline Assembler documentation.

It exists for compatibility with GCC which requires it to print MSA registers
for the 'f' constraint. Although LLVM doesn't need it, the 'w' modifier should
still be used for portability between the two compilers.

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

9 years ago[LSR] don't attempt to promote ephemeral values to indvars
Jingyue Wu [Mon, 13 Jul 2015 03:28:53 +0000 (03:28 +0000)]
[LSR] don't attempt to promote ephemeral values to indvars

Summary:
This at least saves compile time. I also encountered a case where
ephemeral values affect whether other variables are promoted, causing
performance issues. It may be a bug in LSR, but I didn't manage to
reduce it yet. Anyhow, I believe it's in general not worth considering
ephemeral values in LSR.

Reviewers: atrick, hfinkel

Subscribers: llvm-commits

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

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

9 years ago[InstSimplify] Teach InstSimplify how to simplify extractelement
David Majnemer [Mon, 13 Jul 2015 01:15:53 +0000 (01:15 +0000)]
[InstSimplify] Teach InstSimplify how to simplify extractelement

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

9 years ago[InstSimplify] Teach InstSimplify how to simplify extractvalue
David Majnemer [Mon, 13 Jul 2015 01:15:46 +0000 (01:15 +0000)]
[InstSimplify] Teach InstSimplify how to simplify extractvalue

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

9 years agoFix PR24099 reported by Tomas Brukner.
Yaron Keren [Sun, 12 Jul 2015 20:40:41 +0000 (20:40 +0000)]
Fix PR24099 reported by Tomas Brukner.

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

9 years ago[ARM] Add support for nest attribute using r12
Renato Golin [Sun, 12 Jul 2015 18:16:40 +0000 (18:16 +0000)]
[ARM] Add support for nest attribute using r12

Register r12 ('ip') is used by GCC for this purpose
and hence is used here. As discussed on the GCC mailing
list, the register choice is an ABI issue and so
choosing the same register as GCC means
__builtin_call_with_static_chain is compatible.

A similar patch has just gone in the AArch64 backend,
so this is just the ARM counterpart, following the same
discussion.

Patch by Stephen Cross.

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

9 years ago[X86][SSE] Tidied up vector extend/truncation tests. NFCI.
Simon Pilgrim [Sun, 12 Jul 2015 17:40:49 +0000 (17:40 +0000)]
[X86][SSE] Tidied up vector extend/truncation tests. NFCI.

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

9 years ago[X86][SSE] (V)PMINSB is commutable.
Simon Pilgrim [Sun, 12 Jul 2015 16:44:11 +0000 (16:44 +0000)]
[X86][SSE] (V)PMINSB is commutable.

(V)PMINSB is no different to the other (V)PMIN/(V)PMAX B/D/W instructions - it is fully commutable.

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

9 years agoTrim trailing whitespaces. NFC.
Simon Pilgrim [Sun, 12 Jul 2015 11:17:33 +0000 (11:17 +0000)]
Trim trailing whitespaces. NFC.

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

9 years ago[X86][SSE] Vectorized v4i32 non-uniform shifts.
Simon Pilgrim [Sun, 12 Jul 2015 11:15:19 +0000 (11:15 +0000)]
[X86][SSE] Vectorized v4i32 non-uniform shifts.

While the v4i32 shl operation is already vectorized using a cvttps2dq/pmulld pattern, the lshr/ashr opeations are still scalarized.

This patch adds vectorization support for non-uniform v4i32 shift operations - it splats constant shift amounts to allow them to use the immediate sse shift instructions, or extracts/zero-extends non-constant shift amounts. The individual results are then blended together.

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

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

9 years ago[LICM] Don't try to sink values out of loops without any exits
David Majnemer [Sun, 12 Jul 2015 03:53:05 +0000 (03:53 +0000)]
[LICM] Don't try to sink values out of loops without any exits

There is no suitable basic block to sink instructions in loops without
exits.  The only way an instruction in a loop without exits can be used
is as an incoming value to a PHI.  In such cases, the incoming block for
the corresponding value is unreachable.

This fixes PR24013.

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

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

9 years ago[PowerPC] Make use of the TargetRecip system
Hal Finkel [Sun, 12 Jul 2015 02:33:57 +0000 (02:33 +0000)]
[PowerPC] Make use of the TargetRecip system

r238842 added the TargetRecip system for controlling use of reciprocal
estimates for sqrt and division using a set of parameters that can be set by
the frontend. Clang now supports a sophisticated -mrecip option, and this will
allow that option to effectively control the relevant code-generation
functionality of the PPC backend.

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

9 years ago[PowerPC] Support the nest parameter attribute
Hal Finkel [Sun, 12 Jul 2015 00:37:44 +0000 (00:37 +0000)]
[PowerPC] Support the nest parameter attribute

This adds support for the 'nest' attribute, which allows the static chain
register to be set for functions calls under non-Darwin PPC/PPC64 targets. r11
is the chain register (which the PPC64 ELF ABI calls the "environment
pointer"). For indirect calls under PPC64 ELFv1, this would normally be loaded
from the function descriptor, but providing an explicit 'nest' parameter will
override that process and use the value provided.

This allows __builtin_call_with_static_chain to work as expected on PowerPC.

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

9 years agoRevert "[ExecutionEngine] Use std::function rather than a function pointer for the...
Renato Golin [Sat, 11 Jul 2015 13:42:48 +0000 (13:42 +0000)]
Revert "[ExecutionEngine] Use std::function rather than a function pointer for the LazyFunctionCreator."

This reverts commit r241962, as it was breaking all ARM buildbots.

It also reverts the two subsequent related commits:

r241974: "[ExecutionEngine] Add a static cast to the unittest for r241962 to suppress a warning."

r241973: "[ExecutionEngine] Remove cruft and fix a couple of warnings in the test case for r241962."

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

9 years agoRevert "Revert r236894 "[BasicAA] Fix zext & sext handling""
Hal Finkel [Sat, 11 Jul 2015 11:04:54 +0000 (11:04 +0000)]
Revert "Revert r236894 "[BasicAA] Fix zext & sext handling""

r236894 caused PR23626 (Clang miscompiles webkit's base64 decoder), and was
reverted in r237984. This reapplies the patch with an additional test case for
PR23626 and the associated fix (both scales and offsets in the
BasicAliasAnalysis::constantOffsetHeuristic should initially be zero).

Patch by Nick White, thanks!

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

9 years agoMove getStrideFromPointer and friends from LoopVectorize to VectorUtils
Hal Finkel [Sat, 11 Jul 2015 10:52:42 +0000 (10:52 +0000)]
Move getStrideFromPointer and friends from LoopVectorize to VectorUtils

The following functions are moved from the LoopVectorizer to VectorUtils:

  - getGEPInductionOperand
  - stripGetElementPtr
  - getUniqueCastUse
  - getStrideFromPointer

These used to be static functions in LoopVectorize, but will also be used by
the upcoming loop versioning LICM transformation.

Patch by Ashutosh Nema!

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

9 years agoAdd argmemonly attribute.
Igor Laevsky [Sat, 11 Jul 2015 10:30:36 +0000 (10:30 +0000)]
Add argmemonly attribute.

This change adds new attribute called "argmemonly". Function marked with this attribute can only access memory through it's argument pointers. This attribute directly corresponds to the "OnlyAccessesArgumentPointees" ModRef behaviour in alias analysis.

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

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

9 years agoFix include guard typo introduced in r239315.
Yaron Keren [Sat, 11 Jul 2015 09:40:28 +0000 (09:40 +0000)]
Fix include guard typo introduced in r239315.

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

9 years agoDefine a new intrinsic @llvm.canonicalize.
Owen Anderson [Sat, 11 Jul 2015 07:01:27 +0000 (07:01 +0000)]
Define a new intrinsic @llvm.canonicalize.

This is used the canonicalize floating point values, which is useful for
implementing certain numeric primitives.  See the LangRef changes for
the full details of its semantics.

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

9 years ago[PM/AA] Completely remove the AliasAnalysis::copyValue interface.
Chandler Carruth [Sat, 11 Jul 2015 04:39:00 +0000 (04:39 +0000)]
[PM/AA] Completely remove the AliasAnalysis::copyValue interface.

No in-tree alias analysis used this facility, and it was not called in
any particularly rigorous way, so it seems unlikely to be correct.

Note that one of the only stateful AA implementations in-tree,
GlobalsModRef is completely broken currently (and any AA passes like it
are equally broken) because Module AA passes are not effectively
invalidated when a function pass that fails to update the AA stack runs.

Ultimately, it doesn't seem like we know how we want to build stateful
AA, and until then trying to support and maintain correctness for an
untested API is essentially impossible. To that end, I'm planning to rip
out all of the update API. It can return if and when we need it and know
how to build it on top of the new pass manager and as part of *tested*
stateful AA implementations in the tree.

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

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

9 years ago[ExecutionEngine] Add a static cast to the unittest for r241962 to suppress a
Lang Hames [Sat, 11 Jul 2015 02:07:28 +0000 (02:07 +0000)]
[ExecutionEngine] Add a static cast to the unittest for r241962 to suppress a
warning.

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

9 years ago[ExecutionEngine] Remove cruft and fix a couple of warnings in the test case for
Lang Hames [Sat, 11 Jul 2015 01:59:04 +0000 (01:59 +0000)]
[ExecutionEngine] Remove cruft and fix a couple of warnings in the test case for
r241962.

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

9 years agoRenamed some uses of unroll to interleave in the vectorizer.
Tyler Nowicki [Sat, 11 Jul 2015 00:31:11 +0000 (00:31 +0000)]
Renamed some uses of unroll to interleave in the vectorizer.

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

9 years agoMC: Shrink MCDwarfLoc/MCLineEntry
Duncan P. N. Exon Smith [Fri, 10 Jul 2015 23:55:34 +0000 (23:55 +0000)]
MC: Shrink MCDwarfLoc/MCLineEntry

Drop 8 bytes off of `MCDwarfLoc` by restricting the `Isa`, `Column`, and
`Flags` members to appropriate sizes (from `DWARFDebugLine::Row`).
Saves a little over 0.5% off the heap of llc with no real functionality
change.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

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

9 years agoClean up the comments in DIBuilder.h to adhere to the coding standards
Adrian Prantl [Fri, 10 Jul 2015 23:31:08 +0000 (23:31 +0000)]
Clean up the comments in DIBuilder.h to adhere to the coding standards
a little more.

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

9 years agoRevert "Clean up the comments in DIBuilder.h to adhere to the coding standards"
Adrian Prantl [Fri, 10 Jul 2015 23:31:05 +0000 (23:31 +0000)]
Revert "Clean up the comments in DIBuilder.h to adhere to the coding standards"

This reverts commit 241965. (I accidentally committed too much).

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

9 years agoCleanup a couple of comments in DIBuilder.cpp
Adrian Prantl [Fri, 10 Jul 2015 23:26:02 +0000 (23:26 +0000)]
Cleanup a couple of comments in DIBuilder.cpp

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

9 years agoClean up the comments in DIBuilder.h to adhere to the coding standards
Adrian Prantl [Fri, 10 Jul 2015 23:25:54 +0000 (23:25 +0000)]
Clean up the comments in DIBuilder.h to adhere to the coding standards
a little more.

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

9 years ago[ExecutionEngine] Use std::function rather than a function pointer for the
Lang Hames [Fri, 10 Jul 2015 22:56:47 +0000 (22:56 +0000)]
[ExecutionEngine] Use std::function rather than a function pointer for the
LazyFunctionCreator.

Patch by Pierre-Andre Saulais. Thanks Pierre!

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

9 years agoMC: Only allow changing feature bits in MCSubtargetInfo
Duncan P. N. Exon Smith [Fri, 10 Jul 2015 22:52:15 +0000 (22:52 +0000)]
MC: Only allow changing feature bits in MCSubtargetInfo

Disallow all mutation of `MCSubtargetInfo` expect the feature bits.

Besides deleting the assignment operators -- which were dead "code" --
this restricts `InitMCProcessorInfo()` to subclass initialization
sequences, and exposes a new more limited function called
`setDefaultFeatures()` for use by the ARMAsmParser `.cpu` directive.

There's a small functional change here: ARMAsmParser used to adjust
`MCSubtargetInfo::CPUSchedModel` as a side effect of calling
`InitMCProcessorInfo()`, but I've removed that suspicious behaviour.
Since the AsmParser shouldn't be doing any scheduling, there shouldn't
be any observable change...

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

9 years agoAMDGPU: Fix chains for memory ops dependent on argument loads
Matt Arsenault [Fri, 10 Jul 2015 22:51:36 +0000 (22:51 +0000)]
AMDGPU: Fix chains for memory ops dependent on argument loads

Most loads and stores are derived from pointers derived from
a kernel argument load inserted during argument lowering.
This was just using the EntryToken chain for the argument loads,
and any users of these loads were also on the EntryToken chain.

Return the chain of the lowered argument load so that dependent loads
end up on the correct chain.

No test since I'm not aware of any case where this actually
broke.

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

9 years agoMIR Serialization: Serialize the virtual register operands.
Alex Lorenz [Fri, 10 Jul 2015 22:51:20 +0000 (22:51 +0000)]
MIR Serialization: Serialize the virtual register operands.

Reviewers: Duncan P. N. Exon Smith

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

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

9 years ago[IR] Switch static const to an enum to silence MSVC linker warnings
David Majnemer [Fri, 10 Jul 2015 22:46:02 +0000 (22:46 +0000)]
[IR] Switch static const to an enum to silence MSVC linker warnings

Integral class statics are handled oddly in MSVC, we don't need them
in this case, use an enum instead.

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

9 years agoMC: Remove MCSubtargetInfo() default constructor
Duncan P. N. Exon Smith [Fri, 10 Jul 2015 22:43:42 +0000 (22:43 +0000)]
MC: Remove MCSubtargetInfo() default constructor

Force all creators of `MCSubtargetInfo` to immediately initialize it,
merging the default constructor and the initializer into an initializing
constructor.  Besides cleaning up the code a little, this makes it clear
that the initializer is never called again later.

Out-of-tree backends need a trivial change: instead of calling:

    auto *X = new MCSubtargetInfo();
    InitXYZMCSubtargetInfo(X, ...);
    return X;

they should call:

    return createXYZMCSubtargetInfoImpl(...);

There's no real functionality change here.

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

9 years agoMC: Remove MCSubtargetInfo::InitCPUSched()
Duncan P. N. Exon Smith [Fri, 10 Jul 2015 22:33:01 +0000 (22:33 +0000)]
MC: Remove MCSubtargetInfo::InitCPUSched()

Remove all calls to `MCSubtargetInfo::InitCPUSched()` and merge its body
into the only relevant caller, `MCSubtargetInfo::InitMCProcessorInfo()`.
We were only calling the former after explicitly calling the latter with
the same CPU; it's confusing to have both methods exposed.

Besides a minor (surely unmeasurable) speedup in ARM and X86 from
avoiding running the logic twice, no functionality change.

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

9 years ago[InstCombine] Actually combine AA metadata when replacing one load with another
Bjorn Steinbrink [Fri, 10 Jul 2015 22:30:17 +0000 (22:30 +0000)]
[InstCombine] Actually combine AA metadata when replacing one load with another

Fixes PR24083

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

9 years agoAMDGPU: Use requested chain when lowering arguments
Matt Arsenault [Fri, 10 Jul 2015 22:28:41 +0000 (22:28 +0000)]
AMDGPU: Use requested chain when lowering arguments

No test since I'm not aware of any case where this will
end up being a different chain.

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

9 years agoARM: Use SpecificBumpPtrAllocator to fix leak introduced in r241920
Matthias Braun [Fri, 10 Jul 2015 22:23:57 +0000 (22:23 +0000)]
ARM: Use SpecificBumpPtrAllocator to fix leak introduced in r241920

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

9 years ago[SEH] Push reloads of the SEH code past phi nodes
Reid Kleckner [Fri, 10 Jul 2015 22:21:54 +0000 (22:21 +0000)]
[SEH] Push reloads of the SEH code past phi nodes

This in turn would sometimes introduce new cleanupblocks that didn't
previously exist. The uses were being introduced by SSA value demotion.
We actually want to *promote* uses of EH pointers and selectors, so I
added some spcecial casing to avoid demoting such instructions.  This is
getting overly complicated, but hopefully we'll come along and delete it
in the new representation.

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

9 years agoAdd <type_traits> for is_pod, fixing r241947
Duncan P. N. Exon Smith [Fri, 10 Jul 2015 22:17:49 +0000 (22:17 +0000)]
Add <type_traits> for is_pod, fixing r241947

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

9 years agoDAGCombiner: Assume invariant load cannot alias a store
Matt Arsenault [Fri, 10 Jul 2015 22:17:40 +0000 (22:17 +0000)]
DAGCombiner: Assume invariant load cannot alias a store

The motivation is to allow GatherAllAliases / FindBetterChain
to not give up on dependent loads of a pointer from constant memory.

This is important for AMDGPU, because most loads are pointers
derived from a load of a kernel argument from constant memory.

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

9 years agoMC: Remove the copy of MCSchedModel in MCSubtargetInfo
Duncan P. N. Exon Smith [Fri, 10 Jul 2015 22:13:43 +0000 (22:13 +0000)]
MC: Remove the copy of MCSchedModel in MCSubtargetInfo

`MCSchedModel` is large.  Make `MCSchedModel::GetDefaultSchedModel()`
return by-reference instead of by-value, so we can store a pointer in
`MCSubtargetInfo::CPUSchedModel` instead of a copy.

Note: since `MCSchedModel` is POD, this doesn't create a static
constructor.

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

9 years ago[ShrinkWrap][PEI] Do not insert epilogue for unreachable blocks.
Quentin Colombet [Fri, 10 Jul 2015 22:09:55 +0000 (22:09 +0000)]
[ShrinkWrap][PEI] Do not insert epilogue for unreachable blocks.

Although this is not incorrect to insert such code, it is useless
and it hurts the binary size.

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

9 years ago[MC] Switch static const to an enum to silence MSVC linker warnings
David Majnemer [Fri, 10 Jul 2015 21:50:04 +0000 (21:50 +0000)]
[MC] Switch static const to an enum to silence MSVC linker warnings

Integral class statics are handled oddly in MSVC, we don't need them in
this case, use an enum instead.

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

9 years agoFix AArch64 prologue for empty frame with dynamic allocas.
Evgeniy Stepanov [Fri, 10 Jul 2015 21:24:07 +0000 (21:24 +0000)]
Fix AArch64 prologue for empty frame with dynamic allocas.

Fixes PR23804: assertion failure in emitPrologue in the case of a
function with an empty frame and a dynamic alloca that needs stack
realignment. This is a typical case for AddressSanitizer.

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

9 years ago[TTI] BasicTTIImpl assumes no vector registers
Jingyue Wu [Fri, 10 Jul 2015 21:14:54 +0000 (21:14 +0000)]
[TTI] BasicTTIImpl assumes no vector registers

Summary:
Following the discussion on r241884, it's more reasonable to assume that a
target has no vector registers by default instead of letting every such
target overrides getNumberOfRegisters.

Therefore, this patch modifies BasicTTIImpl::getNumberOfRegisters to
return 0 when Vector is true, and partially reverts r241884 which
modifies NVPTXTTIImpl::getNumberOfRegisters.

It also fixes a performance bug in LoopVectorizer. Even if a target has
no vector registers, vectorization may still help ILP. So, we need both
checks to be false before disabling loop vectorization all together.

Reviewers: hfinkel

Subscribers: llvm-commits, jholewinski

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

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

9 years agoFix `llvm-config` to emit the linker flag for the combined shared object built by...
JF Bastien [Fri, 10 Jul 2015 20:24:17 +0000 (20:24 +0000)]
Fix `llvm-config` to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components.

Summary:
This fixes `llvm-config` instead of fixing the makefiles because, AIUI, LLVM's autoconfig/make build system is on the way out anyway.

This change only affects builds that use autoconfig/make.

Reviewers: jfb

Subscribers: echristo, dschuff, llvm-commits

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

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

9 years ago[Object][ELF] Handle the dynamic string table in files without a section table.
Michael J. Spencer [Fri, 10 Jul 2015 20:11:57 +0000 (20:11 +0000)]
[Object][ELF] Handle the dynamic string table in files without a section table.

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

9 years agoFix enum BitcodeError to not define a zero-valued error code.
Jan Wen Voung [Fri, 10 Jul 2015 19:46:16 +0000 (19:46 +0000)]
Fix enum BitcodeError to not define a zero-valued error code.

Summary:
std::error_code assumes it isn't an error if the error code is zero.

Patch by Karl Schimpf

Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10815

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

9 years ago[LoopDist/LoopVer] Move LoopVersioning to a new module, NFC
Adam Nemet [Fri, 10 Jul 2015 18:55:13 +0000 (18:55 +0000)]
[LoopDist/LoopVer] Move LoopVersioning to a new module, NFC

Summary:
The class will obviously need improvement down the road.  For one, there
is no reason that addPHINodes would have to be exposed like that.  I
will make this and other improvements in follow-up patches.

The main goal is to be able to share this functionality.  The
LoopLoadElimination pass I am working on needs it too.  Later we can
move other clients as well (LV and Ashutosh's LICMVer).

Reviewers: hfinkel, ashutosh.nema

Subscribers: llvm-commits

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

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

9 years ago[LoopDist] Move loop-versioning helper functions to Cloning, NFC
Adam Nemet [Fri, 10 Jul 2015 18:55:09 +0000 (18:55 +0000)]
[LoopDist] Move loop-versioning helper functions to Cloning, NFC

Summary:
This makes them available to the LoopVersioning class as that is moved
to its own module in the next patch.

Reviewers: ashutosh.nema, hfinkel

Subscribers: llvm-commits

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

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

9 years agoARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code
Matthias Braun [Fri, 10 Jul 2015 18:37:33 +0000 (18:37 +0000)]
ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code

This commit factors out common code from MergeBaseUpdateLoadStore() and
MergeBaseUpdateLSMultiple() and introduces a new function
MergeBaseUpdateLSDouble() which merges adds/subs preceding/following a
strd/ldrd instruction into an strd/ldrd instruction with writeback where
possible.

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

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

9 years agoComputeKnownBits: be a bit smarter about ADDs
Fiona Glaser [Fri, 10 Jul 2015 18:29:02 +0000 (18:29 +0000)]
ComputeKnownBits: be a bit smarter about ADDs

If our two inputs have known top-zero bit counts M and N, we trivially
know that the output cannot have any bits set in the top (min(M, N)-1)
bits, since nothing could carry past that point.

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

9 years agoARMLoadStoreOptimizer: Create LDRD/STRD on thumb2
Matthias Braun [Fri, 10 Jul 2015 18:28:49 +0000 (18:28 +0000)]
ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2

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

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

9 years agoWebAssembly: basic instructions todo, and basic register info.
JF Bastien [Fri, 10 Jul 2015 18:23:10 +0000 (18:23 +0000)]
WebAssembly: basic instructions todo, and basic register info.

Summary:
This code is based on AArch64 for modern backend good practice, and NVPTX for
virtual ISA concerns.

Reviewers: sunfish

Subscribers: aemerson, llvm-commits, jfb

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

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

9 years agoMIR Serialization: Initial serialization of stack objects.
Alex Lorenz [Fri, 10 Jul 2015 18:13:57 +0000 (18:13 +0000)]
MIR Serialization: Initial serialization of stack objects.

This commit implements the initial serialization of stack objects from the
MachineFrameInfo class. It can only serialize the ordinary stack objects
(including ordinary spill slots), but it doesn't serialize variable sized or
fixed stack objects yet.

The stack objects are serialized using a YAML sequence of YAML inline mappings.
Each mapping has the object's ID, type, size, offset and alignment. The stack
objects are a part of machine function's YAML mapping.

Reviewers: Duncan P. N. Exon Smith

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

9 years agoTarget RegisterInfo: devirtualize TargetFrameLowering
JF Bastien [Fri, 10 Jul 2015 18:13:17 +0000 (18:13 +0000)]
Target RegisterInfo: devirtualize TargetFrameLowering

Summary:
The target frame lowering's concrete type is always known in RegisterInfo, yet it's only sometimes devirtualized through a static_cast. This change adds an auto-generated static function <Target>GenRegisterInfo::getFrameLowering(const MachineFunction &MF) which does this devirtualization, and uses this function in all targets which can.

This change was suggested by sunfish in D11070 for WebAssembly, I figure that I may as well improve the other targets while I'm here.

Subscribers: sunfish, ted, llvm-commits, jfb

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

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

9 years agoARMLoadStoreOptimizer: Rewrite LDM/STM matching logic.
Matthias Braun [Fri, 10 Jul 2015 18:08:49 +0000 (18:08 +0000)]
ARMLoadStoreOptimizer: Rewrite LDM/STM matching logic.

This improves the logic in several ways and is a preparation for
followup patches:
- First perform an analysis and create a list of merge candidates, then
  transform. This simplifies the code in that you have don't have to
  care to much anymore that you may be holding iterators to
  MachineInstrs that get removed.
- Analyze/Transform basic blocks in reverse order. This allows to use
  LivePhysRegs to find free registers instead of the RegisterScavenger.
  The RegisterScavenger will become less precise in the future as it
  relies on the deprecated kill-flags.
- Return the newly created node in MergeOps so there's no need to look
  around in the schedule to find it.
- Rename some MBBI iterators to InsertBefore to make their role clear.
- General code cleanup.

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

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

9 years agoActually support volatile memcpys in NVPTX lowering
Eli Bendersky [Fri, 10 Jul 2015 15:40:33 +0000 (15:40 +0000)]
Actually support volatile memcpys in NVPTX lowering

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

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

9 years agoNFC. Added a blank line for consistency.
Nemanja Ivanovic [Fri, 10 Jul 2015 14:25:17 +0000 (14:25 +0000)]
NFC. Added a blank line for consistency.

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

9 years ago[InstSimplify] Fold away ord/uno fcmps when nnan is present.
Benjamin Kramer [Fri, 10 Jul 2015 14:02:02 +0000 (14:02 +0000)]
[InstSimplify] Fold away ord/uno fcmps when nnan is present.

This is important to fold away the slow case of complex multiplies
emitted by clang.

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

9 years agoAdd support for fast-math flags to the FCmp instruction.
James Molloy [Fri, 10 Jul 2015 12:52:00 +0000 (12:52 +0000)]
Add support for fast-math flags to the FCmp instruction.

FCmp behaves a lot like a floating-point binary operator in many ways,
and can benefit from fast-math information. Flags such as nsz and nnan
can affect if this fcmp (in combination with a select) can be treated
as a fminnum/fmaxnum operation.

This adds backwards-compatible bitcode support, IR parsing and writing,
LangRef changes and IRBuilder changes. I'll need to audit InstSimplify
and InstCombine in a followup to find places where flags should be
copied.

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

9 years agoAdd missing builtins to the PPC back end for ABI compliance (vol. 3)
Nemanja Ivanovic [Fri, 10 Jul 2015 12:38:08 +0000 (12:38 +0000)]
Add missing builtins to the PPC back end for ABI compliance (vol. 3)

This patch corresponds to review:
http://reviews.llvm.org/D10973

Back end portion of the third round of additions to altivec.h.

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

9 years agoDisable loop re-rotation for -Oz (patch by Andrey Turetsky)
Alexey Bataev [Fri, 10 Jul 2015 10:37:09 +0000 (10:37 +0000)]
Disable loop re-rotation for -Oz (patch by Andrey Turetsky)

After changes in rL231820 loop re-rotation is performed even in -Oz mode. Since loop rotation is disabled for -Oz, it seems loop re-rotation should be disabled too.
Differential Revision: http://reviews.llvm.org/D10961

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

9 years ago[llvm-stress] Enhance scalar type selection from command line.
Pawel Bylica [Fri, 10 Jul 2015 10:01:47 +0000 (10:01 +0000)]
[llvm-stress] Enhance scalar type selection from command line.

llvm-stress command line options like -generate-x86-fp80 has been replaced with one list-like option -types. E.g. llvm-stress -types=x86_fp80,i100,i256,half. Default types (i1, i8, i16, i32, i64, float, double) are always added at the beginning of that list.

Reviewers: hfinkel

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

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

9 years agollvm/Object/ELF.h: Appease g++-4.7.2.
NAKAMURA Takumi [Fri, 10 Jul 2015 08:43:41 +0000 (08:43 +0000)]
llvm/Object/ELF.h: Appease g++-4.7.2.

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

9 years agoRevert the new EH instructions
David Majnemer [Fri, 10 Jul 2015 07:15:17 +0000 (07:15 +0000)]
Revert the new EH instructions

This reverts commits r241888-r241891, I didn't mean to commit them.

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

9 years agoAdd missing 'const'. I don't think this is strictly required, but some
Daniel Jasper [Fri, 10 Jul 2015 07:09:20 +0000 (07:09 +0000)]
Add missing 'const'. I don't think this is strictly required, but some
compiler configuration is giving me an error and it seems to be
recommended anyway.

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

9 years agoTighten the verifier check for catchblock.
David Majnemer [Fri, 10 Jul 2015 07:01:07 +0000 (07:01 +0000)]
Tighten the verifier check for catchblock.

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

9 years agoAddress Joseph's review comments.
David Majnemer [Fri, 10 Jul 2015 07:01:03 +0000 (07:01 +0000)]
Address Joseph's review comments.

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

9 years agoAddress Reid's review feedback.
David Majnemer [Fri, 10 Jul 2015 07:00:58 +0000 (07:00 +0000)]
Address Reid's review feedback.

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

9 years agoNew EH representation for MSVC compatibility
David Majnemer [Fri, 10 Jul 2015 07:00:44 +0000 (07:00 +0000)]
New EH representation for MSVC compatibility

Summary:
This introduces new instructions neccessary to implement MSVC-compatible
exception handling support.  Most of the middle-end and none of the
back-end haven't been audited or updated to take them into account.

Reviewers: rnk, JosephTremoulet, reames, nlewycky, rjmccall

Subscribers: llvm-commits

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

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

9 years ago[InstCombine] Employ AliasAnalysis in FindAvailableLoadedValue
Bjorn Steinbrink [Fri, 10 Jul 2015 06:55:49 +0000 (06:55 +0000)]
[InstCombine] Employ AliasAnalysis in FindAvailableLoadedValue

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

9 years ago[InstCombine] Properly combine metadata when replacing a load with another
Bjorn Steinbrink [Fri, 10 Jul 2015 06:55:44 +0000 (06:55 +0000)]
[InstCombine] Properly combine metadata when replacing a load with another

Not doing this can lead to misoptimizations down the line, e.g. because
of range metadata on the replacing load excluding values that are valid
for the load that is being replaced.

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

9 years ago[NVPTX] declare no vector registers
Jingyue Wu [Fri, 10 Jul 2015 04:31:56 +0000 (04:31 +0000)]
[NVPTX] declare no vector registers

Summary:
Without this patch, LoopVectorizer in certain cases (see loop-vectorize.ll)
produces code with complex control flow which hurts later optimizations. Since
NVPTX doesn't have vector registers in LLVM's sense
(NVPTXTTI::getRegisterBitWidth(true) == 32), we for now declare no vector
registers to effectively disable loop vectorization.

Reviewers: jholewinski

Subscribers: jingyue, llvm-commits, jholewinski

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

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

9 years ago[WinEH] Make sure LSDA tables are 4 byte aligned
Reid Kleckner [Fri, 10 Jul 2015 00:08:49 +0000 (00:08 +0000)]
[WinEH] Make sure LSDA tables are 4 byte aligned

Apparently this is important, otherwise _except_handler3 assumes that
the registration node is corrupted and ignores it.

Also fix a bug in WinEHPrepare where we would insert code after a
terminator instruction.

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

9 years agoReplace index-loops by range-based loops
Eli Bendersky [Thu, 9 Jul 2015 23:06:03 +0000 (23:06 +0000)]
Replace index-loops by range-based loops

NFC

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

9 years ago[x86] enable machine combiner reassociations for scalar double-precision multiplies
Sanjay Patel [Thu, 9 Jul 2015 22:58:39 +0000 (22:58 +0000)]
[x86] enable machine combiner reassociations for scalar double-precision multiplies

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

9 years ago[x86] enable machine combiner reassociations for scalar double-precision adds
Sanjay Patel [Thu, 9 Jul 2015 22:48:54 +0000 (22:48 +0000)]
[x86] enable machine combiner reassociations for scalar double-precision adds

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

9 years agoFix shadowing.
Michael J. Spencer [Thu, 9 Jul 2015 22:42:21 +0000 (22:42 +0000)]
Fix shadowing.

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

9 years ago[Object][ELF] Support dumping hash-tables from files with no section table.
Michael J. Spencer [Thu, 9 Jul 2015 22:32:24 +0000 (22:32 +0000)]
[Object][ELF] Support dumping hash-tables from files with no section table.

This time without breaking the bots.

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

9 years agoMIR Serialization: Serialize the virtual register definitions.
Alex Lorenz [Thu, 9 Jul 2015 22:23:13 +0000 (22:23 +0000)]
MIR Serialization: Serialize the virtual register definitions.

The virtual registers are serialized using a YAML sequence of YAML inline
mappings. Each mapping has the id of the virtual register and the register
class.

Reviewers: Duncan P. N. Exon Smith

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

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

9 years ago[LAA] Fix grammar in debug output
Adam Nemet [Thu, 9 Jul 2015 22:17:41 +0000 (22:17 +0000)]
[LAA] Fix grammar in debug output

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

9 years ago[LAA] Hide NeedRTCheck logic completely inside canCheckPtrAtRT, NFC
Adam Nemet [Thu, 9 Jul 2015 22:17:38 +0000 (22:17 +0000)]
[LAA] Hide NeedRTCheck logic completely inside canCheckPtrAtRT, NFC

Currently canCheckPtrAtRT returns two flags NeedRTCheck and CanDoRT.
NeedRTCheck says whether we need checks and CanDoRT whether we can
generate the checks.  The idea is to encode three states with these:

     Need/Can:
(1) false/dont-care: no checks are needed
(2) true/false: we need checks but can't generate them
(3) true/true: we need checks and we can generate them

This is pretty unnecessary since the caller (analyzeLoop) is only
interested in whether we can generate the checks if we actually need
them (i.e. 1 or 3).

So this change cleans up to return just that (CanDoRTIfNeeded) and pulls
all the underlying logic into canCheckPtrAtRT.

By doing all this, we simplify analyzeLoop which is the complex function
in LAA.

There is further room for improvement here by using RtCheck.Need
directly rather than a new local variable NeedRTCheck but that's for a
later patch.

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