Commit Graph

63833 Commits

Author SHA1 Message Date
Tilmann Scheller
10b5086e6e ARM: Add GPR register class excluding LR for use with the ADR instruction.
This improves code generation for jump tables by avoiding the emission of "mov pc, lr" which could fool the processor into believing this is a return from a function causing mispredicts. The code generation logic for jump tables uses ADR to materialize the address of the jump target.

Patch by Daniel Stewart!
   


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190043 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 11:10:31 +00:00
Richard Sandiford
16277c4698 [SystemZ] Add NC, OC and XC
For now these are just used to handle scalar ANDs, ORs and XORs in which
all operands are memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190041 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 10:36:45 +00:00
Nick Lewycky
a83aeae350 Declare missing dependency on AliasAnalysis. Patch by Liu Xin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190035 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 08:19:58 +00:00
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
Bill Wendling
d6d2ef1582 Fix comments to reflect reality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190021 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 00:54:52 +00:00
Eric Christopher
edc8e7b4ff Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190019 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 00:22:35 +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
Nick Kledzik
a38c27be0f Add names for mach-o permissions bits and use the symbol names in place of magic numbers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190013 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 23:53:44 +00:00
Bill Wendling
19f066e0e0 Add missing header line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190004 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 22:35:41 +00:00
Bill Wendling
9e4bd87f47 Use ArrayRef instead of explicit container.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190003 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 22:35:29 +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
6509593cb6 Revert "Revert r189902 as the workaround shouldn't be necessary anymore."
Needs testcase updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190000 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:36:52 +00:00
Eric Christopher
a42c7d5db1 Revert r189902 as the workaround shouldn't be necessary anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189999 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:26:56 +00:00
Andrew Trick
3d6e70c857 comment typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:12:05 +00:00
Andrew Trick
ba9ec8ce80 Remove dead subtree limit code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189995 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:00:20 +00:00
Andrew Trick
da9f441854 -view-misched-dags, better pruning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189994 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:00:18 +00:00
Andrew Trick
ee5fd9cf10 mi-sched: DEBUG cleanup, call tracePick for unidirectional scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189993 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:00:16 +00:00
Andrew Trick
85d7f0be78 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189992 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:00:13 +00:00
Andrew Trick
16bb45c5c8 mi-sched: Suppress register pressure tracking when the scheduling window is too small.
If the instruction window is < NumRegs/2, pressure tracking is not
likely to be effective. The scheduler has to process a very large
number of tiny blocks. We want this to be fast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189991 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:00:11 +00:00
Andrew Trick
d1d0d37a19 mi-sched: Load clustering is a bit to expensive to enable unconditionally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189990 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:00:08 +00:00
Andrew Trick
00b5fa4c28 mi-sched: Reuse an invalid HazardRecognizer to save compile time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189989 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:00:05 +00:00
Andrew Trick
40b52bb8f2 mi-sched: bypass heuristic checks when regpressure tracking is disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189988 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 21:00:02 +00:00
Andrew Trick
42ebb3ad41 Added -misched-regpressure option.
Register pressure tracking is half the complexity of the
scheduler. It's useful to be able to turn it off for compile time and
performance comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189987 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 20:59:59 +00:00
Rafael Espindola
775079c227 Rename some variables to match the style guide.
I am about to patch this code, and this makes the diff far more readable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189982 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 20:08:46 +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
b3df27d440 R600: Use SchedModel enum for is{Trans,Vector}Only functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189979 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 19:53:30 +00:00
Eric Christopher
4dc211ae39 Unify and clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189977 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 19:53:21 +00:00
Jim Grosbach
1bfa80359e ARM: Teach A15 SDOptimizer to properly handle D-reg by-lane.
These instructions, such as vmul.f32, require the second source operand to
be in D0-D15 rather than the full D0-D31. When optimizing, make sure to
account for that by constraining the register class of a replacement virtual
register to be compatible with the virtual register(s) it's replacing.

I've been unsuccessful in creating a non-fragile regression test. This issue
was detected by the LLVM nightly test suite running on an A15 (Bullet).

PR17093: http://llvm.org/bugs/show_bug.cgi?id=17093

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189972 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 19:08:44 +00:00
Rafael Espindola
1d7df349ab Small simplification given that insert of an empty range is a nop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189971 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 18:53:21 +00:00
Rafael Espindola
0fb771667e Refactor duplicated logic to a helper function.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189969 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 18:37:36 +00:00
Rafael Espindola
8b08904e6c Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189967 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 18:16:02 +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
Alexander Kornienko
280e5eef43 Move generic isPrint and columnWidth implementations to a separate header/source to allow using both generic and system-dependent versions on win32.
Summary:
This is needed so we can use generic columnWidthUTF8 in clang-format on
win32 simultaneously with a separate system-dependent implementations of
isPrint/columnWidth in TextDiagnostic.cpp to avoid attempts to print Unicode
characters using narrow-character interfaces (which is not supported on Windows,
and we'll have to figure out how to handle this).

Reviewers: jordan_rose

Reviewed By: jordan_rose

CC: llvm-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D1559

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189952 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 16:00:12 +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
NAKAMURA Takumi
16eedf0ba0 Support/Process: Add comments about PageSize and AllocationGranularity on Cygwin and Win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189940 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 14:12:26 +00:00
NAKAMURA Takumi
81b135cc1e MemoryBuffer.cpp: Don't peek the next page if file is multiple of *physical* pagesize(4k) but is not multiple of AllocationGranularity(64k), when a null terminator is required, on cygwin and win32.
For example, r189780's SparcISelLowering.cpp has the size 98304. It crashed clang to touch a null terminator on cygwin.

FIXME: It's not good to hardcode 4096 here. dwPageSize shows 4096.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 14:12:19 +00:00
NAKAMURA Takumi
a53ee67e5e Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189938 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 14:12:12 +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
Michael Gottesman
c15c64fbeb Add llvm namespace to llvm::next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189912 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 04:26:09 +00:00
Michael Gottesman
30955e9afb Use llvm::next() instead of incrementing begin iterators of std::vector.
Iterator of std::vector may be implemented as a raw pointer. In
this case begin iterators are rvalues and cannot be incremented.
For example, this is the case with STDCXX implementation of vector.

Patch by Konstantin Tokarev <annulen@yandex.ru>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189911 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 04:19:01 +00:00