Commit Graph

9688 Commits

Author SHA1 Message Date
Chris Lattner e36d77b726 Make -steens-aa more conservative (aka correct) by making sure to obey
incompleteness flags.

Make it more aggressive by taking field sensitive information into
account.

llvm-svn: 20781
2005-03-23 01:48:09 +00:00
Tanya Lattner 13417b5be3 Added alias analysis.
Fixed many many bugs.
This now works on almost all Singlesource , and most of MultiSource.

llvm-svn: 20780
2005-03-23 01:47:20 +00:00
Chris Lattner 7d3df410ab implement Analysis/DSGraph/field-sensitive.ll
llvm-svn: 20779
2005-03-23 01:47:19 +00:00
Chris Lattner dcb82f5d0a don't crash in some bad cases.
llvm-svn: 20776
2005-03-23 01:29:26 +00:00
Chris Lattner 310d1a3882 Several changes here:
1. Increase max node size from 64->256 to avoid collapsing an important
   structure in 181.mcf
2. If we have multiple calls to an indirect call node with an indirect
   callee, fold these call nodes together, to avoid DSA turning apoc into
   a flaming fireball of death when analyzing 176.gcc.
  With this change, 176.gcc now takes ~7s to analyze for loc+bu+td, with
  5.7s of that in the BU pass.

llvm-svn: 20775
2005-03-22 23:54:52 +00:00
Chris Lattner ca174306f0 Mark external globals incomplete in the BU Globals graph, fixing
Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll

llvm-svn: 20773
2005-03-22 22:10:22 +00:00
Andrew Lenharth 8180e87e51 hum, it is good to use real instructions
llvm-svn: 20769
2005-03-22 16:42:52 +00:00
Chris Lattner f00684079a Directly count the number of memory instructions.
llvm-svn: 20766
2005-03-22 03:55:10 +00:00
Chris Lattner 24922c7a2b Timers SHOULD NOT record the time taken to count the bytes allocated in the heap!
llvm-svn: 20765
2005-03-22 03:20:38 +00:00
Chris Lattner 495f00946e Remove an iteration pass over the entire scalarmap for each function created
by not allowing integer constants to get into the scalar map in the first
place.

llvm-svn: 20764
2005-03-22 02:45:13 +00:00
Chris Lattner 250726ec25 When making a clone of a DSGraph from the BU pass, make sure to remember that
this clone is supposed to be used for *ALL* of the functions in the SCC.

This fixes the memory explosion problem the TD pass was having, reducing the
memory growth from 24MB -> 3.5MB on povray and 270MB ->8.3MB on perlbmk!
This obviously also speeds up the TD pass *a lot*.

llvm-svn: 20763
2005-03-22 01:50:42 +00:00
Chris Lattner e05c633099 Don't use operator[], use the new method instead, which is faster. This speeds
up the TD pass about 30% for povray and perlbmk.  It's still not clear why
copying a 5MB set of graphs turns into a 25MB set of graphs though :(

llvm-svn: 20762
2005-03-22 01:42:59 +00:00
Chris Lattner fcae88f280 Now that the dead ctor is gone, nothing uses the old node mapping exported by
cloneInto: make it an internally used mapping.

llvm-svn: 20760
2005-03-22 00:36:51 +00:00
Chris Lattner 8016c975c9 remove a dead ctor
llvm-svn: 20759
2005-03-22 00:33:35 +00:00
Chris Lattner ea2c02bcca now that the second argument is always this->ReturnNodes, don't bother passing it.
llvm-svn: 20758
2005-03-22 00:29:44 +00:00
Chris Lattner 571578143c instead of using a local RetValMap, just use the graph we are cloning into
for the return node map.

llvm-svn: 20757
2005-03-22 00:25:52 +00:00
Andrew Lenharth 6294dee913 two things: 1)evilness reduction patch, reduces the number of instructions hiding in the small jump CC moving code. 2)implement div of small data types by FP DIV (also reduces evilness and should speed things up)
llvm-svn: 20756
2005-03-22 00:24:07 +00:00
Chris Lattner d05ab9cab4 now that the valuemapping is always the local scalar map, we can eliminate
this identity merge.

llvm-svn: 20755
2005-03-22 00:22:45 +00:00
Chris Lattner 19944fade3 remove the second argument to cloneInto
llvm-svn: 20754
2005-03-22 00:21:05 +00:00
Chris Lattner 03b7f99338 add some timers, don't clone aux nodes
llvm-svn: 20752
2005-03-22 00:12:00 +00:00
Chris Lattner 410da35a1f move this out of line
llvm-svn: 20751
2005-03-22 00:09:45 +00:00
Chris Lattner 5f10e6dda1 don't generate temporary scalarmaps.
llvm-svn: 20749
2005-03-22 00:04:21 +00:00
Chris Lattner 848ef879c5 allow passing clone flags down to cloneInto
llvm-svn: 20748
2005-03-21 22:49:53 +00:00
Chris Lattner c1439d539f Enhance the TD pass to build composite graphs when we have indirect call
sites that target multiple callees.  If we have a function table, for
example, with N callees, and M callers call through it, we used to have
to perform O(M*N) graph inlinings.  Now we perform O(M+N) inlinings.

This speeds up the td pass on perlbmk from 36.26s to 25.75s.

llvm-svn: 20743
2005-03-21 20:31:29 +00:00
Chris Lattner d90f5bab82 make this const correct
llvm-svn: 20741
2005-03-21 20:28:50 +00:00
Chris Lattner 040426aee0 Fix a major problem where we didn't add call graph edges for call sites with
more than 1 callee.  This fixes Analysis/DSGraph/FunctionPointerTable-const.ll

llvm-svn: 20740
2005-03-21 20:20:49 +00:00
Misha Brukman 82ae9e1dda We may be adding functions to the Module during initialization, so
conservatively, it's modified

llvm-svn: 20735
2005-03-21 19:22:14 +00:00
Chris Lattner e8a43291cd Ugh, for some reason, I can't call this unless the reference is const!?!?!?
llvm-svn: 20732
2005-03-21 10:00:45 +00:00
Chris Lattner 13429dc5af The reachability cloner should add arguments to merged calls when the RHS of
the merge has more operands than the LHS.

llvm-svn: 20731
2005-03-21 09:39:51 +00:00
Chris Lattner 7269f15e8f 'note to self'
llvm-svn: 20727
2005-03-21 08:43:32 +00:00
Chris Lattner a5f4b773d9 Remove a bunch of cruft and dead code for handling the case when types were
defined in function constant pools.  The assembler grammar has long
disallowed functions from having constant pools, so all of this stuff is
dead.

This makes it an immediate error for functions to refer to nonexisting
types, fixing Regression/Verifier/2005-03-21-UndefinedTypeReference.ll.

