Commit Graph

93565 Commits

Author SHA1 Message Date
Bill Schmidt 2db29ef467 [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 8b4ccc0645 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 fa90a0b325 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 51969be724 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 4801303ce1 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 d6c78e8f9f [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 d131ff8cf8 [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 fed0ccfb9c llvm/test/CMakeLists.txt: Add llvm-cov in "check-clang".
llvm-svn: 185801
2013-07-08 08:44:36 +00:00
NAKAMURA Takumi b39be04164 llvm/test/CMakeLists.txt: Reformat LLVM_TEST_DEPENDS.
llvm-svn: 185800
2013-07-08 08:44:30 +00:00
NAKAMURA Takumi 1be81b4d1c 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 8cb9a0e1d3 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 c5cca5ab42 Revert: Fix wrong code offset for unwind code SET_FPREG.
llvm-svn: 185793
2013-07-08 04:48:34 +00:00
Kai Nacke 939ecd7ea0 Revert: Generate IMAGE_REL_AMD64_ADDR32NB relocations for SEH data structures.
llvm-svn: 185791
2013-07-08 04:46:55 +00:00
Kai Nacke 07bad44e9b Revert: Fix alignment of unwind data.
llvm-svn: 185790
2013-07-08 04:45:05 +00:00
Kai Nacke 42097301f6 Revert: Emit personality function and Dwarf EH data for Win64 SEH.
llvm-svn: 185788
2013-07-08 04:43:23 +00:00
Hal Finkel ec474f28e3 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 8c96263ee3 [objc-arc] Committed test for r185770 as per dblaikie's suggestion.
llvm-svn: 185782
2013-07-08 02:13:47 +00:00
Nico Rieck 43b51056d6 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 cfe7f352c7 Remove trailing whitespace from SelectionDAG/*.cpp
llvm-svn: 185780
2013-07-08 00:37:03 +00:00
Nico Rieck 7adf6111a8 Reuse %rax after calling __chkstk on win64
llvm-svn: 185778
2013-07-07 16:48:39 +00:00
Nadav Rotem 2ee35771a8 Clear the builder insert point between tree-vectorization phases.
llvm-svn: 185777
2013-07-07 14:57:18 +00:00
Nick Lewycky c0514629c9 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 dba60e11fe 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 2041b742d4 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 618df456e2 [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 a72630d453 [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 6d715e8699 SelectionDAGBuilder: style fixes (add space between end parentheses and open brace)
llvm-svn: 185768
2013-07-06 21:44:25 +00:00
Joey Gouly 2efaa733a2 Add MC support for the v8fp instructions: vmaxnm and vminnm.
llvm-svn: 185767
2013-07-06 20:50:18 +00:00
Benjamin Kramer 48b6a881be 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 e557da26db [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 99ef2890c0 Proper va_arg/va_copy lowering on win64
llvm-svn: 185763
2013-07-06 18:08:19 +00:00
Kai Nacke c947ad2a2d 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 4417cccba3 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 2a933a6549 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
Kai Nacke 66bfdb8354 Fix wrong code offset for unwind code SET_FPREG.
The code offset for unwind code SET_FPREG is wrong because it is set
to constant 0. The fix is to do the same as for the other unwind
codes: emit a label and later the absolute difference between the
label and the begin of the prologue.
Also enables the failing test case MC/COFF/seh.s

Reviewed by Charles Davis and Nico Rieck.

llvm-svn: 185758
2013-07-06 17:15:36 +00:00
Benjamin Kramer 3d90a8f4f9 Reassociate: Remove unnecessary default operator=.
llvm-svn: 185757
2013-07-06 15:10:13 +00:00
Benjamin Kramer c7332b2796 DAGCombiner: Don't drop extension behavior when shrinking a load when unsafe.
ReduceLoadWidth unconditionally drops extensions from loads. Limit it to the
case when all of the bits the extension would otherwise produce are dropped by
the shrink. It would be possible to shrink the load in more cases by merging
the extensions, but this isn't trivial and a very rare case. I left a TODO for
that case.

Fixes PR16551.

llvm-svn: 185755
2013-07-06 14:05:09 +00:00
Tim Northover dab4db5372 Stop putting operations after a tail call.
This prevents the emission of DAG-generated vreg definitions after a
tail call be dropping them entirely (on the grounds that nothing could
use them anyway, and they interfere with O0 CodeGen).

llvm-svn: 185754
2013-07-06 12:58:45 +00:00
Nico Rieck a37acf702d MC: Implement COFF .linkonce directive
llvm-svn: 185753
2013-07-06 12:13:10 +00:00
Michael Gottesman 11dd1d04ca [llvm-ar] Added llvm_unreachable to quiet -Wreturn-type warnings.
llvm-svn: 185751
2013-07-06 02:39:51 +00:00
David Majnemer c13678a24f isKnownToBeAPowerOfTwo: Fix a typo in a comment
llvm-svn: 185748
2013-07-06 02:24:59 +00:00
Michael Gottesman 4d9439c73f [objc-arc] Performed some small cleanups in ARCRuntimeEntryPoints and added an llvm_unreachable after the switch to quiet -Wreturn_type errors.
llvm-svn: 185746
2013-07-06 02:18:56 +00:00
Michael Gottesman 574d521c85 [objc-arc] Renamed Module => TheModule in ARCRuntimeEntryPoints. Also did some small cleanups.
This fixes an issue that came up due to -fpermissive on the bots.

llvm-svn: 185744
2013-07-06 01:57:32 +00:00
Michael Gottesman 01df45056e Removed trailing whitespace.
llvm-svn: 185743
2013-07-06 01:41:35 +00:00
Michael Gottesman 0b912b2673 [objc-arc] Updated ObjCARCContract to use ARCRuntimeEntryPoints.
llvm-svn: 185742
2013-07-06 01:39:26 +00:00
Michael Gottesman 14acfacc48 [objc-arc] Updated ObjCARCOpts to use ARCRuntimeEntryPoints.
llvm-svn: 185741
2013-07-06 01:39:23 +00:00
Michael Gottesman a94186a4c0 [objc-arc] Refactor runtime entrypoint declaration entrypoint creation.
This is the first patch in a series of 3 patches which clean up how we create
runtime function declarations in the ARC optimizer when they do not exist
already in the IR.

Currently we have a bunch of duplicated code in ObjCARCOpts, ObjCARCContract
that does this. This patch refactors that code into a separate class called
ARCRuntimeEntryPoints which lazily creates the declarations for said
entrypoints.

The next two patches will consist of the work of refactoring
ObjCARCContract/ObjCARCOpts to use this new code.

llvm-svn: 185740
2013-07-06 01:39:18 +00:00
Nick Lewycky efe31f2951 Fix language.
llvm-svn: 185739
2013-07-06 01:04:47 +00:00
Nick Lewycky cff2cf8e3a Fix annotation of unlink. Should fix builder.
llvm-svn: 185738
2013-07-06 00:59:28 +00:00
David Majnemer 69430609ff InstCombine: typo in or_icmp_eq_B_0_icmp_ult_A_B test
llvm-svn: 185737
2013-07-06 00:54:07 +00:00