Commit Graph

13175 Commits

Author SHA1 Message Date
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
Lang Hames
94b6e14182 Don't create a new copy of reserved regs - we already have one handy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150525 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 23:06:12 +00:00
Bill Wendling
b464d3ff72 Add code to the target lowering object file module to handle module flags.
The MachO back-end needs to emit the garbage collection flags specified in the
module flags. This is a WIP, so the front-end hasn't been modified to emit these
flags just yet. Documentation and front-end switching to occur soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150507 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 21:28:13 +00:00
Lang Hames
03698deb25 Update MachineVerifier to check the new physreg live-in rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150496 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 19:17:48 +00:00
Lang Hames
342c64c904 Tighten physical register invariants: Allocatable physical registers can
only be live in to a block if it is the function entry point or a landing pad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150494 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 18:51:53 +00:00
Nadav Rotem
8b7c3d0ee4 Fix PR12000. Some vector operations may use scalar operands with types
that are greater than the vector element type. For example BUILD_VECTOR
of type <1 x i1> with a constant i8 operand.
This patch fixes the assertion.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150477 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 13:06:32 +00:00
Benjamin Kramer
fc52a52323 Turn push_back loops into append/insert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150471 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 10:29:27 +00:00
Lang Hames
0796134bde Rename getExceptionAddressRegister() to getExceptionPointerRegister() for consistency with setExceptionPointerRegister(...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150460 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 04:45:49 +00:00
Lang Hames
cd339b71ff Use convenience function for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150457 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 03:04:29 +00:00
Bill Wendling
bdf9db6f49 Don't reserve the R0 and R1 registers here. We don't use these registers, and
marking them as "live-in" into a BB ruins some invariants that the back-end
tries to maintain.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150437 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:47:16 +00:00
Bill Wendling
150a371569 Don't recalculate the size of the vector each time through the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:45:26 +00:00
Jakob Stoklund Olesen
16a7ff3165 Add register mask support to ScheduleDAGRRList.
The scheduler will sometimes check the implicit-def list on instructions
to properly handle pre-colored DAG edges.

Also check any register mask operands for physreg clobbers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150428 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:25:24 +00:00
Andrew Trick
d35576b3c0 LiveIntervalAnalysis does not depend on MachineLoopInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150411 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 20:44:42 +00:00
Jakob Stoklund Olesen
3ed4dee530 Check regmask interference for -join-physregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150404 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 18:17:04 +00:00
Nadav Rotem
0877fdf30b Fix a bug in DAGCombine for the optimization of BUILD_VECTOR. We cant generate a shuffle node from two vectors of different types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150383 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 12:42:26 +00:00
Nadav Rotem
2ee746b87d This patch addresses the problem of poor code generation for the zext
v8i8 -> v8i32 on AVX machines. The codegen often scalarizes ANY_EXTEND nodes.
The DAGCombiner has two optimizations that can mitigate the problem. First,
if all of the operands of a BUILD_VECTOR node are extracted from an ZEXT/ANYEXT
nodes, then it is possible to create a new simplified BUILD_VECTOR which uses
UNDEFS/ZERO values to eliminate the scalar ZEXT/ANYEXT nodes.
Second, another dag combine optimization lowers BUILD_VECTOR into a shuffle
vector instruction.

In the case of zext v8i8->v8i32 on AVX, a value in an XMM register is to be
shuffled into a wide YMM register.

This patch modifes the second optimization and allows the creation of
shuffle vectors even when the newly generated vector and the original vector
from which we extract the values are of different types.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150340 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 15:05:31 +00:00
Anton Korobeynikov
d4a19b6a72 Add support for implicit TLS model used with MS VC runtime.
Patch by Kai Nacke!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 17:26:53 +00:00
Andrew Trick
746f24b732 Add TargetPassConfig hooks for scheduling/bundling.
In case the MachineScheduling pass I'm working on doesn't work well
for another target, they can completely override it. This also adds a
hook immediately after the RegAlloc pass to cleanup immediately after
vregs go away. We may want to fold it into the postRA hook later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150298 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 07:11:32 +00:00
Jakob Stoklund Olesen
5637379000 Allow Post-RA LICM to hoist reserved register reads.
When using register masks, registers like %rip are clobbered by the
register mask. LICM should still be able to hoist instructions reading
%rip from a loop containing calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 00:44:19 +00:00
Jakob Stoklund Olesen
a6d513f474 Handle register masks in local live range splitting.
Again the goal is to produce identical assembly with register mask
operands enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150287 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 00:42:18 +00:00