Before, references to non-existing types in functions would only be
detected when the subsequent function was parsed, due to the call to
"ResolveTypes".  "ResolveTypes" has not resolved any types for a long time,
instead it emitted an error message if no resolved types are left.  Since
the only caller of this method is in the module code, just inline it.

llvm-svn: 20726
2005-03-21 06:27:42 +00:00
Tanya Lattner 87ee2ba48d Make this method non-const. Making it const causes the const version of
getIGroup to be called instead of the non-const one.  These two methods
have (??) different behavior, so this change fixes bugs.

llvm-svn: 20724
2005-03-21 06:07:43 +00:00
Chris Lattner 98f7e1c370 Change the way that the TD pass inlines graphs. Instead of inlining each
graph into all of the functions it calls when we visit a graph, change it so
that the graph visitor inlines all of the callers of a graph into the current
graph when it visits it.

While we're at it, inline global information from the GG instead of from each
of the callers.  The GG contains a superset of the info that the callers do
anyway, and this way we only need to do it one time (not one for each caller).

This speeds up the TD pass substantially on several programs, and there is
still room for improvement.  For example, the TD pass used to take 147s
on perlbmk, it now takes 36s.  On povray, we went from about 5s to 1.97s.
134.perl is down from ~1s for Loc+BU+TD to .6s.

The TD pass needs a lot of improvement though, which will occur with later
patches.

llvm-svn: 20723
2005-03-21 04:55:35 +00:00
Chris Lattner c5cdc2260d Don't strip modref bits when inlining down the call graph. This fixes
the DSGraph/2003-06-30-TopDownResolve.ll regression from last night.

llvm-svn: 20717
2005-03-20 18:02:56 +00:00
Chris Lattner 21ef7678d6 Remove the ability to keep track of inlined globals, which is always dead.
llvm-svn: 20716
2005-03-20 04:30:30 +00:00
Chris Lattner 571c62a008 This call is always a noop, remove it.
llvm-svn: 20714
2005-03-20 04:29:54 +00:00
Chris Lattner b1cabb6541 remove some pointless asserts
llvm-svn: 20713
2005-03-20 04:29:39 +00:00
Chris Lattner ded489ec3b -steens doesn't use the inlined globals facility.
llvm-svn: 20712
2005-03-20 04:23:57 +00:00
Chris Lattner ff634f4e32 Build EC's for globals twice. The first is after constructing the initial
Globals Graph for the local pass, the second is after all of the locals
graphs have been constructed.  This allows for many additional global EC's
to be recognized that weren't before.  This speeds up analysis of programs
like 177.mesa, where it changes DSA from taking 0.712s to 0.4018s.

llvm-svn: 20711
2005-03-20 03:32:35 +00:00
Chris Lattner 36a810ac40 Add a new DSNode::removeGlobal method.
llvm-svn: 20710
2005-03-20 03:29:54 +00:00
Chris Lattner 5ae215248f Transform BU pass to not use the horrible DSCallSiteIterator class.
llvm-svn: 20708
2005-03-20 02:42:07 +00:00
Chris Lattner a550a5b173 Implement new methods for dealing with DSNode global lists, rename uses of
old methods.

llvm-svn: 20707
2005-03-20 02:41:38 +00:00
Chris Lattner e68e808bcd use simpler methods.
llvm-svn: 20706
2005-03-20 02:41:16 +00:00
Chris Lattner 1ffdd57e0a method was renamed.
llvm-svn: 20705
2005-03-20 02:40:27 +00:00
Chris Lattner 5635a88fcb print out equiv class info.
llvm-svn: 20704
2005-03-20 02:40:11 +00:00
Chris Lattner e7a8e8677e some methods got renamed
llvm-svn: 20703
2005-03-20 02:40:04 +00:00
Chris Lattner 711e083c26 Make use of simpler DSNode methods.
llvm-svn: 20702
2005-03-20 02:39:49 +00:00
Chris Lattner 61f3befdc8 #ifdef out a function only used by #ifdef'd code.
llvm-svn: 20700
2005-03-20 02:14:15 +00:00
Chris Lattner e965bd16bb comment cleanup
llvm-svn: 20699
2005-03-20 01:18:00 +00:00
Chris Lattner 9379e69af9 Create an equivalence class of global variables that DSA will never be able
to tell apart anyway, and only track the leader for of these equivalence
classes in our graphs.

This dramatically reduces the number of GlobalValue*'s that appear in scalar
maps, which A) reduces memory usage, by eliminating many many scalarmap entries
and B) reduces time for operations that need to execute an operation for each
global in the scalar map.

