1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

93631 Commits

Author SHA1 Message Date
Jim Grosbach
b4234c1d88 ARM: Improve codegen for generic vselect.
Fall back to by-element insert rather than building it up on the stack.

rdar://14351991

llvm-svn: 185846
2013-07-08 18:18:52 +00:00
David Blaikie
b236f97d1a DebugInfo: Correct comment & re-format a nearby loop
llvm-svn: 185844
2013-07-08 17:51:28 +00:00
Shuxin Yang
a6173e9a56 Fix a SCEV update problem.
The symptom is seg-fault, and the root cause is that a SCEV contains a SCEVUnknown
which has null-pointer to a llvm::Value.

 This is how the problem take place:
 ===================================
  1). In the pristine input IR, there are two relevant instrutions Op1 and Op2, 
     Op1's corresponding SCEV (denoted as SCEV(op1)) is a SCEVUnknown, and
     SCEV(Op2) contains SCEV(Op1).  None of these instructions are dead.

     Op1 : V1 = ...
     ...
     Op2 : V2 = ... // directly or indirectly (data-flow) depends on Op1
    
  2) Optimizer (LSR in my case) generates an instruction holding the equivalent
     value of Op1, making Op1 dead. 
     Op1': V1' = ...
     Op1: V1 = ... ; now dead)
     Op2 : V2 = ... //Now deps on Op1', but the SCEV(Op2) still contains SCEV(Op1)

  3) Op1 is deleted, and call-back function is called to reset 
     SCEV(Op1) to indicate it is invalid. However, SCEV(Op2) is not 
     invalidated as well.

  4) Following pass get the cached, invalid SCEV(Op2), and try to manipulate it,
     and cause segfault. 

 The fix:
 ========
 It seems there is no clean yet inexpensive fix. I write to dev-list
soliciting good solution, unforunately no ack. So, I decide to fix this 
problem in a brute-force way:

  When ScalarEvolution::getSCEV is called, check if the cached SCEV 
contains a invalid SCEVUnknow, if yes, remove the cached SCEV, and
re-evaluate the SCEV from scratch.

  I compile buch of big *.c and *.cpp, fortunately, I don't see any increase
in compile time.

 Misc:
=====
 The reduced test-case has 2357 lines of code+other-stuff, too big to commit.

 rdar://14283433

llvm-svn: 185843
2013-07-08 17:33:13 +00:00
David Blaikie
8fa902a764 DebugInfo: Simplify Address Pool index handling.
Since the pool indexes are necessarily sequential and contiguous, just
insert things in the right place rather than having to sort the sequence
after the fact.

No functionality change.

llvm-svn: 185842
2013-07-08 17:33:10 +00:00
Quentin Colombet
51c235a1aa Revert: "Use Clang's __has_* macros in Compiler.h to test for features"
This reverts r185831 and 185833.

llvm-svn: 185841
2013-07-08 17:32:13 +00:00
Hal Finkel
059614de7f PPC: Mark vector FREM as Expand by default
Another bug found by llvm-stress! This fixes crashing with:
  LLVM ERROR: Cannot select: v4f32 = frem ...

llvm-svn: 185840
2013-07-08 17:30:25 +00:00
Rafael Espindola
1732782ad3 clang-format this enum.
llvm-svn: 185835
2013-07-08 16:55:56 +00:00
Rafael Espindola
fc25f0c6cf We now always create files with the correct permissions. Simplify the interface.
llvm-svn: 185834
2013-07-08 16:42:01 +00:00
Reid Kleckner
4e247915c9 Attempt to fix Compiler.h for some self-hosting bots
I tested r185831 by self-hosting clang with a recent clang, and got no
warnings.  I haven't been able to reproduce the problem locally.

llvm-svn: 185833
2013-07-08 16:36:29 +00:00
Rafael Espindola
80b3c47cc6 Create files with the correct permission instead of changing it afterwards.
No intended functionality change.

