oota-llvm.git
11 years agoMake atomic load and store of pointers work. Tighten verification of atomic operations
Eli Friedman [Fri, 17 Aug 2012 23:24:29 +0000 (23:24 +0000)]
Make atomic load and store of pointers work.  Tighten verification of atomic operations
so other unexpected operations don't slip through.  Based on patch by Logan Chien.
PR11786/PR13186.

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

11 years agoFix undefined behavior (binding a reference to a dereferenced null pointer) if
Richard Smith [Fri, 17 Aug 2012 21:42:44 +0000 (21:42 +0000)]
Fix undefined behavior (binding a reference to a dereferenced null pointer) if
SSAUpdater was created and destroyed without being initialized.

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

11 years agoAdd MipsELFWriterInfo.{h,cpp}.
Akira Hatanaka [Fri, 17 Aug 2012 21:38:47 +0000 (21:38 +0000)]
Add MipsELFWriterInfo.{h,cpp}.

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

11 years agoCorrect MCJIT functionality for MIPS32 architecture.
Akira Hatanaka [Fri, 17 Aug 2012 21:28:04 +0000 (21:28 +0000)]
Correct MCJIT functionality for MIPS32 architecture.

No new tests are added.
All tests in ExecutionEngine/MCJIT that have been failing pass after this patch
is applied (when "make check" is done on a mips board).

Patch by Petar Jovanovic.

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

11 years agoImplement stack protectors for structures with character arrays in them.
Bill Wendling [Fri, 17 Aug 2012 20:59:56 +0000 (20:59 +0000)]
Implement stack protectors for structures with character arrays in them.
<rdar://problem/10545247>

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

11 years agoAvoid folding ADD instructions with FI operands.
Jakob Stoklund Olesen [Fri, 17 Aug 2012 20:55:34 +0000 (20:55 +0000)]
Avoid folding ADD instructions with FI operands.

PEI can't handle the pseudo-instructions. This can be removed when the
pseudo-instructions are replaced by normal predicated instructions.

Fixes PR13628.

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

11 years agoAdd stub methods for mips assembly matcher.
Akira Hatanaka [Fri, 17 Aug 2012 20:16:42 +0000 (20:16 +0000)]
Add stub methods for mips assembly matcher.

Patch by Vladimir Medic.

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

11 years agoMemoryBuiltins: Properly guard ObjectSizeOffsetVisitor against cycles in the IR.
Benjamin Kramer [Fri, 17 Aug 2012 19:26:41 +0000 (19:26 +0000)]
MemoryBuiltins: Properly guard ObjectSizeOffsetVisitor against cycles in the IR.

The previous fix only checked for simple cycles, use a set to catch longer
cycles too.

Drop the broken check from the ObjectSizeOffsetEvaluator. The BoundsChecking
pass doesn't have to deal with invalid IR like InstCombine does.

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

11 years agoChange the `linker_private_weak_def_auto' linkage to `linkonce_odr_auto_hide' to
Bill Wendling [Fri, 17 Aug 2012 18:33:14 +0000 (18:33 +0000)]
Change the `linker_private_weak_def_auto' linkage to `linkonce_odr_auto_hide' to
make it more consistent with its intended semantics.

The `linker_private_weak_def_auto' linkage type was meant to automatically hide
globals which never had their addresses taken. It has nothing to do with the
`linker_private' linkage type, which outputs the symbols with a `l' (ell) prefix
among other things.

The intended semantic is more like the `linkonce_odr' linkage type.

Change the name of the linkage type to `linkonce_odr_auto_hide'. And therefore
changing the semantics so that it produces the correct output for the linker.

Note: The old linkage name `linker_private_weak_def_auto' will still parse but
is not a synonym for `linkonce_odr_auto_hide'. This should be removed in 4.0.
<rdar://problem/11754934>

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

11 years agoAssert that dominates is not given a multiple edge. Finding out if we have
Rafael Espindola [Fri, 17 Aug 2012 18:21:28 +0000 (18:21 +0000)]
Assert that dominates is not given a multiple edge. Finding out if we have
multiple edges between two blocks is linear. If the caller is iterating all
edges leaving a BB that would be a square time algorithm. It is more efficient
to have the callers handle that case.

Currently the only callers are:
* GVN: already avoids the multiple edge case.
* Verifier: could only hit this assert when looking at an invalid invoke. Since
it already rejects the invoke, just avoid computing the dominance for it.

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

