Commit Graph

20694 Commits

Author SHA1 Message Date
Venkatraman Govindaraju
1b41835f02 [Sparc] Correctly handle call to functions with ReturnsTwice attribute.
In sparc, setjmp stores only the registers %fp, %sp, %i7 and %o7. longjmp restores
the stack, and the callee-saved registers (all local/in registers: %i0-%i7, %l0-%l7)
using the stored %fp and register windows. However, this does not guarantee that the longjmp
will restore the registers, as they were when the setjmp was called. This is because these
registers may be clobbered after returning from setjmp, but before calling longjmp.

This patch prevents the registers %i0-%i5, %l0-l7 to live across the setjmp call using the register mask.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190033 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 05:32:16 +00:00
Andrew Trick
d4486ebd5f mi-sched: Force bottom up scheduling for generic targets.
Fast register pressure tracking currently only takes effect during
bottom up scheduling. Forcing this is a bit faster and simpler for
targets that don't have many scheduling constraints and don't need
top-down scheduling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190014 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 23:54:00 +00:00
Eric Christopher
efc47ec528 Remove hack ensuring that darwin didn't produce dwarf > 3 for modules
without a limiting factor.

Update all testcases accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190002 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 22:21:24 +00:00
Eric Christopher
1b290a139a Expand and rewrite comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189998 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:23:23 +00:00
Arnold Schwaighofer
b4b7a52ec5 Change swift/vldm test case to be less dependent on allocation order
'Force' values in registers using the calling convention. Now, we only depend on
the calling convention and that the allocator performs copy coalescing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189985 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 20:51:06 +00:00
Vincent Lejeune
f94eea9e11 R600: Use shared op optimization when checking cycle compatibility
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189981 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 19:53:54 +00:00
Vincent Lejeune
bb25a01d23 R600: Non vector only instruction can be scheduled on trans unit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189980 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 19:53:46 +00:00
Vincent Lejeune
09c52189ce R600: Remove fmul.v4f32.ll test which is redundant with fmul.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189978 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 19:53:22 +00:00
Rafael Espindola
2421572dd9 Merge these 2 tests in a single file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189975 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 19:19:32 +00:00
Arnold Schwaighofer
3d476a80e9 Swift: Only build vldm/vstm with q register aligned register lists
Unaligned vldm/vstm need more uops and therefore are slower in general on swift.

radar://14522102

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189961 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 17:41:16 +00:00
Silviu Baranga
87b120690b Fix scheduling for vldm/vstm instructions that load/store more than 32 bytes on Cortex-A9. This also makes the existing code more compact.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 17:05:18 +00:00
Rafael Espindola
9718158222 Revert "Add r159136 back now that pr13124 has been fixed."
This reverts commit r189886.

I found a corner case where this optimization is not valid:

Say we have a "linkonce_odr unnamed_addr" in two translation units:
* In TU 1 this optimization kicks in and makes it hidden.
* In TU 2 it gets const merged with a constant that is *not* unnamed_addr,
  resulting in a non unnamed_addr constant with default visibility.
* The static linker rules for combining visibility them produce a hidden
  symbol, which is incorrect from the point of view of the non unnamed_addr
  constant.

The one place we can do this is when we know that the symbol is not used from
another TU in the same shared object, i.e., during LTO. I will move it there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189954 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 16:09:01 +00:00
Rafael Espindola
9127334dad Error on linking appending globals with different unnamed_addr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189950 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 15:33:34 +00:00
Venkatraman Govindaraju
bf34f34642 [Sparc] Fix an assertion failure while lowering fcmp on long double.
This assertion is triggered because an integer constant is created with wrong
  type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189948 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 15:15:20 +00:00
Rafael Espindola
6947f10ec4 Fix linking of unnamed_addr in functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189945 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 14:59:03 +00:00
Rafael Espindola
254f75095b Rename in preparation for adding tests for function linking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189944 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 14:40:49 +00:00
Rafael Espindola
2396be0c6e Use CHECK-DAG instead of sort.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189942 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 14:35:48 +00:00
Rafael Espindola
3acfb58b17 Fix linking of unnamed_addr.
This was regression from r134829. When linking we have to be conservative. If
one of the symbols has a significant address, then the result should have it
too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189935 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 14:05:09 +00:00
Tim Northover
0415b1810b InstCombine: allow unmasked icmps to be combined with logical ops
"(icmp op i8 A, B)" is equivalent to "(icmp op i8 (A & 0xff), B)" as a
degenerate case. Allowing this as a "masked" comparison when analysing "(icmp)
&/| (icmp)" allows us to combine them in more cases.

