Commit Graph

8178 Commits

Author SHA1 Message Date
Dale Johannesen 5f4eecf961 Adjust isConstantSplat to allow for big-endian targets.
PPC is such a target; make it work.

llvm-svn: 87060
2009-11-13 01:45:18 +00:00
Bill Wendling c781d7a072 Simplify code a bit
llvm-svn: 87040
2009-11-12 23:13:08 +00:00
Bill Wendling e412064c4c Refactor code that checks if it's a call to a "nounwind" function.
llvm-svn: 87036
2009-11-12 21:59:20 +00:00
David Greene 033d65581d Do some cleanups suggested by Chris.
llvm-svn: 87034
2009-11-12 21:49:55 +00:00
David Greene 7cf326aed4 Set the ReloadReuse AsmPrinter flag where appropriate.
llvm-svn: 87030
2009-11-12 21:07:54 +00:00
Daniel Dunbar 5026bc3a86 Fix -Asserts warning.
llvm-svn: 87024
2009-11-12 20:53:43 +00:00
Bill Wendling e3ae25b3d8 If there's more than one function operand to a call instruction, be conservative
and don't assume that the call doesn't throw. It would be nice if there were a
way to determine which is the callee and which is a parameter. In practice, the
architecture we care about normally only have one operand for a call instruction
(x86 and arm).

llvm-svn: 87023
2009-11-12 20:51:53 +00:00
David Greene 1fbe054450 Add a bool flag to StackObjects telling whether they reference spill
slots.  The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values.  It's too easy to pass a wrong argument
value when multiple arguments have default values.  Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..

llvm-svn: 87022
2009-11-12 20:49:22 +00:00
Benjamin Kramer 68e4945c03 Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.

llvm-svn: 87020
2009-11-12 20:36:59 +00:00
David Greene 81eb42d8ca Make FixedStackPseudoSourceValue a first-class PseudoSourceValue by
making it visible to clients and adding LLVM-style cast capability.
This will be used by AsmPrinter to determine when to emit spill comments
for an instruction.

llvm-svn: 87019
2009-11-12 20:25:07 +00:00
David Goodwin da83f7d58b Rename registers to break output dependencies in addition to anti-dependencies.
llvm-svn: 87015
2009-11-12 19:08:21 +00:00
Devang Patel 2904aa9f6e "Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.
llvm-svn: 87014
2009-11-12 19:02:56 +00:00
Evan Cheng 5d85a46f76 RegScavenger::enterBasicBlock should always reset register state.
llvm-svn: 86972
2009-11-12 07:49:10 +00:00
Jim Grosbach 801b33b17c Move the utility function UpdateTerminator() from CodePlacementOpt() into
MachineBasicBlock so other passes can utilize it.

llvm-svn: 86947
2009-11-12 03:55:33 +00:00
Dan Gohman a9b40a6eb4 Make the BranchFolderPass class local to BranchFolding.cpp.
llvm-svn: 86928
2009-11-12 01:59:26 +00:00
Dan Gohman b3bf49f67e Minor code cleanups.
llvm-svn: 86926
2009-11-12 01:51:28 +00:00
Lang Hames bff25cb044 Fixed an iteration condition in PreAllocSplitting. This should fix some miscompilations casued by PreAllocSplitting.
llvm-svn: 86919
2009-11-12 01:24:08 +00:00
Dan Gohman 09478e975d Tail merge at any size when there are two potentials blocks and one
can be made to fall through into the other.

llvm-svn: 86909
2009-11-12 00:39:10 +00:00
Bill Wendling 7a6b11e707 Don't mark a call as potentially throwing if the function it's calling has the
"nounwind" attribute.

llvm-svn: 86897
2009-11-11 23:17:02 +00:00
Dan Gohman 02b155427e Promote MergePotentialsElt and SameTailElt to be regular classes
instead of typedefs for std::pair. This simplifies the type of
SameTails, which previously was std::vector<std::pair<std::vector<std::pair<unsigned, MachineBasicBlock *> >::iterator, MachineBasicBlock::iterator>

llvm-svn: 86885
2009-11-11 21:57:02 +00:00
Kenneth Uildriks 9f34406a90 x86 users can now return arbitrary sized structs. Structs too large to fit in return registers will be returned through a hidden sret parameter introduced during SelectionDAG construction.
llvm-svn: 86876
2009-11-11 19:59:24 +00:00
Dan Gohman 71782d59c7 Revert this line of 86871.
llvm-svn: 86875
2009-11-11 19:56:05 +00:00
Devang Patel d41f119dac If doesSupportDebugInformation() is false then do not try to emit dwarf debug info.
llvm-svn: 86874
2009-11-11 19:55:08 +00:00
Dan Gohman 34eeb4e983 Check in the changes to this file too.
llvm-svn: 86873
2009-11-11 19:49:34 +00:00
Dan Gohman 64b5d0f468 Add support for tail duplication to BranchFolding, and extend
tail merging support to handle more cases.
 - Recognize several cases where tail merging is beneficial even when
   the tail size is smaller than the generic threshold.
 - Make use of MachineInstrDesc::isBarrier to help detect
   non-fallthrough blocks.
 - Check for and avoid disrupting fall-through edges in more cases.

llvm-svn: 86871
2009-11-11 19:48:59 +00:00
Jakob Stoklund Olesen 4f7fd3baeb Fix liveness calculation when splitting critical edges during PHI elimination.
- Edges are split before any phis are eliminated, so the code is SSA.

- Create a proper IR BasicBlock for the split edges.

- LiveVariables::addNewBlock now has same syntax as
  MachineDominatorTree::addNewBlock. Algorithm calculates predecessor live-out
  set rather than successor live-in set.