11 years agoAdd comment, clean up code. No functional change.
Jakob Stoklund Olesen [Fri, 17 Aug 2012 16:59:09 +0000 (16:59 +0000)]
Add comment, clean up code. No functional change.

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

11 years agoTargetLowering: Use the large shift amount during legalize types. The legalizer may...
Benjamin Kramer [Fri, 17 Aug 2012 15:54:21 +0000 (15:54 +0000)]
TargetLowering: Use the large shift amount during legalize types. The legalizer may call us with an overly large type.

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

11 years agoUse standard pattern for iterate+erase.
Jakob Stoklund Olesen [Fri, 17 Aug 2012 14:38:59 +0000 (14:38 +0000)]
Use standard pattern for iterate+erase.

Increment the MBB iterator at the top of the loop to properly handle the
current (and previous) instructions getting erased.

This fixes PR13625.

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

11 years agoGuard MemoryBuiltins against self-looping GEPs, which can occur in unreachable code...
Benjamin Kramer [Fri, 17 Aug 2012 14:16:37 +0000 (14:16 +0000)]
Guard MemoryBuiltins against self-looping GEPs, which can occur in unreachable code due to constant propagation.

Fixes PR13621.

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

11 years agoFix broken check lines.
Benjamin Kramer [Fri, 17 Aug 2012 12:28:26 +0000 (12:28 +0000)]
Fix broken check lines.

I really need to find a way to automate this, but I can't come up with a regex
that has no false positives while handling tricky cases like custom check
prefixes.

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

11 years agoImplement NEON domain switching for scalar <-> S-register vmovs on ARM
Tim Northover [Fri, 17 Aug 2012 11:32:52 +0000 (11:32 +0000)]
Implement NEON domain switching for scalar <-> S-register vmovs on ARM

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

11 years agoInsertion of NoFolder functions to avoid ambiguous overload warnings or errors about...
Jin-Gu Kang [Fri, 17 Aug 2012 08:54:57 +0000 (08:54 +0000)]
Insertion of NoFolder functions to avoid ambiguous overload warnings or errors about whether to convert Idx to ArrayRef<Constant *> or ArrayRef<Value *> like ConstantFolder and TargetFolder.

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

11 years agoUse nested switch to select arguments to reduce calls to EmitPCMP.
Craig Topper [Fri, 17 Aug 2012 07:15:56 +0000 (07:15 +0000)]
Use nested switch to select arguments to reduce calls to EmitPCMP.

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

11 years agoMake ReplaceATOMIC_BINARY_64 a static function. Use a nested switch to reduce to...
Craig Topper [Fri, 17 Aug 2012 06:55:11 +0000 (06:55 +0000)]
Make ReplaceATOMIC_BINARY_64 a static function. Use a nested switch to reduce to only a single call to it thus allowing it to be inlined by the compiler.

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

11 years agoTest commit.
Pranav Bhandarkar [Fri, 17 Aug 2012 06:36:26 +0000 (06:36 +0000)]
Test commit.
include/llvm/IntrinsicsHexagon.td: Hexagon_Intrinsic is the base class
for all Hexagon intrinsics and not altivec intrinsics.

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

11 years agoRemove unnecessary include of ARMGenInstrInfo.inc.
Craig Topper [Fri, 17 Aug 2012 06:21:09 +0000 (06:21 +0000)]
Remove unnecessary include of ARMGenInstrInfo.inc.

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

11 years agoDeclare some for loop indices inside the for loop statement.
Craig Topper [Fri, 17 Aug 2012 05:42:16 +0000 (05:42 +0000)]
Declare some for loop indices inside the for loop statement.

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

11 years agoFix up indentation of outputted decode function for readability.
Craig Topper [Fri, 17 Aug 2012 05:16:15 +0000 (05:16 +0000)]
Fix up indentation of outputted decode function for readability.

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

11 years agolit: Show actually created count of threads. The incorrect threads count is printed...
NAKAMURA Takumi [Fri, 17 Aug 2012 04:15:41 +0000 (04:15 +0000)]
lit: Show actually created count of threads. The incorrect threads count is printed if the number of tests are less than the number of default threads.

Thanks to Vinson Lee, reported in PR13620.

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