llvm-svn: 185832
2013-07-08 16:16:51 +00:00
Reid Kleckner
3a0476922a Use Clang's __has_* macros in Compiler.h to test for features
When targetting Windows, clang does not define __GNUC__, and as a result
we don't use our attributes with it.  This leads to warnings about
unused functions that are already annotated with LLVM_ATTRIBUTE_UNUSED.
Rather than testing for __clang__, we can use its __has_attribute and
__has_builtin macros directlty.

While I'm here, conditionally define and use __GNUC_PREREQ for gcc
version checks.  Spelling the check out with three comparisons is
verbose and error prone.

Reviewers: aaron.ballman

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

llvm-svn: 185831
2013-07-08 15:31:29 +00:00
Rafael Espindola
49984266b7 Create files with the correct permission instead of changing it afterwards.
Not intended functionality change.

llvm-svn: 185830
2013-07-08 15:22:09 +00:00
Ulrich Weigand
2a068338ad [PowerPC] Support time base instructions
This adds support for the old-style time base instructions;
while new programs are supposed to use mfspr, the mftb instructions
are still supported and in use by existing assembler files.

llvm-svn: 185829
2013-07-08 15:20:38 +00:00
Ulrich Weigand
86dbe652aa [PowerPC] Support basic compare mnemonics
This adds support for the basic mnemoics (with the L operand) for the
fixed-point compare instructions.  These are defined as aliases for the
already existing CMPW/CMPD patterns, depending on the value of L.

This requires use of InstAlias patterns with immediate literal operands.
To make this work, we need two further changes:

 - define a RegisterPrefix, because otherwise literals 0 and 1 would
   be parsed as literal register names

 - provide a PPCAsmParser::validateTargetOperandClass routine to
   recognize immediate literals (like ARM does)

llvm-svn: 185826
2013-07-08 14:49:37 +00:00
Manuel Klimek
1741a5940a Fixes problem when calling llvm-ar from an unmodifiable directory.
This fixes a regression introduced by r185726: the new call to get
a unique file does not prepend the system temporary directory, so
we need to anchor on the file that the temporary file gets moved
to to ensure we're on the same file system.

llvm-svn: 185825
2013-07-08 14:44:57 +00:00
Hal Finkel
caf5dc75de Improve the comment from r185794 (re: PromoteIntRes_BUILD_VECTOR)
In response to Duncan's review, I believe that the original comment was not as
clear as it could be. Hopefully, this is better.

llvm-svn: 185824
2013-07-08 14:40:04 +00:00
Bill Schmidt
58913550ff [PowerPC] Fix PR16556 (handle undef ppcf128 in LowerFP_TO_INT).
PPCTargetLowering::LowerFP_TO_INT() expects its source operand to be
either an f32 or f64, but this is not checked.  A long double
(ppcf128) operand will normally be custom-lowered to a conversion to
f64 in this context.  However, this isn't the case for an UNDEF node.

This patch recognizes a ppcf128 as a legal source operand for
FP_TO_INT only if it's an undef, in which case it creates an undef of
the target type.

At some point we might want to do a wholesale custom lowering of
ISD::UNDEF when the type is ppcf128, but it's not really clear that's
a great idea, and probably more work than it's worth for a situation
that only arises in the case of a programming error.  At this point I
think simple is best.

The test case comes from PR16556, and is a crash-test only.

llvm-svn: 185821
2013-07-08 14:22:45 +00:00
Reid Kleckner
377e7e61d0 Convert an OCaml binding grep test to FileCheck
I shaved this yak because I mistakenly thought that this was one of the
last grep tests.  Turns out my search was skipping .ll files, for which
there are ~1200 more tests using grep.

llvm-svn: 185819
2013-07-08 14:14:22 +00:00
David Majnemer
c84fdc2727 InstCombine: Fold X-C1 <u 2 -> (X & -2) == C1
Back in r179493 we determined that two transforms collided with each
other.  The fix back then was to reorder the transforms so that the
preferred transform would give it a try and then we would try the
secondary transform.  However, it was noted that the best approach would
canonicalize one transform into the other, removing the collision and
allowing us to optimize IR given to us in that form.

llvm-svn: 185808
2013-07-08 11:53:08 +00:00
Nico Rieck
7230f0d23f Reuse %rax after calling __chkstk on win64
Reapply this as I reverted the wrong commit.