This feature still causes some miscompilations.

llvm-svn: 86867
2009-11-11 19:31:31 +00:00
Dan Gohman 16cfb9106e Fix indentation level.
llvm-svn: 86856
2009-11-11 18:42:28 +00:00
Dan Gohman c86b5a15f5 Whitespace cleanups.
llvm-svn: 86855
2009-11-11 18:38:14 +00:00
Dan Gohman 84bb28fc84 Prefix MBB numbers with "BB#" in debug output to make it clear what
the numbers mean.

llvm-svn: 86854
2009-11-11 18:23:17 +00:00
Dan Gohman f4141f1dda Minor code simplification.
llvm-svn: 86853
2009-11-11 18:18:34 +00:00
Daniel Dunbar 75b4d3562c Fix -Asserts warning.
llvm-svn: 86794
2009-11-11 03:09:50 +00:00
Bill Wendling 676f44062e Make sure that the exception handling data has the same visibility as the
function it's generated for.

llvm-svn: 86779
2009-11-11 01:24:59 +00:00
Devang Patel 78319c67ca Do not assume first function scope seen represents current function.
llvm-svn: 86771
2009-11-11 00:31:36 +00:00
Devang Patel 4450f26621 While creating DbgScopes, do not forget parent scope.
llvm-svn: 86763
2009-11-11 00:18:40 +00:00
Devang Patel cdb7d44d6d Ignore variable if scope info is not available.
llvm-svn: 86753
2009-11-10 23:20:04 +00:00
Dale Johannesen 6f7d5b22bb Emit correct code when making a ConstantPool entry for a vector
constant whose component type is not a legal type for the target.
(If the target ConstantPool cannot handle this type either, it has
an opportunity to merge elements.  In practice any target with
8-bit bytes must support i8 *as data*).  7320806 (partial).

llvm-svn: 86751
2009-11-10 23:16:41 +00:00
Devang Patel f6eeaebd76 Implement support to debug inlined functions.
llvm-svn: 86748
2009-11-10 23:06:00 +00:00
Jakob Stoklund Olesen 4453dc976b Teach PHIElimination to split critical edges when -split-phi-edges is enabled.
Critical edges leading to a PHI node are split when the PHI source variable is
live out from the predecessor block. This help the coalescer eliminate more
PHI joins.

llvm-svn: 86725
2009-11-10 22:01:05 +00:00
Jakob Stoklund Olesen 19f235e455 Refactoring: Extract method PHIElimination::isLiveOut().
Clean up some whitespace.
No functional changes.

llvm-svn: 86724
2009-11-10 22:00:56 +00:00
Duncan Sands dca0c28452 Codegen support for the llvm.invariant/lifetime.start/end intrinsics:
just throw them away.

llvm-svn: 86678
2009-11-10 09:08:09 +00:00
Dan Gohman 42cc1806d8 Remove an unused variable.
llvm-svn: 86642
2009-11-10 01:37:57 +00:00
Dan Gohman 48079d4bf5 Minor code simplification.
llvm-svn: 86641
2009-11-10 01:36:20 +00:00
Jeffrey Yasskin b40d3f76a0 Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!

llvm-svn: 86636
2009-11-10 01:02:17 +00:00
David Goodwin 0d412c2528 Fixed to address code review. No functional changes.
llvm-svn: 86634
2009-11-10 00:48:55 +00:00
David Goodwin cf89db135e Allow targets to specify register classes whose member registers should not be renamed to break anti-dependencies.
llvm-svn: 86628
2009-11-10 00:15:47 +00:00
Dan Gohman a951526510 Remove an unneeded #include.
llvm-svn: 86601
2009-11-09 22:28:30 +00:00
Mike Stump f04c4cdb27 Fix for 64-bit builds.
llvm-svn: 86600
2009-11-09 22:28:21 +00:00
Dan Gohman 2745d19287 Print "..." instead of all the uninteresting register clobbers on call
instructions. This makes CodeGen dumps significantly less noisy.

Example before:
  BL <ga:@bar>, %R0<imp-def>, %R1<imp-def,dead>, %R2<imp-def,dead>, %R3<imp-def,dead>, %R12<imp-def,dead>, %LR<imp-def,dead>, %D0<imp-def,dead>, %D1<imp-def,dead>, %D2<imp-def,dead>, %D3<imp-def,dead>, %D4<imp-def,dead>, %D5<imp-def,dead>, %D6<imp-def,dead>, %D7<imp-def,dead>, %D16<imp-def,dead>, %D17<imp-def,dead>, %D18<imp-def,dead>, %D19<imp-def,dead>, %D20<imp-def,dead>, %D21<imp-def,dead>, %D22<imp-def,dead>, %D23<imp-def,dead>, %D24<imp-def,dead>, %D25<imp-def,dead>, %D26<imp-def,dead>, %D27<imp-def,dead>, %D28<imp-def,dead>, %D29<imp-def,dead>, %D30<imp-def,dead>, %D31<imp-def,dead>, %CPSR<imp-def,dead>, %FPSCR<imp-def,dead>

Same example after:
  BL <ga:@bar>, %R0<imp-def>, %R1<imp-def,dead>, %LR<imp-def,dead>, %CPSR<imp-def,dead>, ...

llvm-svn: 86583
2009-11-09 19:38:45 +00:00
David Goodwin d2f9c044c0 Fix dependencies added to model memory aliasing for post-RA scheduling. The dependencies were overly conservative for memory access that are known not to alias.
llvm-svn: 86580
2009-11-09 19:22:17 +00:00
Dan Gohman 6f67f8902a Constify MachineFunctionAnalysis' TargetMachine reference.
llvm-svn: 86564
2009-11-09 18:18:49 +00:00