Commit Graph

9635 Commits

Author SHA1 Message Date
Devang Patel
3547a88b50 Keep track of MCSymbol used to mark beginning of a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 18:39:21 +00:00
Devang Patel
bc655eaee0 At this point Start and End are not null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 18:28:58 +00:00
Jakob Stoklund Olesen
a063e19593 Run LiveVariables instead of computing liveness locally in -regalloc=fast.
This actually makes everything slower, but the plan is to have isel add <kill>
flags the way it is already adding <dead> flags. Then LiveVariables can be
removed again.

When ignoring the time spent in LiveVariables, -regalloc=fast is now twice as
fast as -regalloc=local.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 23:18:07 +00:00
Evan Cheng
e3dd8550c6 Do not try to optimize a copy that has already been marked for deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 20:57:54 +00:00
Devang Patel
708e474c2f Add command line option to disable debug info printing in .s file. This option does not impact debug info generation and preservation through earlier compile starges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 19:08:53 +00:00
Jakob Stoklund Olesen
00207237dd Add fast register allocator, enabled with -regalloc=fast.
So far this is just a clone of -regalloc=local that has been lobotomized to run
25% faster. It drops the least-recently-used calculations, and is just plain
stupid when it runs out of registers.

The plan is to make this go even faster for -O0 by taking advantage of the short
live intervals in unoptimized code. It should not be necessary to calculate
liveness when most virtual registers are killed 2-3 instructions after they are
born.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 18:02:42 +00:00
Devang Patel
9cdb4109d5 Identify when a lexical scope is split in to multiple instruction ranges. Emit such ranges using DW_AT_ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 16:32:19 +00:00
Evan Cheng
e566763b19 Implement -disable-non-leaf-fp-elim which disable frame pointer elimination
optimization for non-leaf functions. This will be hooked up to gcc's
-momit-leaf-frame-pointer option. rdar://7886181


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101984 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 03:18:23 +00:00
Dan Gohman
f0757b0edc Add more const qualifiers on TargetMachine and friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 01:34:56 +00:00
Dan Gohman
af5097537c Update CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101976 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 01:32:29 +00:00
Dan Gohman
5eb6d65a27 Move several SelectionDAG-independent utility functions out of the
SelectionDAG directory and into a new Analysis.cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 01:22:34 +00:00
Evan Cheng
30fdb5c2ac - Clean up some crappy code which deals with coalescing of copies which look at
extract_subreg / insert_subreg, etc.
- Add support for more aggressive insert_subreg coalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 00:44:22 +00:00
Evan Cheng
3115698611 Rewrite machine cse to avoid recursion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 00:21:07 +00:00
Dan Gohman
bc7588eb68 Add another variant of this test which found a place where
CodeGen's ComputeMaskedBits was being over-conservative when computing
bits for an ADD.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 00:19:28 +00:00
Dale Johannesen
7609017dc3 Because of the EMMS problem, right now we have to support
user-defined operations that use MMX register types, but
the compiler shouldn't generate them on its own.  This adds
a Synthesizable abstraction to represent this, and changes
the vector widening computation so it won't produce MMX types.
(The motivation is to remove noise from the ABI compatibility
part of the gcc test suite, which has some breakage right now.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101951 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 22:34:09 +00:00
Jakob Stoklund Olesen
9196ab6405 When MachineLICM is hoisting a physical register after regalloc, make sure the
register is not killed in the loop.

This fixes 188.ammp on ARM where the post-ra scheduler would grab a register
that looked available but wasn't.

A testcase would be huge and fragile, sorry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 18:45:47 +00:00
Evan Cheng
d6060a4ce9 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 17:27:38 +00:00
Dan Gohman
92884f7ee5 Sink the CopyToExportRegsIfNeeded calls out of SelectionDAGISel
into SelectionDAGBuilder. This avoids a separate pass over the
instructions, and has the side effect of providing debug location
information to the copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 15:03:56 +00:00
Dan Gohman
ba5be5c07b Don't send PHI nodes down to SelectionDAGBuilder of FastISel, since
they end up doing nothing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 15:00:41 +00:00
Dan Gohman
d84e806dd4 Sink this use_empty() check into isUsedOutsideOfDefiningBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 14:50:13 +00:00
Dan Gohman
c025c85352 If a PHI node somehow has debug info, propogate it to the MachineInstr PHI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 14:48:02 +00:00
Dan Gohman
3f1403f14e Don't iterate through the whole block just to find the PHI nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 14:46:25 +00:00
Gabor Greif
a9b2313c13 use abstract accessors to CallInst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 13:13:04 +00:00
Chris Lattner
44e05080f8 Bill's change in r95336 broke empty aggregates embedded
in other types.  fix this by only bumping zero-byte globals
up to a single byte if the *entire global* is zero size,
fixing PR6340.

This also fixes empty arrays etc to be handled correctly,
and only does this on subsection-via-symbols targets (aka
darwin) which is the only place where this matters.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 06:20:21 +00:00
Dan Gohman
8b1dbebc1e Delete a redundant return statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101860 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 01:58:20 +00:00
Bill Wendling
86c5abb4c0 The visitXOR method can return the same SDNode. If so, we don't want to delete
it as it's not dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 01:25:01 +00:00
Dan Gohman
a9056dbec1 Remove this debug output; it isn't that useful, and it's incomplete
in the case where a basic block is split.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 00:56:44 +00:00
Dan Gohman
8ba3aa7f9c Sink DebugLoc handling out of SelectionDAGISel into FastISel and
SelectionDAGBuilder, where it doesn't have to be as complicated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 00:48:35 +00:00
Dan Gohman
084751cd16 Remove MachineFunction's DefaultDebugLoc member, and make DwarfDebug.cpp
responsible for figuring out what that's supposed to be on its own.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101844 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 00:37:27 +00:00
Dan Gohman
a9a3321938 Reapply the removal of SelectionDAGISel's BB, with a fix for the case
where multiple blocks are emitted; functions which do this need to return
the new BB so that their callers can stay current.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 00:29:35 +00:00
Dan Gohman
68b7960c1a Revert 101825, which is causing trouble.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 23:34:15 +00:00
Dan Gohman
66db3a0f10 Make BreakAntiDependencies' SUnits argument const, and make the Begin
and End arguments by-value rather than by-reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 23:11:58 +00:00
Dan Gohman
35bb85b7ee Eliminate SelectionDAGISel's "current block" member. Just pass it as
an argument to things that need it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101825 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 22:51:14 +00:00
Dan Gohman
99be8ae389 Eliminate the CurMBB member from SelectionDAGBuilder. For places that
need it, just pass around the parent block of the current instruction
explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 22:41:47 +00:00
Evan Cheng
4c26e93e89 More progress on promoting i16 operations to i32 for x86. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101808 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 19:29:22 +00:00
Dan Gohman
50d2b1ac02 Give SelectionDAG a TargetMachine too, rather than having it
fetch one from the MachineFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 19:22:07 +00:00
Evan Cheng
285fb1cc4a More 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101806 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 19:17:44 +00:00
Devang Patel
2a4a3b7c61 Add DW_AT_APPLE_omit_frame_ptr to encode -fomit-frame-pointer flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 19:14:02 +00:00
Dan Gohman
55e59c1863 Code that needs a TargetMachine should have access to one directly, rather
than just getting one through a TargetLowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 19:05:59 +00:00
Dan Gohman
46007b3712 Move isInTailCallPosition out of SelectionDAGBuilder, as it isn't
SelectionDAG-specific.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 18:41:46 +00:00
Dan Gohman
3fb150a902 Fix -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 17:42:52 +00:00
Dan Gohman
0d805c33d1 Add const qualifiers to TargetLoweringObjectFile usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 16:44:48 +00:00
Dan Gohman
82d5eaf23e Use const_cast instead of a C-style cast to cast away const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 16:43:55 +00:00
Dan Gohman
9f23dee08c Start function numbering at 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 16:29:15 +00:00
Dan Gohman
383b5f6b91 Delete now-unnecessary const_casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 15:32:28 +00:00
Dan Gohman
d858e90f03 Use const qualifiers with TargetLowering. This eliminates several
const_casts, and it reinforces the design of the Target classes being
immutable.

SelectionDAGISel::IsLegalToFold is now a static member function, because
PIC16 uses it in an unconventional way. There is more room for API
cleanup here.

And PIC16's AsmPrinter no longer uses TargetLowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 15:26:15 +00:00
Evan Cheng
94d1d9c219 Postra machine licm must add registers defined by loop invariants to *all* of
the live-in sets of BBs in the loop. Otherwise later pass may end up using the
registers and override the invariant. rdar://7852937
No reasonablly sized test case possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 07:07:11 +00:00
Evan Cheng
f2b910922d Fix codegen passes. -disable-ssc shouldn't disable postra machine licm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 06:47:47 +00:00
Evan Cheng
e5b51ac770 More work to allow dag combiner to promote 16-bit ops to 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 06:13:15 +00:00
Evan Cheng
4ff28527bb Another 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 06:12:32 +00:00