As an example, this reduces the memory used to analyze 176.gcc from 1GB to
511MB, which (while it's still way too much) is better because it doesn't hit
swap anymore.  On eon, this shrinks the local graphs from 14MB to 6.8MB,
shrinks the bu+td graphs of povray from 50M to 40M, shrinks the TD graphs of
130.li from 8.8M to 3.6M, etc.

This change also speeds up DSA on large programs where this makes a big
difference.  For example, 130.li goes from 1.17s -> 0.56s, 134.perl goes
from 2.14 -> 0.93s, povray goes from 15.63s->7.99s (!!!).

This also apparently either fixes the problem that caused DSA to crash on
perlbmk and gcc, or it hides it, because DSA now works on these.  These
both take entirely too much time in the TD pass (147s for perl, 538s for
gcc, vs 7.67/5.9s in the bu pass for either one), but this is a known
problem that I'll deal with later.

llvm-svn: 20696
2005-03-19 22:23:45 +00:00
Chris Lattner 484bfc4d26 Fix the 3 regressions last night, due to my buggy patch from yesterday.
llvm-svn: 20689
2005-03-19 17:35:11 +00:00
Alkis Evlogimenos 9160d5fd8b Add new function getPtrPtrFromArrayPtr().
llvm-svn: 20684
2005-03-19 11:40:31 +00:00
Alkis Evlogimenos 1a48561432 Stop using deprecated interface.
llvm-svn: 20679
2005-03-19 09:22:17 +00:00
Chris Lattner c1b9b56a2c Switch to use the new interface for the EquivalenceClasses class, and fix
a bug involving SCC's who have multiple members that are part of an EC.

llvm-svn: 20678
2005-03-19 05:15:27 +00:00
Chris Lattner bed1c18a44 do not bother inlining nullary functions without return values. The only
effect these calls can have is due to global variables, and these passes
all use the globals graph to capture their effect anyway.  This speeds up
the BU pass very slightly on perlbmk, reducing the number of dsnodes
allocated from 98913 to 96423.

llvm-svn: 20676
2005-03-18 23:19:47 +00:00
Chris Lattner 30525a04c1 fix a bogus assertion
llvm-svn: 20675
2005-03-18 23:18:30 +00:00
Chris Lattner 5bd948b4d7 another fastpath
llvm-svn: 20674
2005-03-18 23:18:20 +00:00
Chris Lattner bed9657ff6 remove use of getPrev() and getNext() on ilist nodes.
llvm-svn: 20673
2005-03-18 16:12:37 +00:00
Chris Lattner e29503a805 expose this pass to both opt and analyze
llvm-svn: 20672
2005-03-18 05:27:57 +00:00
Chris Lattner a8e1a5250a remove a bogus optimization. This only works if there are no globals in the
graph, and the combination of a function that does not reference globals, takes
not arguments and returns no value is pretty rare.

llvm-svn: 20670
2005-03-18 00:23:59 +00:00
Chris Lattner 3f181d7880 Rewrite DSAA::getModRefInfo to compute the mapping between caller and callee
to determine mod/ref behavior, instead of creating a *copy* of the caller
graph and inlining the callee graph into the copy.

This speeds up aa-eval on Ptrdist/yacr2 from 109.13s to 3.98s, and gives
identical results.  The speedup is similar on other programs.

llvm-svn: 20669
2005-03-18 00:21:03 +00:00
Chris Lattner b8d85c1a74 implement a new method.
llvm-svn: 20668
2005-03-17 23:45:54 +00:00
Chris Lattner 488a80a292 add some possibly bogus assertions.
llvm-svn: 20665
2005-03-17 20:33:27 +00:00
Chris Lattner 9c9f68c42f Do not include the Function* for direct call/invoke instructions in the
alias evaluation.  Clients really don't care.

llvm-svn: 20664
2005-03-17 20:25:04 +00:00
Duraid Madina 8a3aa43422 typo/denial
llvm-svn: 20663
2005-03-17 20:23:27 +00:00
Chris Lattner b5525529bd simplify this function a bit, allow DS-AA to build on/improve the mod/ref
results returned by AA, not just use one or the other.

llvm-svn: 20662
2005-03-17 20:16:58 +00:00
Chris Lattner 8dd1491e71 Clean up some code, handle null pointer specially to avoid an assertion
llvm-svn: 20660
2005-03-17 19:56:56 +00:00
Chris Lattner ea7e6548dc Two changes:
1. Chain to the parent implementation of M/R analysis if we can't find
     any information.  It has some heuristics that often do well.
  2. Do not clear all flags, this can make invalid nodes by turning nodes
     that used to be collapsed into non-collapsed nodes (fixing crashes)

llvm-svn: 20659
2005-03-17 19:56:18 +00:00
Duraid Madina df642ff2ae clean up warnings when building in release mode
llvm-svn: 20658
2005-03-17 19:00:40 +00:00
Duraid Madina a06265a119 OK, IA64 is statically linked into llc
llvm-svn: 20655
2005-03-17 18:37:05 +00:00
Duraid Madina f5cc2c453d build the IA64 target as a .so for now
llvm-svn: 20654
2005-03-17 18:29:04 +00:00
Duraid Madina 91ed0a11cf and so it begins...
PHASE 1: write instruction selector
PHASE 2: ???
PHASE 3: profit!

llvm-svn: 20652
2005-03-17 18:17:03 +00:00
Chris Lattner 43832b049e Don't emit two comparisons when comparing a FP value against zero!
llvm-svn: 20651
2005-03-17 16:29:26 +00:00
Chris Lattner 7b9020a059 Fix the missing symbols problem Bill was hitting. Patch contributed by
Bill Wendling!!

llvm-svn: 20649
2005-03-17 15:38:16 +00:00
Chris Lattner 5251047abd Do not create ridiculously huge DSNodes, as described in the comments.
This speeds up the BU pass on 172.mgrid from 62.3 -> 0.1242s.

llvm-svn: 20648
2005-03-17 05:25:34 +00:00
Chris Lattner 252f546ceb Fix a bug where we would consider " .99" and "1.0" different because of the
leading whitespace.

llvm-svn: 20647
2005-03-17 04:49:04 +00:00
Chris Lattner 62462c2314 remove use of compat_iterator.
llvm-svn: 20643
2005-03-16 22:42:19 +00:00
Misha Brukman 96eb878f2a Convert tabs to spaces
llvm-svn: 20638
2005-03-16 05:42:00 +00:00
Chris Lattner 018b093c79 fix some 80 column violations
Add support for programs that define main in a .a file, such as f2c'd programs.

llvm-svn: 20631
2005-03-15 23:03:34 +00:00
Chris Lattner ebaf17875e consolidate LinkFiles into LinkItems, use lib_* iterators.
llvm-svn: 20630
2005-03-15 22:55:17 +00:00
Chris Lattner d3d086d679 consolidate LinkLibraries into LinkItems
llvm-svn: 20629
2005-03-15 22:51:40 +00:00
Chris Lattner f901355379 make sure to mark nodes in the globals graph incomplete after computing it
so that external globals (and whatever they point to) are marked incomplete.

llvm-svn: 20628
2005-03-15 22:47:18 +00:00
Chris Lattner 21a79edb27 fix crashes when we only have a prototype for main.
llvm-svn: 20627
2005-03-15 22:10:04 +00:00
Chris Lattner dadf4b369e Fix a crash that happens when mapping something like this:
{ short, short }

to
  short

where the second short maps onto the second field of the first struct.  In
this case, the struct index is not aligned, so we should avoid calling
getLink(2), which asserts out.

llvm-svn: 20626
2005-03-15 21:36:50 +00:00
Andrew Lenharth aa254d5f79 sure, I can set a flag, but if I never check it, why bother setting it? Should fix 20 programs :)
llvm-svn: 20623
2005-03-15 19:51:19 +00:00
Chris Lattner dd3fb83f32 Make computeGGToGMapping compute an invnodemap
llvm-svn: 20622
2005-03-15 17:52:18 +00:00
Chris Lattner d31a3d0e82 Finally fix (the right way) the problem where functions like this:
void foo() {
  G = 1;
}

would have an empty DSGraph even though G (a global) is directly used
in the function.