rdar://problem/7625728

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189931 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 11:57:17 +00:00
Tim Northover
7bfabdac4e InstCombine: look for masked compares with subset relation
Even in cases which aren't universally optimisable like "(A & B) != 0 && (A &
C) != 0", the masks can make one of the comparisons completely redundant. In
this case, since we've gone to the effort of spotting masked comparisons we
should combine them.

rdar://problem/7625728

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189930 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 11:57:13 +00:00
Hao Liu
19fdc268c3 Inplement aarch64 neon instructions in AdvSIMD(shift). About 24 shift instructions:
sshr,ushr,ssra,usra,srshr,urshr,srsra,ursra,sri,shl,sli,sqshlu,sqshl,uqshl,shrn,sqrshrun,sqshrn,uqshr,sqrshrn,uqrshrn,sshll,ushll
 and 4 convert instructions:
      scvtf,ucvtf,fcvtzs,fcvtzu


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189925 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 09:28:24 +00:00
Michael Gottesman
dc42d031fb Revert "Revert "Remove the darwin gdb option, that version of gdb is now dead and the rest of the compatibility should be done on a dwarf-N level.""
This reverts commit r189913.

Talked with Eric on IRC. I am going to XFAIL the failing test since it
is using what Eric described as "the member hack" which was needed on
that old GDB.

Sorry for the noise!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189914 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 04:39:38 +00:00
Michael Gottesman
14ce9f1d25 Revert "Remove the darwin gdb option, that version of gdb is now dead and the rest of the compatibility should be done on a dwarf-N level."
This reverts commit r189903.

This commit broke the phase 1 buildbot for a while.

http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/6684

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189913 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 04:31:56 +00:00
Eric Christopher
0a69049b62 Remove the darwin gdb option, that version of gdb is now dead and
the rest of the compatibility should be done on a dwarf-N level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 02:02:10 +00:00
Rafael Espindola
79869ee59a Add r159136 back now that pr13124 has been fixed.
Original message:
If a constant or a function has linkonce_odr linkage and unnamed_addr, mark
hidden. Being linkonce_odr guarantees that it is available in every dso that
needs it. Being a constant/function with unnamed_addr guarantees that the
copies don't have to be merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189886 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 23:34:36 +00:00
Michael Gottesman
72196ab082 [objc-arc] Turn off the objc_retainBlock -> objc_retain optimization.
The reason that I am turning off this optimization is that there is an
additional case where a block can escape that has come up. Specifically, this
occurs when a block is used in a scope outside of its current scope.

This can cause a captured retainable object pointer whose life is preserved by
the objc_retainBlock to be deallocated before the block is invoked.

An example of the code needed to trigger the bug is:

----
\#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
  void (^somethingToDoLater)();

  {
    NSObject *obj = [NSObject new];

    somethingToDoLater = ^{
      [obj self]; // Crashes here
    };
  }

  NSLog(@"test.");

  somethingToDoLater();
  return 0;
}
----

In the next commit, I remove all the dead code that results from this.

Once I put in the fixing commit I will bring back the tests that I deleted in
this commit.

rdar://14802782.
rdar://14868830.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189869 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 22:40:54 +00:00
Michael Gottesman
08c560e782 [objc-arc] Move some block tests from basic.ll -> retain-block.ll and add some missing CHECK-LABELS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189868 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 22:40:50 +00:00
Matt Arsenault
330943afb7 Teach InstCombineLoadCast about address spaces.
This is another one that doesn't matter much,
but uses the right GEP index types in the first
place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189854 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 21:05:48 +00:00
Jim Grosbach
b81d7a8912 Revert "Revert "ARM: Improve pattern for isel mul of vector by scalar.""
This reverts commit r189648.

Fixes for the previously failing clang-side arm_neon_intrinsics test
cases will be checked in separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189841 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 20:08:17 +00:00
Eric Christopher
bd18c8d090 Add the rest of the stock attributes to the attribute table.
This won't affect the kinds of hashes we test for as we actually
do hashing based on form and attribute. Change the fission-hash
testcase one last time to handle DW_AT_comp_dir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189840 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 20:00:20 +00:00
Yi Jiang
89008539a3 In this patch we are trying to do two things:
1) If the width of vectorization list candidate is bigger than vector reg width, we will break it down to fit the vector reg.
2) We do not vectorize the width which is not power of two.

