1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

5871 Commits

Author SHA1 Message Date
Chris Lattner
145aea5c4c Now that all the code generators support the select instruction, and the instcombine
pass can eliminate many nasty cases of them, start generating them in the optimizers

llvm-svn: 12545
2004-03-30 19:44:05 +00:00
Chris Lattner
b6612acb18 Implement select.ll:test[3-6]
llvm-svn: 12544
2004-03-30 19:37:13 +00:00
Chris Lattner
95942c021a Fix a fairly major performance problem. If a PHI node had a constant as
an incoming value from a block, the selector would evaluate the constant
at the TOP of the block instead of at the end of the block.  This made the
live range for the constant span the entire block, increasing register
pressure needlessly.

llvm-svn: 12542
2004-03-30 19:10:12 +00:00
Chris Lattner
87479998f2 Add the select lowering pass to get initial support for select instructions
llvm-svn: 12541
2004-03-30 18:41:59 +00:00
Chris Lattner
58a6a4d57a Add a simple select instruction lowering pass
llvm-svn: 12540
2004-03-30 18:41:10 +00:00
Chris Lattner
e78381e9f1 Add some new methods
llvm-svn: 12539
2004-03-30 00:20:08 +00:00
Brian Gaeke
610cfaa7fd Don't warn about a null live range if the Value is a ConstantIntegral.
Otherwise, if you're in debugging mode, you get warnings for (apparently)
every immediate constant in the function during reg. allocation.

llvm-svn: 12538
2004-03-29 21:58:41 +00:00
Brian Gaeke
27be9eb265 Change how the beginnings and ends of MachineFunctions are printed. Get
rid of the funny cast.

llvm-svn: 12537
2004-03-29 21:58:31 +00:00
Chris Lattner
dd7ed2912e Adjust to new itf
llvm-svn: 12534
2004-03-29 20:42:49 +00:00
Chris Lattner
50dc89f874 Handle -0.0 correctly
llvm-svn: 12530
2004-03-29 19:51:24 +00:00
Chris Lattner
7f5d56b43a Add a bunch of methods that should have been added a long time ago.
llvm-svn: 12526
2004-03-29 02:37:53 +00:00
Chris Lattner
27cbe8d690 Add another check
llvm-svn: 12525
2004-03-29 00:29:36 +00:00
Chris Lattner
44acd09520 Fix an assertion
Contributed by Reid Spencer

llvm-svn: 12524
2004-03-29 00:17:20 +00:00
Chris Lattner
874db50b32 Make error message a bit nicer.
Contributed by Reid Spencer

llvm-svn: 12523
2004-03-29 00:16:01 +00:00
Chris Lattner
b34cfff038 Add two methods which have been needed for a long time: Type::get(Un)signedVersion
llvm-svn: 12522
2004-03-26 21:43:22 +00:00
Chris Lattner
d191e5625c X % -1 == X % 1 == 0
llvm-svn: 12520
2004-03-26 16:11:24 +00:00
Chris Lattner
e15fb6ac61 Two changes:
#1 is to unconditionally strip constantpointerrefs out of
instruction operands where they are absolutely pointless and inhibit
optimization.  GRRR!

#2 is to implement InstCombine/getelementptr_const.ll

llvm-svn: 12519
2004-03-25 22:59:29 +00:00
Chris Lattner
ecb0efb6e5 Minor efficiency improvement, finegrainify namespacification
llvm-svn: 12517
2004-03-25 22:56:03 +00:00
Chris Lattner
f3867b270c Hrm, we were leaking ~1M of garbage that valgrind never told us about because
it was "reachable".  Cute.

llvm-svn: 12515
2004-03-19 23:34:33 +00:00
Chris Lattner
078f97b50d Teach the optimizer to delete zero sized alloca's (but not mallocs!)
llvm-svn: 12507
2004-03-19 06:08:10 +00:00
Chris Lattner
4e7ea3671c Fix PR299: [Sparc] Code generator asserts on alloc of zero size type
llvm-svn: 12504
2004-03-19 04:21:43 +00:00
Chris Lattner
b8f179cb9b Malloc doesn't kill a load. This patch need not go into 1.2 though.
llvm-svn: 12500
2004-03-18 17:01:26 +00:00
Chris Lattner
ef7c1e9f7f Fix a really nasty bug that was breaking ijpeg in LLC mode. We were incorrectly
folding load instructions into other instructions across free instruction
boundaries.  Perhaps this will also fix the other strange failures?