11 years agoFlatten the aligned-char-array utility template to be a directly
Chandler Carruth [Fri, 17 Aug 2012 01:47:25 +0000 (01:47 +0000)]
Flatten the aligned-char-array utility template to be a directly
templated union at the request of Richard Smith. This makes it
substantially easier to type. =]

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

11 years agoAdd ADD and SUB to the predicable ARM instructions.
Jakob Stoklund Olesen [Thu, 16 Aug 2012 23:21:55 +0000 (23:21 +0000)]
Add ADD and SUB to the predicable ARM instructions.

It is not my plan to duplicate the entire ARM instruction set with
predicated versions. We need a way of representing predicated
instructions in SSA form without requiring a separate opcode.

Then the pseudo-instructions can go away.

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

11 years agoHandle ARM MOVCC optimization in PeepholeOptimizer.
Jakob Stoklund Olesen [Thu, 16 Aug 2012 23:14:20 +0000 (23:14 +0000)]
Handle ARM MOVCC optimization in PeepholeOptimizer.

Use the target independent select analysis hooks.

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

11 years agoAdd an MCID::Select flag and TII hooks for optimizing selects.
Jakob Stoklund Olesen [Thu, 16 Aug 2012 23:11:47 +0000 (23:11 +0000)]
Add an MCID::Select flag and TII hooks for optimizing selects.

Select instructions pick one of two virtual registers based on a
condition, like x86 cmov. On targets like ARM that support predication,
selects can sometimes be eliminated by predicating the instruction
defining one of the operands.

Teach PeepholeOptimizer to recognize select instructions, and ask the
target to optimize them.

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

11 years agoRevert r162034, r162035 and r162037.
Roman Divacky [Thu, 16 Aug 2012 19:07:59 +0000 (19:07 +0000)]
Revert r162034, r162035 and r162037.

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

11 years agoDefine and handle additional fixup kinds. By Adhemerval Zanella.
Roman Divacky [Thu, 16 Aug 2012 18:37:52 +0000 (18:37 +0000)]
Define and handle additional fixup kinds. By Adhemerval Zanella.

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

11 years agoAdd PPC64 relocations definitions, by Adhemerval Zanella.
Roman Divacky [Thu, 16 Aug 2012 18:31:29 +0000 (18:31 +0000)]
Add PPC64 relocations definitions, by Adhemerval Zanella.

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

11 years agoHandle PowerPC.
Roman Divacky [Thu, 16 Aug 2012 18:30:03 +0000 (18:30 +0000)]
Handle PowerPC.

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

11 years agoFix typo and grammar. By Adhemerval Zanella.
Roman Divacky [Thu, 16 Aug 2012 18:19:29 +0000 (18:19 +0000)]
Fix typo and grammar. By Adhemerval Zanella.

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

11 years agoTeach GVN to reason about edges dominating uses. This allows it to handle cases
Rafael Espindola [Thu, 16 Aug 2012 15:09:43 +0000 (15:09 +0000)]
Teach GVN to reason about edges dominating uses. This allows it to handle cases
where some fact lake a=b dominates a use in a phi, but doesn't dominate the
basic block itself.

This feature could also be implemented by splitting critical edges, but at least
with the current algorithm reasoning about the dominance directly is faster.

The time for running "opt -O2" in the testcase in pr10584 is 1.003 times slower
and on gcc as a single file it is 1.0007 times faster.

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

11 years agoAdd dump/dumpr methods to SDValue.
Nadav Rotem [Thu, 16 Aug 2012 07:39:52 +0000 (07:39 +0000)]
Add dump/dumpr methods to SDValue.

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

11 years ago[arm-fast-isel] Add support for fastcc.
Jush Lu [Thu, 16 Aug 2012 05:15:53 +0000 (05:15 +0000)]
[arm-fast-isel] Add support for fastcc.

Without fastcc support, the caller just falls through to CallingConv::C
for fastcc, but callee still uses fastcc, this inconsistency of calling
convention is a problem, and fastcc support can fix it.

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

11 years agoPatch to enable FMA on bdver2 target. Make XOP feature enable FMA4 as well.
Anitha Boyapati [Thu, 16 Aug 2012 04:04:02 +0000 (04:04 +0000)]
Patch to enable FMA on bdver2 target. Make XOP feature enable FMA4 as well.

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

