Commit Graph

75512 Commits

Author SHA1 Message Date
Duncan Sands a098436b32 Split the init.trampoline intrinsic, which currently combines GCC's
init.trampoline and adjust.trampoline intrinsics, into two intrinsics
like in GCC.  While having one combined intrinsic is tempting, it is
not natural because typically the trampoline initialization needs to
be done in one function, and the result of adjust trampoline is needed
in a different (nested) function.  To get around this llvm-gcc hacks the
nested function lowering code to insert an additional parent variable
holding the adjust.trampoline result that can be accessed from the child
function.  Dragonegg doesn't have the luxury of tweaking GCC code, so it
stored the result of adjust.trampoline in the memory GCC set aside for
the trampoline itself (this is always available in the child function),
and set up some new memory (using an alloca) to hold the trampoline.
Unfortunately this breaks Go which allocates trampoline memory on the
heap and wants to use it even after the parent has exited (!).  Rather
than doing even more hacks to get Go working, it seemed best to just use
two intrinsics like in GCC.  Patch mostly by Sanjoy Das.

llvm-svn: 139140
2011-09-06 13:37:06 +00:00
Nick Lewycky 78664db054 Fix typo in comment again.
llvm-svn: 139139
2011-09-06 07:02:40 +00:00
Nick Lewycky 237878b7ac Apparently we compile the code, not the comments. Thanks Eli!
llvm-svn: 139138
2011-09-06 06:56:00 +00:00
Nick Lewycky 0af94cc50b Fix typo in comment.
llvm-svn: 139137
2011-09-06 06:46:01 +00:00
Nick Lewycky 702cf1eccc Nope! I had it right the first time. Revert the operative part of r139135 and
add more showing of my work.

llvm-svn: 139136
2011-09-06 06:39:54 +00:00
Nick Lewycky 6f86e001d6 Fix flipped sign. While there, show my math.
llvm-svn: 139135
2011-09-06 05:33:18 +00:00
Nick Lewycky db66b82dd5 No no no, fix typo properly!
llvm-svn: 139134
2011-09-06 05:08:09 +00:00
Nick Lewycky 658bdb5133 The logic inside getMulExpr to simplify {a,+,b}*{c,+,d} was wrong, which was
visible given a=b=c=d=1, on iteration #1 (the second iteration). Replace it with
correct math. Fixes PR10383!

llvm-svn: 139133
2011-09-06 05:05:14 +00:00
Nick Lewycky b1438c763a Revert r139126 due to selfhost failures reported by buildbots.
llvm-svn: 139130
2011-09-06 02:43:13 +00:00
Nick Lewycky c4c43fbb07 Teach SCEV to report a max backedge count in one interesting case in
HowFarToZero; the case for a canonical loop.

llvm-svn: 139126
2011-09-05 23:25:16 +00:00
Nick Lewycky 73df7e3830 Add a new MC bit for NaCl (Native Client) mode. NaCl requires that certain
instructions are more aligned than the CPU requires, and adds some additional
directives, to follow in future patches. Patch by David Meyer!

llvm-svn: 139125
2011-09-05 21:51:43 +00:00
Nick Lewycky df06b6e069 Update the C++ backend to use the new ArrayRef'ified APIs. Patch by arrowdodger!
llvm-svn: 139124
2011-09-05 18:50:59 +00:00
Nick Lewycky f1a5f57d2f Fix typo in comment.
llvm-svn: 139122
2011-09-05 18:35:03 +00:00
Benjamin Kramer 4b79c21ef2 InstSimplify: Don't try to replace an extractvalue/insertvalue pair with the original value if types don't match.
Fixes clang selfhost.

llvm-svn: 139120
2011-09-05 18:16:19 +00:00
Duncan Sands 29192d042e Delete trivial landing pads that just continue unwinding the caught
exception.

llvm-svn: 139117
2011-09-05 12:57:57 +00:00
Duncan Sands fd26a954a8 Add some simple insertvalue simplifications, for the purpose of cleaning
up do-nothing exception handling code produced by dragonegg.