llvm-svn: 20619
2005-03-15 17:14:09 +00:00
Chris Lattner 92d0c1c1ba Start using retnodes_* for iteration.
llvm-svn: 20618
2005-03-15 16:55:04 +00:00
Chris Lattner 451fa32685 avoid varialbe name collisions
llvm-svn: 20606
2005-03-15 06:29:12 +00:00
Chris Lattner 6cb4559369 stop using method.
llvm-svn: 20603
2005-03-15 05:19:49 +00:00
Chris Lattner fb972add4f stop using arg_front
llvm-svn: 20599
2005-03-15 05:03:36 +00:00
Chris Lattner 31c8a9d41a stop using arg_back
llvm-svn: 20598
2005-03-15 04:59:17 +00:00
Chris Lattner 531f9e92d4 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner 28f1caa639 Don't crash if computing a mapping to a node with zero size
llvm-svn: 20595
2005-03-15 04:40:24 +00:00
Chris Lattner 26415d7432 rename method, add counterpart
llvm-svn: 20593
2005-03-15 00:58:16 +00:00
Andrew Lenharth 0b9096bcc5 FP 0.0 setcc optimization, and generate short branch sequence for setcc(FP) rather than stack usage
llvm-svn: 20589
2005-03-14 19:23:45 +00:00
Chris Lattner 1bdb8b7e7e add a method to compute a commonly used mapping.
llvm-svn: 20588
2005-03-14 19:22:47 +00:00
Chris Lattner 9071175625 regardless of whether or not the client things we should mark globals incomplete,
ALWAYS mark them incomplete if they are external!

llvm-svn: 20586
2005-03-13 20:36:01 +00:00
Chris Lattner b9e2a4dec0 Make sure to remove incomplete markers before we add to them! :)
llvm-svn: 20585
2005-03-13 20:32:26 +00:00
Chris Lattner 5a6609771a The incoming arguments to main (the argv list) are not complete!
llvm-svn: 20584
2005-03-13 20:22:10 +00:00
Chris Lattner 2eff970892 After finishing BU analysis, move all global variables from the globals
graph into main and mark them complete.

llvm-svn: 20583
2005-03-13 20:15:06 +00:00
Chris Lattner 68c3caccb1 ADd support for printing eqgraphs.
llvm-svn: 20582
2005-03-13 19:51:24 +00:00
Chris Lattner 9cc2c3e9d6 Replace linear search with logrithmic one.
llvm-svn: 20580
2005-03-13 19:05:05 +00:00
Chris Lattner 3434004dce add a StructLayout::getElementContainingOffset method.
llvm-svn: 20579
2005-03-13 19:04:41 +00:00
Andrew Lenharth af9a15fe64 Should fix mesa
llvm-svn: 20577
2005-03-13 00:43:20 +00:00
Chris Lattner 97ac0a8780 make sure to mark nodes returned from functions as incomplete
llvm-svn: 20576
2005-03-12 14:58:28 +00:00
Chris Lattner dd6bcbe820 remove this from the PA namespace, leaving it in the llvm ns
llvm-svn: 20574
2005-03-12 12:08:52 +00:00
Chris Lattner 2dd9a09837 Move this from the pool allocator project to here, where it logically belongs.
llvm-svn: 20570
2005-03-12 11:51:30 +00:00
Andrew Lenharth 27a3df07a0 remove a pseudo instruction and improve inline constant generation
llvm-svn: 20563
2005-03-11 17:48:05 +00:00
Chris Lattner 6f6ecad995 I didn't mean to check this in. :(
llvm-svn: 20555
2005-03-10 20:59:51 +00:00
Chris Lattner 85e7163947 Fix a bug where we would incorrectly do a sign ext instead of a zero ext
because we were checking the wrong thing.  Thanks to andrew for pointing
this out!

llvm-svn: 20554
2005-03-10 20:55:51 +00:00
Andrew Lenharth 7054073bb6 yay for camel_cvs diff
llvm-svn: 20552
2005-03-10 20:15:09 +00:00
Andrew Lenharth 7728eb7b80 some typoes and .bss isn't liked, at all
llvm-svn: 20542
2005-03-10 19:02:02 +00:00
Chris Lattner 76aa8e071b Allow the live interval analysis pass to be a bit more aggressive about
numbering values in live ranges for physical registers.

The alpha backend currently generates code that looks like this:

  vreg = preg
...
  preg = vreg
  use preg
...
  preg = vreg
  use preg

etc.  Because vreg contains the value of preg coming in, each of the
copies back into preg contain that initial value as well.

In the case of the Alpha, this allows this testcase:

void "foo"(int %blah) {
        store int 5, int *%MyVar
        store int 12, int* %MyVar2
        ret void
}

to compile to:

foo:
        ldgp $29, 0($27)
        ldiq $0,5
        stl $0,MyVar
        ldiq $0,12
        stl $0,MyVar2
        ret $31,($26),1

instead of:

foo:
        ldgp $29, 0($27)
        bis $29,$29,$0
        ldiq $1,5
        bis $0,$0,$29
        stl $1,MyVar
        ldiq $1,12
        bis $0,$0,$29
        stl $1,MyVar2
        ret $31,($26),1

This does not seem to have any noticable effect on X86 code.

This fixes PR535.

llvm-svn: 20536
2005-03-09 23:05:19 +00:00
Andrew Lenharth 8145fec740 minor correction for Register that isn't used
llvm-svn: 20535
2005-03-09 20:48:23 +00:00
Chris Lattner 7f26946709 constant fold FP_ROUND_INREG, ZERO_EXTEND_INREG, and SIGN_EXTEND_INREG
This allows the alpha backend to compile:

bool %test(uint %P) {
        %c = seteq uint %P, 0
        ret bool %c
}

into:

test:
        ldgp $29, 0($27)
        ZAP $16,240,$0
        CMPEQ $0,0,$0
        AND $0,1,$0
        ret $31,($26),1

instead of:

test:
        ldgp $29, 0($27)
        ZAP $16,240,$0
        ldiq $1,0
        ZAP $1,240,$1
        CMPEQ $0,$1,$0
        AND $0,1,$0
        ret $31,($26),1

... and fixes PR534.

llvm-svn: 20534
2005-03-09 18:37:12 +00:00
Chris Lattner b1d901427a correct the computation of the isAbstract bit for types.
llvm-svn: 20533
2005-03-09 17:34:27 +00:00
Chris Lattner 562c180879 Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis!

llvm-svn: 20531
2005-03-09 16:29:52 +00:00
Reid Spencer f064bb2617 Fix a typo in an assertion comment.
Patch contributed by Vladimir Merzliakov.

llvm-svn: 20529
2005-03-09 15:19:41 +00:00
Chris Lattner adb043c2d8 Export two methods for getting -X and A-B.
llvm-svn: 20527
2005-03-09 05:34:41 +00:00
Chris Lattner b9f0cebeb5 get bugpoint working on ia64, by building .so's with -fpic. :)
llvm-svn: 20525
2005-03-09 03:31:02 +00:00
Chris Lattner 1f1462fafa Fix a crash handling 'undef bool', fixing an llc crash on 186.crafty
llvm-svn: 20523
2005-03-08 22:53:09 +00:00
Reid Spencer 00658b80fb Patch to make assembly output compatible with mingw compilation (identical
to cygwin)