llvm-svn: 185807
2013-07-08 11:20:11 +00:00
Nico Rieck
90555b76a0 Revert "Proper va_arg/va_copy lowering on win64"
This reverts commit 2b52880592a525cfe04d8f9008a35da8c2ea94c3.

Needs review.

llvm-svn: 185806
2013-07-08 11:19:44 +00:00
Richard Sandiford
9120682071 [SystemZ] Remove unwanted part from last commit
I was originally going to use MVC for memmove too, but that's less of
a clear win.  Remove some accidental left-overs in the previous commit.

llvm-svn: 185804
2013-07-08 09:55:36 +00:00
Richard Sandiford
537b8d7bec [SystemZ] Use MVC for memcpy
Use MVC for memcpy in cases where a single MVC is enough.  Using MVC is
a win for longer copies too, but I'll leave that for later.

llvm-svn: 185802
2013-07-08 09:35:23 +00:00
NAKAMURA Takumi
72e9abbaf6 llvm/test/CMakeLists.txt: Add llvm-cov in "check-clang".
llvm-svn: 185801
2013-07-08 08:44:36 +00:00
NAKAMURA Takumi
59804e678f llvm/test/CMakeLists.txt: Reformat LLVM_TEST_DEPENDS.
llvm-svn: 185800
2013-07-08 08:44:30 +00:00
NAKAMURA Takumi
146f6c2ba7 llvm/test/Other/llvm-cov.test: It requires +Asserts to let XFAILed.
llvm-svn: 185799
2013-07-08 08:44:24 +00:00
Hal Finkel
b21ca286dc Fix PromoteIntRes_BUILD_VECTOR crash with i1 vectors
This fixes a bug (found by llvm-stress) in
DAGTypeLegalizer::PromoteIntRes_BUILD_VECTOR where it assumed that the result
type would always be larger than the original operands. This is not always
true, however, with boolean vectors. For example, promoting a node of type v8i1
(where the operands will be of type i32, the type to which i1 is promoted) will
yield a node with a result vector element type of i16 (and operands of type
i32). As a result, we cannot blindly assume that we can ANY_EXTEND the operands
to the result type.

llvm-svn: 185794
2013-07-08 06:16:58 +00:00
Kai Nacke
fea440d04d Revert: Fix wrong code offset for unwind code SET_FPREG.
llvm-svn: 185793
2013-07-08 04:48:34 +00:00
Kai Nacke
2a396931b7 Revert: Generate IMAGE_REL_AMD64_ADDR32NB relocations for SEH data structures.
llvm-svn: 185791
2013-07-08 04:46:55 +00:00
Kai Nacke
f430305bee Revert: Fix alignment of unwind data.
llvm-svn: 185790
2013-07-08 04:45:05 +00:00
Kai Nacke
94a5be6668 Revert: Emit personality function and Dwarf EH data for Win64 SEH.
llvm-svn: 185788
2013-07-08 04:43:23 +00:00
Hal Finkel
2464b6ac5c Add the nearbyint -> FNEARBYINT mapping to BasicTargetTransformInfo
This fixes an oversight that Intrinsic::nearbyint was not being mapped to
ISD::FNEARBYINT (thus fixing the over-optimistic cost we were assigning to
nearbyint calls for some targets).

llvm-svn: 185783
2013-07-08 03:24:07 +00:00
Michael Gottesman
fb9cc0dd34 [objc-arc] Committed test for r185770 as per dblaikie's suggestion.
llvm-svn: 185782
2013-07-08 02:13:47 +00:00
Nico Rieck
cd7bc94022 Revert "Reuse %rax after calling __chkstk on win64"
This reverts commit 01f8d579f7672872324208ac5bc4ac311e81b22e.

