Commit Graph

5276 Commits

Author SHA1 Message Date
Chris Lattner
44a6807f4f Optimize the case where we are inlining a function that contains only one basic block,
and that basic block ends with a return instruction.  In this case, we can just splice
the cloned "body" of the function directly into the source basic block, avoiding a lot
of rearrangement and splitBasicBlock's linear scan over the split block.  This speeds up
the inliner on the testcase in PR209 from 2.3s to 1.7s, a 35% reduction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11116 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 04:17:06 +00:00
Chris Lattner
c24a076c6a Adjust to the new BasicBlock ctor, which requires a function parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11114 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 03:58:28 +00:00
Chris Lattner
4f05611ed9 Adjust to the new BB ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11113 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 03:57:50 +00:00
Chris Lattner
3b332fd376 Remove unneeded code now that splitBasicBlock does the "right thing"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11111 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 03:21:51 +00:00
Chris Lattner
c6aa017eae When splitting a basic block, insert the new half immediately after the first
half.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11110 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 03:21:31 +00:00
Chris Lattner
5e923dee60 More refactoring. Move alloca instructions and handle invoke instructions
before we delete the original call site, allowing slight simplifications of
code, but nothing exciting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11109 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 02:51:48 +00:00
Chris Lattner
5052c911ec Move the cloning of the function body much earlier in the inlinefunction
process.  The only optimization we did so far is to avoid creating a
PHI node, then immediately destroying it in the common case where the
callee has one return statement.  Instead, we just don't create the return
value.  This has no noticable performance impact, but paves the way for
future improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11108 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 01:41:09 +00:00
Chris Lattner
23b4c68f46 Give CloneBasicBlock an optional function argument to specify which function
to add the cloned block to.  This allows the block to be added to the function
immediately, and all of the instructions to be immediately added to the function
symbol table, which speeds up the inliner from 3.7 -> 3.38s on the PR209.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11107 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 01:19:43 +00:00
Chris Lattner
786993c01e If changing a parent, don't add then remove the object from the leak detector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11106 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 01:06:38 +00:00
Chris Lattner
f2c3106866 In BasicBlock::splitBasicBlock, just use islist::splice to move the instructions,
instead of a loop that is really inefficient with large basic blocks.