llvm-svn: 20520
2005-03-08 17:02:05 +00:00
Chris Lattner ea50620eec Make sure to remove all dead type names from the symbol table, not just
struct types.  This fixes Regression/CodeGen/CBackend/2005-03-08-RecursiveTypeCrash.ll,
a crash on Java output that Alkis reported.

llvm-svn: 20519
2005-03-08 16:19:59 +00:00
Misha Brukman 20238eb963 Single characters should be printed out as chars, not strings.
llvm-svn: 20515
2005-03-08 00:26:08 +00:00
Chris Lattner e9328b319c Fix an apparent ambiguity compiling on PPC
llvm-svn: 20507
2005-03-07 02:59:36 +00:00
Chris Lattner 8c79559443 fix a bug where we thought arguments were constants :(
llvm-svn: 20506
2005-03-06 22:52:29 +00:00
Chris Lattner 2ce303b406 Fix Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll,
hopefully not breaking too many other things.

llvm-svn: 20505
2005-03-06 22:36:12 +00:00
Chris Lattner 45403e5052 implement Transforms/LoopStrengthReduce/invariant_value_first_arg.ll
llvm-svn: 20501
2005-03-06 22:06:22 +00:00
Chris Lattner d3874fad44 minor simplifications of the code.
llvm-svn: 20497
2005-03-06 21:58:22 +00:00
Chris Lattner dd3ec92085 trivial simplification
llvm-svn: 20494
2005-03-06 21:35:38 +00:00
Chris Lattner 238f6df546 Fix a bug where we could corrupt a parent loop's header info if we unrolled
a nested loop.  This fixes Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll
and PR532

llvm-svn: 20493
2005-03-06 20:57:32 +00:00
Chris Lattner 86fe3a1fdb rename insertEntry to insert
llvm-svn: 20484
2005-03-06 05:55:40 +00:00
Chris Lattner 533805e6da Merge SymbolTable::removeEntry into SymbolTable::remove, its only caller
llvm-svn: 20483
2005-03-06 05:51:09 +00:00
Chris Lattner 290d881f84 Delete the really inefficient method: void remove(const Type* Typ);
Speed up the symbol stripping code by avoiding a linear search of the
type table.

Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.

llvm-svn: 20481
2005-03-06 05:46:41 +00:00
Chris Lattner 1b032f59e7 Make this MUCH faster by avoiding a linear search in the symbol table code.
llvm-svn: 20479
2005-03-06 05:42:36 +00:00
Chris Lattner bad0e7e2d9 Remove some really gross and hard to understand code now that
InternallyInconsistent is always false.

llvm-svn: 20477
2005-03-06 05:21:40 +00:00
Chris Lattner cd56f5a8e4 Simplify some code.
llvm-svn: 20476
2005-03-06 05:13:42 +00:00
Chris Lattner eb9a12cbce remove these methods.
llvm-svn: 20474
2005-03-06 02:37:47 +00:00
Chris Lattner 8a982e10be simplify and speed up some code
llvm-svn: 20472
2005-03-06 02:32:00 +00:00
Chris Lattner c9b0984666 simplify some code.
llvm-svn: 20471
2005-03-06 02:28:23 +00:00
Chris Lattner ffb3778f87 This fixes PR531, a crash when running the CBE on a bytecode file.
The problem is that Function::renameLocalSymbols is iterating through
the symbol table planes, occasionally calling setName to rename a value
(which used to do a symbol table remove/insert pair).

The problem is that if there is only a single value in a particular type
plane that the remove will nuke the symbol table plane, and the insert
will create and insert a new one.  This hoses Function::renameLocalSymbols
because it has an iterator to the old plane, under the (very reasonable)
assumption that simply renaming a value won't cause the type plane to
disappear.

This patch fixes the bug by making the rename operation a single atomic
operation, which has a side effect of making the whole thing faster too. :)

llvm-svn: 20469
2005-03-06 02:14:28 +00:00
Jeff Cohen 4abcea3a69 Reformat comments to fix 80 columns.
llvm-svn: 20467
2005-03-05 22:45:40 +00:00
Jeff Cohen be37fa07fd Reuse induction variables created for strength-reduced GEPs by other similar GEPs.
llvm-svn: 20466
2005-03-05 22:40:34 +00:00
Chris Lattner cdb9bfc150 remove all of the various setName implementations, consolidating them into
Value::setName, which is no longer virtual.

llvm-svn: 20464
2005-03-05 19:51:50 +00:00
Chris Lattner 6d0a24c608 second argument to Value::setName is now gone.
llvm-svn: 20463
2005-03-05 19:05:20 +00:00
Chris Lattner 7c832fb0b2 Make sure the two arguments of a setcc instruction point to the same node.
llvm-svn: 20462
2005-03-05 19:04:31 +00:00
Chris Lattner aa72c889a6 zap
llvm-svn: 20461
2005-03-05 19:04:07 +00:00
Chris Lattner f66165674f 2nd arg to setName goes away.
llvm-svn: 20460
2005-03-05 19:02:15 +00:00
Chris Lattner cc77b84fcb Constants never get names.
llvm-svn: 20459
2005-03-05 19:01:59 +00:00
Chris Lattner ed2fb1cf93 Remove the 2nd argument to Value::setName
llvm-svn: 20458
2005-03-05 19:01:49 +00:00
Chris Lattner f246ef3e2f don't break the build on 32-bit hosts.
llvm-svn: 20455
2005-03-05 17:47:38 +00:00
Andrew Lenharth 7c954c6d13 fix data size stuff for architectures with bit challenged data types
llvm-svn: 20453
2005-03-05 15:30:33 +00:00
Chris Lattner cfe2822cdf Do not compute 1ULL << 64, which is undefined. This fixes Ptrdist/ks on the
sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll

llvm-svn: 20445
2005-03-04 23:21:33 +00:00
Andrew Lenharth f3cd1477c3 fix up stack pointer adjustments
llvm-svn: 20442
2005-03-04 21:40:02 +00:00
Chris Lattner c01e2f76c3 Trivial cleanup patch
llvm-svn: 20436
2005-03-04 20:27:46 +00:00
Andrew Lenharth 8df62dda57 fix FCMOVxx typo, set rem and div to hardcode target reg to be the same as the one the assembler uese, update ISel to put values in regs used by assembler for rem and div
llvm-svn: 20434
2005-03-04 20:09:23 +00:00
Jeff Cohen a2c59b7423 Add support for not strength reducing GEPs where the element size is a small
power of two.  This emphatically includes the zeroeth power of two.

llvm-svn: 20429
2005-03-04 04:04:26 +00:00
Andrew Lenharth f0ab14aa24 turn on IEEE for compares
llvm-svn: 20425
2005-03-03 22:12:11 +00:00
Andrew Lenharth 6a5f52d15a beter Select on FP
llvm-svn: 20424
2005-03-03 21:47:53 +00:00
Chris Lattner 00ee68c612 Print -X like this:
double test(double l1_X) {
  return (-l1_X);
}

