oota-llvm.git
13 years agoFix atomic load and store on x86 to pass -verify-machineinstrs (and possibly fix...
Eli Friedman [Wed, 7 Sep 2011 18:48:32 +0000 (18:48 +0000)]
Fix atomic load and store on x86 to pass -verify-machineinstrs (and possibly fix some subtle bugs involving passes which check mayStore()).

This isn't exactly ideal, but it is good enough for the moment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139245 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate test for 139243
Jim Grosbach [Wed, 7 Sep 2011 18:40:06 +0000 (18:40 +0000)]
Update test for 139243

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139244 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 ldm/stm 'db' mnemonics don't have a '.w' suffix.
Jim Grosbach [Wed, 7 Sep 2011 18:39:47 +0000 (18:39 +0000)]
Thumb2 ldm/stm 'db' mnemonics don't have a '.w' suffix.

There is no 16-bit wide encoding, so the .w suffix isn't needed (indeed, isn't
documented as allowed). Also add the missing '!' token on the _UPD
variant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139243 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for LDMIA.
Jim Grosbach [Wed, 7 Sep 2011 18:05:34 +0000 (18:05 +0000)]
Thumb2 parsing and encoding for LDMIA.

Choose 32-bit vs. 16-bit encoding when there's no .w suffix in post-processing
as match classes are insufficient to handle the context-sensitiveness of
the writeback operand's legality for the 16-bit encodings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139242 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPort more assembler tests over to disassembler tests, and fix a minor logic error...
Owen Anderson [Wed, 7 Sep 2011 17:55:19 +0000 (17:55 +0000)]
Port more assembler tests over to disassembler tests, and fix a minor logic error that exposed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139240 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRefactor instprinter and mcdisassembler to take a SubtargetInfo. Add -mattr= handling...
James Molloy [Wed, 7 Sep 2011 17:24:38 +0000 (17:24 +0000)]
Refactor instprinter and mcdisassembler to take a SubtargetInfo. Add -mattr= handling to llvm-mc. Reviewed by Owen Anderson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139237 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen inlining exception handling code into another function, ensure that
Duncan Sands [Wed, 7 Sep 2011 16:44:14 +0000 (16:44 +0000)]
When inlining exception handling code into another function, ensure that
duplicate tests are eliminated (for example if the two functions both have
a catch clause catching the same type, ensure the redundant one is removed).
Note that it would probably be safe to say that eh.typeid.for is 'const',
but since two calls to it with the same argument can give different results
(but only if the calls are in different functions), it seems more correct to
mark it only 'pure'; this doesn't get in the way of the optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139236 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 use 'ldm' as default mnemonic.
Jim Grosbach [Wed, 7 Sep 2011 16:22:42 +0000 (16:22 +0000)]
Thumb2 use 'ldm' as default mnemonic.

Handle explicit 'ia' suffix via a MnemonicAlias (pre-existing).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139234 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDetect attempt to use segmented stacks on non ELF systems and error
Rafael Espindola [Wed, 7 Sep 2011 16:10:57 +0000 (16:10 +0000)]
Detect attempt to use segmented stacks on non ELF systems and error
(not assert) early.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139233 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBetter diagnostic location information for mnemonic suffices.
Jim Grosbach [Wed, 7 Sep 2011 16:06:04 +0000 (16:06 +0000)]
Better diagnostic location information for mnemonic suffices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139232 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAnother forgotten trampoline testcase.
Duncan Sands [Wed, 7 Sep 2011 10:05:14 +0000 (10:05 +0000)]
Another forgotten trampoline testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139230 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoForgot to add this trampoline testcase.
Duncan Sands [Wed, 7 Sep 2011 09:21:38 +0000 (09:21 +0000)]
Forgot to add this trampoline testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139229 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRelax the MemOperands on atomics a bit. Fixes -verify-machineinstrs failures for...
Eli Friedman [Wed, 7 Sep 2011 02:23:42 +0000 (02:23 +0000)]
Relax the MemOperands on atomics a bit.  Fixes -verify-machineinstrs failures for atomic laod/store on ARM.