This speeds up the inliner pass on the testcase in PR209 from 13.8s to 2.24s
which still isn't exactly speedy, but is a lot better.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11105 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 23:11:21 +00:00
Chris Lattner
e47f78ed12 Bunch up all locally used allocas by the block they are allocated in, and
process them all as a group.  This speeds up SRoA/mem2reg from 28.46s to
0.62s on the testcase from PR209.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11100 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 22:34:12 +00:00
Chris Lattner
7fecc2e5e2 Handle extremely trivial cases extremely efficiently. This speeds up
SRoA/mem2reg from 41.2s to 27.5s on the testcase in PR209.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11099 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 22:00:33 +00:00
Chris Lattner
9f08a92e6c Generate ftst instructions for comparison against zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11098 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 18:54:04 +00:00
Chris Lattner
3b904eb351 Add the ftst instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11095 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 07:27:50 +00:00
Chris Lattner
b97046ae4f Add support for one argument OneArgFP instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11094 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 07:27:34 +00:00
Alkis Evlogimenos
4e7854407c When an instruction like: A += B had both A and B virtual registers
spilled, A was loaded from its stack location twice. This fixes the bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11093 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 01:13:07 +00:00
Alkis Evlogimenos
9fe7602862 Revert changes. Will implement this using a different set of primitives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11091 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 23:08:58 +00:00
Alkis Evlogimenos
cc6a1290fc Fix debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11088 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 22:00:32 +00:00
Alkis Evlogimenos
eea81bafd6 Correctly update def/use information for modified machine operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 21:56:40 +00:00
Alkis Evlogimenos
b606eaca1b Should be more careful. The previously applied change made all counts
outside of loops = 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11085 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 20:29:57 +00:00
Chris Lattner
84a102a780 Floating point negates are -0.0 - X, not 0.0 - X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 20:21:29 +00:00
Chris Lattner
0517e72096 Disable (x - (y - z)) => (x + (z - y)) optimization for floating point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11083 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 20:09:56 +00:00
Chris Lattner
529429224c Update comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11082 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 20:09:22 +00:00
Chris Lattner
1580193020 No need to declare implicit uses/defs of ST0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11081 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:57:45 +00:00
Brian Gaeke
09ca4115ee Make deadarghaX0r warning louder.
(I just love typing haX0r.   haX0r haX0r haX0r.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11079 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:32:27 +00:00
Chris Lattner
9f8fd6d9ea Generate the fchs instruction to negate a floating point number
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11078 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:31:38 +00:00
Chris Lattner
4a06f35484 Add support for OneArgFPRW instructions, fix a couple of typeos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11077 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:23:15 +00:00
Brian Gaeke
03f84a969c Include PowerPC.h. Flesh out the stub versions of addPassesToEmitAssembly()
and addPassesToJITCompile() slightly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11076 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:06:36 +00:00
Brian Gaeke
b77232d1fc Add comments describing how you would add prototypes for factory methods for
PowerPC-specific passes here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11073 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:05:28 +00:00
Chris Lattner
af70362e40 Codegen -0.0 correctly. Do not use fldz! This is another -0.0 == +0.0 problem, arg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11070 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 18:56:30 +00:00
Alkis Evlogimenos
22b7e44bb0 Create an object for tracking physical register usage. This will look
much better when I get rid of the reserved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11066 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 07:30:36 +00:00
Chris Lattner
cfdf2419bc Second half of a fix for PR218 & test/Regression/Assembler/2004-02-01-NegativeZero.llx.
Basically we store floating point values as their integral components, instead of relying
on the semantics of floating point < to differentiate between values.  This is likely to
make the map search be faster anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 22:49:04 +00:00
Alkis Evlogimenos
04667297af Change weight array into a vector and make it as big as the number of
registers (not as the max number of registers).

Change toSpill from a std::set into a std::vector<bool>.

Use the reverse iterator adapter to do a reverse scan of allocatable
registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11061 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 20:13:26 +00:00
Alkis Evlogimenos
f440cc19c9 Use std::map::count() instead of std::map::find() != std::map::end()
where appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11060 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 18:39:53 +00:00
Alkis Evlogimenos
b180e3e92b Change string for joined intervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11057 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 16:13:05 +00:00
Alkis Evlogimenos
a1b6f95f78 FpMOV is also a move instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 08:22:16 +00:00
Alkis Evlogimenos
b0b0ebaac0 Change xor to ^.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11054 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 08:19:25 +00:00
Chris Lattner
c23396e8de Disable tail duplication in any "hard" cases, where it might break SSA form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11052 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 06:32:28 +00:00
Chris Lattner
d4baf0f74c Fix a bug in a recent checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11050 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 05:25:07 +00:00
Chris Lattner
e400a0976f Fix the count of the number of instructions removed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11049 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 05:15:07 +00:00
Alkis Evlogimenos
676cf8cb1d Missed one silly assert :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 02:21:31 +00:00
Alkis Evlogimenos
01e74a2aab Simplify joinIntervals() code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11047 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 02:18:31 +00:00
Chris Lattner
fff663b47a Remove all of the annoying statistics now that I'm finished (for the near
term) working on bytecode size stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11046 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:50:31 +00:00
Alkis Evlogimenos
4f67b86648 Use MRegisterInfo::isPhysicalRegister and
MRegisterInfo::isVirtualRegister.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11045 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:27:01 +00:00
Chris Lattner
b97e2788ff Fix a crasher bug in my constant folding rewrite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11044 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:23:19 +00:00
Chris Lattner
338733fdd2 Print an error message if we can't materialize the bytecode file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11043 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:07:25 +00:00
Chris Lattner
da79bd2322 Print an error message if there is an error materialize the bc file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11041 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 00:32:35 +00:00
Alkis Evlogimenos
52220f61bb Apply final part of Chris' patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11040 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 23:48:47 +00:00
Alkis Evlogimenos
02ba13c989 Be a little smarter on the way we handle physical register defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11038 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 23:13:30 +00:00
Chris Lattner
ef09c63e7b Finegrainify namespacification, use new MRegisterInfo::isVirtualRegister
method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11037 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 21:27:19 +00:00