Chris Lattner
c7a67abac2
Fix a use-of-dangling-pointer bug, from the introduction of SrcValue's.
...
llvm-svn: 22679
2005-08-05 16:55:31 +00:00
Chris Lattner
644edfb51e
Fix a latent bug in the libcall inserter that was exposed by Nate's patch
...
yesterday. This fixes whetstone and a bunch of programs in the External tests.
llvm-svn: 22678
2005-08-05 16:23:57 +00:00
Nate Begeman
348caa49b3
Fix a fixme in LegalizeDAG
...
llvm-svn: 22661
2005-08-04 21:43:28 +00:00
Misha Brukman
8b8272b648
* Unbreak release build
...
* Add comments to #endif pragmas for readability
llvm-svn: 22647
2005-08-04 14:22:41 +00:00
Chris Lattner
d124203207
Fix PR611, codegen'ing SREM of FP operands to fmod or fmodf instead of
...
the sequence used for integer ops
llvm-svn: 22629
2005-08-03 20:31:37 +00:00
Chris Lattner
cc8ae687e1
Update to use the new MathExtras.h support for log2 computation.
...
Patch contributed by Jim Laskey!
llvm-svn: 22594
2005-08-02 19:26:06 +00:00
Chris Lattner
83f0262a2c
Fix casts from long to sbyte on ppc
...
llvm-svn: 22570
2005-08-01 18:16:37 +00:00
Jeff Cohen
019104459d
Keep tabs and trailing spaces out.
...
llvm-svn: 22565
2005-07-30 18:33:25 +00:00
Chris Lattner
d742a80e9e
fix float->long conversions on x86
...
llvm-svn: 22563
2005-07-30 01:40:57 +00:00
Chris Lattner
e0b705ba00
Allow targets to have custom expanders for FP_TO_*INT conversions where
...
both the src and dest values are legal
llvm-svn: 22555
2005-07-30 00:04:12 +00:00
Chris Lattner
8d48aef4e3
Allow targets to define custom expanders for FP_TO_*INT
...
llvm-svn: 22548
2005-07-29 00:33:32 +00:00
Chris Lattner
f355c0f6ea
allow a target to request that unknown FP_TO_*INT conversion be promoted to
...
a larger integer destination.
llvm-svn: 22547
2005-07-29 00:11:56 +00:00
Chris Lattner
6b4f386826
instead of having all conversions be handled by one case value, and then have
...
subcases inside, break things out earlier.
llvm-svn: 22546
2005-07-28 23:31:12 +00:00
Andrew Lenharth
f623af9b64
new is not a valid default anywhere, so make this pure virtual
...
llvm-svn: 22542
2005-07-28 18:13:59 +00:00
Chris Lattner
b0658628c1
Fix debug info to not print out recently freed memory.
...
llvm-svn: 22529
2005-07-27 23:11:25 +00:00
Chris Lattner
1a3a4c7791
Print symbolic register names in debug dumps
...
llvm-svn: 22528
2005-07-27 23:03:38 +00:00
Jeff Cohen
bd51ec7461
Eliminate all remaining tabs and trailing spaces.
...
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Nate Begeman
a25a2010e3
Remove unnecessary FP_EXTEND. This causes worse codegen for SSE.
...
llvm-svn: 22469
2005-07-19 16:50:03 +00:00
Chris Lattner
d4f9ab3809
The assertion was wrong: the code only worked for i64. While we're at it,
...
expand the code to work for all integer datatypes. This should unbreak
alpha.
llvm-svn: 22464
2005-07-18 04:31:14 +00:00
Chris Lattner
07d79f8aa7
Only get the .bss and .data sections when needed instead of unconditionally.
...
This allows is to not emit empty sections when .data or .bss is not used.
llvm-svn: 22457
2005-07-16 17:41:06 +00:00
Chris Lattner
60bcec0238
Refactor getSection() method to make it easier to use.
...
llvm-svn: 22455
2005-07-16 17:36:04 +00:00
Chris Lattner
40fbf63df8
Major refactor of the ELFWriter code. Instead of building up one big
...
vector that represents the .o file at once, build up a vector for each
section of the .o file. This is needed because the .o file writer needs
to be able to switch between sections as it emits them (e.g. switch
between the .text section and the .rel section when emitting code).
This patch has no functionality change.
llvm-svn: 22453
2005-07-16 08:01:13 +00:00
Nate Begeman
160c12d896
Teach the legalizer how to promote SINT_TO_FP to a wider SINT_TO_FP that
...
the target natively supports. This eliminates some special-case code from
the x86 backend and generates better code as well.
For an i8 to f64 conversion, before & after:
_x87 before:
subl $2, %esp
movb 6(%esp), %al
movsbw %al, %ax
movw %ax, (%esp)
filds (%esp)
addl $2, %esp
ret
_x87 after:
subl $2, %esp
movsbw 6(%esp), %ax
movw %ax, (%esp)
filds (%esp)
addl $2, %esp
ret
_sse before:
subl $12, %esp
movb 16(%esp), %al
movsbl %al, %eax
cvtsi2sd %eax, %xmm0
addl $12, %esp
ret
_sse after:
subl $12, %esp
movsbl 16(%esp), %eax
cvtsi2sd %eax, %xmm0
addl $12, %esp
ret
llvm-svn: 22452
2005-07-16 02:02:34 +00:00
Chris Lattner
10da57bfed
Break the code for expanding UINT_TO_FP operations out into its own
...
SelectionDAGLegalize::ExpandLegalUINT_TO_FP method.
Add a new method, PromoteLegalUINT_TO_FP, which allows targets to request
that UINT_TO_FP operations be promoted to a larger input type. This is
useful for targets that have some UINT_TO_FP or SINT_TO_FP operations but
not all of them (like X86).
The same should be done with SINT_TO_FP, but this patch does not do that
yet.
llvm-svn: 22447
2005-07-16 00:19:57 +00:00
Chris Lattner
94e486c56e
You can't use config options without config.h
...
llvm-svn: 22446
2005-07-15 22:48:31 +00:00
Chris Lattner
d8eb6ea6da
Make this use the new autoconf support for finding the executables for
...
gv and Graphviz.
llvm-svn: 22434
2005-07-14 05:33:13 +00:00
Chris Lattner
d9f1a60c61
As discussed on IRC, this stuff is just for debugging.
...
llvm-svn: 22432
2005-07-14 05:17:43 +00:00
Chris Lattner
61b33e0bc4
If the Graphviz program is available, use it to visualize dot graphs.
...
llvm-svn: 22429
2005-07-14 01:10:55 +00:00
Chris Lattner
aeae45b371
Fix Alpha/2005-07-12-TwoMallocCalls.ll and PR593.
...
It is not safe to call LegalizeOp on something that has already been legalized.
Instead, just force another iteration of legalization.
This could affect all platforms but X86, as this codepath is dynamically
dead on X86 (ISD::MEMSET and friends are legal).
llvm-svn: 22419
2005-07-13 02:00:04 +00:00
Chris Lattner
628a248ff9
Fix test/Regression/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll
...
llvm-svn: 22417
2005-07-13 01:42:45 +00:00
Chris Lattner
bec12eb953
Add support for 64-bit elf files
...
llvm-svn: 22400
2005-07-12 06:57:52 +00:00
Jeff Cohen
7bc4266cf1
VC++ demands that the function returns a value
...
llvm-svn: 22393
2005-07-12 02:53:33 +00:00
Chris Lattner
8dd11b0f9c
Clean up code, no functionality changes.
...
llvm-svn: 22382
2005-07-11 06:34:30 +00:00
Chris Lattner
d710b0a025
Emit a symbol table entry for each function we output to the ELF file. This
...
allows objdump to know which function we are emitting to:
00000000 <foo>: <----
0: b8 01 00 00 00 mov $0x1,%eax
5: 03 44 24 04 add 0x4(%esp,1),%eax
9: c3 ret
... and allows .o files to be useful for linking :)
llvm-svn: 22378
2005-07-11 06:17:35 +00:00
Chris Lattner
34d2a2ae23
add code to emit the .text section to the section header.
...
Add a *VERY INITIAL* machine code emitter class. This is enough to take
this C function:
int foo(int X) { return X +1; }
and make objdump produce the following:
$ objdump -d t-llvm.o
t-llvm.o: file format elf32-i386
Disassembly of section .text:
00000000 <.text>:
0: b8 01 00 00 00 mov $0x1,%eax
5: 03 44 24 04 add 0x4(%esp,1),%eax
9: c3 ret
Anything using branches or refering to the constant pool or requiring
relocations will not work yet.
llvm-svn: 22375
2005-07-11 05:17:18 +00:00
Chris Lattner
8c10fbf3cc
Use a name mangler object to uniquify names and remove nonstandard
...
characters from them.
llvm-svn: 22371
2005-07-11 03:11:47 +00:00
Chris Lattner
6e49696ba6
Change *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.
...
This is the last MVTSDNode.
This allows us to eliminate a bunch of special case code for handling
MVTSDNodes.
llvm-svn: 22367
2005-07-10 01:55:33 +00:00
Chris Lattner
273b81e0c0
Change TRUNCSTORE to use a VTSDNode operand instead of being an MVTSTDNode
...
llvm-svn: 22366
2005-07-10 00:29:18 +00:00
Chris Lattner
c355896290
Introduce a new VTSDNode class with the ultimate goal of eliminating the
...
MVTSDNode class. This class is used to provide an operand to operators
that require an extra type. We start by converting FP_ROUND_INREG and
SIGN_EXTEND_INREG over to using it.
llvm-svn: 22364
2005-07-10 00:07:11 +00:00
Chris Lattner
de44e16474
Add support for emitting a .data section and .bss section.
...
Add support for emitting external and .bss symbols.
llvm-svn: 22358
2005-07-08 05:47:00 +00:00
Chris Lattner
efccb190b5
Add support for emitting the symbol table (and its string table) of the
...
module to the ELF file. Test it by adding support for emitting common
symbols. This allows us to compile this:
%X = weak global int 0
%Y = weak global int 0
%Z = weak global int 0
to an elf file that 'readelf's this:
Symbol table '.symtab' contains 4 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000004 4 OBJECT GLOBAL DEFAULT COM X
2: 00000004 4 OBJECT GLOBAL DEFAULT COM Y
3: 00000004 4 OBJECT GLOBAL DEFAULT COM Z
llvm-svn: 22343
2005-07-07 07:02:20 +00:00
Chris Lattner
bf100c8bdb
Make several cleanups to Andrews varargs change:
...
1. Pass Value*'s into lowering methods so that the proper pointers can be
added to load/stores from the valist
2. Intrinsics that return void should only return a token chain, not a token
chain/retval pair.
3. Rename LowerVAArgNext -> LowerVAArg, because VANext is long gone.
llvm-svn: 22338
2005-07-05 19:57:53 +00:00
Andrew Lenharth
3543e3b3a9
2 fixes:
...
1: Legalize operand in UINT_TO_FP expanision
2: SRA x, const i8 was not promoting the constant to shift amount type.
llvm-svn: 22337
2005-07-05 19:52:39 +00:00
Andrew Lenharth
c9903eb2cc
I really didn't think this was necessary. But, Legalize wasn't running again
...
and legalizing the extload. Strange. Should fix most alpha regressions.
llvm-svn: 22329
2005-07-02 20:58:53 +00:00
Andrew Lenharth
b8c48ce74e
oops
...
llvm-svn: 22320
2005-06-30 19:32:57 +00:00
Andrew Lenharth
04aa18bd2a
FP EXTLOAD is not support on all archs, expand to LOAD and FP_EXTEND
...
llvm-svn: 22319
2005-06-30 19:22:37 +00:00
Andrew Lenharth
898efb338a
restore old srcValueNode behavior and try to to work around it
...
llvm-svn: 22315
2005-06-29 18:54:02 +00:00
Andrew Lenharth
edccb834bb
tracking the instructions causing loads and stores provides more information than just the pointer being loaded or stored
...
llvm-svn: 22311
2005-06-29 15:57:19 +00:00
Andrew Lenharth
d534c5cb2a
Adapt the code for handling uint -> fp conversion for the 32 bit case to
...
handling it in the 64 bit case. The two code paths should probably be merged.
llvm-svn: 22302
2005-06-27 23:28:32 +00:00
Chris Lattner
8be1980730
iniital checkin of ELFWriter implementation
...
For now, the elf writer is only capable of emitting an empty elf file, with
a section table and a section table string table. This will be enhanced
in the future :)
llvm-svn: 22291
2005-06-27 06:29:00 +00:00
Andrew Lenharth
4fd2bde906
If we support structs as va_list, we must pass pointers to them to va_copy
...
See last commit for LangRef, this implements it on all targets.
llvm-svn: 22273
2005-06-22 21:04:42 +00:00
Andrew Lenharth
a9214fec08
core changes for varargs
...
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Nate Begeman
ed49a51836
Fix bug 537 test 2, which checks to make sure that we fold A+(B-A) -> B for
...
integer types. Add a couple checks to not perform these kinds of transform
on floating point values.
llvm-svn: 22228
2005-06-16 07:06:03 +00:00
Duraid Madina
f4ca48c89e
aCC and STLport complained about this, because they're like that
...
llvm-svn: 22053
2005-05-15 13:05:48 +00:00
Chris Lattner
811dc49f55
Add some simplifications for MULH[SU]. This allows us to compile this:
...
long %bar(long %X) {
%Y = mul long %X, 4294967297
ret long %Y
}
to this:
l1_bar:
mov %EAX, DWORD PTR [%ESP + 4]
mov %EDX, %EAX
add %EDX, DWORD PTR [%ESP + 8]
ret
instead of:
l1_bar:
mov %ECX, DWORD PTR [%ESP + 4]
mov %EDX, 1
mov %EAX, %ECX
mul %EDX
add %EDX, %ECX
add %EDX, DWORD PTR [%ESP + 8]
mov %EAX, %ECX
ret
llvm-svn: 22044
2005-05-15 05:39:08 +00:00
Chris Lattner
54bf1cc313
When inserting callee-save register reloads, make sure to skip over any
...
terminator instructions before the 'ret' in case the target has a
multi-instruction return sequence.
llvm-svn: 22041
2005-05-15 03:09:58 +00:00
Chris Lattner
46de5c99bd
Fix construction of ioport intrinsics, fixing X86/io.llx and io-port.llx
...
llvm-svn: 22026
2005-05-14 13:56:55 +00:00
Chris Lattner
052759b78c
allow token chain at start or end of node
...
llvm-svn: 22020
2005-05-14 08:34:53 +00:00
Chris Lattner
d9e36f94bb
remove special case hacks for readport/readio from the binary operator
...
codepath
llvm-svn: 22019
2005-05-14 07:45:46 +00:00
Chris Lattner
d1d8fbee2d
Implement fixme's by memoizing nodes.
...
llvm-svn: 22018
2005-05-14 07:42:29 +00:00
Chris Lattner
ac7d55f114
Turn this into a wrapper for a simpler version of getNode.
...
llvm-svn: 22016
2005-05-14 07:32:14 +00:00
Chris Lattner
a035798c4b
Eliminate special purpose hacks for dynamic_stack_alloc.
...
llvm-svn: 22015
2005-05-14 07:29:57 +00:00
Chris Lattner
b94e243d14
Use the general mechanism for creating multi-value nodes instead of using
...
special case hacks.
llvm-svn: 22014
2005-05-14 07:25:05 +00:00
Chris Lattner
ad411081fb
Wrap long line, actually add node to the graph.
...
llvm-svn: 22011
2005-05-14 06:42:57 +00:00
Chris Lattner
6f7b63c7d7
legalize target-specific operations
...
llvm-svn: 22010
2005-05-14 06:34:48 +00:00
Chris Lattner
1afb5ae575
add a getNode() version that allows construction of any node type.
...
llvm-svn: 22009
2005-05-14 06:20:26 +00:00
Chris Lattner
6e81a4090f
LowerOperation takes a dag
...
llvm-svn: 22004
2005-05-14 05:50:48 +00:00
Chris Lattner
369427683d
Print the symbolic register name in a register allocator debug dump.
...
llvm-svn: 22002
2005-05-14 05:34:15 +00:00
Chris Lattner
1202c26d6e
Allow targets to have a custom int64->fp expander if desired
...
llvm-svn: 22001
2005-05-14 05:33:54 +00:00
Chris Lattner
2163eeaa67
Align doubles on 8-byte boundaries if possible.
...
llvm-svn: 21993
2005-05-13 23:14:17 +00:00
Chris Lattner
d9dd5bb798
print stack object alignment in -print-machineinstr dumps
...
llvm-svn: 21992
2005-05-13 22:54:44 +00:00
Chris Lattner
a3e57bd844
Tolerate instrs with extra args
...
llvm-svn: 21982
2005-05-13 21:07:15 +00:00
Chris Lattner
9d788e93a6
Add an isTailCall flag to LowerCallTo
...
llvm-svn: 21958
2005-05-13 18:50:42 +00:00
Chris Lattner
3a76f85d43
Handle TAILCALL node
...
llvm-svn: 21957
2005-05-13 18:43:43 +00:00
Chris Lattner
01eba53a10
Emit function entry code after lowering hte arguments.
...
llvm-svn: 21931
2005-05-13 07:33:32 +00:00
Chris Lattner
fdc4816996
Allow targets to emit code into the entry block of each function
...
llvm-svn: 21930
2005-05-13 07:23:21 +00:00
Chris Lattner
5cd760d12d
allow a virtual register to be associated with live-in values.
...
llvm-svn: 21927
2005-05-13 07:08:07 +00:00
Chris Lattner
670c7f516c
Fix a problem that nate reduced for me.
...
llvm-svn: 21923
2005-05-13 05:17:00 +00:00
Chris Lattner
59bb0edb45
rename variables and functions to match renamed DAG nodes. Bonus feature:
...
I can actually remember which one is which now!
llvm-svn: 21922
2005-05-13 05:09:11 +00:00
Chris Lattner
c7013ec3a9
do not call expandop on the same value more than once. This fixes
...
X86/2004-02-22-Casts.llx
llvm-svn: 21919
2005-05-13 04:45:13 +00:00
Chris Lattner
51de10e0c6
fix a bad typeo
...
llvm-svn: 21917
2005-05-12 23:51:40 +00:00
Chris Lattner
00d2fb482f
update comment
...
llvm-svn: 21916
2005-05-12 23:24:44 +00:00
Chris Lattner
094bbfcebb
rename the ADJCALLSTACKDOWN/ADJCALLSTACKUP nodes to be CALLSEQ_START/BEGIN.
...
llvm-svn: 21915
2005-05-12 23:24:06 +00:00
Chris Lattner
dd2700de99
Pass calling convention to use into lower call to
...
llvm-svn: 21900
2005-05-12 19:56:57 +00:00
Chris Lattner
ad48ef0a7d
fix expansion of ct[lt]z nodes
...
llvm-svn: 21896
2005-05-12 19:27:51 +00:00
Chris Lattner
6b5bacbc0b
Expand 64-bit ctlz/cttz nodes for 32-bit targets
...
llvm-svn: 21895
2005-05-12 19:05:01 +00:00
Chris Lattner
3677432d39
Fix uint->fp casts on PPC, allowing UnitTests/2005-05-12-Int64ToFP to
...
work on it.
llvm-svn: 21894
2005-05-12 18:52:34 +00:00
Chris Lattner
dbcdac1ebf
Allow something to be legalized multiple times. This can be used to reduce
...
legalization iteration
llvm-svn: 21892
2005-05-12 16:53:42 +00:00
Chris Lattner
a9a41e8856
Oops, don't do this after we figure out where to insert the call chains.
...
llvm-svn: 21890
2005-05-12 07:00:44 +00:00
Chris Lattner
b58308e6d4
Make sure to expand all nodes, avoiding unintentional node duplication.
...
llvm-svn: 21889
2005-05-12 06:54:21 +00:00
Chris Lattner
9f40cfa0a1
handle a common case generated by the uint64 -> FP code path better
...
llvm-svn: 21888
2005-05-12 06:27:02 +00:00
Chris Lattner
1c248e7462
add fixme
...
llvm-svn: 21887
2005-05-12 06:04:14 +00:00
Chris Lattner
1196356365
Fix a problem where early legalization can cause token chain problems.
...
llvm-svn: 21885
2005-05-12 04:49:08 +00:00
Chris Lattner
b38ffd7fbf
Make legalize a bit more efficient, and canonicalize sub X, C -> add X, -C
...
llvm-svn: 21882
2005-05-12 00:17:04 +00:00
Nate Begeman
e84f776b5d
Necessary changes to codegen cttz efficiently on PowerPC
...
1. Teach LegalizeDAG how to better legalize CTTZ if the target doesn't have
CTPOP, but does have CTLZ
2. Teach PPC32 how to do sub x, const -> add x, -const for valid consts
3. Teach PPC32 how to do and (xor a, -1) b -> andc b, a
4. Teach PPC32 that ISD::CTLZ -> PPC::CNTLZW
llvm-svn: 21880
2005-05-11 23:43:56 +00:00
Chris Lattner
8f2d079b36
Fix lowering of ctlz, so now UnitTests/2005-05-11-Popcount-ffs-fls passes
...
with the CBE
llvm-svn: 21875
2005-05-11 20:24:12 +00:00
Chris Lattner
303ac68c80
Fix lowering of cttz to work with signed values
...
llvm-svn: 21874
2005-05-11 20:02:14 +00:00
Chris Lattner
330f44f3b6
fix and concisify intinsic lowering for ctpop. Unfortunately, this code
...
looks completely untested. :(
llvm-svn: 21873
2005-05-11 19:42:05 +00:00
Chris Lattner
eeeaf45bba
Fix the last remaining bug preventing us from switching the X86 BE over
...
from the simple isel to the pattern isel. This forces inserted libcalls
to serialize against other function calls, which was breaking
UnitTests/2005-05-12-Int64ToFP. Hopefully this will fix issues on other
targets as well.
llvm-svn: 21872
2005-05-11 19:02:11 +00:00
Chris Lattner
296754995e
Do not memoize ADJCALLSTACKDOWN nodes, provide a method to hack on them.
...
llvm-svn: 21871
2005-05-11 18:57:39 +00:00
Chris Lattner
74763db128
wrap long line
...
llvm-svn: 21870
2005-05-11 18:57:06 +00:00
Chris Lattner
d76582b540
Make sure to legalize generated ctpop nodes, convert tabs to spaces
...
llvm-svn: 21868
2005-05-11 18:35:21 +00:00
Duraid Madina
8ad9786fcd
expand count-leading/trailing-zeros; the test 2005-05-11-Popcount-ffs-fls.c
...
should now pass (the "LLVM" and "REF" results should be identical)
llvm-svn: 21866
2005-05-11 08:45:08 +00:00
Chris Lattner
b452b5aa42
Add some notes for expanding clz/ctz
...
llvm-svn: 21862
2005-05-11 05:27:09 +00:00
Chris Lattner
4f05136f61
Simplify this code, use the proper shift amount
...
llvm-svn: 21861
2005-05-11 05:21:31 +00:00
Chris Lattner
3edc8ecb53
Legalize this correctly
...
llvm-svn: 21859
2005-05-11 05:09:47 +00:00
Chris Lattner
457996c4a6
implement expansion of ctpop nodes, implementing CodeGen/Generic/llvm-ct-intrinsics.ll
...
llvm-svn: 21856
2005-05-11 04:51:16 +00:00
Chris Lattner
ce84b90a3d
Print bit count nodes correctly
...
llvm-svn: 21855
2005-05-11 04:50:30 +00:00
Jeff Cohen
afc58006b7
Silence some VC++ warnings
...
llvm-svn: 21838
2005-05-10 02:22:38 +00:00
Chris Lattner
5edb4c4af6
The semantics of cast X to bool are a comparison against zero, not a truncation!
...
llvm-svn: 21833
2005-05-09 22:17:13 +00:00
Chris Lattner
95c836384b
legalize readio/writeio into a load/store if requested
...
llvm-svn: 21827
2005-05-09 20:36:57 +00:00
Chris Lattner
7cc8edfc30
legalize READPORT, WRITEPORT, READIO, WRITEIO, at least in the basic cases
...
where they are directly supported by the architecture. Wrap a bunch of
long lines :(
llvm-svn: 21826
2005-05-09 20:23:03 +00:00
Chris Lattner
af6bde0db6
Add support for matching the READPORT, WRITEPORT, READIO, WRITEIO intrinsics
...
llvm-svn: 21825
2005-05-09 20:22:36 +00:00
Chris Lattner
eee649df34
Add support for READPORT, WRITEPORT, READIO, WRITEIO
...
llvm-svn: 21824
2005-05-09 20:22:17 +00:00
Chris Lattner
c3fa88e7c8
Fold shifts into subsequent SHL's. These shifts often arise due to addrses
...
arithmetic lowering.
llvm-svn: 21818
2005-05-09 17:06:45 +00:00
Chris Lattner
a1e633ef7a
Don't use the load/store instruction as the source pointer, use the pointer
...
being stored/loaded through!
llvm-svn: 21806
2005-05-09 04:28:51 +00:00
Chris Lattner
bfbefe0837
memoize all nodes, even null Value* nodes. Do not add two token chain outputs
...
llvm-svn: 21805
2005-05-09 04:14:13 +00:00
Chris Lattner
b85030373d
wrap long lines
...
llvm-svn: 21804
2005-05-09 04:08:33 +00:00
Chris Lattner
6ffae1a3ec
Print SrcValue nodes correctly
...
llvm-svn: 21803
2005-05-09 04:08:27 +00:00
Chris Lattner
6d85b91b24
Wrap long lines. Fix "warning: conflicting types for built-in function 'memset'"
...
warning from the CBE+GCC.
llvm-svn: 21779
2005-05-08 19:46:29 +00:00
Misha Brukman
1996bf6ea5
* Order #includes alphabetically
...
* Remove commented-out debug printouts
llvm-svn: 21707
2005-05-05 23:45:17 +00:00
Chris Lattner
6e8167d1c2
When hitting an unsupported intrinsic, actually print it
...
Lower debug info to noops.
llvm-svn: 21698
2005-05-05 17:55:17 +00:00
Andrew Lenharth
09c3c4add4
ctpop lowering in legalize
...
llvm-svn: 21697
2005-05-05 15:55:21 +00:00
Andrew Lenharth
9282d00d4f
Make promoteOp work for CT*
...
Proof?
ubyte %bar(ubyte %x) {
entry:
%tmp.1 = call ubyte %llvm.ctlz( ubyte %x )
ret ubyte %tmp.1
}
==>
zapnot $16,1,$0
CTLZ $0,$0
subq $0,56,$0
zapnot $0,1,$0
ret $31,($26),1
llvm-svn: 21691
2005-05-04 19:11:05 +00:00
Andrew Lenharth
8b64bd0fd5
Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
...
population (ctpop). Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.
More coming soon.
llvm-svn: 21676
2005-05-03 17:19:30 +00:00
Alkis Evlogimenos
66f1632de8
Do not use deprecated APIs
...
llvm-svn: 21639
2005-04-30 07:13:31 +00:00
Chris Lattner
fe72cdf838
Codegen and legalize sin/cos/llvm.sqrt as FSIN/FCOS/FSQRT calls. This patch
...
was contributed by Morten Ofstad, with some minor tweaks and bug fixes added
by me.
llvm-svn: 21636
2005-04-30 04:43:14 +00:00
Chris Lattner
0366e4c0d3
Lower llvm.sqrt -> fsqrt/sqrt
...
llvm-svn: 21629
2005-04-30 04:07:50 +00:00
Chris Lattner
6ec8bb9e8d
Legalize FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
...
llvm-svn: 21606
2005-04-28 21:44:33 +00:00
Chris Lattner
4678a790e6
Add FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
...
llvm-svn: 21605
2005-04-28 21:44:03 +00:00
Andrew Lenharth
2a00530fa7
Implement Value* tracking for loads and stores in the selection DAG. This enables one to use alias analysis in the backends.
...
(TRUNK)Stores and (EXT|ZEXT|SEXT)Loads have an extra SDOperand which is a SrcValueSDNode which contains the Value*. Note that if the operation is introduced by the backend, it will still have the operand, but the value* will be null.
llvm-svn: 21599
2005-04-27 20:10:01 +00:00
Chris Lattner
15bcc5273b
Fold (X > -1) | (Y > -1) --> (X&Y > -1)
...
llvm-svn: 21552
2005-04-26 01:18:33 +00:00
Chris Lattner
d8ac4da793
implement some more logical compares with constants, so that:
...
int foo1(int x, int y) {
int t1 = x >= 0;
int t2 = y >= 0;
return t1 & t2;
}
int foo2(int x, int y) {
int t1 = x == -1;
int t2 = y == -1;
return t1 & t2;
}
produces:
_foo1:
or r2, r4, r3
srwi r2, r2, 31
xori r3, r2, 1
blr
_foo2:
and r2, r4, r3
addic r2, r2, 1
li r2, 0
addze r3, r2
blr
instead of:
_foo1:
srwi r2, r4, 31
xori r2, r2, 1
srwi r3, r3, 31
xori r3, r3, 1
and r3, r2, r3
blr
_foo2:
addic r2, r4, 1
li r2, 0
addze r2, r2
addic r3, r3, 1
li r3, 0
addze r3, r3
and r3, r2, r3
blr
llvm-svn: 21547
2005-04-25 21:20:28 +00:00
Chris Lattner
7931b75a81
Codegen x < 0 | y < 0 as (x|y) < 0. This allows us to compile this to:
...
_foo:
or r2, r4, r3
srwi r3, r2, 31
blr
instead of:
_foo:
srwi r2, r4, 31
srwi r3, r3, 31
or r3, r2, r3
blr
llvm-svn: 21544
2005-04-25 21:03:25 +00:00
Misha Brukman
a9a1982a44
Convert tabs to spaces
...
llvm-svn: 21439
2005-04-22 04:01:18 +00:00
Misha Brukman
774e55c446
Remove trailing whitespace
...
llvm-svn: 21420
2005-04-21 22:36:52 +00:00
Chris Lattner
87fbc1c554
Improve and elimination. On PPC, for:
...
bool %test(int %X) {
%Y = and int %X, 8
%Z = setne int %Y, 0
ret bool %Z
}
we now generate this:
rlwinm r2, r3, 0, 28, 28
srwi r3, r2, 3
instead of this:
rlwinm r2, r3, 0, 28, 28
srwi r2, r2, 3
rlwinm r3, r2, 0, 31, 31
I'll leave it to Nate to get it down to one instruction. :)
---------------------------------------------------------------------
llvm-svn: 21391
2005-04-21 06:28:15 +00:00
Chris Lattner
d0a2fda2c6
Fold (x & 8) != 0 and (x & 8) == 8 into (x & 8) >> 3.
...
This turns this PPC code:
rlwinm r2, r3, 0, 28, 28
cmpwi cr7, r2, 8
mfcr r2
rlwinm r3, r2, 31, 31, 31
into this:
rlwinm r2, r3, 0, 28, 28
srwi r2, r2, 3
rlwinm r3, r2, 0, 31, 31
Next up, nuking the extra and.
llvm-svn: 21390
2005-04-21 06:12:41 +00:00
Chris Lattner
188ecaab1d
Fold setcc of MVT::i1 operands into logical operations
...
llvm-svn: 21319
2005-04-18 04:48:12 +00:00
Chris Lattner
72aca1b758
Another minor simplification: handle setcc (zero_extend x), c -> setcc(x, c')
...
llvm-svn: 21318
2005-04-18 04:30:45 +00:00
Chris Lattner
e6117e5d4f
Another simple xform
...
llvm-svn: 21317
2005-04-18 04:11:19 +00:00
Chris Lattner
f6f5b23a00
Fold:
...
// (X != 0) | (Y != 0) -> (X|Y != 0)
// (X == 0) & (Y == 0) -> (X|Y == 0)
Compiling this:
int %bar(int %a, int %b) {
entry:
%tmp.1 = setne int %a, 0
%tmp.2 = setne int %b, 0
%tmp.3 = or bool %tmp.1, %tmp.2
%retval = cast bool %tmp.3 to int
ret int %retval
}
to this:
_bar:
or r2, r3, r4
addic r3, r2, -1
subfe r3, r3, r2
blr
instead of:
_bar:
addic r2, r3, -1
subfe r2, r2, r3
addic r3, r4, -1
subfe r3, r3, r4
or r3, r2, r3
blr
llvm-svn: 21316
2005-04-18 03:59:53 +00:00
Chris Lattner
a32c50520c
Make the AND elimination operation recursive and significantly more powerful,
...
eliminating an and for Nate's testcase:
int %bar(int %a, int %b) {
entry:
%tmp.1 = setne int %a, 0
%tmp.2 = setne int %b, 0
%tmp.3 = or bool %tmp.1, %tmp.2
%retval = cast bool %tmp.3 to int
ret int %retval
}
generating:
_bar:
addic r2, r3, -1
subfe r2, r2, r3
addic r3, r4, -1
subfe r3, r3, r4
or r3, r2, r3
blr
instead of:
_bar:
addic r2, r3, -1
subfe r2, r2, r3
addic r3, r4, -1
subfe r3, r3, r4
or r2, r2, r3
rlwinm r3, r2, 0, 31, 31
blr
llvm-svn: 21315
2005-04-18 03:48:41 +00:00
Nate Begeman
ce63e383b8
Add a couple missing transforms in getSetCC that were triggering assertions
...
in the PPC Pattern ISel
llvm-svn: 21297
2005-04-14 08:56:52 +00:00
Nate Begeman
20b3399465
Disbale the broken fold of shift + sz[ext] for now
...
Move the transform for select (a < 0) ? b : 0 into the dag from ppc isel
Enable the dag to fold and (setcc, 1) -> setcc for targets where setcc
always produces zero or one.
llvm-svn: 21291
2005-04-13 21:23:31 +00:00
Chris Lattner
89f7e115a4
fix an infinite loop
...
llvm-svn: 21289
2005-04-13 20:06:29 +00:00
Chris Lattner
475fe85ddf
fix some serious miscompiles on ia64, alpha, and ppc
...
llvm-svn: 21288
2005-04-13 19:53:40 +00:00
Chris Lattner
03d675414e
avoid work when possible, perhaps fix the problem nate and andrew are seeing
...
with != 0 comparisons vanishing.
llvm-svn: 21287
2005-04-13 19:41:05 +00:00
Chris Lattner
9540cf8c7e
Implement expansion of unsigned i64 -> FP.
...
Note that this probably only works for little endian targets, but is enough
to get siod working :)
llvm-svn: 21280
2005-04-13 05:09:42 +00:00
Chris Lattner
1a6247ff51
Make expansion of uint->fp cast assert out instead of infinitely recurse.
...
llvm-svn: 21275
2005-04-13 03:42:14 +00:00