oota-llvm.git
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

11 years agoDo not optimize (or (and X,Y), Z) into BFI and other sequences if the AND ISDNode...
Nadav Rotem [Mon, 13 Aug 2012 18:52:44 +0000 (18:52 +0000)]
Do not optimize (or (and X,Y), Z) into BFI and other sequences if the AND ISDNode has more than one user.

rdar://11876519

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

11 years agoX86: move Int_CVTSD2SSrr, Int_CVTSI2SSrr, Int_CVTSI2SDrr, Int_CVTSS2SDrr from
Manman Ren [Mon, 13 Aug 2012 18:29:41 +0000 (18:29 +0000)]
X86: move Int_CVTSD2SSrr, Int_CVTSI2SSrr, Int_CVTSI2SDrr, Int_CVTSS2SDrr from
OpTbl1 to OpTbl2 since they have 3 operands and the last operand can be changed
to a memory operand.

PR13576

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

11 years agoAdd support for the %H output modifier.
Eric Christopher [Mon, 13 Aug 2012 18:18:52 +0000 (18:18 +0000)]
Add support for the %H output modifier.

Patch by Weiming Zhao.

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

11 years agoIgnore known externally-homed tools.
David Blaikie [Mon, 13 Aug 2012 17:50:44 +0000 (17:50 +0000)]
Ignore known externally-homed tools.

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

11 years agoX86: when auto-detecting the subtarget features, make sure use IsIntel to detect
Manman Ren [Mon, 13 Aug 2012 17:26:46 +0000 (17:26 +0000)]
X86: when auto-detecting the subtarget features, make sure use IsIntel to detect
Nehalem, Westmere and Sandy Bridge. AMD also has processor family 6.

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

11 years agoFix a documentation typo.
Nadav Rotem [Mon, 13 Aug 2012 15:29:53 +0000 (15:29 +0000)]
Fix a documentation typo.

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

11 years ago[asan] remove the code for --asan-merge-callbacks as it appears to be a bad idea...
Kostya Serebryany [Mon, 13 Aug 2012 14:08:46 +0000 (14:08 +0000)]
[asan] remove the code for --asan-merge-callbacks as it appears to be a bad idea. (partly related to Bug 13225)

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

11 years agoAdded test for non-static use of cl::opt (fixed in r160170)
Alexander Kornienko [Mon, 13 Aug 2012 10:43:36 +0000 (10:43 +0000)]
Added test for non-static use of cl::opt (fixed in r160170)

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

11 years agoAdd test for previous commit correcting NEON load patterns.
Tim Northover [Mon, 13 Aug 2012 10:38:45 +0000 (10:38 +0000)]
Add test for previous commit correcting NEON load patterns.

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

11 years agoUse correct loads for vector types during extending-load operations.
Tim Northover [Mon, 13 Aug 2012 09:06:31 +0000 (09:06 +0000)]
Use correct loads for vector types during extending-load operations.

Previously, we used VLD1.32 in all cases, however there are both 16 and 64-bit
accesses being selected, so we need to use an appropriate width load in those
cases.

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

11 years agoTidy up VSETCC lowering code a bit more by adding an llvm_unreachable and putting...
Craig Topper [Mon, 13 Aug 2012 03:42:38 +0000 (03:42 +0000)]
Tidy up VSETCC lowering code a bit more by adding an llvm_unreachable and putting an a couple if conditions in a better order.

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

11 years agoRefactor code a bit to share commonalities. No functional change intended.
Craig Topper [Mon, 13 Aug 2012 02:34:03 +0000 (02:34 +0000)]
Refactor code a bit to share commonalities. No functional change intended.

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

11 years agoFix an unused variable warning from r161742.
Craig Topper [Mon, 13 Aug 2012 01:26:45 +0000 (01:26 +0000)]
Fix an unused variable warning from r161742.

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

11 years agoRemove the LowerMMXCONCAT_VECTORS function. It could never execute because there...
Craig Topper [Mon, 13 Aug 2012 01:23:55 +0000 (01:23 +0000)]
Remove the LowerMMXCONCAT_VECTORS function. It could never execute because there are no legal 64-bit vector types that could be used as inputs to a 128-bit concat_vectors. Remove a target specific SDNode and its patterns that become unused as a result.

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