llvm-svn: 185781
2013-07-08 01:30:57 +00:00
Stephen Lin
6778645a84 Remove trailing whitespace from SelectionDAG/*.cpp
llvm-svn: 185780
2013-07-08 00:37:03 +00:00
Nico Rieck
15089c31ec Reuse %rax after calling __chkstk on win64
llvm-svn: 185778
2013-07-07 16:48:39 +00:00
Nadav Rotem
709b733114 Clear the builder insert point between tree-vectorization phases.
llvm-svn: 185777
2013-07-07 14:57:18 +00:00
Nick Lewycky
7a38a8d88f Eliminate trivial redundant loads across nocapture+readonly calls to uncaptured
pointer arguments.

llvm-svn: 185776
2013-07-07 10:15:16 +00:00
Nick Lewycky
181e3475a3 Add missing per-argument doesNotAccessMemory accessors. No functionality change
since it has no callers today.

llvm-svn: 185775
2013-07-07 08:29:51 +00:00
Nadav Rotem
883fb8ad80 SLPVectorizer: Implement DCE as part of vectorization.
This is a complete re-write if the bottom-up vectorization class.
Before this commit we scanned the instruction tree 3 times. First in search of merge points for the trees. Second, for estimating the cost. And finally for vectorization.
There was a lot of code duplication and adding the DCE exposed bugs. The new design is simpler and DCE was a part of the design.
In this implementation we build the tree once. After that we estimate the cost by scanning the different entries in the constructed tree (in any order). The vectorization phase also works on the built tree.

llvm-svn: 185774
2013-07-07 06:57:07 +00:00
Michael Gottesman
80ca18cc8d [objc-arc] Remove the alias analysis part of r185764.
Upon further reflection, the alias analysis part of r185764 is not a safe
change.

llvm-svn: 185770
2013-07-07 04:18:03 +00:00
Michael Gottesman
92317b03c4 [objc-arc] Teach the ARC optimizer that objc_sync_enter/objc_sync_exit do not modify the ref count of an objc object and additionally are inert for modref purposes.
llvm-svn: 185769
2013-07-07 01:52:55 +00:00
Stephen Lin
466f28d2c7 SelectionDAGBuilder: style fixes (add space between end parentheses and open brace)
llvm-svn: 185768
2013-07-06 21:44:25 +00:00
Joey Gouly
bc06bffc50 Add MC support for the v8fp instructions: vmaxnm and vminnm.
llvm-svn: 185767
2013-07-06 20:50:18 +00:00
Benjamin Kramer
de21845555 COFFDumper: Print uint64_t with the right format string.
I wish we could typecheck llvm::format.

llvm-svn: 185766
2013-07-06 20:01:46 +00:00
Michael Gottesman
b7b4df0cc9 [objc-arc] When we initialize ARCRuntimeEntryPoints, make sure we reset all references to entrypoint declarations as well.
llvm-svn: 185764
2013-07-06 18:43:05 +00:00
Nico Rieck
f5c31a8456 Proper va_arg/va_copy lowering on win64
llvm-svn: 185763
2013-07-06 18:08:19 +00:00
Kai Nacke
e7660f5a90 Emit personality function and Dwarf EH data for Win64 SEH.
Obviously the personality function should be emitted as language handler
instead of the hard coded _GCC_specific_handler. The language specific
data must be placed after the unwind information therefore it must not
be emitted into a separate section.

Reviewed by Charles Davis and Nico Rieck.

llvm-svn: 185761
2013-07-06 17:17:31 +00:00
Kai Nacke
2ccf08db47 Fix alignment of unwind data.
For alignment purposes, the instruction array will always have an even
number of entries, with the final entry potentially unused (in which
case the array will be one longer than indicated by the count of unwind
codes field).

Reviewed by Charles Davis and Nico Rieck.

llvm-svn: 185760
2013-07-06 17:16:50 +00:00
Kai Nacke
3de8e2c2c3 Generate IMAGE_REL_AMD64_ADDR32NB relocations for SEH
data structures.

The Win64 EH data structures must be of type IMAGE_REL_AMD64_ADDR32NB
instead of IMAGE_REL_AMD64_ADDR32. This is easiely achieved by adding
the VK_COFF_IMGREL32 modifier to the symbol reference.
Change also references to start and end of the SEH range of a function
as offsets to start of the function.

Reviewed by Charles Davis and Nico Rieck.

llvm-svn: 185759
2013-07-06 17:16:12 +00:00