The performance result shows it will help some spec benchmarks. mesa improved 6.97% and ammp improved 1.54%. 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189830 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 17:26:04 +00:00
Joerg Sonnenberger
6217187ff2 Print string value for DT_RPATH and DT_RUNPATH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189829 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 17:13:53 +00:00
Richard Sandiford
8bce43648b [SystemZ] Add support for TMHH, TMHL, TMLH and TMLL
For now this just handles simple comparisons of an ANDed value with zero.
The CC value provides enough information to do any comparison for a
2-bit mask, and some nonzero comparisons with more populated masks,
but that's all future work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189819 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 15:38:35 +00:00
Evgeniy Stepanov
69086b2962 [msan] Fix handling of select with struct arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189796 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 13:05:29 +00:00
Evgeniy Stepanov
6a9b29ec9b [msan] Fix select instrumentation.
Select condition shadow was being ignored resulting in false negatives.
This change OR-s sign-extended condition shadow into the result shadow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 10:04:11 +00:00
Venkatraman Govindaraju
75ddb2bb34 [Sparc] Add support for soft long double (fp128).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189780 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 04:11:59 +00:00
Venkatraman Govindaraju
6ee0857bd7 [Sparc] Implement spill and load for long double(f128) registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189768 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 18:32:45 +00:00
Tilmann Scheller
195dd8a1ce ARM: Default to the Swift CPU when targeting armv7s/thumbv7s.
Test cases adjusted accordingly.

This fixes rdar://14871821.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189766 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 17:09:01 +00:00
Tilmann Scheller
5bed440eb1 Revert 189756 for now, it doesn't match what rdar://14871821 really wants.
What we really want is to enable Swift by default for *v7s triples (and there already seems to be some logic which attempts to do that). In that case the iOS version doesn't matter. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189763 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 15:48:17 +00:00
Tilmann Scheller
024e76b69b ARM: Default to Swift when compiling for iOS 6 or later.
Test cases adjusted accordingly.

This fixes rdar://14871821.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189756 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 12:01:58 +00:00
NAKAMURA Takumi
4629e0da6a FileCheck-ize three tests of llvm/test/CodeGen/X86/h-register(s).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189755 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 12:00:53 +00:00
NAKAMURA Takumi
b9edd20706 llvm/test/CodeGen/X86: Update tests with -mattr=-bmi not to take BMI, corresponding to Craig's r189742.
AMD Piledriver builder detected failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189754 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 12:00:46 +00:00
Craig Topper
69c474ffa8 Create BEXTR instructions for (and ((sra or srl) x, imm), (2**size - 1)). Fixes PR17028.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189742 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 07:53:17 +00:00
Elena Demikhovsky
cafcc99857 AVX-512: gather-scatter tests; added foldable instructions;
Specify GATHER/SCATTER as heavy instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189736 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 07:12:29 +00:00
Elena Demikhovsky
4ca0ce2594 llvm interpreter: select, shuffle and insertelement instructions.
This patch implements vector support for  select instruction and adds specific vector instructions : shuffle and insertelement. (tests are also included)
and functions lle_X_memset, lle_X_memcpy added.

Done by Veselov, Yuri (mailto:Yuri.Veselov@intel.com)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189735 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 06:40:09 +00:00
Elena Demikhovsky
6adcd58d3c AVX-512: Added GATHER and SCATTER instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189729 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-01 14:24:41 +00:00
Reed Kotler
b83c66eb5e Make sure we don't generate stubs for any of these functions because they
don't exist in libc. This is really not the right way to solve this problem;
but it's not clear to me at this time exactly what is the right way.
If we create stubs here, they will cause link errors because these functions
do not exist in libc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189727 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-01 04:12:59 +00:00
Benjamin Kramer
bc870037f6 SimplifyLibCalls: When emitting an overloaded fp function check that it's available.
The existing code missed some edge cases when e.g. we're going to emit sqrtf but
only the availability of sqrt was checked. This happens on odd platforms like
windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189724 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-31 18:19:35 +00:00
Bill Schmidt
11addd2a2f [PowerPC] Call support for fast-isel.
This patch adds fast-isel support for calls (but not intrinsic calls
or varargs calls).  It also removes a badly-formed assert.  There are
some new tests just for calls, and also for folding loads into
arguments on calls to avoid extra extends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189701 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 22:18:55 +00:00
Richard Mitton
d4b3168609 Fixed a bug where diassembling an instruction that had a prefix would cause LLVM to identify a 1-byte instruction, but then upon querying it for that 1-byte instruction would cause an undefined opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 21:19:48 +00:00