llvm-svn: 139113
2011-09-05 06:52:48 +00:00
Benjamin Kramer 0ca1ad0783 Use canonical forms for the branch probability zero heutistic.
- Drop support for X >u 0, it's equivalent to X != 0 and should be canonicalized into the latter.
- Add X < 1 -> unlikely, which is what instcombine canonicalizes X <= 0 into.
- Add X > -1 -> likely, which is what instcombine canonicalizes X >= 0 into.

llvm-svn: 139110
2011-09-04 23:53:04 +00:00
Chandler Carruth 908abc3439 As a (rather delayed) followup to r136738 which stopped building the
edis shared library in the Makefile build, also stop building it in the
CMake build.

Patch by arrowdodger!

llvm-svn: 139108
2011-09-04 23:32:05 +00:00
Chandler Carruth ada9aa2b98 Complete the removal of FindBison from CMake. Noticed this when browsing
some CMake patch backlog...

llvm-svn: 139107
2011-09-04 23:29:12 +00:00
Chandler Carruth ceb4e6408a Update the CMake documentation to the correct variables.
Patch by arrowdodger!

llvm-svn: 139106
2011-09-04 23:24:13 +00:00
Bill Wendling 321fb37773 Use Duncan's patch to delete the instructions in reverse order (minus the landingpad and terminator).
llvm-svn: 139090
2011-09-04 09:43:36 +00:00
Bill Wendling acaad83cd0 The insertion point for the loads is right before the llvm.eh.exception
call. The call may be in the same BB as the landingpad instruction. If that's
the case, then inserting the loads after the landingpad inst, but before the
extractvalues, causes undefined behavior.

llvm-svn: 139088
2011-09-04 09:02:18 +00:00
Benjamin Kramer 09ade9bb8b valgrind: Suppress glibc's optiized strcasecmp harder.
llvm-svn: 139084
2011-09-03 17:59:31 +00:00
Benjamin Kramer 7859d2e148 Use internal storage for command line option.
llvm-svn: 139079
2011-09-03 03:45:06 +00:00
Bill Wendling 7c1d6358a2 Don't reload the values that are already there. The llvm.eh.resume uses the same
values that the resume instruction uses.
PR10850

llvm-svn: 139076
2011-09-03 01:38:17 +00:00
Andrew Trick 2f5420b225 Exclude more arm jit failures pending PR10783.
llvm-svn: 139074
2011-09-03 01:08:35 +00:00
Bruno Cardoso Lopes 07d9914620 Add AVX versions to match AESENC/AESDEC intrinsics. This hopefully ends
the cycle of missing AVX counterparts of already present SSE* patterns

llvm-svn: 139073
2011-09-03 00:47:08 +00:00
Bruno Cardoso Lopes 1d5c2d9227 Add AVX version of a SSE4.1 VPBLENDVB pattern
llvm-svn: 139072
2011-09-03 00:47:05 +00:00
Bruno Cardoso Lopes 212a8c4357 Add AVX versions of SSE4.1 EXTRACTPS patterns
llvm-svn: 139071
2011-09-03 00:47:03 +00:00
Bruno Cardoso Lopes 3d581a36b6 Add AVX versions for SSE4.1 MOVZX* patterns
llvm-svn: 139070
2011-09-03 00:47:01 +00:00
Bruno Cardoso Lopes 6d701fcef0 Add one more AVX pattern for MOVZPQILo2PQI
llvm-svn: 139069
2011-09-03 00:46:58 +00:00
Bruno Cardoso Lopes 9923c51564 Move PUNPCKLQDQ splat pattern close to the instruction definition and
duplicate it for AVX mode.

llvm-svn: 139068
2011-09-03 00:46:56 +00:00
Bruno Cardoso Lopes 96b11f39e2 Add AVX pattern versions for PSHUFB,PSIGN{B,W,D}
llvm-svn: 139067
2011-09-03 00:46:54 +00:00
Bruno Cardoso Lopes 9a0da1e57a Add AVX versions of MOVZDI2PDI patterns. Use SUBREG_TO_REG to indicate
that the AVX versions (even the 128-bit ones) all clear the upper part
of the destination register.