llvm-svn: 12494
2004-03-18 06:29:54 +00:00
Chris Lattner
0f0a253571 Fix bug: CodeExtractor/2004-03-17-MissedLiveIns.ll
With this fix we now successfully extract all 149 loops from 256.bzip2 without
crashing or miscompiling the program!

llvm-svn: 12493
2004-03-18 05:56:32 +00:00
Chris Lattner
521d687d11 Add statistics to the loop extractor. The loop extractor has successfully
extracted all 63 loops for Olden/bh without crashing and without
miscompiling the program!!!

llvm-svn: 12491
2004-03-18 05:46:10 +00:00
Chris Lattner
c835211d82 Fix problem with PHI nodes having multiple predecessors from different
exit nodes

llvm-svn: 12490
2004-03-18 05:43:18 +00:00
Chris Lattner
b1bc514730 Fix CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll
llvm-svn: 12489
2004-03-18 05:38:31 +00:00
Chris Lattner
69fdd9f14a Seriously simplify and correct the PHI node handling code.
llvm-svn: 12487
2004-03-18 05:28:49 +00:00
Chris Lattner
345cf6f177 Fix CodeExtractor/2004-03-17-OutputMismatch.ll
llvm-svn: 12486
2004-03-18 04:12:05 +00:00
Chris Lattner
0d233c03fc Fix several bugs in the extractor:
1. Names were not put on the new arguments created (ok, this just helps sanity :)
2. Fix outgoing pointer values
3. Do not insert stores for values that had not been computed
4. Fix some wierd problems with the outset calculation

This fixes CodeExtractor/2004-03-14-DominanceProblem.ll, making the extractor
work on at least one simple case!

llvm-svn: 12484
2004-03-18 03:49:40 +00:00
Chris Lattner
55114016ea The code extractor needs dominator info. Provide it
llvm-svn: 12483
2004-03-18 03:48:06 +00:00
Chris Lattner
7c0d39dcd6 Prune #includes, moving the module interface to the front. Note that this
exposed the fact that the header was not self-contained.  There is a reason
we do things :)

llvm-svn: 12481
2004-03-18 03:15:29 +00:00
Chris Lattner
c534fac018 Fix a HORRIBLY NASTY bug that caused siod to stop working last night.
llvm-svn: 12479
2004-03-17 23:22:04 +00:00
Chris Lattner
849234af99 Fix compilation of mesa, which I broke earlier today
llvm-svn: 12465
2004-03-17 02:02:47 +00:00
Chris Lattner
eccc0e01b2 Be more accurate
llvm-svn: 12464
2004-03-17 01:59:27 +00:00
Alkis Evlogimenos
81c6957eab Make the set of fixed (preallocated) intervals be a fixed superset of
unhandled + handled. So unhandled is now including all fixed intervals
and fixed intervals never changes when processing a function.

llvm-svn: 12462
2004-03-17 00:48:59 +00:00
Chris Lattner
6fdcd7174b Fix bug in previous checkin
llvm-svn: 12458
2004-03-16 23:36:49 +00:00
Chris Lattner
59342a757e Okay, so there is no reasonable way for tail duplication to update SSA form,
as it is making effectively arbitrary modifications to the CFG and we don't
have a domset/domfrontier implementations that can handle the dynamic updates.
Instead of having a bunch of code that doesn't actually work in practice,
just demote any potentially tricky values to the stack (causing the problem
to go away entirely).  Later invocations of mem2reg will rebuild SSA for us.

This fixes all of the major performance regressions with tail duplication
from LLVM 1.1.  For example, this loop:

---
int popcount(int x) {
  int result = 0;
  while (x != 0) {
    result = result + (x & 0x1);
    x = x >> 1;
  }
  return result;
}
---
Used to be compiled into:

