Nick Lewycky
02d5f77d26
Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
...
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.
llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Lang Hames
16edcd724a
Oops. Backing out 84681 - needs to wait for the indexing patch.
...
llvm-svn: 84682
2009-10-20 21:28:22 +00:00
Lang Hames
d8938d1ca8
Added some debugging output to pre-alloc splitting.
...
llvm-svn: 84681
2009-10-20 21:25:13 +00:00
Evan Cheng
4729191bb2
Distinquish stack slots from other stack objects. They (and fixed objects) get FixedStack PseudoSourceValues.
...
llvm-svn: 84326
2009-10-17 09:20:14 +00:00
Evan Cheng
be27d61cbc
Reset kill markers after live interval is reconstructed.
...
llvm-svn: 83608
2009-10-09 01:17:11 +00:00
Evan Cheng
e23984fbbe
Remove code that makes no sense.
...
llvm-svn: 83589
2009-10-08 22:42:35 +00:00
Lang Hames
a7780905e7
Oops. Renamed remaining MachineInstrIndex references.
...
llvm-svn: 83255
2009-10-03 04:31:31 +00:00
Lang Hames
920301ecc5
Renamed MachineInstrIndex to LiveIndex.
...
llvm-svn: 83254
2009-10-03 04:21:37 +00:00
Lang Hames
6b81770040
Removed static qualifier from a few index related methods. These methods may require a LiveIntervals instance in future.
...
llvm-svn: 81374
2009-09-09 20:14:17 +00:00
Lang Hames
3fffe62177
Replaces uses of unsigned for indexes in LiveInterval and VNInfo with
...
a new class, MachineInstrIndex, which hides arithmetic details from
most clients. This is a step towards allowing the register allocator
to update/insert code during allocation.
llvm-svn: 81040
2009-09-04 20:41:11 +00:00
Chris Lattner
1362602eb2
Change Pass::print to take a raw ostream instead of std::ostream,
...
update all code that this affects.
llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Lang Hames
3b90d973b0
Modified VNInfo. The "copy" member is now a union which holds the copy for a register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg.
...
llvm-svn: 78620
2009-08-10 23:43:28 +00:00
Dan Gohman
0402315d41
Use setPreservesAll and setPreservesCFG in CodeGen passes.
...
llvm-svn: 77754
2009-07-31 23:37:33 +00:00
Evan Cheng
84517443ca
Let callers decide the sub-register index on the def operand of rematerialized instructions.
...
Avoid remat'ing instructions whose def have sub-register indices for now. It's just really really hard to get all the cases right.
llvm-svn: 75900
2009-07-16 09:20:10 +00:00
Torok Edwin
08954aa4e1
Fix assert(0) conversion, as suggested by Chris.
...
llvm-svn: 75423
2009-07-12 20:07:01 +00:00
Torok Edwin
ccb29cd290
Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
...
and abort()/exit() -> llvm_report_error().
llvm-svn: 75363
2009-07-11 13:10:19 +00:00
Lang Hames
dab7b06de9
Improved tracking of value number kills. VN kills are now represented
...
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.
A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test
condition has been updated to reflect this.
llvm-svn: 75097
2009-07-09 03:57:02 +00:00
Lang Hames
16cab1935e
VNInfo cleanup.
...
llvm-svn: 73634
2009-06-17 21:01:20 +00:00
Evan Cheng
210fc62a91
In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However, reloads and restores might be folded into uses / defs and freed registers might not be used at all.
...
VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.
Not yet enabled. This is part 1. More coming.
llvm-svn: 70787
2009-05-03 18:32:42 +00:00
Bob Wilson
51856173c8
Fix pr3954. The register scavenger asserts for inline assembly with
...
register destinations that are tied to source operands. The
TargetInstrDescr::findTiedToSrcOperand method silently fails for inline
assembly. The existing MachineInstr::isRegReDefinedByTwoAddr was very
close to doing what is needed, so this revision makes a few changes to
that method and also renames it to isRegTiedToUseOperand (for consistency
with the very similar isRegTiedToDefOperand and because it handles both
two-address instructions and inline assembly with tied registers).
llvm-svn: 68714
2009-04-09 17:16:43 +00:00
Owen Anderson
4486c1fac0
Remove the "fast" cases for spill and restore point determination, as these were subtlely wrong in obscure cases. Patch the testcase
...
to account for this change.
llvm-svn: 68093
2009-03-31 08:27:09 +00:00
Owen Anderson
0422efc994
Give the pre-alloc splitter access to the VirtRegMap. It doesn't do anything
...
useful with it at the moment, but it will in the future.
llvm-svn: 67012
2009-03-14 21:40:05 +00:00
Owen Anderson
380b3838f6
(Hopefully) silence a warning.
...
llvm-svn: 66158
2009-03-05 08:23:20 +00:00
Owen Anderson
ad503987a8
Be more careful about choosing restore points when doing restore folding. This fixes some subtle miscompilations.
...
llvm-svn: 66147
2009-03-05 07:19:18 +00:00
Owen Anderson
0dedc114de
Add a restore folder, which shaves a dozen or so machineinstrs off oggenc. Update a testcase to check this.
...
llvm-svn: 66029
2009-03-04 08:52:31 +00:00
Owen Anderson
f13820148b
Fix a crash in the pre-alloc splitter exposed by recent codegen changes.
...
llvm-svn: 65121
2009-02-20 10:02:23 +00:00
Evan Cheng
b5f0ec3eb7
Add TargetInstrInfo::isSafeToMoveRegisterClassDefs. It returns true if it's safe to move an instruction which defines a value in the register class. Replace pre-splitting specific IgnoreRegisterClassBarriers with this new hook.
...
llvm-svn: 63936
2009-02-06 17:17:30 +00:00
Owen Anderson
7411523ee6
Pre-alloc splitting needs to be more careful to avoid inserting spills/restores
...
between call frame setup/restore points. Unfortunately, this regresses
code size a bit, but at least it's correct now!
llvm-svn: 63837
2009-02-05 05:58:41 +00:00
Owen Anderson
4eda2cbe5f
MergeValueInto is too smart: it might choose to do the merge the opposite direction.
...
Live interval reconstruction needs to account for this, and scour its maps to
prevent dangling references.
llvm-svn: 63558
2009-02-02 22:42:01 +00:00
Evan Cheng
03f862579c
Refactor PerformPHIConstruction, no functionality changes.
...
llvm-svn: 63536
2009-02-02 18:33:18 +00:00
Owen Anderson
19616c08a0
Fix test failures causes by my previous commit.
...
llvm-svn: 63492
2009-02-01 08:41:54 +00:00
Owen Anderson
66838e9a27
Fix an issue in PHI construction that was exposed by GCC 4.2 producing a different set iteration order for the reg_iterator.
...
llvm-svn: 63490
2009-02-01 07:06:00 +00:00
Owen Anderson
bf77d2eb9d
Correct the algorithms for choosing spill and restore points so that we don't try to insert loads/stores between call frame setup and the actual call.
...
This fixes the last known failure for the pre-alloc-splitter.
llvm-svn: 63339
2009-01-29 22:13:06 +00:00
Owen Anderson
c0924a0632
Fix an issue where restores could be inserted after a terminator instruction,
...
and an iterator invalidation issue.
FreeBench/pifft no longer miscompiles with these fixes!
llvm-svn: 63293
2009-01-29 08:22:06 +00:00
Owen Anderson
a590802ed6
Comments are good. :-)
...
llvm-svn: 63276
2009-01-29 05:41:02 +00:00
Owen Anderson
b05ce78c51
Add support for aggressive load-use-store folding. This takes care of the
...
vast majority of code size regressions introduced by pre-alloc-splitting.
llvm-svn: 63274
2009-01-29 05:28:55 +00:00
Owen Anderson
431053ed2c
Make the pre-split-limit option more useful by using a per-function counter.
...
llvm-svn: 63091
2009-01-27 05:01:15 +00:00
Owen Anderson
e84c3f261e
Reapply r63025 and r63026, with fixes for the failing testcases.
...
llvm-svn: 63049
2009-01-26 21:57:31 +00:00
Bill Wendling
e7fa3c37c6
Also revert r63206
...
llvm-svn: 63041
2009-01-26 21:30:17 +00:00
Bill Wendling
a39c83d118
Temporarily revert r63025 until the testsuite failures can be fixed.
...
llvm-svn: 63040
2009-01-26 21:27:03 +00:00
Owen Anderson
5e235d3a7e
Get rid of a bunch of dead code now that interval reconstruction is enabled.
...
llvm-svn: 63026
2009-01-26 19:18:06 +00:00
Owen Anderson
feffdec244
Fix an issue where LiveIntervals was trying to be smart about removing kill
...
markers, and ended up foiling the interval reconstruction.
This allows us to turn on reconstruction in the pre alloc splitter, which
fixes a number of miscompilations.
llvm-svn: 63025
2009-01-26 19:12:06 +00:00
Evan Cheng
72287a599f
Silence a bogus compiler warning.
...
llvm-svn: 63021
2009-01-26 18:33:51 +00:00
Owen Anderson
ee34b8f179
Some cleanups. No functional changes.
...
llvm-svn: 62917
2009-01-24 10:07:43 +00:00
Owen Anderson
a2ca64a39a
Stage two of fixing pre-alloc-splitting's code size issues: filter out restores that are just
...
going to be re-spilled again.
This also helps performance. Pre-alloc-splitting now seems to be an overall win on SPEC.
llvm-svn: 62834
2009-01-23 03:28:53 +00:00
Owen Anderson
48abf2380b
Add an initial pass at dead spill/restore removal for pre alloc splitting.
...
llvm-svn: 62821
2009-01-23 00:23:32 +00:00
Owen Anderson
fe48dfa0f2
I accidentally removed this check in an earlier commit, which cause breakage in the pre alloc splitter.
...
llvm-svn: 62678
2009-01-21 08:18:03 +00:00
Owen Anderson
be7a29de0b
Be more aggressive about renumbering vregs after splitting them.
...
llvm-svn: 62639
2009-01-21 00:13:28 +00:00
Evan Cheng
c544cb0eca
Change TargetInstrInfo::isMoveInstr to return source and destination sub-register indices as well.
...
llvm-svn: 62600
2009-01-20 19:12:24 +00:00
Owen Anderson
45cfef2cb6
More two-address fixes. This gets lua working with join-creation enabled.
...
llvm-svn: 62073
2009-01-12 03:10:40 +00:00