llvm-svn: 139066
2011-09-03 00:46:51 +00:00
Bruno Cardoso Lopes 903952223a Enforce subtarget checks in a few places to be explicit when the
pattern should be matched

llvm-svn: 139065
2011-09-03 00:46:49 +00:00
Bruno Cardoso Lopes 521b0cfdc6 Tidy up code moving patterns to their appropriate place!
llvm-svn: 139064
2011-09-03 00:46:47 +00:00
Bruno Cardoso Lopes aad5e50ded Add AVX versions of FsMOVAPS and FsMOVAPS. Teach X86InstrInfo how to use
it!

llvm-svn: 139063
2011-09-03 00:46:45 +00:00
Bruno Cardoso Lopes d893fc92af Teach X86FastISel to use AVX versions of instructions when possible
llvm-svn: 139062
2011-09-03 00:46:42 +00:00
Bruno Cardoso Lopes 006c9371a1 Fix 80-column and style
llvm-svn: 139061
2011-09-03 00:46:40 +00:00
Bruno Cardoso Lopes dbb40015ff Tidy up some SSE/AVX convert intrinsics. Also add an AVX version of
OptForSize pattern

llvm-svn: 139060
2011-09-03 00:46:38 +00:00
Owen Anderson 40d756eacc Fix a truly heinous bug in DAGCombine related to AssertZext.
If we have a chain of zext -> assert_zext -> zext -> use, the first zext would get simplified away because of the later zext, and then the later zext would get simplified away because of the assert.  The solution is to teach SimplifyDemandedBits that assert_zext demands all of the high bits of its input, rather than only those demanded by its users.  No testcase because the only example I have manifests as llvm-gcc miscompiling LLVM, and I haven't found a smaller case that reproduces this problem.
Fixes <rdar://problem/10063365>.

llvm-svn: 139059
2011-09-03 00:26:49 +00:00
Dan Gohman 5423017526 Revert r129875, XFAILing this test for arm, since the fix was reverted.
llvm-svn: 139058
2011-09-03 00:14:24 +00:00
Jakob Stoklund Olesen 1f72dd40c7 Pseudo CMOV instructions don't clobber EFLAGS.
The explanation about a 0 argument being materialized as xor is no
longer valid.  Rematerialization will check if EFLAGS is live before
clobbering it.

The code produced by X86TargetLowering::EmitLoweredSelect does not
clobber EFLAGS.

This causes one less testb instruction to be generated in the cmov.ll
test case.

llvm-svn: 139057
2011-09-02 23:52:55 +00:00
Jakob Stoklund Olesen f08354d183 Check for EFLAGS live-out before clobbering it.
It is only allowed to clobber EFLAGS at the end of a block if it isn't
live-in to any successor.

llvm-svn: 139056
2011-09-02 23:52:52 +00:00
Jakob Stoklund Olesen d0c8a31c8b Use existing function.
llvm-svn: 139055
2011-09-02 23:52:49 +00:00
Jim Grosbach f347d1d772 Thumb2 parsing and encoding for CBZ/CBNZ.
llvm-svn: 139054
2011-09-02 23:46:10 +00:00
Jim Grosbach 34842ceb97 Thumb2 parsing and encoding for BXJ.
llvm-svn: 139053
2011-09-02 23:43:09 +00:00
Jim Grosbach 9e55023ca7 Thumb2 parsing and encoding for BIC.
llvm-svn: 139052
2011-09-02 23:37:54 +00:00
Jim Grosbach 93e3fd29b2 Thumb2 parsing and encoding for BFI.
llvm-svn: 139051
2011-09-02 23:28:46 +00:00
Jim Grosbach be31448d99 Thumb2 parsing and encoding for BFC.
llvm-svn: 139050
2011-09-02 23:25:46 +00:00