11 years agogit-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162010 91177308-0d34-0410...
Anitha Boyapati [Thu, 16 Aug 2012 03:50:04 +0000 (03:50 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162010 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTest case for r162008.
Akira Hatanaka [Thu, 16 Aug 2012 03:48:41 +0000 (03:48 +0000)]
Test case for r162008.

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

11 years agoAdd Android ABI to Mips backend to handle functions returning vectors of four
Akira Hatanaka [Thu, 16 Aug 2012 03:48:05 +0000 (03:48 +0000)]
Add Android ABI to Mips backend to handle functions returning vectors of four
floats.

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

11 years agobug in experimental targets
Victor Oliveira [Wed, 15 Aug 2012 22:35:36 +0000 (22:35 +0000)]
bug in experimental targets

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

11 years agoFold predicable instructions into MOVCC / t2MOVCC.
Jakob Stoklund Olesen [Wed, 15 Aug 2012 22:16:39 +0000 (22:16 +0000)]
Fold predicable instructions into MOVCC / t2MOVCC.

The ARM select instructions are just predicated moves. If the select is
the only use of an operand, the instruction defining the operand can be
predicated instead, saving one instruction and decreasing register
pressure.

This implementation can turn AND/ORR/EOR instructions into their
corresponding ANDCC/ORRCC/EORCC variants. Ideally, we should be able to
predicate any instruction, but we don't yet support predicated
instructions in SSA form.

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

11 years agoRemove dead flag.
Bill Wendling [Wed, 15 Aug 2012 21:18:10 +0000 (21:18 +0000)]
Remove dead flag.

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

11 years agoRework test so that it reproduces the error without the horrible flag.
Bill Wendling [Wed, 15 Aug 2012 21:10:18 +0000 (21:10 +0000)]
Rework test so that it reproduces the error without the horrible flag.

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

11 years agoRemove invalid test. This test requires that dead basic blocks be kept
Bill Wendling [Wed, 15 Aug 2012 20:54:09 +0000 (20:54 +0000)]
Remove invalid test. This test requires that dead basic blocks be kept
around. That's not how we do things. Besides, the commit message tells us that
it is covered by the GCC test suite.

------------------------------------------------------------------------
r127497 | zwarich | 2011-03-11 13:51:56 -0800 (Fri, 11 Mar 2011) | 3 lines

Fix the GCC test suite issue exposed by r127477, which was caused by stack
protector insertion not working correctly with unreachable code. Since that
revision was rolled out, this test doesn't actual fail before this fix.
------------------------------------------------------------------------

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

11 years agoFixed a problem in the JIT memory allocator where
Sean Callanan [Wed, 15 Aug 2012 20:53:52 +0000 (20:53 +0000)]
Fixed a problem in the JIT memory allocator where
allocations of executable memory would not be padded
to account for the size of the allocation header.
This resulted in undersized allocations, meaning that
when the allocation was written to later the next
allocation's header would be corrupted.

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

11 years agoAdd a CoveringSubRegIndices field to SubRegIndex records.
Jakob Stoklund Olesen [Wed, 15 Aug 2012 20:15:48 +0000 (20:15 +0000)]
Add a CoveringSubRegIndices field to SubRegIndex records.

This can be used to tell TableGen to use a specific SubRegIndex instead
of synthesizing one when discovering all sub-registers.

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

11 years agoProperly test the LLVM_USE_RVALUE_REFERENCES macro.
Michael J. Spencer [Wed, 15 Aug 2012 19:21:42 +0000 (19:21 +0000)]
Properly test the LLVM_USE_RVALUE_REFERENCES macro.

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

11 years agoProperly test the LLVM_USE_RVALUE_REFERENCES macro.
Michael J. Spencer [Wed, 15 Aug 2012 19:16:27 +0000 (19:16 +0000)]
Properly test the LLVM_USE_RVALUE_REFERENCES macro.

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

11 years ago[PathV2] Add mapped_file_region. Implementation for Windows and POSIX.
Michael J. Spencer [Wed, 15 Aug 2012 19:05:47 +0000 (19:05 +0000)]
[PathV2] Add mapped_file_region. Implementation for Windows and POSIX.

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

11 years agoAdd LLVM_DELETED_FUNCTION compatibility macro.
Michael J. Spencer [Wed, 15 Aug 2012 18:54:36 +0000 (18:54 +0000)]
Add LLVM_DELETED_FUNCTION compatibility macro.

This should replace uses of:

class A {
  A(const &A); // DO NOT IMPLEMENT
public:
  ...
};

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

11 years agoFix a typo in VariadicFunction.h that leads to invalid code in macro expansion.
Chad Rosier [Wed, 15 Aug 2012 18:48:14 +0000 (18:48 +0000)]
Fix a typo in VariadicFunction.h that leads to invalid code in macro expansion.
Patch by Andy Gibbs <andyg1001@hotmail.co.uk>

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

11 years agoFix another roundToIntegral bug where very large values could become infinity. Probl...
Owen Anderson [Wed, 15 Aug 2012 18:28:45 +0000 (18:28 +0000)]
Fix another roundToIntegral bug where very large values could become infinity.  Problem and solution identified by Steve Canon.

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

11 years agoMake synthesized sub-register indexes available in the target namespace.
Jakob Stoklund Olesen [Wed, 15 Aug 2012 18:00:55 +0000 (18:00 +0000)]
Make synthesized sub-register indexes available in the target namespace.

TableGen sometimes synthesizes missing sub-register indexes. Emit these
indexes as enumerators in the target namespace along with the
user-defined ones.

Also take this opportunity to stop creating new Record objects for
synthetic indexes.

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

11 years agoUse vld1/vst1 to load/store f64 if alignment is < 4 and the target allows unaligned...
Evan Cheng [Wed, 15 Aug 2012 17:44:53 +0000 (17:44 +0000)]
Use vld1/vst1 to load/store f64 if alignment is < 4 and the target allows unaligned access. rdar://12091029

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

11 years agoFix typo in comment.
Owen Anderson [Wed, 15 Aug 2012 16:42:53 +0000 (16:42 +0000)]
Fix typo in comment.

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

11 years agoAdd missing Rfalse operand to the predicated pseudo-instructions.
Jakob Stoklund Olesen [Wed, 15 Aug 2012 16:17:24 +0000 (16:17 +0000)]
Add missing Rfalse operand to the predicated pseudo-instructions.

When predicating this instruction:

  Rd = ADD Rn, Rm

We need an extra operand to represent the value given to Rd when the
predicate is false:

  Rd = ADDCC Rfalse, Rn, Rm, pred

The Rd and Rfalse operands are different registers while in SSA form.
Rfalse is tied to Rd to make sure they get the same register during
register allocation.

Previously, Rd and Rn were tied, but that is not required.

Compare to MOVCC:

  Rd = MOVCC Rfalse, Rtrue, pred

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

11 years agoSet the branch probability of branching to the 'normal' destination of an invoke
Bill Wendling [Wed, 15 Aug 2012 12:22:35 +0000 (12:22 +0000)]
Set the branch probability of branching to the 'normal' destination of an invoke
instruction to something absurdly high, while setting the probability of
branching to the 'unwind' destination to the bare minimum. This should set cause
the normal destination's invoke blocks to be moved closer to the invoke.

PR13612

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

11 years agoFix a const violation in the generated disassembler.
Benjamin Kramer [Wed, 15 Aug 2012 10:26:44 +0000 (10:26 +0000)]
Fix a const violation in the generated disassembler.

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

11 years ago[asan] implement --asan-always-slow-path, which is a part of the improvement to handl...
Kostya Serebryany [Wed, 15 Aug 2012 08:58:58 +0000 (08:58 +0000)]
[asan] implement --asan-always-slow-path, which is a part of the improvement to handle unaligned partially OOB accesses. See code.google.com/p/address-sanitizer/issues/detail?id=100

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

11 years agoFix a problem with APFloat::roundToIntegral where it would return incorrect results...
Owen Anderson [Wed, 15 Aug 2012 05:39:46 +0000 (05:39 +0000)]
Fix a problem with APFloat::roundToIntegral where it would return incorrect results for negative inputs to trunc.  Add unit tests to verify this behavior.

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

11 years agofix infinite loop in instcombine with more than 4GB memcpy
Michael Liao [Wed, 15 Aug 2012 03:49:59 +0000 (03:49 +0000)]
fix infinite loop in instcombine with more than 4GB memcpy

- memcpy size is wrongly truncated into 32-bit and treat 8GB memcpy is
  0-sized memcpy
- as 0-sized memcpy/memset is already removed before SimplifyMemTransfer
  and SimplifyMemSet in visitCallInst, replace 0 checking with
  assertions.
- replace getZExtValue() with getLimitedValue() according to
  Eli Friedman

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

11 years agoFix a typo that led to a failure to correctly verify bitcast instructions.
Nick Lewycky [Wed, 15 Aug 2012 02:37:07 +0000 (02:37 +0000)]
Fix a typo that led to a failure to correctly verify bitcast instructions.
Patch by Stephen Hines!

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

11 years agoFix undefined behavior: don't perform array indexing through a potentially null
Richard Smith [Wed, 15 Aug 2012 01:39:31 +0000 (01:39 +0000)]
Fix undefined behavior: don't perform array indexing through a potentially null
pointer.

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

11 years agoThe names of VFP variants of half-to-float conversion instructions were
Anton Korobeynikov [Tue, 14 Aug 2012 23:36:01 +0000 (23:36 +0000)]
The names of VFP variants of half-to-float conversion instructions were
reversed. This leads to wrong codegen for float-to-half conversion
intrinsics which are used to support storage-only fp16 type.
NEON variants of same instructions are fine.

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

11 years agoThis needs braces. Spotted by Bill.
Eric Christopher [Tue, 14 Aug 2012 23:32:15 +0000 (23:32 +0000)]
This needs braces. Spotted by Bill.

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

11 years agominor fix of X86ISD::VSEXT_MOVL dump
Michael Liao [Tue, 14 Aug 2012 22:53:17 +0000 (22:53 +0000)]
minor fix of X86ISD::VSEXT_MOVL dump

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

11 years ago[yaml2obj] Fix incorrect use of signed values.
Michael J. Spencer [Tue, 14 Aug 2012 22:42:31 +0000 (22:42 +0000)]
[yaml2obj] Fix incorrect use of signed values.

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

11 years agofix PR11334
Michael Liao [Tue, 14 Aug 2012 21:24:47 +0000 (21:24 +0000)]
fix PR11334

- FP_EXTEND only support extending from vectors with matching elements.
  This results in the scalarization of extending to v2f64 from v2f32,
  which will be legalized to v4f32 not matching with v2f64.
- add X86-specific VFPEXT supproting extending from v4f32 to v2f64.
- add BUILD_VECTOR lowering helper to recover back the original
  extending from v4f32 to v2f64.
- test case is enhanced to include different vector width.

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

11 years agoSwitch the fixed-length disassembler to be table-driven.
Jim Grosbach [Tue, 14 Aug 2012 19:06:05 +0000 (19:06 +0000)]
Switch the fixed-length disassembler to be table-driven.

Refactor the TableGen'erated fixed length disassemblmer to use a
table-driven state machine rather than a massive set of nested
switch() statements.

As a result, the ARM Disassembler (ARMDisassembler.cpp) builds much more
quickly and generates a smaller end result. For a Release+Asserts build on
a 16GB 3.4GHz i7 iMac w/ SSD:

Time to compile at -O2 (averaged w/ hot caches):
  Previous: 35.5s
  New:       8.9s

TEXT size:
  Previous: 447,251
  New:      297,661

Builds in 25% of the time previously required and generates code 66% of
the size.

Execution time of the disassembler is only slightly slower (7% disassembling
10 million ARM instructions, 19.6s vs 21.0s). The new implementation has
not yet been tuned, however, so the performance should almost certainly
be recoverable should it become a concern.

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

11 years agoFix the construction of the magic constant for roundToIntegral to be 64-bit safe...
Owen Anderson [Tue, 14 Aug 2012 18:51:15 +0000 (18:51 +0000)]
Fix the construction of the magic constant for roundToIntegral to be 64-bit safe.  Fixes c-torture/execute/990826-0.c

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

11 years agoFix the make update target to work even when sub repo repositories are ignored.
David Blaikie [Tue, 14 Aug 2012 18:33:50 +0000 (18:33 +0000)]
Fix the make update target to work even when sub repo repositories are ignored.

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

11 years agoUpdate configure.
Daniel Dunbar [Tue, 14 Aug 2012 18:14:22 +0000 (18:14 +0000)]
Update configure.

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

11 years ago[configure] Add a --enable-keep-symbols configure flag.
Daniel Dunbar [Tue, 14 Aug 2012 18:14:20 +0000 (18:14 +0000)]
[configure] Add a --enable-keep-symbols configure flag.

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

11 years ago[asan] insert crash basic blocks inline as opposed to inserting them at the end of...
Kostya Serebryany [Tue, 14 Aug 2012 14:05:50 +0000 (14:05 +0000)]
[asan] insert crash basic blocks inline as opposed to inserting them at the end of the function. This doesn't seem to fix or break anything, but is considered to be more friendly to downstream passes (test change)

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

11 years ago[asan] insert crash basic blocks inline as opposed to inserting them at the end of...
Kostya Serebryany [Tue, 14 Aug 2012 14:04:51 +0000 (14:04 +0000)]
[asan] insert crash basic blocks inline as opposed to inserting them at the end of the function. This doesn't seem to fix or break anything, but is considered to be more friendly to downstream passes

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

11 years agoFactor duplicate calls to getUNDEF in several functions.
Craig Topper [Tue, 14 Aug 2012 08:18:43 +0000 (08:18 +0000)]
Factor duplicate calls to getUNDEF in several functions.

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

11 years agoRe-factor intrinsic lowering to combine common parts of similar intrinsics. Reduces...
Craig Topper [Tue, 14 Aug 2012 07:43:25 +0000 (07:43 +0000)]
Re-factor intrinsic lowering to combine common parts of similar intrinsics. Reduces compiled code size a little bit.

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

11 years agoChange greater than to greater than or equal so that an identical sized store to...
Craig Topper [Tue, 14 Aug 2012 07:32:05 +0000 (07:32 +0000)]
Change greater than to greater than or equal so that an identical sized store to the same offset is treated as completing overwriting.

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

11 years agoFix undefined behavior: binding null pointer to reference. No functionality change.
Richard Smith [Tue, 14 Aug 2012 05:31:26 +0000 (05:31 +0000)]
Fix undefined behavior: binding null pointer to reference. No functionality change.

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

11 years agoDuring the CodeGenPrepare we often lower intrinsics (such as objsize)
Nadav Rotem [Tue, 14 Aug 2012 05:19:07 +0000 (05:19 +0000)]
During the CodeGenPrepare we often lower intrinsics (such as objsize)
and allow some optimizations to turn conditional branches into unconditional.
This commit adds a simple control-flow optimization which merges two consecutive
basic blocks which are connected by a single edge. This allows the codegen to
operate on larger basic blocks.

rdar://11973998

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

11 years agoGrammar.
Eric Christopher [Tue, 14 Aug 2012 05:13:29 +0000 (05:13 +0000)]
Grammar.

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

11 years agoAvoid undefined behavior in DenseMap::shrink_and_clear(). Log2_32_Ceil(0)
Richard Smith [Tue, 14 Aug 2012 02:56:51 +0000 (02:56 +0000)]
Avoid undefined behavior in DenseMap::shrink_and_clear(). Log2_32_Ceil(0)
returns 32. This change mirrors the corresponding code in
SmallDenseMap::shrink_and_clear().

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

11 years agoTypo.
Eric Christopher [Tue, 14 Aug 2012 01:09:10 +0000 (01:09 +0000)]
Typo.

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

11 years agollvm/test/CodeGen/ARM/floorf.ll: Add explicit -mtriple=arm-unknown-unknown, or it...
NAKAMURA Takumi [Tue, 14 Aug 2012 00:56:06 +0000 (00:56 +0000)]
llvm/test/CodeGen/ARM/floorf.ll: Add explicit -mtriple=arm-unknown-unknown, or it fails on msvc.

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

11 years agoAdd a roundToIntegral method to APFloat, which can be parameterized over various...
Owen Anderson [Mon, 13 Aug 2012 23:32:49 +0000 (23:32 +0000)]
Add a roundToIntegral method to APFloat, which can be parameterized over various rounding modes.  Use this to implement SelectionDAG constant folding of FFLOOR, FCEIL, and FTRUNC.

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

11 years agoTransfer weights in transferSuccessorsAndUpdatePHIs().
Jakob Stoklund Olesen [Mon, 13 Aug 2012 23:13:25 +0000 (23:13 +0000)]
Transfer weights in transferSuccessorsAndUpdatePHIs().

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

11 years agoPrint out MachineBasicBlock successor weights when available.
Jakob Stoklund Olesen [Mon, 13 Aug 2012 23:13:23 +0000 (23:13 +0000)]
Print out MachineBasicBlock successor weights when available.

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

11 years agoLICM uses AliasSet information to hoist and sink instructions. However, other passes...
Nadav Rotem [Mon, 13 Aug 2012 23:06:54 +0000 (23:06 +0000)]
LICM uses AliasSet information to hoist and sink instructions. However, other passes, such as LoopRotate
may invalidate its AliasSet because SSAUpdater does not update the AliasSet properly.
This patch teaches SSAUpdater to notify AliasSet that it made changes.
The testcase in PR12901 is too big to be useful and I could not reduce it to a normal size.

rdar://11872059 PR12901

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

11 years agoMemoryDependenceAnalysis attempts to find the first memory dependency for function...
Nadav Rotem [Mon, 13 Aug 2012 23:03:43 +0000 (23:03 +0000)]
MemoryDependenceAnalysis attempts to find the first memory dependency for function calls.
Currently, if GetLocation reports that it did not find a valid pointer (this is the case for volatile load/stores),
we ignore the result. This patch adds code to handle the cases where we did not obtain a valid pointer.

rdar://11872864  PR12899

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

11 years agoARM: Move Thumb2 tests to Thumb2 test file and fix CHECK lines.
Jim Grosbach [Mon, 13 Aug 2012 22:25:44 +0000 (22:25 +0000)]
ARM: Move Thumb2 tests to Thumb2 test file and fix CHECK lines.

These tests weren't actually being run before (missing ':' after CHECK).

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

11 years agoRemove the TII::scheduleTwoAddrSource() hook.
Jakob Stoklund Olesen [Mon, 13 Aug 2012 21:52:57 +0000 (21:52 +0000)]
Remove the TII::scheduleTwoAddrSource() hook.

It never does anything when running 'make check', and it get's in the
way of updating live intervals in 2-addr.

The hook was originally added to help form IT blocks in Thumb2 code
before register allocation, but the pass ordering has changed since
then, and we run if-conversion after register allocation now.

When the MI scheduler is enabled, there will be no less than two
schedulers between 2-addr and Thumb2ITBlockPass, so this hook is
unlikely to help anything.

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

11 years agoRename test since it's not linux-specific.
Bill Wendling [Mon, 13 Aug 2012 21:32:42 +0000 (21:32 +0000)]
Rename test since it's not linux-specific.

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

11 years agoARM: enable struct byval for AAPCS-VFP.
Manman Ren [Mon, 13 Aug 2012 21:22:50 +0000 (21:22 +0000)]
ARM: enable struct byval for AAPCS-VFP.
This change is to be enabled in clang.

rdar://9877866

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

11 years agoWhitespace cleanup.
Bill Wendling [Mon, 13 Aug 2012 21:20:43 +0000 (21:20 +0000)]
Whitespace cleanup.

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

11 years agoCount triangles and diamonds in early if-conversion.
Jakob Stoklund Olesen [Mon, 13 Aug 2012 21:03:27 +0000 (21:03 +0000)]
Count triangles and diamonds in early if-conversion.

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

11 years agoDelete dead typedef.
Jakob Stoklund Olesen [Mon, 13 Aug 2012 21:03:25 +0000 (21:03 +0000)]
Delete dead typedef.

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

11 years agoHandle extra Tail predecessors in if-conversion.
Jakob Stoklund Olesen [Mon, 13 Aug 2012 20:49:04 +0000 (20:49 +0000)]
Handle extra Tail predecessors in if-conversion.

It is still possible to if-convert if the tail block has extra
predecessors, but the tail phis must be rewritten instead of being
removed.

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

11 years ago[Hexagon] Don't mark callee saved registers as clobbered by a tail call
Arnold Schwaighofer [Mon, 13 Aug 2012 19:54:01 +0000 (19:54 +0000)]
[Hexagon] Don't mark callee saved registers as clobbered by a tail call

This was causing unnecessary spills/restores of callee saved registers.

Fixes PR13572.

Patch by Pranav Bhandarkar!

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

11 years agoFix failure on Atom bot due to r161769
Manman Ren [Mon, 13 Aug 2012 19:34:29 +0000 (19:34 +0000)]
Fix failure on Atom bot due to r161769

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