Kalle Raiskila
e0a1d2b32c
Use i8 as SETCC result type for i1 in SPU.
...
llvm-svn: 120092
2010-11-24 12:59:16 +00:00
Kalle Raiskila
97fc68774c
Allow for 'fcmp ogt' in SPU.
...
Fix by Visa Putkinen!
llvm-svn: 120090
2010-11-24 11:42:17 +00:00
Rafael Espindola
4e70ac7b68
If a symbol is used as tls, mark it as tls even if not declare as so. Probably
...
fixes PR8659.
llvm-svn: 120076
2010-11-24 02:19:40 +00:00
NAKAMURA Takumi
cf3475172f
include/llvm/System/system_error.h: ECANCELED is undefined on Cygwin-1.5.
...
llvm-svn: 120072
2010-11-24 01:29:45 +00:00
Ted Kremenek
1ef52416c7
Tweak ImmutableMap/ImmutableSet/ImmutableList APIs
...
to use lowercase letters for the start of most
method names and to replace some method names
with more descriptive names (e.g., "getLeft()"
instead of "Left()"). No real functionality
change.
llvm-svn: 120070
2010-11-24 00:54:28 +00:00
Jakob Stoklund Olesen
00430319a8
Generalize overflowLeaf to also handle overflows in branch nodes.
...
This doesn't quite work yet because the calls to treeDecrement and treeIncrement
operate at the leaf level, not on pathNode(Level) as required.
llvm-svn: 120068
2010-11-24 00:03:32 +00:00
Chris Lattner
6bf4e6d8b2
add a MemoryBuffer::getOpenFile method, which turns an open
...
file descriptor into a MemoryBuffer (and closes the FD).
llvm-svn: 120065
2010-11-23 22:20:27 +00:00
Michael J. Spencer
5aef638057
system_error: Add fixme.
...
llvm-svn: 120059
2010-11-23 21:09:11 +00:00
Duncan Sands
0488d564e1
Rename SimplifyDistributed to the more meaningfull name SimplifyByFactorizing.
...
llvm-svn: 120051
2010-11-23 20:42:39 +00:00
Benjamin Kramer
94a622af4c
The srem -> urem transform is not safe for any divisor that's not a power of two.
...
E.g. -5 % 5 is 0 with srem and 1 with urem.
Also addresses Frits van Bommel's comments.
llvm-svn: 120049
2010-11-23 20:33:57 +00:00
Duncan Sands
433c1679cf
Replace calls to ConstantFoldInstruction with calls to SimplifyInstruction
...
in two places that are really interested in simplified instructions, not
constants.
llvm-svn: 120044
2010-11-23 20:26:33 +00:00
Duncan Sands
bb2cd025a9
Constant folding here is pointless, because InstructionSimplify
...
(which does constant folding and more) is called a few lines
later.
llvm-svn: 120042
2010-11-23 20:24:21 +00:00
Jason W Kim
8e21bf84e8
Move the ARM reloc constants to Support/ELF.h
...
llvm-svn: 120035
2010-11-23 19:40:36 +00:00
Bob Wilson
d7d2cf7842
Recognize sign/zero-extended constant BUILD_VECTORs for VMULL operations.
...
We need to check if the individual vector elements are sign/zero-extended
values. For now this only handles constants values. Radar 8687140.
llvm-svn: 120034
2010-11-23 19:38:38 +00:00
Bob Wilson
b91ae1ac52
Fix copy-and-paste error in exception message.
...
llvm-svn: 120033
2010-11-23 19:38:34 +00:00
Benjamin Kramer
b5afa65b0a
InstCombine: Reduce "X shift (A srem B)" to "X shift (A urem B)" iff B is positive.
...
This allows to transform the rem in "1 << ((int)x % 8);" to an and.
llvm-svn: 120028
2010-11-23 18:52:42 +00:00
Duncan Sands
60813f96e0
Propagate LeftDistributes and RightDistributes into their only uses.
...
Stylistic improvement suggested by Frits van Bommel.
llvm-svn: 120026
2010-11-23 15:28:14 +00:00
Duncan Sands
22df741687
Fix typo pointed out by Frits van Bommel and Marius Wachtler.
...
llvm-svn: 120025
2010-11-23 15:25:34 +00:00
Duncan Sands
adc7771f18
Exploit distributive laws (eg: And distributes over Or, Mul over Add, etc) in a
...
fairly systematic way in instcombine. Some of these cases were already dealt
with, in which case I removed the existing code. The case of Add has a bunch of
funky logic which covers some of this plus a few variants (considers shifts to be
a form of multiplication), which I didn't touch. The simplification performed is:
A*B+A*C -> A*(B+C). The improvement is to do this in cases that were not already
handled [such as A*B-A*C -> A*(B-C), which was reported on the mailing list], and
also to do it more often by not checking for "only one use" if "B+C" simplifies.
llvm-svn: 120024
2010-11-23 14:23:47 +00:00
Kalle Raiskila
e1b6c273b8
Division by pow-of-2 is not cheap on SPU, do it with
...
shifts.
llvm-svn: 120022
2010-11-23 13:27:59 +00:00
Rafael Espindola
f6c05b1d01
Implement the rex64 prefix.
...
llvm-svn: 120017
2010-11-23 11:23:24 +00:00
Duncan Sands
a021988d64
Expand a little on the description of what InstructionSimplify does.
...
llvm-svn: 120016
2010-11-23 10:50:08 +00:00
Duncan Sands
763dec0ab8
Clarify that constant folding of instructions applies when all operands
...
are constant. There was in fact one exception to this (phi nodes) - so
remove that exception (InstructionSimplify handles this so there should
be no loss).
llvm-svn: 120015
2010-11-23 10:16:18 +00:00
Rafael Espindola
5c1d4e3b1e
Invalidate the layout on any relaxation, not just Instructions. Bug found by David Meyer.
...
While here, remove unused argument and rename UpdateForSlide to Invalidate.
llvm-svn: 120009
2010-11-23 08:08:33 +00:00
Rafael Espindola
3c7cab1402
Produce a relocation for pcrel absolute values. Based on a patch by David Meyer.
...
llvm-svn: 120006
2010-11-23 07:20:12 +00:00
Cameron Zwarich
767a389fa5
Optimize a common case in the Lengauer-Tarjan dominators algorithm. This gives a
...
9.7% speedup running domtree on test-suite.
Reviewed by Chris Lattner.
llvm-svn: 120003
2010-11-23 06:32:37 +00:00
Chris Lattner
2dd97d2d60
Revert functionality doug added in r98575 that was never
...
documented and only used by some clang stuff I just removed.
llvm-svn: 120002
2010-11-23 06:09:51 +00:00
Rafael Espindola
6e13aa1d3b
Reuse data fragments while lowering. Patch by David Meyer.
...
llvm-svn: 119999
2010-11-23 05:49:35 +00:00
Zhanyong Wan
19b96fd4ee
Fix formatting nits in the coding standards. Reviewed by clattner.
...
llvm-svn: 119998
2010-11-23 05:03:07 +00:00
Chris Lattner
a5f868ce03
fix this harder.
...
llvm-svn: 119994
2010-11-23 04:26:12 +00:00
Chris Lattner
13b981b26f
fix a bug I introduced on the other side of the #ifdef
...
llvm-svn: 119993
2010-11-23 04:19:56 +00:00
Chris Lattner
8bec7227d4
reimplement SwapByteOrder.h in terms of overloading instead of
...
being in terms of excessively complex template logic.
llvm-svn: 119992
2010-11-23 04:04:25 +00:00
Wesley Peck
527da1b6e2
Renaming ISD::BIT_CONVERT to ISD::BITCAST to better reflect the LLVM IR concept.
...
llvm-svn: 119990
2010-11-23 03:31:01 +00:00
Chris Lattner
4329e078ac
add a 'LLVMConstIntOfArbitraryPrecision' api to the C api,
...
patch by Greg Pfeil!
llvm-svn: 119989
2010-11-23 02:47:22 +00:00
Chris Lattner
e5afa15b77
duncan's spider sense was right, I completely reversed the condition
...
on this instcombine xform. This fixes a miscompilation of 403.gcc.
llvm-svn: 119988
2010-11-23 02:42:04 +00:00
Chris Lattner
adc29567fc
filecheckize
...
llvm-svn: 119987
2010-11-23 02:26:52 +00:00
Jason W Kim
767a1e9adc
Fixed some style issues (no _, no spc after !)
...
llvm-svn: 119986
2010-11-22 22:05:16 +00:00
Rafael Espindola
6e39a50fd5
Remove duplicated constants. Thanks to Jason for noticing it.
...
llvm-svn: 119985
2010-11-22 21:49:05 +00:00
Benjamin Kramer
f1ebb63161
InstCombine: Implement X - A*-B -> X + A*B.
...
llvm-svn: 119984
2010-11-22 20:31:27 +00:00
Jason W Kim
16b75262c4
Make the <ARCH>ELFObjectWriter statics private
...
llvm-svn: 119982
2010-11-22 18:57:00 +00:00
Jason W Kim
84ffdd5cf1
Fix misplaced statics.
...
llvm-svn: 119981
2010-11-22 18:47:05 +00:00
Jason W Kim
a262546df7
Kill trailing whitespace
...
llvm-svn: 119979
2010-11-22 18:42:07 +00:00
Jason W Kim
7c7d0ef287
Refactor the ELFRelocationEntry (pull up) and move the arch-specific statics to inside the class where it belongs.
...
Next step is to rationally break apart the RecordRelocation()
Probably the step will be to have 1 member function for ech slot of the ELFRelocationEntry()
llvm-svn: 119978
2010-11-22 18:41:13 +00:00
Evan Cheng
eb56dca4fd
Fix epilogue codegen to avoid leaving the stack pointer in an invalid
...
state. Previously Thumb2 would restore sp from fp like this:
mov sp, r7
sub, sp, #4
If an interrupt is taken after the 'mov' but before the 'sub', callee-saved
registers might be clobbered by the interrupt handler. Instead, try
restoring directly from sp:
add sp, #4
Or, if necessary (with VLA, etc.) use a scratch register to compute sp and
then restore it:
sub.w r4, r7, #8
mov sp, r7
rdar://8465407
llvm-svn: 119977
2010-11-22 18:12:04 +00:00
Mikhail Glushenkov
abc0204bf6
Add a newline.
...
llvm-svn: 119976
2010-11-22 17:10:20 +00:00
Mikhail Glushenkov
3c60f755c3
llvmc: Make -march/-mcpu/-mtune behaviour more consistent with gcc.
...
llvm-svn: 119975
2010-11-22 17:10:09 +00:00
Duncan Sands
c133c54426
If a GEP index simply advances by multiples of a type of zero size,
...
then replace the index with zero.
llvm-svn: 119974
2010-11-22 16:32:50 +00:00
Kalle Raiskila
77d11d054c
Fix a bug with extractelement on SPU.
...
In the attached testcase, the element was
never extracted (missing rotate).
llvm-svn: 119973
2010-11-22 16:28:26 +00:00
Rafael Espindola
3c227b0b89
Add basic CFI methods to the streamer interface.
...
llvm-svn: 119972
2010-11-22 14:27:24 +00:00
Duncan Sands
8a0f486e36
Move the "gep undef" -> "undef" transform from instcombine to
...
InstructionSimplify.
llvm-svn: 119970
2010-11-22 13:42:49 +00:00
Rafael Espindola
556f203d64
Remove some #includes.
...
llvm-svn: 119967
2010-11-22 11:53:17 +00:00
Benjamin Kramer
24656c9583
Implement the "if (X == 6 || X == 4)" -> "if ((X|2) == 6)" optimization.
...
This currently only catches the most basic case, a two-case switch, but can be
extended later.
llvm-svn: 119964
2010-11-22 09:45:38 +00:00
Duncan Sands
c6648eb4c3
Don't keep track of inserted phis in PromoteMemoryToRegister: the information
...
is never used. Patch by Cameron Zwarich.
llvm-svn: 119963
2010-11-22 09:41:24 +00:00
Duncan Sands
5cadccc4ea
Fix a compiler warning about Kind being used uninitialized
...
when assertions are disabled.
llvm-svn: 119962
2010-11-22 09:38:00 +00:00
Eric Christopher
37b0736bdc
Pseudos default to 4byte size, let the instruction size field notice
...
that branch tables are special.
llvm-svn: 119954
2010-11-21 23:38:19 +00:00
Wesley Peck
7699d6cfe9
Implement ELF object file writing support for the MBlaze backend. Its not perfect yet, but it works for many tests.
...
llvm-svn: 119952
2010-11-21 22:06:28 +00:00
Wesley Peck
f1d3800e65
Implement branch analysis in the MBlaze backend.
...
llvm-svn: 119951
2010-11-21 21:53:36 +00:00
Wesley Peck
f4efd582ad
Make it a little bit more explicit that the MBlaze backend only supports upto
...
32-bit immediate values.
llvm-svn: 119950
2010-11-21 21:39:46 +00:00
Wesley Peck
7493e30d42
Fix an error in the MBlaze delay slot filler where instructions that already
...
fill a delay slot are moved to fill a different delay slot.
llvm-svn: 119949
2010-11-21 21:36:12 +00:00
Chris Lattner
fc9aead6fd
fix comment
...
llvm-svn: 119948
2010-11-21 19:05:34 +00:00
Chris Lattner
5d2262dc76
apparently tailcalls are better on darwin/x86-64 than on linux?
...
llvm-svn: 119947
2010-11-21 18:59:20 +00:00
Benjamin Kramer
585dfa2b3d
Initialize MemDep's TD member so buildbots don't trip over an uninitialized pointer (TD is passed to PHITransAddr).
...
I wonder why this didn't explode earlier.
llvm-svn: 119944
2010-11-21 15:21:46 +00:00
Duncan Sands
cf4bceba49
Add a rather pointless InstructionSimplify transform, inspired by recent constant
...
folding improvements: if P points to a type of size zero, turn "gep P, N" into "P".
More generally, if a gep index type has size zero, instcombine could replace the
index with zero, but that is not done here.
llvm-svn: 119942
2010-11-21 13:53:09 +00:00
Duncan Sands
1f86be9164
Fix spelling.
...
llvm-svn: 119941
2010-11-21 12:43:13 +00:00
Bill Wendling
22db31305f
More Thumb encodings.
...
llvm-svn: 119940
2010-11-21 11:49:36 +00:00
Bill Wendling
c01d679928
Add encoding for ARM "trap" instruction.
...
llvm-svn: 119938
2010-11-21 11:05:29 +00:00
Bill Wendling
219dabdf68
The "trap" instruction is one of this which doesn't have a condition code. Hack
...
the code to not add a "condition code" if it's trap.
llvm-svn: 119937
2010-11-21 10:56:05 +00:00
Bill Wendling
3acd02706a
- Give "trap" the correct encoding, at least according to Darwin's assembler.
...
- Add comments saying where the encodings for other instructions came from.
llvm-svn: 119936
2010-11-21 10:55:23 +00:00
Chris Lattner
6ce038082b
apply Dan's fix for PR8268 which allows constant folding to handle indexes over
...
zero sized elements. This allows us to compile:
#include <string>
void foo() { std::string s; }
into an empty function.
llvm-svn: 119933
2010-11-21 08:39:01 +00:00
Chris Lattner
526cce12f5
add some helper methods for asmprinter flags, from PR8417
...
llvm-svn: 119932
2010-11-21 08:30:55 +00:00
Chris Lattner
b4cd1819fa
implement PR8524, apparently mainline gas accepts movq as an alias for movd
...
when transfering between i64 gprs and mmx regs.
llvm-svn: 119931
2010-11-21 08:18:57 +00:00
Chris Lattner
5957229659
rework some DSE paths to use the newly-public "getPointerDependencyFrom"
...
method in MemDep instead of inserting an instruction, doing a query,
then removing it. Neither operation is effectively cached.
llvm-svn: 119930
2010-11-21 08:06:10 +00:00
Chris Lattner
e69672c44f
the getLocationForSource/Dest methods can be static.
...
llvm-svn: 119929
2010-11-21 08:05:25 +00:00
Chris Lattner
663ba91cc6
add "getLocation" method to AliasAnalysis for getting the source and
...
destination location of a memcpy/memmove. I'm not clear about whether
TBAA works on these, so I'm leaving it out for now. Dan, please revisit
this when convenient.
llvm-svn: 119928
2010-11-21 07:51:27 +00:00
Chris Lattner
e48c31ce33
implement PR8576, deleting dead stores with intervening may-alias stores.
...
llvm-svn: 119927
2010-11-21 07:34:32 +00:00
Chris Lattner
6e22221b37
file checkize
...
llvm-svn: 119926
2010-11-21 07:32:40 +00:00
Chris Lattner
9165d9d2ac
add some random notes.
...
llvm-svn: 119925
2010-11-21 07:05:31 +00:00
Owen Anderson
7e484e0be7
Use by-name rather than by-order operand matching for some NEON encodings.
...
llvm-svn: 119923
2010-11-21 06:47:06 +00:00
Chris Lattner
f7e896138e
optimize:
...
void a(int x) { if (((1<<x)&8)==0) b(); }
into "x != 3", which occurs over 100 times in 403.gcc but in no
other program in llvm-test.
llvm-svn: 119922
2010-11-21 06:44:42 +00:00
Chris Lattner
9de0176ef8
tail calls on x86 are implemented.
...
llvm-svn: 119920
2010-11-21 06:10:27 +00:00
Jim Grosbach
e040a46eb3
BR_JTadd is ARM-only, so use the proper pseudo class to get the predicate.
...
llvm-svn: 119918
2010-11-21 01:26:01 +00:00
Rafael Espindola
26cb15a549
Handle PCRel relocations with absolute values. Fixes PR8656.
...
llvm-svn: 119917
2010-11-21 00:48:25 +00:00
Chris Lattner
58f9f58716
Implement PR8644: forwarding a memcpy value to a byval,
...
allowing the memcpy to be eliminated.
Unfortunately, the requirements on byval's without explicit
alignment are really weak and impossible to predict in the
mid-level optimizer, so this doesn't kick in much with current
frontends. The fix is to change clang to set alignment on all
byval arguments.
llvm-svn: 119916
2010-11-21 00:28:59 +00:00
Chris Lattner
d78dbee431
a byval argument without an align can have an arbitrary alignment
...
requirement on the input pointer.
llvm-svn: 119914
2010-11-20 23:49:06 +00:00
Bill Wendling
c31de25137
A few more thumb instruction MC encodings.
...
llvm-svn: 119913
2010-11-20 22:52:33 +00:00
Eric Christopher
0a3c28bd6b
Rewrite address handling to use a structure with all the possible address
...
mode variables. Handle frame indexes in load/store and allocas again.
llvm-svn: 119912
2010-11-20 22:38:27 +00:00
Eric Christopher
d0aec3bf64
STRH only needs the additional operand, not t2STRH. Also invert conditional
...
to match the one from the load emitter above.
llvm-svn: 119911
2010-11-20 22:01:38 +00:00
Benjamin Kramer
ddd1b7b801
Simplify code. No change in functionality.
...
llvm-svn: 119908
2010-11-20 18:43:35 +00:00
Frits van Bommel
da17c921ba
Test commit: Fix two -Asserts mode warnings in StringMap.h.
...
llvm-svn: 119907
2010-11-20 18:37:24 +00:00
Anton Korobeynikov
36590fc72a
Make this compile on case-sensitive file systemsw
...
llvm-svn: 119905
2010-11-20 16:14:57 +00:00
Anton Korobeynikov
4687778398
Move some more hooks to TargetFrameInfo
...
llvm-svn: 119904
2010-11-20 15:59:32 +00:00
Benjamin Kramer
f6fb58a216
Silence Release build warnings about unused functions.
...
llvm-svn: 119903
2010-11-20 15:53:24 +00:00
Francois Pichet
4fd9b685ff
Disable warning C4291 on MSVC. Caused because class AttributeList provides a non implemented operator delete without a corresponding new.
...
llvm-svn: 119902
2010-11-20 15:39:03 +00:00
Duncan Sands
7c601ded34
On X86, MEMBARRIER, MFENCE, SFENCE, LFENCE are not target memory intrinsics,
...
so don't claim they are. They are allocated using DAG.getNode, so attempts
to access MemSDNode fields results in reading off the end of the allocated
memory. This fixes crashes with "llc -debug" due to debug code trying to
print MemSDNode fields for these barrier nodes (since the crashes are not
deterministic, use valgrind to see this). Add some nasty checking to try
to catch this kind of thing in the future.
llvm-svn: 119901
2010-11-20 11:25:00 +00:00
Andrew Trick
cf7fefb25c
Removing the useless test that I added recently. It was meant as an example, but not complicated enough to merit another test.
...
llvm-svn: 119898
2010-11-20 07:26:51 +00:00
Andrew Trick
ada75c5ad1
RABasic fix. Regalloc is responsible for updating block live ins.
...
llvm-svn: 119896
2010-11-20 02:57:05 +00:00
Andrew Trick
799ec1c4d6
Whitespace.
...
llvm-svn: 119895
2010-11-20 02:43:55 +00:00
Jakob Stoklund Olesen
40e78b4da0
Fix old GCC build error.
...
llvm-svn: 119884
2010-11-20 01:24:43 +00:00
Bill Wendling
284326bd69
Add more Thumb add instruction encodings.
...
llvm-svn: 119883
2010-11-20 01:18:47 +00:00
Bill Wendling
fe1de03629
Add Thumb encodings for some add instructions.
...
llvm-svn: 119882
2010-11-20 01:00:29 +00:00
Bill Wendling
e60fd5a9db
Add more encodings for Thumb instructions.
...
llvm-svn: 119881
2010-11-20 00:53:35 +00:00
Jakob Stoklund Olesen
8bf9e546d4
Detemplatize NodeRef.
...
It is now possible to navigate the B+-tree using NodeRef::subtree() and
NodeRef::size() without knowing the key and value template types used in the
tree.
llvm-svn: 119880
2010-11-20 00:49:00 +00:00
Jakob Stoklund Olesen
3864c518c2
Rename NodeBase::{key,val} as {first,second} and swap the BranchNode arrays such
...
that the noderefs are the first member in the object.
This is in preparation of detemplatization of tree navigation.
llvm-svn: 119879
2010-11-20 00:48:57 +00:00
Bill Wendling
0914d44fa4
Have the getAddrMode3OpValue() function in ARMCodeEmitter.cpp produce the same
...
value that the one in ARMMCCodeEmitter.cpp does.
llvm-svn: 119878
2010-11-20 00:26:37 +00:00
Bill Wendling
54df187f25
Check for _setjmp too, because it's also used.
...
llvm-svn: 119875
2010-11-20 00:03:09 +00:00
Jakob Stoklund Olesen
6ae70b2e0f
Implement IntervalMap destructor.
...
Key and value objects may not be destructed instantly when they are erased from
the container, but they will be destructed eventually by the IntervalMap
destructor.
llvm-svn: 119873
2010-11-19 23:28:59 +00:00
Jakob Stoklund Olesen
c041268c8c
Implement IntervalMap::clear().
...
llvm-svn: 119872
2010-11-19 23:28:57 +00:00
Jakob Stoklund Olesen
46389fda3b
Support backwards iteration starting from end().
...
llvm-svn: 119871
2010-11-19 23:28:53 +00:00
Dale Johannesen
87a98b57b8
Add test for PR 8111. By Frits van Bommel.
...
llvm-svn: 119870
2010-11-19 23:23:22 +00:00
Jim Grosbach
2aff392af9
Fix ARM LDR* post-indexed operand encoding.
...
llvm-svn: 119869
2010-11-19 23:14:43 +00:00
Bill Wendling
1825cc74f4
Encodings for the compare instructions.
...
llvm-svn: 119868
2010-11-19 23:14:32 +00:00
Owen Anderson
b4fd2c90e9
The Vm and Vn register fields must be the same for a register-register vmov.
...
llvm-svn: 119867
2010-11-19 23:12:43 +00:00
Evan Cheng
a5f048485f
Fix a cut-n-paste-error.
...
llvm-svn: 119866
2010-11-19 23:01:16 +00:00
Owen Anderson
ea326db47b
Document the new GVN number table structure.
...
llvm-svn: 119865
2010-11-19 22:48:40 +00:00
Jim Grosbach
785952e5ac
Operand names
...
llvm-svn: 119864
2010-11-19 22:43:08 +00:00
Jim Grosbach
5876e41c9f
trailing whitespace
...
llvm-svn: 119863
2010-11-19 22:42:55 +00:00
Eric Christopher
35e2d7f610
Don't need to save piecemeal now.
...
llvm-svn: 119862
2010-11-19 22:39:56 +00:00
Eric Christopher
cee83d6e6b
Update comment.
...
llvm-svn: 119861
2010-11-19 22:37:58 +00:00
Bill Wendling
a82fb71324
Add encodings for some of the thumb ADD instructions. Tests will come once the
...
asm parser can handle them.
llvm-svn: 119860
2010-11-19 22:37:33 +00:00
Eric Christopher
558b61e2d4
Update comment.
...
llvm-svn: 119859
2010-11-19 22:36:41 +00:00
Jim Grosbach
7d8df3185f
Clarify operand names.
...
llvm-svn: 119858
2010-11-19 22:36:02 +00:00
Owen Anderson
c0177aeb71
Add a test for CodeGenPrepare's ability to look through PHI nodes when performing
...
addressing mode folding, introduced in r119853.
llvm-svn: 119857
2010-11-19 22:34:53 +00:00
Eric Christopher
fef5f315af
Refactor address mode handling into a single struct (ala x86), this
...
should give allow a wider range of addressing modes.
No functional change.
llvm-svn: 119856
2010-11-19 22:30:02 +00:00
Jim Grosbach
48bf4f8e56
Fix encoding for ARM MLS instruction.
...
llvm-svn: 119855
2010-11-19 22:22:37 +00:00
Owen Anderson
dfb8c3bbfc
When folding addressing modes in CodeGenPrepare, attempt to look through PHI nodes
...
if all the operands of the PHI are equivalent. This allows CodeGenPrepare to undo
unprofitable PRE transforms.
llvm-svn: 119853
2010-11-19 22:15:03 +00:00
Jim Grosbach
09d7bfd886
Add ARM encoding information for STRD.
...
llvm-svn: 119852
2010-11-19 22:14:31 +00:00
Jim Grosbach
5a77b8b5c4
Shuffle things around a bit to keep like things together. Tidy up formatting.
...
llvm-svn: 119851
2010-11-19 22:06:57 +00:00
Bill Wendling
c92a5770df
Revert accidental commit.
...
llvm-svn: 119850
2010-11-19 22:06:18 +00:00
Bill Wendling
49a2e2384b
Change long binary encodings to use hex instead. It's more readable. Also
...
initialize missing bit.
llvm-svn: 119849
2010-11-19 22:02:18 +00:00
Dale Johannesen
c9242c577e
Prefetch has a MemOperand now. FileCheckize a test.
...
This finishes up 8460971.
llvm-svn: 119848
2010-11-19 21:49:38 +00:00
Jim Grosbach
6e9aace4f3
Factor out operand encoding bits for ARM addressing mode 2 store instructions.
...
llvm-svn: 119846
2010-11-19 21:35:06 +00:00
Jim Grosbach
09f6823eb6
Delete another dead class.
...
llvm-svn: 119844
2010-11-19 21:16:08 +00:00
Jim Grosbach
e093e5f0dc
whitespace tweak.
...
llvm-svn: 119843
2010-11-19 21:14:37 +00:00
Rafael Espindola
cf14a382ec
Fix a use after free. Patch by Frits van Bommel.
...
llvm-svn: 119842
2010-11-19 21:14:29 +00:00
Jim Grosbach
d6e5c9f2fe
Refactor PICSTR* instructions to really be pseudos. Nuke dead classes.
...
llvm-svn: 119841
2010-11-19 21:14:02 +00:00
Jim Grosbach
4a22eba616
Rename ARM .td class AIldst1 to AI2ldst for consistency with the other classes.
...
llvm-svn: 119840
2010-11-19 21:07:51 +00:00
Jim Grosbach
003c6e700b
Add ARM binary encoding information for the rest of the indexed loads.
...
llvm-svn: 119821
2010-11-19 19:41:26 +00:00
Jakob Stoklund Olesen
8e0cc61f35
Rename methods for clarity instead of brevity. No functional changes.
...
llvm-svn: 119820
2010-11-19 19:10:39 +00:00
Mon P Wang
88ff56caa3
Make isScalarToVector to return false if the node is a scalar. This will prevent
...
DAGCombine from making an illegal transformation of bitcast of a scalar to a
vector into a scalar_to_vector.
llvm-svn: 119819
2010-11-19 19:08:12 +00:00
Jakob Stoklund Olesen
55964f6a75
Include raw_ostream.h unconditionally even if it is only used for debug code.
...
We don't want any clients acidentally depending on this and then failing in a
-Asserts build.
llvm-svn: 119818
2010-11-19 18:51:46 +00:00
Kevin Enderby
8be14414f6
Added support for the Mach-O .symbol_resolver directive. rdar://8673046
...
llvm-svn: 119816
2010-11-19 18:39:33 +00:00
Jim Grosbach
c6ac246671
Remove dead code.
...
llvm-svn: 119815
2010-11-19 18:18:37 +00:00
Jim Grosbach
76aed40813
ARM LDRD binary encoding.
...
llvm-svn: 119812
2010-11-19 18:16:46 +00:00
Jim Grosbach
d7a3550a5e
Remove hard tabs.
...
llvm-svn: 119810
2010-11-19 18:01:37 +00:00
Jim Grosbach
2bb49e15a6
Remove trailing whitespace.
...
llvm-svn: 119806
2010-11-19 17:11:02 +00:00
Benjamin Kramer
2e49eaa92f
Avoid release build warnings.
...
llvm-svn: 119804
2010-11-19 16:36:02 +00:00
Owen Anderson
336021f758
Fix decoding ambiguities of stdrex and ldrex.
...
llvm-svn: 119801
2010-11-19 13:11:50 +00:00
Benjamin Kramer
c77ebcc9a5
Silence warning about an uninitialized variable.
...
llvm-svn: 119800
2010-11-19 11:37:26 +00:00
Duncan Sands
b238de0415
Remove threading of Xor over selects and phis, with an explanation
...
of why such threading is pointless.
llvm-svn: 119798
2010-11-19 09:20:39 +00:00
Duncan Sands
af4ad85160
Simplify, no functionality change.
...
llvm-svn: 119797
2010-11-19 08:33:20 +00:00
Rafael Espindola
9900b4802e
Add a MCLineSectionOrder vector so that we produce the line tables in a
...
deterministic order.
llvm-svn: 119795
2010-11-19 07:41:23 +00:00
Evan Cheng
2debc86138
These instructions are thumb2 only.
...
llvm-svn: 119793
2010-11-19 06:28:11 +00:00
Evan Cheng
0eb2994626
Fix an obvious oversight.
...
llvm-svn: 119792
2010-11-19 06:15:10 +00:00
Jakob Stoklund Olesen
4031c5eb48
Don't attempt trivial coalescing for sub-register copies.
...
Patch by Krister Wombell!
llvm-svn: 119791
2010-11-19 05:45:24 +00:00
Jakob Stoklund Olesen
df1c49c16f
Work around GCC 4.0 build error:
...
llvm/include/llvm/ADT/IntervalMap.h:334: error: '((llvm::IntervalMapImpl::DesiredNodeBytes / static_cast<unsigned int>(((2 * sizeof (KeyT)) + sizeof (ValT)))) >? 3u)' is not a valid template argument for type 'unsigned int' because it is a non-constant expression
llvm-svn: 119790
2010-11-19 05:36:51 +00:00
Rafael Espindola
0b4c9aa9a9
Add an assert.
...
llvm-svn: 119788
2010-11-19 04:55:36 +00:00
Jakob Stoklund Olesen
345945e355
Add ADT/IntervalMap.
...
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.
Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.
The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.
The IntervalMap is initially intended to be used with SlotIndex intervals for:
- Backing store for LiveIntervalUnion that is smaller and faster than std::set.
- Backing store for LiveInterval with less overhead than std::vector for typical
intervals and O(N log N) merging of large intervals. 99% of virtual registers
need 4 entries or less and would benefit from the small object optimization.
- Backing store for LiveDebugVariable which doesn't exist yet, but will track
debug variables during register allocation.
This is a work in progress. Missing items are:
- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.
llvm-svn: 119787
2010-11-19 04:47:19 +00:00
Rafael Espindola
92ca933f6e
Fix llvm-gcc boostrap on OS X by avoiding printing sleb and uleb when
...
possible.
llvm-svn: 119785
2010-11-19 04:10:13 +00:00
NAKAMURA Takumi
1818edb53f
unittests/CMakeLists.txt: [PR8225] Tweak linking JITTests on MSVC to add JITTests.def.
...
CMake can pass *.def to link.exe.
llvm-svn: 119783
2010-11-19 03:19:42 +00:00
NAKAMURA Takumi
7a953baa1d
unittests/CMakeLists.txt: Suppress building ValueMapTest on MSVC older than 10(VS2010).
...
MSVC9 and 8 cannot compile ValueMapTest.cpp due to their bug.
See issue#331418 in Visual Studio.
llvm-svn: 119782
2010-11-19 03:19:32 +00:00
NAKAMURA Takumi
1801996111
lit.GoogleTest: On case-insensitive filesystem, matching should be case-insensitive when directory name is checked with test_sub_dir.
...
On MSVS8, ${CMAKE_CFG_INTDIR}, aka $(OutDir), has capitalized name(eg. Debug), although $(OutDir) is made with lower case(eg. debug).
llvm-svn: 119781
2010-11-19 03:19:26 +00:00
NAKAMURA Takumi
148b62cca9
CMakeLists.txt: On MSVS10, touch LLVM.sln as workaround, w/e project files are changed, to avoid the Dialog Hell. Thanks to Oscar.
...
FIXME: This could be removed with future version of CMake.
llvm-svn: 119780
2010-11-19 03:19:18 +00:00
Rafael Espindola
b58867ccba
Change some methods in MCDwarf.cpp to be able to handle an arbitrary
...
MCStreamer instead of just MCObjectStreamer. Address changes cannot
be as efficient as we have to use DW_LNE_set_addres, but at least
most of the logic is shared.
This will be used so that, with CodeGen still using EmitDwarfLocDirective,
llvm-gcc is able to produce debug_line sections without needing an
assembler that supports .loc.
llvm-svn: 119777
2010-11-19 02:26:16 +00:00
Bill Wendling
945b776b6e
Add MC encodings for some Thumb instructions. Test for a few of them. The "bx
...
lr" instruction cannot be tested just yet. It requires matching a "condition
code", but adding one of those makes things go south quickly...
llvm-svn: 119774
2010-11-19 01:33:10 +00:00
Jakob Stoklund Olesen
09770251f6
Revert "Add ADT/IntervalMap.", GCC doesn't like it.
...
This reverts r119772.
llvm-svn: 119773
2010-11-19 01:21:03 +00:00
Jakob Stoklund Olesen
6d89171dcc
Add ADT/IntervalMap.
...
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.
Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.
The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.
The IntervalMap is initially intended to be used with SlotIndex intervals for:
- Backing store for LiveIntervalUnion that is smaller and faster than std::set.
- Backing store for LiveInterval with less overhead than std::vector for typical
intervals and O(N log N) merging of large intervals. 99% of virtual registers
need 4 entries or less and would benefit from the small object optimization.
- Backing store for LiveDebugVariable which doesn't exist yet, but will track
debug variables during register allocation.
This is a work in progress. Missing items are:
- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.
llvm-svn: 119772
2010-11-19 01:14:40 +00:00
Dale Johannesen
461e704a2c
Aligned and unaligned copies of the same string
...
were not hashing to the same value. Analysis
and patch by Frits van Bommel!
llvm-svn: 119770
2010-11-19 00:48:58 +00:00
Bill Wendling
20b5ea9858
Use array_pod_sort because the list is contiguous.
...
llvm-svn: 119769
2010-11-19 00:38:19 +00:00
Owen Anderson
f53e4d9fd1
Provide Thumb2 encodings for strex and ldrex.
...
llvm-svn: 119768
2010-11-19 00:28:38 +00:00
Jim Grosbach
2aeb8b9361
Minor cleanups to a few llvm_unreachable() calls.
...
llvm-svn: 119767
2010-11-19 00:27:09 +00:00
Bill Wendling
2ecfcbd2aa
An 'unreachable' shouldn't have a '0 &&' prefix.
...
llvm-svn: 119762
2010-11-19 00:05:15 +00:00
Bill Wendling
2063b84297
Add support for parsing the writeback ("!") token.
...
llvm-svn: 119761
2010-11-18 23:43:05 +00:00
Jason W Kim
5a97bd873e
Fix .o emission of ARM movt/movw. MCSymbolRefExpr::VK_ARM_(HI||LO)16 for the .o path now works for ARM.
...
Note: lo16AllZero remains in ARMInstrInfo.td - It can be factored out when Thumb movt is repaired.
Existing tests cover this update.
llvm-svn: 119760
2010-11-18 23:37:15 +00:00
Bill Wendling
4a08e563d7
Give the exclamation point a name instead of a number.
...
llvm-svn: 119759
2010-11-18 23:36:54 +00:00
Owen Anderson
690fa953e1
More tests.
...
llvm-svn: 119756
2010-11-18 23:30:10 +00:00
Owen Anderson
3517585249
Fix encodings for pkhbt, and fix some tests where I accidentally tested ARM mode instead of Thumb2.
...
llvm-svn: 119755
2010-11-18 23:29:56 +00:00
Anton Korobeynikov
14ee344944
Move getInitialFrameState() to TargetFrameInfo
...
llvm-svn: 119754
2010-11-18 23:25:52 +00:00
Jim Grosbach
a391c97bd0
ARM Encoding information for UXTAH and friends.
...
llvm-svn: 119753
2010-11-18 23:24:22 +00:00
Tanya Lattner
cd68095650
Fix bug in DAGCombiner for ARM that was trying to do a ShiftCombine on illegal types (vector should be split first).
...
Added test case.
llvm-svn: 119749
2010-11-18 22:06:46 +00:00
Bill Wendling
0ab0f67925
Don't allocate the SmallVector of Registers. It gets messy figuring out who
...
should delete what when the object gets copied around. It's also making valgrind
upset.
llvm-svn: 119747
2010-11-18 21:50:54 +00:00
Owen Anderson
10839cb62c
Provide Thumb2 encodings for mov's that come from MOVCC SDNodes.
...
llvm-svn: 119744
2010-11-18 21:46:31 +00:00
Jim Grosbach
1b91ae18ed
Add ARM encoding information for LDRH post-increment.
...
llvm-svn: 119743
2010-11-18 21:43:37 +00:00
Bob Wilson
4e22a38759
Change the 'x' type modifier for Neon intrinsics to force a signed integer.
...
This makes it symmetric with the 'u' modifier that forces an unsigned type.
This is needed for unsigned vector shifts, where the shift amount still needs
to be signed. PR8482 (Radar 8603521).
llvm-svn: 119742
2010-11-18 21:43:22 +00:00
Anton Korobeynikov
0eecf5d201
Move hasFP() and few related hooks to TargetFrameInfo.
...
llvm-svn: 119740
2010-11-18 21:19:35 +00:00
Duncan Sands
c92331b984
Fix thinko: we must turn select(anyext, sext) into sext(select)
...
not anyext(select). Spotted by Frits van Bommel.
llvm-svn: 119739
2010-11-18 21:16:28 +00:00
Bob Wilson
7d47133ff7
Split up ARM LowerShift function.
...
This function was being called from two different places for completely
unrelated reasons. During type legalization, it was called to expand 64-bit
shift operations. During operation legalization, it was called to handle
Neon vector shifts. The vector shift code was not written to check for
illegal types, since it was assumed to be only called after type legalization.
Fixed this by splitting off the 64-bit shift expansion into a separate
function. I don't have a particular testcase for this; I just noticed it
by inspection.
llvm-svn: 119738
2010-11-18 21:16:28 +00:00
Owen Anderson
3fec5ff14b
More Thumb2 encodings.
...
llvm-svn: 119737
2010-11-18 21:15:19 +00:00
Owen Anderson
3625098459
Fill out the set of Thumb2 multiplication operator encodings.
...
llvm-svn: 119733
2010-11-18 20:32:18 +00:00
Duncan Sands
12f3b3b44f
The DAGCombiner was threading select over pairs of extending loads even
...
if the extension types were not the same. The result was that if you
fed a select with sext and zext loads, as in the testcase, then it
would get turned into a zext (or sext) of the select, which is wrong
in the cases when it should have been an sext (resp. zext). Reported
and diagnosed by Sebastien Deldon.
llvm-svn: 119728
2010-11-18 20:05:18 +00:00
Duncan Sands
aef146b890
Factor code for testing whether replacing one value with another
...
preserves LCSSA form out of ScalarEvolution and into the LoopInfo
class. Use it to check that SimplifyInstruction simplifications
are not breaking LCSSA form. Fixes PR8622.
llvm-svn: 119727
2010-11-18 19:59:41 +00:00
Bill Wendling
b9bd594610
Missed the _RET versions of LDMIA.
...
llvm-svn: 119726
2010-11-18 19:44:29 +00:00
Eric Christopher
b006fc9c07
Rewrite stack callee saved spills and restores to use push/pop instructions.
...
Remove movePastCSLoadStoreOps and associated code for simple pointer
increments. Update routines that depended upon other opcodes for save/restore.
Adjust all testcases accordingly.
llvm-svn: 119725
2010-11-18 19:40:05 +00:00
Owen Anderson
2e831897d6
Fix an order-of-deallocation issue where the AttrListImpl could be deallocated before the global
...
LLVMContext, causing memory errors. Patch by Peter Collingbourne.
llvm-svn: 119721
2010-11-18 18:59:13 +00:00
Owen Anderson
aa398c1617
Use thread-safe statics to avoid a static constructor here. This isn't thread-safe on MSVC, but we don't
...
support threaded LLVM there anyways.
llvm-svn: 119718
2010-11-18 18:49:05 +00:00
Dan Gohman
e4f7ec17f8
Oops, missed this file when remaing ExpandPseudos to ExpandISelPseudos.
...
llvm-svn: 119717
2010-11-18 18:48:28 +00:00
Dan Gohman
c2b786163c
Rename ExpandPseudos to ExpandISelPseudos to help clarify its role.
...
llvm-svn: 119716
2010-11-18 18:45:06 +00:00
Owen Anderson
c21c100f3d
Completely rework the datastructure GVN uses to represent the value number to leader mapping. Previously,
...
this was a tree of hashtables, and a query recursed into the table for the immediate dominator ad infinitum
if the initial lookup failed. This led to really bad performance on tall, narrow CFGs.
We can instead replace it with what is conceptually a multimap of value numbers to leaders (actually
represented by a hashtable with a list of Value*'s as the value type), and then
determine which leader from that set to use very cheaply thanks to the DFS numberings maintained by
DominatorTree. Because there are typically few duplicates of a given value, this scan tends to be
quite fast. Additionally, we use a custom linked list and BumpPtr allocation to avoid any unnecessary
allocation in representing the value-side of the multimap.
This change brings with it a 15% (!) improvement in the total running time of GVN on 403.gcc, which I
think is pretty good considering that includes all the "real work" being done by MemDep as well.
The one downside to this approach is that we can no longer use GVN to perform simple conditional progation,
but that seems like an acceptable loss since we now have LVI and CorrelatedValuePropagation to pick up
the slack. If you see conditional propagation that's not happening, please file bugs against LVI or CVP.
llvm-svn: 119714
2010-11-18 18:32:40 +00:00
Jim Grosbach
51fdc47a11
ARMPseudoInst instructions should default to being considered a single 4-byte
...
instruction. Any that may be expanded otherwise by MC lowering should
override this value. rdar://8683274
llvm-svn: 119713
2010-11-18 18:01:40 +00:00
Dan Gohman
5a1a2d53de
Fix typos.
...
llvm-svn: 119712
2010-11-18 17:44:17 +00:00
Dan Gohman
0037f431e5
Document the units for the Size field.
...
llvm-svn: 119711
2010-11-18 17:39:01 +00:00