Commit Graph

13194 Commits

Author SHA1 Message Date
Ahmed Charles
b0934ab7d8 Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 11:37:01 +00:00
Lang Hames
6aceab1392 Add machinery for pushing live ranges onto bundle starts while bundling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150915 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 07:13:05 +00:00
Lang Hames
4a0b2d658a Simplify moveEnteringDownFrom rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150914 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 06:13:56 +00:00
Lang Hames
038d2d5ced Skip through instructions rather than operands when looking for last use slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150912 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 04:38:25 +00:00
Lang Hames
ac027144e8 Fix TODO and trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150910 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 03:09:55 +00:00
Lang Hames
55fed62c9e Defer sanity checks on live intervals until after all have been updated. Hold (LiveInterval, LiveRange) pairs to update, rather than vregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150909 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 03:00:30 +00:00
Lang Hames
ecb50624d1 Bring HMEditor into line with LLVM coding standards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150851 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 23:43:40 +00:00
Eric Christopher
9b5d6b860c Ignore the lifetime intrinsics in fast-isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 23:03:39 +00:00
Jakob Stoklund Olesen
0b923d9ee9 Don't print out pointer values in SUnit::dump().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150842 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 21:44:51 +00:00
Matt Beaumont-Gay
0310038d5a Sink variable into assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150841 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 21:40:48 +00:00
Lang Hames
fbc8dd306a Add support for regmask slots to HMEditor. Also fixes a comment error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150840 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 21:29:41 +00:00
Jakob Stoklund Olesen
d9f0ff56a1 Transfer regmasks to MRI.
MRI keeps track of which physregs have been used. Make sure it gets
updated with all the regmask-clobbered registers.

Delete the closePhysRegsUsed() function which isn't necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150830 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 19:07:56 +00:00
Lang Hames
3dc7c5138d Refactor 'handleMove' code in live intervals. Clients of LiveIntervals won't see
any changes.

Internally this adds a private inner class HMEditor, to LiveIntervals. HMEditor provides
an API for updating live intervals when code is moved or bundled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 18:44:18 +00:00
Jim Grosbach
7842a741eb Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150820 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 17:35:10 +00:00
Jakob Stoklund Olesen
0f7de3542f Revert r150288, "Allow Post-RA LICM to hoist reserved register reads."
This caused miscompilations on out-of-tree targets, and possibly i386 as
well.

I'll find some other way of hoisting %rip-relative loads from loops
containing calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 16:40:44 +00:00
David Chisnall
50f603fff6 ... and it's probably best to use the correct alignment, rather than just guessing that it's the same as the size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150813 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 16:30:39 +00:00
David Chisnall
ca5b752d18 It turns out that putting an 8-byte symbol in a 4-byte section makes Solaris ld sulk. GNU ld is perfectly happy with it, which is worrying for a whole other set of reasons...
Thanks to Anton, Duncan and Rafael for helping me track this down.
Pointy hat to Rafael for introducing the bug in the first place.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150811 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 16:05:50 +00:00
Lang Hames
00195d828b Reverse iterator - should be incrementing rather than decrementing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150778 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 01:54:11 +00:00
Lang Hames
29879d7f86 MachineScheduler shouldn't use/preserve LiveDebugVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150773 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 01:11:37 +00:00
Lang Hames
5d0827582f Oops - isRegLiveIntoSuccessor is used in non-assert builds now. Remove NDEBUG guards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150771 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 00:51:32 +00:00
Lang Hames
c2e08db4e5 Re-enable 150652 and 150654 - Make FPSCR non-reserved, and make MachineCSE bail on reserved registers. This *should* be safe as of r150786.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150769 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 00:27:16 +00:00
Lang Hames
af8b34dae9 Turn off assertion, conservatively compute liveness for live-in un-allocatable registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150768 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 00:18:18 +00:00
Benjamin Kramer
1a7ea9dd04 Disable machine copy propagation for now. It's known to be buggy (PR11940) and introduces subtle miscompiles in many places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150703 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 17:29:50 +00:00
James Molloy
6afa3f744a Remove extraneous #include and spelling mistake introduced in r150669.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150670 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 09:48:07 +00:00
James Molloy
6660c05da3 Modify the algorithm when traversing the DAGCombiner's worklist to be O(log N) for all operations. This fixes a horrible worst case with lots of nodes where 99% of the time was being spent in std::remove.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150669 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 09:17:04 +00:00
Lang Hames
1834df8384 Oop - r150653 + r150654 broke one of my test cases. Backing out for now...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 02:32:10 +00:00
Lang Hames
f7e31b9e81 MachineCSE shouldn't extend the live ranges of reserved or allocatable registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150653 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 02:19:35 +00:00
Jakob Stoklund Olesen
a230262791 Handle register masks in branch folding.
Don't attempt to move instructions with regmask operands. They are most
likely calls anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 23:42:54 +00:00
Andrew Trick
e746186ed4 Fix library visibility problems with VLIWPacketizer.
The existing framework for postra scheduling is library local. We want to keep it that way. Soon we will have a more general MachineScheduler interface. At that time, various bits will be exposed to targets. In the meantime, the VLIWPacketizer wants to use ScheduleDAGInstrs directly, so it needs to wrapped in a PIMPL to avoid exposing it to the target interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150633 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 23:34:15 +00:00
Lang Hames
cc2037be2c Make LiveIntervals::handleMove() bundle aware.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150630 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 23:21:33 +00:00
Bill Wendling
2de3ff5043 Use 'getDataNoRel' for the section kind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150628 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 22:47:53 +00:00
Lang Hames
cc72913268 Fix assertion condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150627 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 22:45:51 +00:00
Bill Wendling
057d521e3d Modify the code that emits the module flags to use the new module flags accessor
method. This allows the target lowering code to not have to deal with MDNodes.