int %popcount(int %X) {
entry:
	br label %loopentry

loopentry:		; preds = %entry, %no_exit
	%x.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ]		; <int> [#uses=3]
	%result.1.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ]		; <int> [#uses=2]
	%tmp.1 = seteq int %x.0, 0		; <bool> [#uses=1]
	br bool %tmp.1, label %loopexit, label %no_exit

no_exit:		; preds = %loopentry
	%tmp.4 = and int %x.0, 1		; <int> [#uses=1]
	%tmp.6 = add int %tmp.4, %result.1.0		; <int> [#uses=1]
	%tmp.9 = shr int %x.0, ubyte 1		; <int> [#uses=1]
	br label %loopentry

loopexit:		; preds = %loopentry
	ret int %result.1.0
}

And is now compiled into:

int %popcount(int %X) {
entry:
        br label %no_exit

no_exit:                ; preds = %entry, %no_exit
        %x.0.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ]          ; <int> [#uses=2]
        %result.1.0.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ]             ; <int> [#uses=1]
        %tmp.4 = and int %x.0.0, 1              ; <int> [#uses=1]
        %tmp.6 = add int %tmp.4, %result.1.0.0          ; <int> [#uses=2]
        %tmp.9 = shr int %x.0.0, ubyte 1                ; <int> [#uses=2]
        %tmp.1 = seteq int %tmp.9, 0            ; <bool> [#uses=1]
        br bool %tmp.1, label %loopexit, label %no_exit

loopexit:               ; preds = %no_exit
        ret int %tmp.6
}

llvm-svn: 12457
2004-03-16 23:29:09 +00:00
Chris Lattner
e04883605a This code was both incredibly complex and incredibly broken. Fix it.
llvm-svn: 12456
2004-03-16 23:23:11 +00:00
Brian Gaeke
c1c4cfd741 The .type directive on Solaris uses the # character instead of @.
llvm-svn: 12454
2004-03-16 22:52:04 +00:00
Brian Gaeke
f97393aebf Fix bug in zero-extending of shorts.
llvm-svn: 12453
2004-03-16 22:45:42 +00:00
Brian Gaeke
26deccbffb Add UMULrr and SMULrr instructions.
llvm-svn: 12452
2004-03-16 22:37:13 +00:00
Brian Gaeke
fd02eeae64 Use ! for comment char; it works in both Solaris as and GAS.
llvm-svn: 12451
2004-03-16 22:37:12 +00:00
Brian Gaeke
199ba20b20 Make getClass more robust by adding cLong.
Add handling for Mul instruction.

llvm-svn: 12450
2004-03-16 22:37:11 +00:00
Chris Lattner
c260cfab09 Punt if we see gigantic PHI nodes. This improves a huge interpreter loop
testcase from 32.5s in -raise to take .3s

llvm-svn: 12443
2004-03-16 19:52:53 +00:00
Chris Lattner
dc22f37eb5 Do not try to optimize PHI nodes with incredibly high degree. This reduces SCCP
time from 615s to 1.49s on a large testcase that has a gigantic switch statement
that all of the blocks in the function go to (an intepreter).

llvm-svn: 12442
2004-03-16 19:49:59 +00:00
Chris Lattner
2175b35b46 Do not copy gigantic switch instructions
llvm-svn: 12441
2004-03-16 19:45:22 +00:00
Chris Lattner
686a74c7ac Fix PR296: [execution engines] Unhandled cast constant expression
llvm-svn: 12435
2004-03-16 08:38:56 +00:00
Chris Lattner
9ae2b6acd7 Fix a regression from this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040308/013095.html

Basically, this patch only updated the immediate dominatees of the header node
to tell them that the preheader also dominated them.  In practice, ALL
dominatees of the header node are also dominated by the preheader.

This fixes: LoopSimplify/2004-03-15-IncorrectDomUpdate.
and PR293

llvm-svn: 12434
2004-03-16 06:00:15 +00:00
Chris Lattner
c2eb0678d8 Add some missing functions. Make sure to handle calls together in case the
client has another VN implementation that can VN calls.

llvm-svn: 12427
2004-03-16 03:41:35 +00:00