Commit Graph

8139 Commits

Author SHA1 Message Date
Chris Lattner
da6122f61d Fix this function to not say that longs have 8-byte alignment on X86/PPC.
This method is really a gross hack, but at least we can make it work on
the targets we support right now.

This bug fix stops a crash in a testcase reduced from 176.gcc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17443 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 22:18:18 +00:00
Tanya Lattner
80f085500f Added gross hacks such as creating my own def-use map, and picking on Instruction that I can add all my TmpInstructions to its MCFI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17441 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 21:04:56 +00:00
Chris Lattner
f1de30acce Graphs that are part of equivalence sets can be multi-function SCC's
themselves.  Make sure to update DSInfo correctly.  This fixes a testcase
reduced from Prolangs-C++/objects


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17439 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 20:31:06 +00:00
Chris Lattner
caa35bc0b6 Correctly handle new SCC's found as a result of merging EQ graphs do to
function pointer equivalences.  This fixes many problems, including a testcase
reduced Prolangs-C++/objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17437 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 19:29:59 +00:00
Chris Lattner
033a7d5389 Substantially cleanup/speedup the eq graphs pass by walking the callgraph
a DSGraph at a time instead of a function at a time.  This is also more
correct, though it doesn't seem to fix any programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17435 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 17:51:11 +00:00
Chris Lattner
a62869b064 Fix a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17431 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 15:27:57 +00:00
Chris Lattner
983baf472f Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17428 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 06:38:58 +00:00
Chris Lattner
d308f8a87f * Rearrange code slightly
* Disable broken transforms for simplifying (setcc (cast X to larger), CI)
  where CC is not != or ==


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17422 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-02 03:50:32 +00:00
Chris Lattner
4457f7ea46 Remove more dead methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17413 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 21:07:05 +00:00
Chris Lattner
fcb7d950bc Rename FoldedGraph -> DSInfo to be consistent with other passes
delete some dead methods


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17410 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 21:02:23 +00:00
Chris Lattner
77408b8987 Get rid of the EquivClassGraphArgsInfo class, and the map that held it.
We only need one instance of the vector that it contains at a time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17407 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 20:37:00 +00:00
Chris Lattner
7cc372bfc3 Add placeholder variable to make Win32 work, applied for Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17406 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 20:10:20 +00:00
Chris Lattner
68f9658fcb Eliminate the cloneGraph method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17405 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 19:54:06 +00:00
Chris Lattner
7e54a01ddb Speed up the tail duplication pass on the testcase below from 68.2s to 1.23s:
#define CL0(a) case a: f(); goto c;
 #define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \
 CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9)
 #define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \
 CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9)
 #define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \
 CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9)
 #define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \
 CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9)

 void f();

 void a() {
     int b;
  c: switch (b) {
         CL4(1)
     }
 }

This comes from GCC PR 15524


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17390 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 07:05:07 +00:00
Chris Lattner
bfd3e52701 Do not compute the predecessor list for a block unless we need it.
This speeds up simplifycfg on this program, from 44.87s to 0.29s (with
a profiled build):

 #define CL0(a) case a: goto c;
 #define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \
 CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9)
 #define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \
 CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9)
 #define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \
 CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9)
 #define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \
 CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9)

 void f();

 void a() {
     int b;
  c: switch (b) {
         CL4(1)
     }
 }

This testcase is contrived to expose N^2 behavior, but this patch should speedup
simplifycfg on any programs that use large switch statements.  This testcase
comes from GCC PR17895.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17389 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-01 06:53:58 +00:00
Chris Lattner
31d3f671be * Do not refer to ActualCallees in CBU, when we can do it locally.
* *DO NOT* print CBU graphs when asked to print our own.  This is just
  FREAKING confusing and misleading: it's better to not print anything.
* Simplify and clean up some code
* Add some more paranoia assertion checking code that I found to track
  down this bug:
* Fix a nasty bug that was causing us to crash on Prolangs-C++/objects,
  where we were missing processing some graphs.  This hunk is the bugfix:

-    if (!I->isExternal() && !FoldedGraphsMap.count(I))
+    if (!I->isExternal() && !ValMap.count(I))

  urg!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17386 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 23:41:26 +00:00
Chris Lattner
4bbf3dfbe6 Simplify graph traversal, improve grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17383 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 23:01:34 +00:00
Chris Lattner
ab8544aa75 Do not do horrible things to the CBU graphs. In particular, we do NOT own
the CBU graphs, copy them instead of hacking on the CBU graphs.

Also, instead of forwarding request from ECGraphs clients to the CBU graphs
clients, service them ourselves.

