Commit Graph

8247 Commits

Author SHA1 Message Date
David Greene
1924aabf99 Move DebugInfo checks into EmitComments and remove them from
target-specific AsmPrinters.  Not all comments need DebugInfo.

Re-enable the line numbers comment test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 21:34:57 +00:00
Dan Gohman
c4c550c758 When optimizing for size, don't tail-merge unless it's likely to be a
code-size win, and not when it's only likely to be code-size neutral,
such as when only a single instruction would be eliminated and a new
branch would be required.

This fixes rdar://7392894.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 21:02:15 +00:00
Evan Cheng
236490d870 Fix PR5410: LiveVariables lost subreg def:
D0<def,dead> = ...
...
             = S0<use, kill>
S0<def>      = ...
...
D0<def>      = 

The first D0 def is correctly marked dead, however, livevariables should have
added an implicit def of S0 or we end up with a use without a def.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 20:36:40 +00:00
David Goodwin
87d21b92fc Allow target to specify regclass for which antideps will only be broken along the critical path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 19:52:48 +00:00
Dan Gohman
01205a80f5 Don't let a noalias difference disrupt the tailcall optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 18:49:38 +00:00
Devang Patel
3fb6bd690a Ignore nameless variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 02:25:26 +00:00
Dale Johannesen
1e608819aa Adjust isConstantSplat to allow for big-endian targets.
PPC is such a target; make it work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:45:18 +00:00
Bill Wendling
ecc260e403 Simplify code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 23:13:08 +00:00
Bill Wendling
ed060dcb5c Refactor code that checks if it's a call to a "nounwind" function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 21:59:20 +00:00
David Greene
b3bc115a24 Do some cleanups suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87034 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 21:49:55 +00:00
David Greene
6bedb30220 Set the ReloadReuse AsmPrinter flag where appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 21:07:54 +00:00
Daniel Dunbar
bf4af353ed Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:53:43 +00:00
Bill Wendling
ac18929801 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:51:53 +00:00
David Greene
3f2bf85d14 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..


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:49:22 +00:00
Benjamin Kramer
05872ea804 Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:36:59 +00:00
David Greene
cf62632d83 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:25:07 +00:00
David Goodwin
12dd99dc30 Rename registers to break output dependencies in addition to anti-dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 19:08:21 +00:00
Devang Patel
70d75ca310 "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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 19:02:56 +00:00
Evan Cheng
60f9061820 RegScavenger::enterBasicBlock should always reset register state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86972 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:49:10 +00:00
Jim Grosbach
7707a0df5b Move the utility function UpdateTerminator() from CodePlacementOpt() into
MachineBasicBlock so other passes can utilize it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 03:55:33 +00:00
Dan Gohman
72b2990a74 Make the BranchFolderPass class local to BranchFolding.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:59:26 +00:00
Dan Gohman
8520149db1 Minor code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:51:28 +00:00
Lang Hames
f035ce58bc Fixed an iteration condition in PreAllocSplitting. This should fix some miscompilations casued by PreAllocSplitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:24:08 +00:00
Dan Gohman
ad6af45dc1 Tail merge at any size when there are two potentials blocks and one
can be made to fall through into the other.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 00:39:10 +00:00
Bill Wendling
73b5551058 Don't mark a call as potentially throwing if the function it's calling has the
"nounwind" attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 23:17:02 +00:00
Dan Gohman
ffe644ebf4 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>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 21:57:02 +00:00
Kenneth Uildriks
c158dde219 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86876 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:59:24 +00:00
Dan Gohman
7cc253e3b8 Revert this line of 86871.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:56:05 +00:00
Devang Patel
3380cc5307 If doesSupportDebugInformation() is false then do not try to emit dwarf debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:55:08 +00:00
Dan Gohman
412a3b90d1 Check in the changes to this file too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:49:34 +00:00
Dan Gohman
2210c0bea8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:48:59 +00:00
Jakob Stoklund Olesen
3e20475fee 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:31:31 +00:00
Dan Gohman
cdc06ba5df Fix indentation level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:42:28 +00:00
Dan Gohman
4e3f125e18 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:38:14 +00:00
Dan Gohman
a127edceae Prefix MBB numbers with "BB#" in debug output to make it clear what
the numbers mean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:23:17 +00:00
Dan Gohman
d194498d26 Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:18:34 +00:00
Daniel Dunbar
c032679d3e Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 03:09:50 +00:00
Bill Wendling
ee161a6824 Make sure that the exception handling data has the same visibility as the
function it's generated for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 01:24:59 +00:00
Devang Patel
39ae3ff6d1 Do not assume first function scope seen represents current function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:31:36 +00:00
Devang Patel
2f105c6e18 While creating DbgScopes, do not forget parent scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:18:40 +00:00
Devang Patel
fb0ee43438 Ignore variable if scope info is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:20:04 +00:00
Dale Johannesen
9a645cd9d4 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).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:16:41 +00:00
Devang Patel
53bb5c95af Implement support to debug inlined functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:06:00 +00:00
Jakob Stoklund Olesen
f235f13931 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:01:05 +00:00
Jakob Stoklund Olesen
e35e3c33dc Refactoring: Extract method PHIElimination::isLiveOut().
Clean up some whitespace.
No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:00:56 +00:00
Duncan Sands
f07c9497b2 Codegen support for the llvm.invariant/lifetime.start/end intrinsics:
just throw them away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 09:08:09 +00:00
Dan Gohman
7071528e4e Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:37:57 +00:00
Dan Gohman
b2e40990c4 Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:36:20 +00:00
Jeffrey Yasskin
81cf432569 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:02:17 +00:00
David Goodwin
c2e8a7e8d2 Fixed to address code review. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 00:48:55 +00:00