11 years agoGive this test an explicit triple.
Nick Lewycky [Sun, 12 Aug 2012 08:21:27 +0000 (08:21 +0000)]
Give this test an explicit triple.

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

11 years agoWhen emitting the PC range in an FDE, use the same data encoding for both ends
Nick Lewycky [Sun, 12 Aug 2012 08:09:45 +0000 (08:09 +0000)]
When emitting the PC range in an FDE, use the same data encoding for both ends
of the range. Fixes PR13581!

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

11 years agoRemove call to setOperationAction for SETCC of v4f32. SETCC returns an integer type...
Craig Topper [Sun, 12 Aug 2012 05:31:32 +0000 (05:31 +0000)]
Remove call to setOperationAction for SETCC of v4f32. SETCC returns an integer type not an FP type.

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

11 years agoRemove unnecessary call to setOperationAction for SETCC of v2i64 under SSE42. It...
Craig Topper [Sun, 12 Aug 2012 05:15:16 +0000 (05:15 +0000)]
Remove unnecessary call to setOperationAction for SETCC of v2i64 under SSE42. It was already called for the same under SSE2.

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

11 years agoRevert 161581: Patch to implement UMLAL/SMLAL instructions for the ARM
Arnold Schwaighofer [Sun, 12 Aug 2012 05:11:56 +0000 (05:11 +0000)]
Revert 161581: Patch to implement UMLAL/SMLAL instructions for the ARM
architecture

It broke MultiSource/Applications/JM/ldecod/ldecod on armv7 thumb O0 g and armv7
thumb O3.

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

11 years agoChange addTypeForNeon to use MVT instead of EVT so all the calls to getSimpleVT can...
Craig Topper [Sun, 12 Aug 2012 03:16:37 +0000 (03:16 +0000)]
Change addTypeForNeon to use MVT instead of EVT so all the calls to getSimpleVT can be removed.

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

11 years agoMake replace many calls to getSizeInBits() with is128BitVector/is256BitVector
Craig Topper [Sun, 12 Aug 2012 02:23:29 +0000 (02:23 +0000)]
Make replace many calls to getSizeInBits() with is128BitVector/is256BitVector

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

11 years agoUse MVT.isXBitVector instead of EVT.isXBitVector when setting up operation actions...
Craig Topper [Sun, 12 Aug 2012 00:34:56 +0000 (00:34 +0000)]
Use MVT.isXBitVector instead of EVT.isXBitVector when setting up operation actions. Compiles to smaller code.

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

11 years agofix PR13577, an issue introduced by r161687
Michael Liao [Sat, 11 Aug 2012 23:47:06 +0000 (23:47 +0000)]
fix PR13577, an issue introduced by r161687

- FCMOV only supports a subset of X86 conditions. Skip boolean
  simplification if X86 condition is not valid for FCMOV.
- add a minimal test case for PR13577.

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

11 years agoCreate isXBitVector methods in MVT and call them from EVT. This allows targets to...
Craig Topper [Sat, 11 Aug 2012 23:31:18 +0000 (23:31 +0000)]
Create isXBitVector methods in MVT and call them from EVT. This allows targets to call them with an MVT without needing to convert to EVT.

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

11 years agoMove setOperationAction for CONCAT_VECTORS for 256-bit vectors into loop since all...
Craig Topper [Sat, 11 Aug 2012 22:34:26 +0000 (22:34 +0000)]
Move setOperationAction for CONCAT_VECTORS for 256-bit vectors into loop since all 256-bit types are supported.

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

11 years agoMachineCSE: Hoist isConstantPhysReg out of the loop, it checks for overlaps already.
Benjamin Kramer [Sat, 11 Aug 2012 20:42:59 +0000 (20:42 +0000)]
MachineCSE: Hoist isConstantPhysReg out of the loop, it checks for overlaps already.

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

11 years agoPR13578: Teach MachineCSE that instructions that use a constant register can be CSE...
Benjamin Kramer [Sat, 11 Aug 2012 19:05:13 +0000 (19:05 +0000)]
PR13578: Teach MachineCSE that instructions that use a constant register can be CSE'd safely.

This is common e.g. when doing rip-relative addressing on x86_64.

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

11 years agoTidy up indentation. No functional change.
Craig Topper [Sat, 11 Aug 2012 17:53:00 +0000 (17:53 +0000)]
Tidy up indentation. No functional change.

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