(The fix for the related failures on x86 is going to be nastier because we actually need Acquire memoperands attached to the atomic load instrs, etc.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139221 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDependency should be on the output file name, not the dependency file
Joerg Sonnenberger [Wed, 7 Sep 2011 02:12:03 +0000 (02:12 +0000)]
Dependency should be on the output file name, not the dependency file
name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139220 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhile sinking machine instructions, sink matching DBG_VALUEs also otherwise live...
Devang Patel [Wed, 7 Sep 2011 00:07:58 +0000 (00:07 +0000)]
While sinking machine instructions, sink matching DBG_VALUEs also otherwise live debug variable pass will drop DBG_VALUEs on the floor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139208 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReenable compact unwind by default. However, also emit the old version of unwind
Bill Wendling [Tue, 6 Sep 2011 23:47:14 +0000 (23:47 +0000)]
Reenable compact unwind by default. However, also emit the old version of unwind
information for older linkers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139206 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agomemset_pattern16 uses a 16 BYTE pattern, not a 16 BIT pattern. Add comments to that...
Owen Anderson [Tue, 6 Sep 2011 23:43:26 +0000 (23:43 +0000)]
memset_pattern16 uses a 16 BYTE pattern, not a 16 BIT pattern.  Add comments to that effect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139205 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach BasicAA about the aliasing properties of memset_pattern16.
Owen Anderson [Tue, 6 Sep 2011 23:33:25 +0000 (23:33 +0000)]
Teach BasicAA about the aliasing properties of memset_pattern16.
Fixes PR10872 and <rdar://problem/10065079>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139204 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoISB is HasDB, not just HasV7.
Jim Grosbach [Tue, 6 Sep 2011 23:09:19 +0000 (23:09 +0000)]
ISB is HasDB, not just HasV7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139202 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for ISB.
Jim Grosbach [Tue, 6 Sep 2011 22:53:27 +0000 (22:53 +0000)]
Thumb2 parsing and encoding for ISB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139200 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for EOR.
Jim Grosbach [Tue, 6 Sep 2011 22:44:50 +0000 (22:44 +0000)]
Thumb2 parsing and encoding for EOR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139199 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for DSB.
Jim Grosbach [Tue, 6 Sep 2011 22:19:40 +0000 (22:19 +0000)]
Thumb2 parsing and encoding for DSB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139194 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for DMB.
Jim Grosbach [Tue, 6 Sep 2011 22:14:58 +0000 (22:14 +0000)]
Thumb2 parsing and encoding for DMB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139193 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDisable these tests harder. They're XFAIL'd, but that means they still run, and
Nick Lewycky [Tue, 6 Sep 2011 22:08:18 +0000 (22:08 +0000)]
Disable these tests harder. They're XFAIL'd, but that means they still run, and
these tests all infinitely recurse, bringing my system down into swapping hell.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139192 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for DBG.
Jim Grosbach [Tue, 6 Sep 2011 22:06:40 +0000 (22:06 +0000)]
Thumb2 parsing and encoding for DBG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139191 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for CMN and CMP.
Jim Grosbach [Tue, 6 Sep 2011 21:44:58 +0000 (21:44 +0000)]
Thumb2 parsing and encoding for CMN and CMP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139188 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis transform only handles two-operand AddRec's. Prevent it from trying to
Nick Lewycky [Tue, 6 Sep 2011 21:42:18 +0000 (21:42 +0000)]
This transform only handles two-operand AddRec's. Prevent it from trying to
handle anything more complex. Fixes PR10383 again!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139186 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd mayLoad/mayStore markings to ARM 64-bit atomic pseudo-instructions.
Eli Friedman [Tue, 6 Sep 2011 20:53:37 +0000 (20:53 +0000)]
Add mayLoad/mayStore markings to ARM 64-bit atomic pseudo-instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139179 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for CLZ.
Jim Grosbach [Tue, 6 Sep 2011 20:44:17 +0000 (20:44 +0000)]
Thumb2 parsing and encoding for CLZ.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139177 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for CLREX.
Jim Grosbach [Tue, 6 Sep 2011 20:27:04 +0000 (20:27 +0000)]
Thumb2 parsing and encoding for CLREX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139172 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPort more encoding tests over to Thumb2 decoding tests.
Owen Anderson [Tue, 6 Sep 2011 20:26:34 +0000 (20:26 +0000)]
Port more encoding tests over to Thumb2 decoding tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139171 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd -verify-indvars for imperfect SCEV trip count verification after indvars.
Andrew Trick [Tue, 6 Sep 2011 20:20:38 +0000 (20:20 +0000)]
Add -verify-indvars for imperfect SCEV trip count verification after indvars.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139169 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for CDP/CDP2.
Jim Grosbach [Tue, 6 Sep 2011 20:12:23 +0000 (20:12 +0000)]
Thumb2 parsing and encoding for CDP/CDP2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139168 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix comment. Noticed by Duncan.
Rafael Espindola [Tue, 6 Sep 2011 19:29:31 +0000 (19:29 +0000)]
Fix comment. Noticed by Duncan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139161 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd codegen support for vector select (in the IR this means a select
Duncan Sands [Tue, 6 Sep 2011 19:07:46 +0000 (19:07 +0000)]
Add codegen support for vector select (in the IR this means a select
with a vector condition); such selects become VSELECT codegen nodes.
This patch also removes VSETCC codegen nodes, unifying them with SETCC
nodes (codegen was actually often using SETCC for vector SETCC already).
This ensures that various DAG combiner optimizations kick in for vector
comparisons.  Passes dragonegg bootstrap with no testsuite regressions
(nightly testsuite as well as "make check-all").  Patch mostly by
Nadav Rotem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139159 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix fall outs from my recent change on how carry bit is modeled during isel.
Evan Cheng [Tue, 6 Sep 2011 18:52:20 +0000 (18:52 +0000)]
Fix fall outs from my recent change on how carry bit is modeled during isel.
Now the 'S' instructions, e.g. ADDS, treat S bit as optional operand as well.
Also fix isel hook to correctly set the optional operand.
rdar://10073745

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139157 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse IRBuilder.
Devang Patel [Tue, 6 Sep 2011 18:49:53 +0000 (18:49 +0000)]
Use IRBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139156 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoARM .code directive should always go to the streamer.
Jim Grosbach [Tue, 6 Sep 2011 18:46:23 +0000 (18:46 +0000)]
ARM .code directive should always go to the streamer.

Even if there's no mode switch performed, the .code directive should still
be sent to the output streamer. Otherwise, for example, an output asm stream
is not equivalent to the input stream which generated it (a dependency on
the input target triple arm vs. thumb is introduced which was not originally
there).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139155 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix style issues and typos found by Duncan.
Rafael Espindola [Tue, 6 Sep 2011 18:43:08 +0000 (18:43 +0000)]
Fix style issues and typos found by Duncan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139154 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAs a first step, emit both the compact unwind and CIE/FDEs for a function.
Bill Wendling [Tue, 6 Sep 2011 18:37:11 +0000 (18:37 +0000)]
As a first step, emit both the compact unwind and CIE/FDEs for a function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139152 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry again at r138809 (make DSE more aggressive in removing dead stores at the end...
Owen Anderson [Tue, 6 Sep 2011 18:14:09 +0000 (18:14 +0000)]
Try again at r138809 (make DSE more aggressive in removing dead stores at the end of a function), now with less deleting stores before memcpy's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139150 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAtomic pseudos don't use (as in read) CPSR. They clobber it.
Jakob Stoklund Olesen [Tue, 6 Sep 2011 17:40:35 +0000 (17:40 +0000)]
Atomic pseudos don't use (as in read) CPSR. They clobber it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139148 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNow, named mdnode llvm.dbg.cu keeps track of all compile units in a module. Update...
Devang Patel [Tue, 6 Sep 2011 17:40:08 +0000 (17:40 +0000)]
Now, named mdnode llvm.dbg.cu keeps track of all compile units in a module. Update DebugInfoFinder to collect compile units from llvm.dbg.cu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139147 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSplit the init.trampoline intrinsic, which currently combines GCC's
Duncan Sands [Tue, 6 Sep 2011 13:37:06 +0000 (13:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139140 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typo in comment again.
Nick Lewycky [Tue, 6 Sep 2011 07:02:40 +0000 (07:02 +0000)]
Fix typo in comment again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139139 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoApparently we compile the code, not the comments. Thanks Eli!
Nick Lewycky [Tue, 6 Sep 2011 06:56:00 +0000 (06:56 +0000)]
Apparently we compile the code, not the comments. Thanks Eli!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139138 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typo in comment.
Nick Lewycky [Tue, 6 Sep 2011 06:46:01 +0000 (06:46 +0000)]
Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139137 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNope! I had it right the first time. Revert the operative part of r139135 and
Nick Lewycky [Tue, 6 Sep 2011 06:39:54 +0000 (06:39 +0000)]
Nope! I had it right the first time. Revert the operative part of r139135 and
add more showing of my work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139136 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix flipped sign. While there, show my math.
Nick Lewycky [Tue, 6 Sep 2011 05:33:18 +0000 (05:33 +0000)]
Fix flipped sign. While there, show my math.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139135 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNo no no, fix typo properly!
Nick Lewycky [Tue, 6 Sep 2011 05:08:09 +0000 (05:08 +0000)]
No no no, fix typo properly!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139134 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe logic inside getMulExpr to simplify {a,+,b}*{c,+,d} was wrong, which was
Nick Lewycky [Tue, 6 Sep 2011 05:05:14 +0000 (05:05 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139133 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r139126 due to selfhost failures reported by buildbots.
Nick Lewycky [Tue, 6 Sep 2011 02:43:13 +0000 (02:43 +0000)]
Revert r139126 due to selfhost failures reported by buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139130 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach SCEV to report a max backedge count in one interesting case in
Nick Lewycky [Mon, 5 Sep 2011 23:25:16 +0000 (23:25 +0000)]
Teach SCEV to report a max backedge count in one interesting case in
HowFarToZero; the case for a canonical loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139126 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a new MC bit for NaCl (Native Client) mode. NaCl requires that certain
Nick Lewycky [Mon, 5 Sep 2011 21:51:43 +0000 (21:51 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139125 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate the C++ backend to use the new ArrayRef'ified APIs. Patch by arrowdodger!
Nick Lewycky [Mon, 5 Sep 2011 18:50:59 +0000 (18:50 +0000)]
Update the C++ backend to use the new ArrayRef'ified APIs. Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139124 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typo in comment.
Nick Lewycky [Mon, 5 Sep 2011 18:35:03 +0000 (18:35 +0000)]
Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139122 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoInstSimplify: Don't try to replace an extractvalue/insertvalue pair with the original...
Benjamin Kramer [Mon, 5 Sep 2011 18:16:19 +0000 (18:16 +0000)]
InstSimplify: Don't try to replace an extractvalue/insertvalue pair with the original value if types don't match.

Fixes clang selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139120 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDelete trivial landing pads that just continue unwinding the caught
Duncan Sands [Mon, 5 Sep 2011 12:57:57 +0000 (12:57 +0000)]
Delete trivial landing pads that just continue unwinding the caught
exception.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139117 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd some simple insertvalue simplifications, for the purpose of cleaning
Duncan Sands [Mon, 5 Sep 2011 06:52:48 +0000 (06:52 +0000)]
Add some simple insertvalue simplifications, for the purpose of cleaning
up do-nothing exception handling code produced by dragonegg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139113 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse canonical forms for the branch probability zero heutistic.
Benjamin Kramer [Sun, 4 Sep 2011 23:53:04 +0000 (23:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139110 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAs a (rather delayed) followup to r136738 which stopped building the
Chandler Carruth [Sun, 4 Sep 2011 23:32:05 +0000 (23:32 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139108 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoComplete the removal of FindBison from CMake. Noticed this when browsing
Chandler Carruth [Sun, 4 Sep 2011 23:29:12 +0000 (23:29 +0000)]
Complete the removal of FindBison from CMake. Noticed this when browsing
some CMake patch backlog...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139107 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate the CMake documentation to the correct variables.
Chandler Carruth [Sun, 4 Sep 2011 23:24:13 +0000 (23:24 +0000)]
Update the CMake documentation to the correct variables.

Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139106 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse Duncan's patch to delete the instructions in reverse order (minus the landingpad...
Bill Wendling [Sun, 4 Sep 2011 09:43:36 +0000 (09:43 +0000)]
Use Duncan's patch to delete the instructions in reverse order (minus the landingpad and terminator).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139090 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe insertion point for the loads is right before the llvm.eh.exception
Bill Wendling [Sun, 4 Sep 2011 09:02:18 +0000 (09:02 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139088 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agovalgrind: Suppress glibc's optiized strcasecmp harder.
Benjamin Kramer [Sat, 3 Sep 2011 17:59:31 +0000 (17:59 +0000)]
valgrind: Suppress glibc's optiized strcasecmp harder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139084 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse internal storage for command line option.
Benjamin Kramer [Sat, 3 Sep 2011 03:45:06 +0000 (03:45 +0000)]
Use internal storage for command line option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139079 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't reload the values that are already there. The llvm.eh.resume uses the same
Bill Wendling [Sat, 3 Sep 2011 01:38:17 +0000 (01:38 +0000)]
Don't reload the values that are already there. The llvm.eh.resume uses the same
values that the resume instruction uses.
PR10850

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139076 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExclude more arm jit failures pending PR10783.
Andrew Trick [Sat, 3 Sep 2011 01:08:35 +0000 (01:08 +0000)]
Exclude more arm jit failures pending PR10783.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139074 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX versions to match AESENC/AESDEC intrinsics. This hopefully ends
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:47:08 +0000 (00:47 +0000)]
Add AVX versions to match AESENC/AESDEC intrinsics. This hopefully ends
the cycle of missing AVX counterparts of already present SSE* patterns

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139073 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX version of a SSE4.1 VPBLENDVB pattern
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:47:05 +0000 (00:47 +0000)]
Add AVX version of a SSE4.1 VPBLENDVB pattern

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139072 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX versions of SSE4.1 EXTRACTPS patterns
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:47:03 +0000 (00:47 +0000)]
Add AVX versions of SSE4.1 EXTRACTPS patterns

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139071 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX versions for SSE4.1 MOVZX* patterns
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:47:01 +0000 (00:47 +0000)]
Add AVX versions for SSE4.1 MOVZX* patterns

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139070 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd one more AVX pattern for MOVZPQILo2PQI
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:58 +0000 (00:46 +0000)]
Add one more AVX pattern for MOVZPQILo2PQI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139069 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove PUNPCKLQDQ splat pattern close to the instruction definition and
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:56 +0000 (00:46 +0000)]
Move PUNPCKLQDQ splat pattern close to the instruction definition and
duplicate it for AVX mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139068 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX pattern versions for PSHUFB,PSIGN{B,W,D}
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:54 +0000 (00:46 +0000)]
Add AVX pattern versions for PSHUFB,PSIGN{B,W,D}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139067 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX versions of MOVZDI2PDI patterns. Use SUBREG_TO_REG to indicate
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:51 +0000 (00:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139066 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnforce subtarget checks in a few places to be explicit when the
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:49 +0000 (00:46 +0000)]
Enforce subtarget checks in a few places to be explicit when the
pattern should be matched

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139065 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTidy up code moving patterns to their appropriate place!
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:47 +0000 (00:46 +0000)]
Tidy up code moving patterns to their appropriate place!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139064 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd AVX versions of FsMOVAPS and FsMOVAPS. Teach X86InstrInfo how to use
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:45 +0000 (00:46 +0000)]
Add AVX versions of FsMOVAPS and FsMOVAPS. Teach X86InstrInfo how to use
it!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139063 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach X86FastISel to use AVX versions of instructions when possible
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:42 +0000 (00:46 +0000)]
Teach X86FastISel to use AVX versions of instructions when possible

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139062 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix 80-column and style
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:40 +0000 (00:46 +0000)]
Fix 80-column and style

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139061 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTidy up some SSE/AVX convert intrinsics. Also add an AVX version of
Bruno Cardoso Lopes [Sat, 3 Sep 2011 00:46:38 +0000 (00:46 +0000)]
Tidy up some SSE/AVX convert intrinsics. Also add an AVX version of
OptForSize pattern

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139060 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a truly heinous bug in DAGCombine related to AssertZext.
Owen Anderson [Sat, 3 Sep 2011 00:26:49 +0000 (00:26 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139059 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r129875, XFAILing this test for arm, since the fix was reverted.
Dan Gohman [Sat, 3 Sep 2011 00:14:24 +0000 (00:14 +0000)]
Revert r129875, XFAILing this test for arm, since the fix was reverted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139058 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPseudo CMOV instructions don't clobber EFLAGS.
Jakob Stoklund Olesen [Fri, 2 Sep 2011 23:52:55 +0000 (23:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139057 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCheck for EFLAGS live-out before clobbering it.
Jakob Stoklund Olesen [Fri, 2 Sep 2011 23:52:52 +0000 (23:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139056 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse existing function.
Jakob Stoklund Olesen [Fri, 2 Sep 2011 23:52:49 +0000 (23:52 +0000)]
Use existing function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139055 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for CBZ/CBNZ.
Jim Grosbach [Fri, 2 Sep 2011 23:46:10 +0000 (23:46 +0000)]
Thumb2 parsing and encoding for CBZ/CBNZ.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139054 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for BXJ.
Jim Grosbach [Fri, 2 Sep 2011 23:43:09 +0000 (23:43 +0000)]
Thumb2 parsing and encoding for BXJ.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139053 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for BIC.
Jim Grosbach [Fri, 2 Sep 2011 23:37:54 +0000 (23:37 +0000)]
Thumb2 parsing and encoding for BIC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139052 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for BFI.
Jim Grosbach [Fri, 2 Sep 2011 23:28:46 +0000 (23:28 +0000)]
Thumb2 parsing and encoding for BFI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139051 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for BFC.
Jim Grosbach [Fri, 2 Sep 2011 23:25:46 +0000 (23:25 +0000)]
Thumb2 parsing and encoding for BFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139050 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding of B instruction.
Jim Grosbach [Fri, 2 Sep 2011 23:22:08 +0000 (23:22 +0000)]
Thumb2 parsing and encoding of B instruction.

Tweak handling of IT blocks a bit to enable this. The differentiation between
B and Bcc needs special sauce.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139049 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAttempt to silence known valgrind errors.
Andrew Trick [Fri, 2 Sep 2011 22:59:34 +0000 (22:59 +0000)]
Attempt to silence known valgrind errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139048 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove unused variables.
Jakob Stoklund Olesen [Fri, 2 Sep 2011 22:41:25 +0000 (22:41 +0000)]
Remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139047 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry to eliminate the use of the 'unwind' instruction.
Bill Wendling [Fri, 2 Sep 2011 22:41:11 +0000 (22:41 +0000)]
Try to eliminate the use of the 'unwind' instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139046 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't fast-isel for atomic load/store; some cases require extra handling missing...
Eli Friedman [Fri, 2 Sep 2011 22:33:24 +0000 (22:33 +0000)]
Don't fast-isel for atomic load/store; some cases require extra handling missing from fast-isel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139044 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThumb2 parsing and encoding for ASR.
Jim Grosbach [Fri, 2 Sep 2011 21:28:54 +0000 (21:28 +0000)]
Thumb2 parsing and encoding for ASR.

For other shift and rotate instructions, too. Tests for those forthcoming
as I work my way through the ISA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139040 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBetter fix for this testcase. Update it to the new EH scheme entirely.
Bill Wendling [Fri, 2 Sep 2011 21:27:08 +0000 (21:27 +0000)]
Better fix for this testcase. Update it to the new EH scheme entirely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139039 91177308-0d34-0410-b5e6-96231b3b80d8