Finally, remove a broken "optimization"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17378 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 21:56:11 +00:00
Chris Lattner
3b7b81b814 Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17377 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 21:54:51 +00:00
Chris Lattner
e84c23e0c1 Improve comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17375 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 19:57:43 +00:00
Chris Lattner
f498568240 Fix another bug in Prolangs-C++/objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17372 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 18:13:19 +00:00
Chris Lattner
113cde8685 Only call getNodeForValue on pointer arguments! this fixes a problem running
on Prolangs-C++/objects


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 17:47:48 +00:00
Chris Lattner
7d8d4711d9 Add more paranoid assertions :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17367 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-31 17:45:40 +00:00
Reid Spencer
cc2d1e25f3 Internalize variable names to prevent recursive assignment. Cleanup docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17359 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 09:19:36 +00:00
Chris Lattner
f1bd4b4215 Fix some more problems where we called getOffset before getNode()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17358 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 07:21:19 +00:00
Chris Lattner
857eb0697f Fix three bugs:
1. Calls to external global VARIABLES should not be treated as a call to an
    external function
 2. Efficiently deleting an element from a vector by using std::swap with
    the back, then pop_back is NOT a good way to keep the vector sorted.
 3. Our hope of having stuff get deleted by making them redundant just won't
    work.  In particular, if we have three calls in sequence that should be
    merged: A, B, C   first we unify B into A.  To be sure that they appeared
    identical (so B would be erased) we set B = A.  On the next step, we
    unified C into A and set C = A.  Unfortunately, this is no guarantee that
    C = B, so we would fail to delete the dead call.  Switch to a more
    explicit scheme.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17357 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 05:41:23 +00:00
Chris Lattner
62c3a95051 Fix more undefined behavior
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17356 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 04:22:45 +00:00
Chris Lattner
6f96774fc4 * Add a method
* change some uses of NH.getNode() in a bool context to use !NH.isNull()
* Fix a bunch of places where we depended on the (undefined) order of
  evaluation of arguments to function calls to ensure that getNode() was
  called before getOffset().  In practice, this was NOT happening.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17354 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 04:05:01 +00:00
Tanya Lattner
260652a7af Fixed bug with infinite epilogues.
Fixed issue with generating the partial order. It now adds the nodes not in recurrences in sets for each connected component.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17351 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-30 00:39:07 +00:00
Misha Brukman
9437db4e78 * Fix compilation on AIX: GCC's fixincludes eliminates isinf() declaration
* Move file comment to the top of the header where it belongs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17349 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-29 23:17:45 +00:00
Brian Gaeke
b982c42e65 Change name of target lib to conform to new naming scheme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17347 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-29 21:57:16 +00:00
Brian Gaeke
b13fac70ca Remove dependency on MRegisterInfo::getRegClass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17346 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-29 21:42:27 +00:00
Misha Brukman
e7a3f3e728 The Alpha (tm) intrinsics have never been used anywhere
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17340 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-29 18:43:17 +00:00
Brian Gaeke
88560c3a42 When emitting debug msgs for function stubs, don't truncate the
printed pointer value if sizeof(unsigned) != pointer size.  Instead,
use uintptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17338 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-29 18:22:45 +00:00
Alkis Evlogimenos
56a2468b68 Gep indices must be of int, uint, long or ulong type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17313 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 06:43:38 +00:00
Reid Spencer
685f86ac0e Fix library name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17307 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 05:37:24 +00:00
Alkis Evlogimenos
002242149f Fix library name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17306 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 05:36:48 +00:00
Reid Spencer
06aada9ebd Fix library name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17305 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 05:32:01 +00:00
Reid Spencer
e55bd78e80 Fix name of library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17304 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 05:30:54 +00:00
Reid Spencer
5d6ca51ded Make sure that the yacc and lex output are specified as BUILT_SOURCES.
Correct the dependency of the Lexer.o file on the constructed
llvmAsmParser.h header file. It is not the Lexer.cpp file that depends on
the header, its the output of compiling Lexer.cpp, Lexer.o


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17289 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 00:43:24 +00:00
Reid Spencer
6cb21d443e Change Library Names Not To Conflict With Others When Installed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 23:18:45 +00:00
Reid Spencer
abec8f96e3 Changes to support rand48 tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17284 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 23:03:44 +00:00
Chris Lattner
1fca5ff62b Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17281 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 16:14:51 +00:00
Nate Begeman
0aafc3289c Move destructor out of line to avoid vtable emission in every file that includes the header. Thanks to sabre.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17278 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 06:00:53 +00:00
Chris Lattner
dc78122242 Hrm, this code was severely botched. As it turns out, this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041018/019708.html

exposed ANOTHER latent bug in this xform, which caused Prolangs-C/bison to fill
the zion nightly tester disk up and make the tester barf.

This is obviously not a good thing, so lets fix this bug shall we? :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17276 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 05:57:15 +00:00
Nate Begeman
4c3480169b Fix the build by eliminating some more dead code. That'll learn me not to listen to Reid
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 05:44:23 +00:00
Chris Lattner
2f48686307 Initialize with the correct constant type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17270 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 03:55:24 +00:00
Chris Lattner
e8343a5fbb Plug a memory leak in the asmparser. It turns out that we were leaking
the strings for basic block labels in some cases.  This amounted to about
120K of memory for namd, a medium sized program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17262 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26 18:26:14 +00:00
Chris Lattner
48b2f6ba2e add support for UndefValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17260 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26 16:23:03 +00:00
Chris Lattner
52c09d7656 Move method bodies that depend on <algorithm> from MBB.h to MBB.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17253 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26 15:43:42 +00:00