- Oct 13, 2004
-
-
Reid Spencer authored
llvm-svn: 16945
-
Reid Spencer authored
llvm-svn: 16944
-
Reid Spencer authored
days of trying to figure it out. Despite some developer's penchant for relaxing the tool versions, this just isn't possible. Only certain versions work with certain other versions. llvm-svn: 16943
-
- Oct 12, 2004
-
-
Misha Brukman authored
llvm-svn: 16942
-
Misha Brukman authored
llvm-svn: 16941
-
Misha Brukman authored
llvm-svn: 16940
-
Misha Brukman authored
llvm-svn: 16939
-
Chris Lattner authored
llvm-svn: 16937
-
Misha Brukman authored
llvm-svn: 16936
-
Chris Lattner authored
llvm-svn: 16934
-
Chris Lattner authored
Patch contributed by Paolo Invernizzi llvm-svn: 16933
-
Chris Lattner authored
llvm-svn: 16932
-
Chris Lattner authored
llvm-svn: 16931
-
Chris Lattner authored
llvm-svn: 16930
-
Chris Lattner authored
llvm-svn: 16929
-
Chris Lattner authored
llvm-svn: 16928
-
Chris Lattner authored
llvm-svn: 16927
-
Chris Lattner authored
to go in. This patch allows us to compute the trip count of loops controlled by values loaded from constant arrays. The cannonnical example of this is strlen when passed a constant argument: for (int i = 0; "constantstring"[i]; ++i) ; return i; In this case, it will compute that the loop executes 14 times, which means that the exit value of i is 14. Because of this, the loop gets DCE'd and we are happy. This also applies to anything that does similar things, e.g. loops like this: const float Array[] = { 0.1, 2.1, 3.2, 23.21 }; for (int i = 0; Array[i] < 20; ++i) and is actually fairly general. The problem with this is that it almost never triggers. The reason is that we run indvars and the loop optimizer only at compile time, which is before things like strlen and strcpy have been inlined into the program from libc. Because of this, it almost never is used (it triggers twice in specint2k). I'm committing it because it DOES work, may be useful in the future, and doesn't slow us down at all. If/when we start running the loop optimizer at link-time (-O4?) this will be very nice indeed :) llvm-svn: 16926
-
Chris Lattner authored
marker from one ilist into the middle of another basic block! llvm-svn: 16925
-
Chris Lattner authored
pointer recurrences into expressions from this: %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ] %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1 ; <sbyte*> [#uses=2] into this: %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec Actually create something nice, like this: %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec llvm-svn: 16924
-
Chris Lattner authored
well as a vector of constant*'s. It turns out that this is more efficient and all of the clients want to do that, so we should cater to them. llvm-svn: 16923
-
Chris Lattner authored
llvm-svn: 16922
-
Chris Lattner authored
llvm-svn: 16921
-
- Oct 11, 2004
-
-
Chris Lattner authored
llvm-svn: 16918
-
Chris Lattner authored
llvm-svn: 16917
-
Chris Lattner authored
First, it allows SRA of globals that have embedded arrays, implementing GlobalOpt/globalsra-partial.llx. This comes up infrequently, but does allow, for example, deleting several stores to dead parts of globals in dhrystone. Second, this implements GlobalOpt/malloc-promote-*.llx, which is the following nifty transformation: Basically if a global pointer is initialized with malloc, and we can tell that the program won't notice, we transform this: struct foo *FooPtr; ... FooPtr = malloc(sizeof(struct foo)); ... FooPtr->A FooPtr->B Into: struct foo FooPtrBody; ... FooPtrBody.A FooPtrBody.B This comes up occasionally, for example, the 'disp' global in 183.equake (where the xform speeds the CBE version of the program up from 56.16s to 52.40s (7%) on apoc), and the 'desired_accept', 'fixLRBT', 'macroArray', & 'key_queue' globals in 300.twolf (speeding it up from 22.29s to 21.55s (3.4%)). The nice thing about this xform is that it exposes the resulting global to global variable optimization and makes alias analysis easier in addition to eliminating a few loads. llvm-svn: 16916
-
Chris Lattner authored
cannot be SRA'd llvm-svn: 16915
-
Chris Lattner authored
cases. llvm-svn: 16914
-
Chris Lattner authored
llvm-svn: 16913
-
Chris Lattner authored
llvm-svn: 16912
-
Chris Lattner authored
first element of an array, return a GEP instead of a cast. This allows us to transparently fold this: int* getelementptr (int* cast ([100 x int]* %Gbody to int*), int 40) into this: int* getelementptr ([100 x int]* %Gbody, int 0, int 40) llvm-svn: 16911
-
Misha Brukman authored
llvm-svn: 16910
-
Misha Brukman authored
llvm-svn: 16909
-
Misha Brukman authored
llvm-svn: 16908
-
Misha Brukman authored
llvm-svn: 16907
-
Misha Brukman authored
llvm-svn: 16906
-
Misha Brukman authored
llvm-svn: 16905
-
Misha Brukman authored
llvm-svn: 16904
-
Misha Brukman authored
llvm-svn: 16903
-
Misha Brukman authored
llvm-svn: 16902
-