Also, avoid leaking memory like a sieve by not creating a global variable for
the image info section, but just emitting the code directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150624 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 22:36:15 +00:00
Andrew Trick
68c36e0c26 Don't expose DefaultVLIWScheduler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150619 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 22:06:21 +00:00
Lang Hames
862fd5f77a Remove overly conservative assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150608 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 19:04:53 +00:00
Andrew Trick
ebafa0c611 Generic "VLIW" packetizer based on a DFA generated from target itinerary.
Patch by Sundeep!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150607 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 18:55:14 +00:00
Andrew Trick
900d7b78e6 Revert r150565 again. Appears to be a stage2 failure with dragonegg.
I'll put MachineLICM back before PEI. All my arm/x86 benchmarks look good, but buildbots don't like it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150568 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 07:57:03 +00:00
Andrew Trick
788066a1f4 Reapply r150565 with the typo fix properly merged.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 05:43:27 +00:00
Andrew Trick
40bb92a5cc reverting r150565. Premature push.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150566 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 05:22:12 +00:00
Andrew Trick
352aa4f67f Move PostRAMachineLICM into MachineLateOptimization. It now runs after PEI!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150565 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 05:13:47 +00:00
Andrew Trick
79bf288584 Allow CodeGen (llc) command line options to work as expected.
The llc command line options for enabling/disabling passes are local to CodeGen/Passes.cpp. This patch associates those options with standard pass IDs so they work regardless of how the target configures the passes.

A target has two ways of overriding standard passes:
1) Redefine the pass pipeline (override TargetPassConfig::add%Stage)
2) Replace or suppress individiual passes with TargetPassConfig::substitutePass.

In both cases, the command line options associated with the pass override the target default.

For example, say a target wants to disable machine instruction scheduling by default:

- The target calls disablePass(MachineSchedulerID) but otherwise does not override any TargetPassConfig methods.

- Without any llc options, no scheduler is run.

- With -enable-misched, the standard machine scheduler is run and honors the -misched=... flag to select the scheduler variant, which may be used for performance evaluation or testing.

Sorry overridePass is ugly. I haven't thought of a better way without replacing the cl::opt framework. I hope to do that one day...

I haven't figured out why CodeGen uses char& for pass IDs. AnalysisID is much easier to use and less bug prone. I'm using it wherever I can for internal implementation. Maybe later we can change the global pass ID definitions as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150563 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 03:21:51 +00:00
Andrew Trick
5e108eeeef Added TargetPassConfig::disablePass/substitutePass as a general mechanism to override specific passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150562 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 03:21:47 +00:00
Lang Hames
f58e37f957 Don't emit live ranges for physregs live-ins that are dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150553 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 01:31:10 +00:00
Lang Hames
da7984fbba Disentangle moving a machine instr from updating LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150552 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 01:23:52 +00:00
Pete Cooper
bbfa5c02be Added hook to let targets custom lower splitting of illegal vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150550 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15 00:55:31 +00:00
Jakob Stoklund Olesen
d5d61edfc6 Fix global live range splitting regmask accuracy.
Pretend that regmask interference ends at the 'dead' slot, even when
there is other interference ending at the 'reg' slot of the same
instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150531 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 23:53:23 +00:00
Jakob Stoklund Olesen
cac5fa39bd Fix details in local live range splitting with regmasks.
Perform all comparisons at instruction granularity, and make sure
register masks on uses count in both gaps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150530 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 23:51:27 +00:00
Jakob Stoklund Olesen
1cf8b0f2a5 Handle regmasks in findRegisterDefOperandIdx().
Only accept register masks when looking for an 'overlapping' def. When
Overlap is not set, the function searches for a proper definition of
Reg.

This means MI->modifiesRegister() considers register masks, but
MI->definesRegister() doesn't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150529 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 23:49:37 +00:00
Jakob Stoklund Olesen
6b7913893b Use the proper clobber check in handleLiveInRegister().
When a physreg is live in to a basic block, look for any instruction in
the block that clobbers the physreg.

The instruction doesn't have to properly redefine the register, any
overlapping clobber is OK.

This slightly changes live ranges when compiling with register masks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150528 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 23:46:24 +00:00
Jakob Stoklund Olesen
f658af5484 Dump live intervals in numerical order.
The old DenseMap hashed order was very confusing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150527 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 23:46:21 +00:00