Nate Begeman
4034852ba9
Add ISD::UNDEF node
...
Teach the SelectionDAG code how to expand and promote it
Have PPC32 LowerCallTo generate ISD::UNDEF for int arg regs used up by fp
arguments, but not shadowing their value. This allows us to do the right
thing with both fixed and vararg floating point arguments.
llvm-svn: 20988
2005-04-01 22:34:39 +00:00
Chris Lattner
375f5e6ed5
Fix another PATypeHolder error, contributed by Bill Wendling!
...
llvm-svn: 20983
2005-04-01 15:41:30 +00:00
Duraid Madina
48ef32d6d3
repair mindless SELECT waste.
...
llvm-svn: 20982
2005-04-01 10:35:00 +00:00
Nate Begeman
244b36582a
Fix Olden/bh, CR0 was being set in the wrong order
...
LowerCallTo and ISD::CALL are going to need to be modified, regs are being
set in the wrong order.
llvm-svn: 20981
2005-04-01 08:57:43 +00:00
Nate Begeman
f3ead25b68
Also apply Chris's fix to FP select and SETCC
...
llvm-svn: 20979
2005-04-01 07:21:30 +00:00
Chris Lattner
0cd0036523
Move the selection of the arms of the select operation up to the conditional
...
part to make sure we get the side effects and to avoid confusing the CFG.
llvm-svn: 20977
2005-04-01 07:10:02 +00:00
Chris Lattner
c81870e4e6
print the machine CFG in the -print-machineinstrs dump
...
llvm-svn: 20976
2005-04-01 06:48:38 +00:00
Nate Begeman
e82a2d7373
Fix stores to global addresses
...
Fix calls with no arguments
llvm-svn: 20975
2005-04-01 05:57:17 +00:00
Nate Begeman
9d224ae29b
Support indexed loads and stores. This drops Shootout/matrix time from
...
18.8 to 14.8 seconds. The Pattern ISel is now often faster than the
Simple ISel, esp. on memory intensive code.
llvm-svn: 20973
2005-04-01 04:45:11 +00:00
Nate Begeman
af7c6366d7
Implement FP_TO_SINT and FP_TO_UINT
...
llvm-svn: 20972
2005-04-01 02:59:27 +00:00
Nate Begeman
552f6f5f4e
Add support for adding 0.0 and -0.0 to the constant pool, since we lie and
...
say that we support them, for the purposes of generating fsel instructions.
llvm-svn: 20970
2005-04-01 01:08:07 +00:00
Nate Begeman
18b3394f4d
Factor out common code, support FP comparison in folded SetCC
...
llvm-svn: 20969
2005-04-01 00:32:34 +00:00
Nate Begeman
fc89059914
fsel generation for f32 and f64 select
...
generate compare immediate for integer compare with constant
fold setcc into branch
fold setcc into select
Code generation quality for Shootout is now on par with the Simple ISel
llvm-svn: 20968
2005-03-31 23:55:40 +00:00
Andrew Lenharth
1ba016ab6f
make fp div trick dependend on flag
...
llvm-svn: 20967
2005-03-31 22:02:25 +00:00
Andrew Lenharth
7db3834ecf
PCMarker support for DAG and Alpha
...
llvm-svn: 20965
2005-03-31 21:24:06 +00:00
Duraid Madina
47fed18416
Assorted fixes:
...
* Stop being pessimistic about output register allocation
* Start to handle function descriptors: compute target GPs and so on
when doing indirect calls etc. Not there yet, though. For the moment,
we try to use _indirect_ branches wherever possible, to stress test
function descriptors.
* FP divide-by-zero should work now
* add varargs (it doesn't work, though)
At this point, all of SingleSource passes (modulo C++ tests that are due
to issues with the CFE, see note in the README.) Much of MultiSource also
passes although there's still a ton of bugs around. Something for me to
work on tomorrow, then. :)
llvm-svn: 20960
2005-03-31 12:31:11 +00:00
Duraid Madina
f2d1865c74
* declare local common symbols as such (.lcomm, not merely .common)
...
* begin great adventure into correct function descriptor materialization
llvm-svn: 20956
2005-03-31 07:40:24 +00:00
Duraid Madina
03efd3bea9
daintyness
...
llvm-svn: 20955
2005-03-31 07:36:43 +00:00
Duraid Madina
11ff0a2a5f
add what we need to fudge a 'floating point conditional move', this is
...
used to get FP div-by-zero working properly (shunt the right answer
depending on how frcpa sets its predicate output)
llvm-svn: 20954
2005-03-31 07:32:32 +00:00
Nate Begeman
17ff2b3a87
Pass the correct values to the chain argument for node construction during
...
LowerCallTo.
Handle ISD::ADD in SelectAddr, allowing us to have nonzero immediates for
loads and stores, amazing!
llvm-svn: 20946
2005-03-31 02:05:53 +00:00
Nate Begeman
de4aac1374
Rewrite LowerCallTo and Select(ISD::CALL) to properly handle float varargs
...
Tell the SelectionDAG ISel to expand SEXTLOAD of i1 and i8, rather than
complicate the code in ISD::SEXTLOAD to do it by hand
Combine the FP and Int ISD::LOAD codegen
Generate better code for constant pool loads
As a result, all of Shootout, and likely many other programs are now
working.
llvm-svn: 20945
2005-03-31 00:15:26 +00:00
Nate Begeman
9c5480beeb
Fix calls whose arguments fit entirely in registers to not break the Chain.
...
Implement SINT_TO_FP and UINT_TO_FP
Remove some dead code from the simple ISel
llvm-svn: 20944
2005-03-30 19:38:35 +00:00
Andrew Lenharth
91bd9033c6
yea, fine Duraid
...
llvm-svn: 20942
2005-03-30 18:22:52 +00:00
Nate Begeman
c877844625
Fix frame index code to generate legal PowerPC instructions. About half of
...
Shootout now works.
llvm-svn: 20940
2005-03-30 02:23:08 +00:00
Nate Begeman
ec87399dac
Fix external symbol printing in the AsmPrinter. Tell the ISel that we
...
don't support things like memcpy directly. This allows a handful of the
Shootout programs to work, yay!
llvm-svn: 20939
2005-03-30 01:45:43 +00:00
Chris Lattner
abb59a3c21
Instead of setting up the CFG edges at selectiondag construction time, set
...
them up after the code has been emitted. This allows targets to select one
mbb as multiple mbb's as needed.
llvm-svn: 20937
2005-03-30 01:10:47 +00:00
Chris Lattner
46c4246df1
don't depend on the cfg being set up yet
...
llvm-svn: 20936
2005-03-30 01:10:00 +00:00
Nate Begeman
8eddad3985
Fix BranchCC (it's still dumb), and implement FP select (also dumb)
...
llvm-svn: 20935
2005-03-29 22:48:55 +00:00
Nate Begeman
43b127ca0a
Implement integer select and i1 sign extend
...
llvm-svn: 20934
2005-03-29 22:24:51 +00:00
Nate Begeman
d5d90ec76b
Implement SetCC, fix ZERO_EXTEND_INREG
...
llvm-svn: 20933
2005-03-29 21:54:38 +00:00
Chris Lattner
761bb09edb
import all of the rest of the stubs that dsa uses for direct comparison
...
llvm-svn: 20932
2005-03-29 20:36:05 +00:00
Tanya Lattner
bc14e623e3
Compare dependence analysis with llvm instructions versus machine instrutions. the problem with using machine instructions and alias analysis is that aa does not handle tmp instructions.
...
llvm-svn: 20931
2005-03-29 20:35:10 +00:00
Tanya Lattner
7edde71619
Dependence analyzer that just determines dependences within a loop for loads and stores using alias analysis.
...
llvm-svn: 20930
2005-03-29 20:33:42 +00:00
Chris Lattner
94ea4d104c
learn about some more functions.
...
llvm-svn: 20929
2005-03-29 20:04:24 +00:00
Andrew Lenharth
21c4590f96
Fix up some types and constants
...
llvm-svn: 20928
2005-03-29 19:24:04 +00:00
Chris Lattner
cc1644eb2c
Fix a problem where we not marking incoming arguments to functions with
...
external linkage as incomplete.
llvm-svn: 20927
2005-03-29 19:16:59 +00:00
Chris Lattner
02a4d3bd9b
Fix a bug that andrew noticed where we do not correctly sign/zero extend
...
returned integer values all of the way to 64-bits (we only did it to 32-bits
leaving the top bits undefined). This causes problems for targets like alpha
whose ABI's define the top bits too.
llvm-svn: 20926
2005-03-29 19:09:56 +00:00
Chris Lattner
39064a8ca0
there is no point comparing against null pointer.
...
llvm-svn: 20925
2005-03-29 17:44:52 +00:00
Chris Lattner
5ceaf630ab
Fix a major problem with global variable initializers. This could cause
...
us to have stuff pointing to the null pointer, which makes no sense
(the null ptr is an ssa value, not the null object)
llvm-svn: 20922
2005-03-29 17:21:53 +00:00
Chris Lattner
3759d20b0f
fix a warning in the optimized build
...
llvm-svn: 20920
2005-03-29 15:13:27 +00:00
Chris Lattner
4f9c2cde55
add some more functions, ignore setcc for constraints!
...
llvm-svn: 20917
2005-03-29 06:52:20 +00:00
Chris Lattner
9b3adb88b8
disable this transformation in the one obscure case that really pessimizes
...
pointer analysis.
llvm-svn: 20916
2005-03-29 06:37:47 +00:00
Chris Lattner
813ef90a12
Handle "known" external calls context sensitively, add support for realloc
...
and a couple of other functions that are important.
Handle aggregate undef values for gv initializers
llvm-svn: 20914
2005-03-29 06:09:07 +00:00
Nate Begeman
62e458272f
Implement div, rem, and frameindex
...
llvm-svn: 20907
2005-03-29 00:03:27 +00:00
Nate Begeman
734a61f057
Pattern ISel: fix argument loading for i64s (thanks chris)
...
Simple ISel: fix i64 subtract
llvm-svn: 20903
2005-03-28 23:08:54 +00:00
Nate Begeman
32d1caae6d
Remove fake instruction 'subc' (mnemonic for subfc).
...
More pattern isel updates
llvm-svn: 20902
2005-03-28 22:28:37 +00:00
Chris Lattner
185e7e2c22
implement legalization of build_pair for nate
...
llvm-svn: 20901
2005-03-28 22:03:13 +00:00
Andrew Lenharth
c287cd1e4e
First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
...
llvm-svn: 20900
2005-03-28 20:05:49 +00:00
Nate Begeman
2ab66f55b6
Implement proper loads and zero-extends of all types
...
llvm-svn: 20897
2005-03-28 19:36:43 +00:00
Duraid Madina
7b5f67baf9
Emit .global @function and .global @object entries so the Intel ias
...
assembler may be used; identify LLVM output as such.
llvm-svn: 20892
2005-03-28 15:21:43 +00:00
Chris Lattner
47fcba56f8
Teach andersens that non-escaping memory cannot be mod/ref'd by external fn calls.
...
llvm-svn: 20891
2005-03-28 06:21:17 +00:00
Misha Brukman
b97b449309
Fix grammar
...
llvm-svn: 20890
2005-03-28 04:32:12 +00:00
Chris Lattner
abb512a593
Make anders-aa much more precise by not being completely pessimistic about
...
external functions. Teach it about a few important ones.
llvm-svn: 20889
2005-03-28 04:03:52 +00:00
Alkis Evlogimenos
e0e628a401
Rename createPromoteMemoryToRegister() to
...
createPromoteMemoryToRegisterPass() to be consistent with other pass
creation functions.
llvm-svn: 20885
2005-03-28 02:01:12 +00:00
Chris Lattner
691b1987e1
wrap some long lines
...
llvm-svn: 20884
2005-03-27 22:03:46 +00:00
Chris Lattner
6b31704450
remove ...
...
llvm-svn: 20883
2005-03-27 21:57:09 +00:00
Chris Lattner
15741f8877
speed up steens by using spliceFrom, improve its precision by realizing that
...
an incomplete node cannot alias a complete node.
llvm-svn: 20882
2005-03-27 21:56:55 +00:00
Chris Lattner
7f0903e187
teach andersens about undef
...
llvm-svn: 20881
2005-03-27 18:58:23 +00:00
Chris Lattner
de6cc372e3
Don't give up completely, maybe other AA can say something about this.
...
llvm-svn: 20873
2005-03-27 00:02:33 +00:00
Chris Lattner
3a88055932
Factor out percentage printing into its own function. Make two changes to
...
the function: print more precision XX.X% instead of XX%, and cast to ULL
before scaling by 100/1000 to avoid wrap around for large numbers of queries
(such as occur for 253.perlbmk and 176.gcc)
llvm-svn: 20872
2005-03-26 23:56:33 +00:00
Chris Lattner
b84076a278
Cache mapping information for a call site after computing it for a mod/ref
...
query. If the next mod/ref query happens to be for the same call site
(which is extremely likely), use the cache instead of recomputing the
callee/caller mapping. This makes -aa-eval ***MUCH*** faster with
ds-aa
llvm-svn: 20871
2005-03-26 23:29:03 +00:00
Chris Lattner
21d25dd835
Remove more long dead code: dsa doesn't provide must alias info
...
llvm-svn: 20870
2005-03-26 22:54:46 +00:00
Chris Lattner
8638fbf4d6
remove some unsafe code that has long been dead
...
llvm-svn: 20869
2005-03-26 22:48:42 +00:00
Chris Lattner
ee96215ded
slightly improve mod/ref for DSAA by checking the globals graph for fallback
...
llvm-svn: 20868
2005-03-26 22:47:03 +00:00
Chris Lattner
02275101be
Teach steens-aa two things about mod/ref information:
...
1. If memory never escapes the program, it cannot be mod/ref'd by external
functions.
2. If memory is global never mod/ref'd in the program, it cannot be mod/ref'd
by any call.
llvm-svn: 20867
2005-03-26 22:43:20 +00:00
Chris Lattner
bbec058833
Interchange this loop so that we test all pointers against one call site
...
before moving on to the next call site. This will be a more efficient way
to compute the mod/ref set for AA implementations like DSA.
llvm-svn: 20866
2005-03-26 22:16:44 +00:00
Nate Begeman
6b0fbf811f
Fix that pesky floats in integer regs problem by assigning the f32 type to
...
the correct register class. Also remove the loading of float data into int
regs part of varargs; it will need to be implemented differently later.
llvm-svn: 20857
2005-03-26 08:25:22 +00:00
Nate Begeman
31d175d1e5
Get closer to having varargs working. There's still something strange
...
going on with copies between floating point and integer register files
being generated. Once that is solved, varargs will be done.
llvm-svn: 20856
2005-03-26 07:46:36 +00:00
Nate Begeman
69742e6ea1
Make 64bit args and float args work correct with calls. Thanks to Chris
...
for explaining EXTRACT_ELEMENT to me.
llvm-svn: 20847
2005-03-26 02:17:46 +00:00
Nate Begeman
f821401825
Change interface to LowerCallTo to take a boolean isVarArg argument.
...
llvm-svn: 20842
2005-03-26 01:29:23 +00:00
Nate Begeman
d3b5925b38
Next round of pattern isel changes, mostly dealing with calls.
...
llvm-svn: 20841
2005-03-26 01:28:53 +00:00
Nate Begeman
4106e81966
Correct a documention link
...
llvm-svn: 20840
2005-03-26 01:28:05 +00:00
Chris Lattner
d11e075664
no really, don't double count these nodes either!
...
llvm-svn: 20837
2005-03-25 20:54:45 +00:00
Chris Lattner
81e77226bb
Don't count all of the nodes in the SCC once for each function in the SCC.
...
llvm-svn: 20836
2005-03-25 20:37:32 +00:00
Chris Lattner
14fd1844ba
Grow the EQ classes for globals at the end of the BU pass. This shrinks
...
memory usage in the TD pass for 254.gap from 31.3MB to 3.9MB.
llvm-svn: 20834
2005-03-25 16:45:43 +00:00
Nate Begeman
ba1cd37734
Support global addresses and fix call returns. Varargs still aren't
...
handled correctly for floating point arguments, or more than 8 arguemnts.
This does however, allow hello world to run.
llvm-svn: 20832
2005-03-25 08:34:25 +00:00
Chris Lattner
8e8b8bb133
Enhance loopsimplify to preserve alias analysis instead of clobbering it.
...
This prevents crashes on some programs when using -ds-aa -licm.
llvm-svn: 20831
2005-03-25 06:37:22 +00:00
Chris Lattner
549f99e537
Treat free operations as volatile, since they cannot be moved. This fixes
...
Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll
llvm-svn: 20830
2005-03-25 05:49:37 +00:00
Chris Lattner
4f4fa287ee
Fix a bug where LICM was not updating AA information properly when sinking
...
a pointer value out of a loop causing it to be duplicated.
llvm-svn: 20828
2005-03-25 00:22:36 +00:00
Chris Lattner
52e28abe6e
remove a debugging timer.
...
llvm-svn: 20827
2005-03-25 00:06:09 +00:00
Chris Lattner
5d60f10a1d
Two changes here:
...
1. Instead of copying Local graphs to the BU graphs to start with, use
spliceFrom to do the job (which is constant time in this case). On
176.gcc, this chops off .17s from the bu pass.
2. When building SCC graphs, simplify the logic and use spliceFrom to
do the heavy lifting, instead of cloneInto/delete. This slices
another .14s off 176.gcc.
llvm-svn: 20826
2005-03-25 00:05:04 +00:00
Chris Lattner
02206c42f2
Make the spliceFrom case where one graph is completely empty be constant time.
...
llvm-svn: 20825
2005-03-25 00:02:41 +00:00
Chris Lattner
a90eb0ff31
add a new DSGraph::spliceFrom method, which violently takes the content of
...
one graph and plops it into another, without breaking a sweat.
llvm-svn: 20824
2005-03-24 23:46:04 +00:00
Nate Begeman
6b11098886
Implement next round of Pattern ISel fixes
...
1. void returns
2. multiplies
3. calls
llvm-svn: 20822
2005-03-24 23:35:30 +00:00
Nate Begeman
613e54d5f0
Fix an incorrect argument being passed to BuildMI for indirect calls.
...
llvm-svn: 20821
2005-03-24 23:34:38 +00:00
Chris Lattner
5f6b30b7c0
This replaces the correct but slow code with a more aggressive scc-finder
...
based approach to find globals and call sites that need to be copied. This
speeds up the BU pass on 176.gcc from 22s back up to 2.3s. Not as good
as 1.5s, but at least it's correct :)
llvm-svn: 20820
2005-03-24 23:06:02 +00:00
Chris Lattner
dec4b495c9
only look at successors of globals. This gets us down to "only" 22s in the
...
bu pass for 176.gcc
llvm-svn: 20818
2005-03-24 21:17:27 +00:00
Chris Lattner
0a5c8b7f21
Unfortunately, a previous patch was not safe. Revert it, reimplement
...
something correct. Unfortunately this takes 176.gcc's BU phase back
up to 29s from 1.5. This fixes DSGraph/2005-03-24-Global-Arg-Alias.ll
llvm-svn: 20817
2005-03-24 21:07:47 +00:00
Nate Begeman
4584ca0554
Commit Gabor Greif's patch to use iterators in lowering intrinsics.
...
llvm-svn: 20816
2005-03-24 20:07:16 +00:00
Chris Lattner
32dc61b75e
don't bother |'ing in 0's
...
llvm-svn: 20815
2005-03-24 18:42:51 +00:00
Chris Lattner
0530cce5a5
be more aggressive about incompleteness marking
...
llvm-svn: 20814
2005-03-24 18:42:28 +00:00
Chris Lattner
ad07b1bc54
eliminate dead variables, patch contributed by Gabor Greif!
...
llvm-svn: 20812
2005-03-24 17:32:20 +00:00
Nate Begeman
833c1d0994
Implement more of the PPC32 Pattern ISel:
...
1) dynamic stack alloc
2) loads
3) shifts
4) subtract
5) immediate form of add, and, or, xor
6) change flag from -pattern-isel to -enable-ppc-pattern-isel
Remove dead arguments from getGlobalBaseReg in the simple ISel
llvm-svn: 20810
2005-03-24 06:28:42 +00:00
Chris Lattner
a42c4a0874
Fix silly "no newline at end of file" warning
...
llvm-svn: 20809
2005-03-24 06:16:18 +00:00
Chris Lattner
56f3525a1d
Fix compilation errors, patch contributed by the fabulous Bill Wendling!
...
llvm-svn: 20808
2005-03-24 05:13:53 +00:00
Chris Lattner
2e2035aa72
fix a compilation error, patch contributed by Bill Wendling!
...
llvm-svn: 20807
2005-03-24 05:12:48 +00:00
Nate Begeman
0e77845b7e
Addition of the PPC32 Pattern ISel. While it is far from complete, it will
...
be brought up to parity with the current simple ISel in the coming days.
Currently, -pattern-isel is required to trigger it.
llvm-svn: 20805
2005-03-24 04:41:43 +00:00
Nate Begeman
175a9f1cc6
Remove comments that are now meaningless from the pattern ISels, at Chris's
...
request.
llvm-svn: 20804
2005-03-24 04:39:54 +00:00
Chris Lattner
120bfecc01
Fix a crash while promoting a value out of a loop from a global variable
...
when using ds-aa
llvm-svn: 20802
2005-03-24 04:22:04 +00:00
Chris Lattner
586f97a8b6
teach ds-aa about mod/ref for external function calls.
...
llvm-svn: 20801
2005-03-24 03:04:50 +00:00