instead of like this:

double test(double l1_X) {
  return (-0x0p+0 - l1_X);
}

llvm-svn: 20423
2005-03-03 21:12:04 +00:00
Andrew Lenharth 00348ce902 LSR cleanup patch
llvm-svn: 20422
2005-03-03 19:03:21 +00:00
Chris Lattner 1a678c67c9 Do not lower malloc's to pass "sizeof" expressions like this:
ltmp_0_7 = malloc(((unsigned )(&(((signed char (*)[784])/*NULL*/0)[1u]))));

Instead, just emit the literal constant, like this:

  ltmp_0_7 = malloc(784u);

This works around a bug in ICC 8.1 compiling the CBE generated code.  :-(

llvm-svn: 20415
2005-03-03 01:04:50 +00:00
Chris Lattner ef1e989e4f Add an optional argument to lower to a specific constant value instead of
to a "sizeof" expression.

llvm-svn: 20414
2005-03-03 01:03:43 +00:00
Misha Brukman f090d1b3ab Fix the spelling of the word `the'
llvm-svn: 20412
2005-03-02 23:17:31 +00:00
Chris Lattner 4d8689edcb Print the module ID as a comment.
llvm-svn: 20411
2005-03-02 23:12:40 +00:00
Chris Lattner 5b5caaf3cd cleanup the cfg after lsr
llvm-svn: 20410
2005-03-02 21:56:00 +00:00
Andrew Lenharth 180a04a4bb remove 32 sign extend after 32 sextload and handle small negative constant
llvm-svn: 20408
2005-03-02 17:23:03 +00:00
Andrew Lenharth ed4b6488a7 Added LSR as a beta pass for alpha
llvm-svn: 20407
2005-03-02 17:21:38 +00:00
Chris Lattner c8bb99760a Add a temporary option for llc-beta: -enable-lsr-for-ppc, which turns on
Loop Strength Reduction.

llvm-svn: 20399
2005-03-02 06:19:22 +00:00
Reid Spencer a556669219 Be slightly more accurate in an error message.
llvm-svn: 20397
2005-03-02 05:45:56 +00:00
Chris Lattner fe760deb75 Fix a nasty order of evaluation bug that Gabor Greif ran into. Here's an
explanation from IRC:

	|sabre|	I think it's an order of evaluation thing
	|sabre|	for me, the RHS of the assignment is evaluated first
	|sabre|	getTypeDescription checks to see if ConcreteTypeDescription[Ty] contains anything
	|sabre|	since it doesn't, it computes and returns the value
	|sabre|	this gets put into the map.
	|sabre|	For you, the LHS is evaluated first.
	|sabre|	Map[Ty] (aka ConcreteTypeDescriptions[Ty]) inserts an empty string into the map, returning a reference
	|sabre|	getTypeDesc then sees the empty string in the map
	|sabre|	and returns it
	|sabre|	bork :)

llvm-svn: 20394
2005-03-02 03:54:43 +00:00
Jeff Cohen 8ea6f9e821 Fixed the following LSR bugs:
* Loop invariant code does not dominate the loop header, but rather
    the end of the loop preheader.

  * The base for a reduced GEP isn't a constant unless all of its
    operands (preceding the induction variable) are constant.

  * Allow induction variable elimination for the simple case after all.

Also made changes recommended by Chris for properly deleting
instructions.

llvm-svn: 20383
2005-03-01 03:46:11 +00:00
Alkis Evlogimenos b3846f4b06 Lower llvm.isunordered(a, b) into a != a | b != b.
llvm-svn: 20382
2005-03-01 02:07:58 +00:00
Chris Lattner 12328e9378 Remove tabs from file.
llvm-svn: 20380
2005-02-28 19:36:15 +00:00
Chris Lattner 811107350a Add support to the C backend for llvm.prefetch. Patch contributed by
Justin Wick!

llvm-svn: 20378
2005-02-28 19:29:46 +00:00
Chris Lattner 1772c1a672 recognize llvm.prefetch. Patch contributed by Justin Wick!
llvm-svn: 20377
2005-02-28 19:28:00 +00:00
Chris Lattner 39637ef023 Verify llvm.prefetch.
llvm-svn: 20376
2005-02-28 19:27:42 +00:00
Chris Lattner c87e03aeea Lower prefetch to a noop, patch contributed by Justin Wick!
llvm-svn: 20375
2005-02-28 19:27:23 +00:00
Andrew Lenharth 76eff48195 fix integer division and stuff
llvm-svn: 20372
2005-02-28 17:22:18 +00:00
Jeff Cohen dcaa48b5c4 Fix crash in LSR due to attempt to remove original induction variable. However,
for reasons explained in the comments, I also deactivated this code as it needs
more thought.

llvm-svn: 20367
2005-02-28 00:08:56 +00:00
Jeff Cohen fd63d3af0d PHI nodes were incorrectly placed when more than one GEP is reduced in a loop.
llvm-svn: 20360
2005-02-27 21:08:04 +00:00
Jeff Cohen 39751c3b7c First pass at improved Loop Strength Reduction. Still not yet ready for prime time.
llvm-svn: 20358
2005-02-27 19:37:07 +00:00
Chris Lattner 7f32c4aa36 Use const iterators where possible. Patch by Evan Jones!
llvm-svn: 20354
2005-02-27 19:06:10 +00:00
Chris Lattner 7561ca1d15 Teach globalopt how memset/cpy/move affect memory, to allow better optimization.
llvm-svn: 20352
2005-02-27 18:58:52 +00:00
Chris Lattner 0ce80cd542 Fix spelling, patch contributed by Gabor Greif!
llvm-svn: 20343
2005-02-27 06:18:25 +00:00
Chris Lattner dc166eb8f7 Fix spelling, patch contributed by Gabor Greif
llvm-svn: 20342
2005-02-27 06:15:51 +00:00
Chris Lattner 5315aa0ec6 Remove some stuff I checked in accidentally
llvm-svn: 20340
2005-02-27 04:32:35 +00:00
Chris Lattner 0b0f3520cb DCE a dead function
llvm-svn: 20339
2005-02-26 23:36:45 +00:00
Reid Spencer 709e10ed92 Implement an isBytecodeArchive method to determine if an archive contains
bytecode file members or not.
Patch Contributed By Adam Treat

llvm-svn: 20338
2005-02-26 22:00:32 +00:00
Chris Lattner f05d2b3178 1 + 100 + 51 == 152, not 52.
If we fold three constants together (c1+c2+c3), make sure to keep
LHSC updated, instead of reusing (in this case), the 1 instead of the
partial sum.

llvm-svn: 20337
2005-02-26 18:50:19 +00:00
Chris Lattner cc6d75fddf remove extraneous cast
llvm-svn: 20334
2005-02-26 18:33:28 +00:00
Andrew Lenharth 10bc4c0ff6 make BB labels be exported for debuging, add fp negation optimization, further pecimise the FP instructions
llvm-svn: 20332
2005-02-25 22:55:15 +00:00
Chris Lattner e99ee2b35d Handle null a bit more carefully.
Actually teach dsa about select instructions.  This doesn't affect the
graph in any way other than not setting a spurious U marker on pointer
nodes that are selected.

llvm-svn: 20324
2005-02-25 01:27:48 +00:00
Chris Lattner 468fd33abb This instruction:
X = gep null, ...

Used to not create a scalar map entry for X, which caused clients to barf.
This is bad.

llvm-svn: 20316
2005-02-24 19:55:31 +00:00
Chris Lattner d13cc49e19 Fix a bug introduced by revision 1.187 of this file.
llvm-svn: 20308
2005-02-24 18:48:07 +00:00
Andrew Lenharth 904650cdd0 fix Allocas. Really. I mean it this time.
llvm-svn: 20306
2005-02-24 18:36:32 +00:00
Chris Lattner 08f7d0c262 Fix some problems where the verifier would crash on invalid input instead of
reporting the problem and exiting.

llvm-svn: 20302
2005-02-24 16:58:29 +00:00
Chris Lattner 1cca959e5d Implement Transforms/SimplifyCFG/switch_thread.ll
This does a simple form of "jump threading", which eliminates CFG edges that
are provably dead.  This triggers 90 times in the external tests, and
eliminating CFG edges is always always a good thing! :)

llvm-svn: 20300
2005-02-24 06:17:52 +00:00
Chris Lattner 47ac187c08 switch instructions only allow constantints for their values, be more specific.
llvm-svn: 20298
2005-02-24 05:32:09 +00:00
Chris Lattner 75f5b42624 use more specific cast.
llvm-svn: 20297
2005-02-24 05:26:04 +00:00
Chris Lattner fc824c1a7e add more checking
llvm-svn: 20296
2005-02-24 05:25:17 +00:00
Chris Lattner 5f0df0c1e6 Do not read free'd memory when printing an error message.
llvm-svn: 20295
2005-02-24 04:59:49 +00:00
Chris Lattner ce046ac9c6 add a new method.
llvm-svn: 20293
2005-02-24 02:37:26 +00:00
Tanya Lattner ee47100d44 Only print out machine instructions before modulo scheduling if we are actually doing modulo scheduling! :)
llvm-svn: 20292
2005-02-24 02:14:44 +00:00
Andrew Lenharth 27cf4eb1c7 Ah the problems you have to fix when you stray from the One True Way (TM)
llvm-svn: 20290
2005-02-23 17:33:42 +00:00
Chris Lattner 25169caa80 make this more efficient. Scan up to 16 nodes, not the whole list.
llvm-svn: 20289
2005-02-23 16:53:04 +00:00
Chris Lattner d36552f34f new method
llvm-svn: 20288
2005-02-23 16:51:11 +00:00
Chris Lattner cf08c21f2c Reduce the amount of searching this assertion does. On a testcase of mine,
this reduces the time for -simplifycfg in a debug build from 106s to 14.82s

llvm-svn: 20286
2005-02-23 07:09:08 +00:00
Chris Lattner 80c5b97046 Silence some uninit variable warnings.
llvm-svn: 20284
2005-02-23 05:57:21 +00:00
Tanya Lattner a31ad5172e Fixed bug in findAllcircuits. Fixed branch addition to schedule. Added debug information.
llvm-svn: 20280
2005-02-23 02:01:42 +00:00
Andrew Lenharth ccdfdd7aee oops
llvm-svn: 20278
2005-02-22 23:29:25 +00:00
Chris Lattner 3166471603 Remove use of bind_obj, deleter, and finegrainify namespacification.
llvm-svn: 20277
2005-02-22 23:27:21 +00:00
Chris Lattner 52e931b37d Remove use of bind_obj
llvm-svn: 20276
2005-02-22 23:22:58 +00:00
Chris Lattner 06b6c4bbde C++ is not a functional programming language.
llvm-svn: 20274
2005-02-22 23:13:58 +00:00
Andrew Lenharth 7ac0143fa6 dynamic stack allocas
llvm-svn: 20273
2005-02-22 21:59:48 +00:00
Chris Lattner a474313902 Fix a bug in the 'store fpimm, ptr' -> 'store intimm, ptr' handling code.
Changing 'op' here caused us to not enter the store into a map, causing
reemission of the code!!  In practice, a simple loop like this:

no_exit:                ; preds = %no_exit, %entry
        %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %tmp.4 = getelementptr "complex long double"* %P, uint %indvar, uint 0          ; <double*> [#uses=1]
        store double 0.000000e+00, double* %tmp.4
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
        %exitcond = seteq uint %indvar.next, %N         ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit

was being code gen'd to:

.LBBtest_1:     # no_exit
        movl %edx, %esi
        shll $4, %esi
        movl $0, 4(%eax,%esi)
        movl $0, (%eax,%esi)
        incl %edx
        movl $0, (%eax,%esi)
        movl $0, 4(%eax,%esi)
        cmpl %ecx, %edx
        jne .LBBtest_1  # no_exit

Note that we are doing 4 32-bit stores instead of 2.  Now we generate:

.LBBtest_1:     # no_exit
        movl %edx, %esi
        incl %esi
        shll $4, %edx
        movl $0, (%eax,%edx)
        movl $0, 4(%eax,%edx)
        cmpl %ecx, %esi
        movl %esi, %edx
        jne .LBBtest_1  # no_exit

This is much happier, though it would be even better if the increment of ESI
was scheduled after the compare :-/

llvm-svn: 20265
2005-02-22 07:23:39 +00:00
Andrew Lenharth 5ab3986e49 no longer build as a shared library
llvm-svn: 20264
2005-02-22 04:58:26 +00:00
Chris Lattner ec3f094489 Fix problems running the HowToUseJIT on powerpc, and probably problems with
ANY program that does not have all functions internalized.

llvm-svn: 20258
2005-02-20 18:43:35 +00:00
Jeff Cohen 18cf7ebcee Fix silly mistake.
llvm-svn: 20256
2005-02-20 02:48:51 +00:00
Jeff Cohen 4220bf5726 Implement standard I/O redirection in ExecuteAndWait().
llvm-svn: 20255
2005-02-20 02:43:04 +00:00
Chris Lattner e68dae0eb6 Add support for ".so" files compiled with LLVM which contain LLVM bytecode.
llvm-svn: 20253
2005-02-19 18:30:29 +00:00
Chris Lattner fe723a7c05 Eliminate silly warnings from the linker of the form:
WARNING: Type conflict between types named 'union.._604.'.
    Src=' %union.._604.'.
   Dest=' %union.._604.'
llvm-svn: 20252
2005-02-19 17:52:37 +00:00
Jeff Cohen 07e22ba2c7 Change __MINGW to __MINGW32__. Patch submitted by Henrik Bach.
llvm-svn: 20243
2005-02-19 03:01:13 +00:00
Jeff Cohen 81549a57b8 Make PreventCoreFiles() do the right thing on Windows.
llvm-svn: 20237
2005-02-18 07:05:18 +00:00
Misha Brukman 20430321c2 Fix compilation errors with VS 2005, patch contributed by Aaron Gray.
llvm-svn: 20232
2005-02-17 21:40:27 +00:00
Misha Brukman 73e929f89d Fix compilation errors with VS 2005, patch by Aaron Gray.
llvm-svn: 20231
2005-02-17 21:39:27 +00:00
Chris Lattner 381dddc90c Don't rely on doubles comparing identical to each other, which doesn't work
for 0.0 and -0.0.

llvm-svn: 20230
2005-02-17 20:17:32 +00:00
Chris Lattner 0c56a548ed Don't sink argument loads into loops or other bad places. This disables folding of argument loads with instructions that are not in the entry block.
llvm-svn: 20228
2005-02-17 19:40:32 +00:00
Chris Lattner 7b5d9e2217 Do not mark obviously unreachable blocks live when processing PHI nodes,
and handle incomplete control dependences correctly.  This fixes:

Regression/Transforms/ADCE/dead-phi-edge.ll
  -> a missed optimization

Regression/Transforms/ADCE/dead-phi-edge.ll
  -> a compiler crash distilled from QT4

llvm-svn: 20227
2005-02-17 19:28:49 +00:00
Chris Lattner 47555decfb Scary typo that fixes Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll
and PR515.

llvm-svn: 20224
2005-02-17 16:54:16 +00:00
Jeff Cohen 97a41e238e Arg list already has program name in it.
llvm-svn: 20208
2005-02-16 04:43:45 +00:00
Tanya Lattner c28fd0db2e Fixed node deletion bug.
llvm-svn: 20207
2005-02-16 04:00:59 +00:00
Chris Lattner 3e7a193bd7 Instead of doing a manual comparison loop, just use memcmp, thanks to JohnC
for the suggestion! :)

llvm-svn: 20203
2005-02-15 22:12:10 +00:00
Chris Lattner 9d0db6f602 Make this more efficient now that we know both files are the same length.
llvm-svn: 20202
2005-02-15 22:01:43 +00:00
Misha Brukman f232a4582d Fix spelling
llvm-svn: 20201
2005-02-15 21:59:53 +00:00
Reid Spencer f4425b0208 Adjust DiffFilesWithTolerance to help poor cygwin's mmap facility by
handling zero length files a little more intelligently. If both files are
zero length then we return 0 (true) indicating a match. If only one of the
files is zero length then we return 1 (false) indicating that the files
differ. If the files don't agree in length then they can't match so we
skip the first loop that looks for a quick match.

llvm-svn: 20200
2005-02-15 21:47:02 +00:00
Chris Lattner 915fd0de4b Fix a problem where the PPC backend lost track of the fact that it had
to save and restore the LR register on entry and exit of a leaf function
that needed to access globals or the constant pool.  This should hopefully
fix oscar from sending the PPC tester spinning out of control.

llvm-svn: 20197
2005-02-15 20:26:49 +00:00
Chris Lattner 3e708301d2 Add a sanity check.
llvm-svn: 20195
2005-02-15 18:48:48 +00:00
Chris Lattner 219002ed8f Add a new method to make it easy to update graphs.
llvm-svn: 20194
2005-02-15 18:40:55 +00:00
Chris Lattner 3bef66fcf3 Fix volatile load/store of pointers. Consider this testcase:
void %test(int** %P) {
  %A = volatile load int** %P
  ret void
}

void %test2(int*** %Q) {
  %P = load int*** %Q
  volatile store int** %P, int*** %Q
  ret void
}

instead of emitting:

void test(int **l1_P) {
  int *l2_A;

  l2_A = (int **((volatile int **)l1_P));
  return;
}
void test2(int ***l2_Q) {
  int **l1_P;

  l1_P = *l2_Q;
  *((volatile int ***)l2_Q) = l1_P;
  return;
}

... which is loading/storing volatile pointers, not through volatile pointers,
emit this (which is right):

void test(int **l1_P) {
  int *l3_A;

  l3_A = *((int * volatile*)l1_P);
  return;
}
void test2(int ***l2_Q) {
  int **l1_P;

  l1_P = *l2_Q;
  *((int ** volatile*)l2_Q) = l1_P;
  return;
}

llvm-svn: 20191
2005-02-15 05:52:14 +00:00
Chris Lattner 6e528dce90 Fix a bug in my previous change to this, which broke the build on sparcs.
llvm-svn: 20184
2005-02-14 21:42:10 +00:00
Chris Lattner 145569b076 Print GEP offsets as signed values instead of unsigned values. On X86, this
prints:

getelementptr (int* %A, int -1)

as: "(A) - 4" instead of "(A) + 18446744073709551612", which makes the
assembler much happier.

This fixes test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll,
and Benchmarks/Prolangs-C/cdecl with LLC on X86.

llvm-svn: 20183
2005-02-14 21:40:26 +00:00
Chris Lattner 31f3382b3b Fix the second bug attached to PR504.
llvm-svn: 20181
2005-02-14 20:11:45 +00:00
Chris Lattner a3a55bf997 Work around GCC PR19958, which causes programs to sometimes crash after
printing help output or version info.

llvm-svn: 20180
2005-02-14 19:17:29 +00:00
Misha Brukman 2b1e10031f Write out single characters as chars, not strings.
llvm-svn: 20179
2005-02-14 18:52:35 +00:00
Chris Lattner 7afbdcad15 Implement CodeGen/CBackend/2005-02-14-VolatileOperations.ll
Volatile loads and stores need to emit volatile pointer operations in C.

llvm-svn: 20177
2005-02-14 16:47:52 +00:00
Andrew Lenharth cae2f21e3b fix setcc on floats, fixes singlesource:pi, perhaps others
llvm-svn: 20172
2005-02-14 05:41:43 +00:00
Chris Lattner 259df2bf3c Fix the llvm bootstrap
llvm-svn: 20170
2005-02-13 23:37:09 +00:00
Chris Lattner dc01c3f058 Move helper function here.
llvm-svn: 20168
2005-02-13 23:13:47 +00:00