11 years agoFix a cast that was casting away 'const' unnecessarily
Craig Topper [Sat, 11 Aug 2012 17:46:16 +0000 (17:46 +0000)]
Fix a cast that was casting away 'const' unnecessarily

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

11 years agoAdd a couple default: llvm_unreachable() to some switch statements. Fix a bad message...
Craig Topper [Sat, 11 Aug 2012 17:44:14 +0000 (17:44 +0000)]
Add a couple default: llvm_unreachable() to some switch statements. Fix a bad message in an existing llvm_unreachable.

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

11 years agoX86: when we are auto-detecting the subtarget features, make sure we turn on
Manman Ren [Fri, 10 Aug 2012 23:43:32 +0000 (23:43 +0000)]
X86: when we are auto-detecting the subtarget features, make sure we turn on
FeatureFastUAMem for Nehalem, Westmere and Sandy Bridge.

FeatureFastUAMem is already on if we pass in nehalem or westmere as a command
argument.

rdar: 7252306

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

11 years agoAdd a proper if-conversion cost model.
Jakob Stoklund Olesen [Fri, 10 Aug 2012 22:27:31 +0000 (22:27 +0000)]
Add a proper if-conversion cost model.

Detect when there is not enough available ILP, so if-conversion can't
speculate instructions for free.

Compute the lengthening of the critical path when inserting a select
instruction that depends on the condition as well as both sides of the
if.

Reject conversions that would stretch the critical path by more than
half a mispredict penalty.

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

11 years agoGive MachineTraceMetrics its own debug tag.
Jakob Stoklund Olesen [Fri, 10 Aug 2012 22:27:29 +0000 (22:27 +0000)]
Give MachineTraceMetrics its own debug tag.

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

11 years agoAdd more trace query functions.
Jakob Stoklund Olesen [Fri, 10 Aug 2012 22:27:27 +0000 (22:27 +0000)]
Add more trace query functions.

Trace::getResourceLength() computes the number of cycles required to
execute the trace when ignoring data dependencies. The number can be
compared to the critical path to estimate the trace ILP.

Trace::getPHIDepth() computes the data dependency depth of a PHI in a
trace successor that isn't necessarily part of the trace.

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

11 years agoThe normal edge of an invoke is not allowed to branch to a block with a
Eli Friedman [Fri, 10 Aug 2012 20:55:20 +0000 (20:55 +0000)]
The normal edge of an invoke is not allowed to branch to a block with a
landingpad.  Enforce it in the verifier, and fix the regression tests to match.

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

11 years agoARM: enable struct byval for AAPCS.
Manman Ren [Fri, 10 Aug 2012 20:39:38 +0000 (20:39 +0000)]
ARM: enable struct byval for AAPCS.
This change is to be enabled in clang.

rdar://9877866
PR://13350

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

11 years agoAdd getTPred() and getFPred() functions.
Jakob Stoklund Olesen [Fri, 10 Aug 2012 20:19:17 +0000 (20:19 +0000)]
Add getTPred() and getFPred() functions.

They identify the PHI predecessors in both diamonds and triangles.

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

11 years agoInclude loop-carried dependencies when computing instr heights.
Jakob Stoklund Olesen [Fri, 10 Aug 2012 20:11:38 +0000 (20:11 +0000)]
Include loop-carried dependencies when computing instr heights.

When a trace ends with a back-edge, include PHIs in the loop header in
the height computations. This makes the critical path through a loop
more accurate by including the latencies of the last instructions in the
loop.

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

11 years agoadd X86-specific DAG optimization to simplify boolean test
Michael Liao [Fri, 10 Aug 2012 19:58:13 +0000 (19:58 +0000)]
add X86-specific DAG optimization to simplify boolean test

- if a boolean test (X86ISD::CMP or X86ISD:SUB) checks a boolean value
  generated from X86ISD::SETCC, try to simplify the boolean value
  generation and checking by reusing the original EFLAGS with proper
  condition code
- add hooks to X86 specific SETCC/BRCOND/CMOV, the major 3 places
  consuming EFLAGS

part of patches fixing PR12312

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

11 years agoA couple of addition comment fixes
Eli Bendersky [Fri, 10 Aug 2012 18:30:44 +0000 (18:30 +0000)]
A couple of addition comment fixes

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