Bill Wendling
dcecc143ae
Refactor the code that creates the "dot-label" difference. This may be used in
...
more than one place. No intended functionality change.
llvm-svn: 89024
2009-11-17 01:23:53 +00:00
Jakob Stoklund Olesen
6ac8f7ec34
Enable -split-phi-edges by default
...
llvm-svn: 89021
2009-11-17 01:07:22 +00:00
Dan Gohman
fc21555ca5
Remove the optimizations that convert BRCOND and BR_CC into
...
unconditional branches or fallthroghes. Instcombine/SimplifyCFG
should be simplifying branches with known conditions.
This fixes some problems caused by these transformations not
updating the MachineBasicBlock CFG.
llvm-svn: 89017
2009-11-17 00:47:23 +00:00
Dan Gohman
04717dcf0a
Initialize the new AsmPrinterFlags field to 0, fixing uses of
...
uninitialized memory.
llvm-svn: 88985
2009-11-16 22:49:38 +00:00
Devang Patel
aad93dd4c0
Revert r88939.
...
llvm-svn: 88973
2009-11-16 21:53:40 +00:00
Dan Gohman
22377c8327
Sink a #include <map> to where it's actually needed.
...
llvm-svn: 88956
2009-11-16 20:40:47 +00:00
Dan Gohman
0679a637b3
Fix a typo in a comment.
...
llvm-svn: 88953
2009-11-16 20:35:59 +00:00
Bob Wilson
ead1392ff4
Fix a comment.
...
llvm-svn: 88940
2009-11-16 19:33:27 +00:00
Devang Patel
9263c9d854
Add VISIBILITY_HIDDEN marker.
...
llvm-svn: 88939
2009-11-16 19:20:48 +00:00
Bob Wilson
72925c0154
Fix some comments.
...
llvm-svn: 88932
2009-11-16 18:54:08 +00:00
Bob Wilson
eca4a0c2e4
Whitespace: be consistent with pointer syntax.
...
llvm-svn: 88929
2009-11-16 18:08:46 +00:00
Bob Wilson
04825f6c4b
Clean up whitespace.
...
llvm-svn: 88927
2009-11-16 17:56:13 +00:00
David Greene
6469fa6824
Support spill comments.
...
Have the asm printer emit a comment if an instruction is a spill or
reload and have the spiller mark copies it introdues so the asm printer
can also annotate those.
llvm-svn: 88911
2009-11-16 15:12:23 +00:00
Evan Cheng
ea46259f53
Check if subreg index is zero.
...
llvm-svn: 88899
2009-11-16 06:31:49 +00:00
Evan Cheng
2fa416debd
For some targets, a copy can use a register multiple times, e.g. ppc.
...
llvm-svn: 88895
2009-11-16 05:52:06 +00:00
Lang Hames
bd7b181f94
Fixes the bug exposed by Anton's test case in PR 5495:
...
Make sure when ProcessImplicitDefs removes a copy which kills its source reg that it
removes the copy from said reg's Kills list.
llvm-svn: 88881
2009-11-16 02:07:31 +00:00
Lang Hames
ce9d705846
Fix for the original bug in PR5495 - Look at uses as well as defs when determining the PHI-copy insert point.
...
- Patch by Andrew Canis!
llvm-svn: 88880
2009-11-16 02:00:09 +00:00
Lang Hames
4d30650e61
Added an assert to the PBQP allocator to catch infinite cost solutions which might otherwise lead to miscompilations.
...
llvm-svn: 88829
2009-11-15 04:39:51 +00:00
Jim Grosbach
b81732e2f7
Do not merge jump tables this early. Branch folding will do any necessary
...
merges, and until then, it's useful to keep the tables separate for ease
of manipulation.
llvm-svn: 88806
2009-11-14 20:15:03 +00:00
Jim Grosbach
e4dfaf99cd
Add function to replace a destination MBB in a single jump table
...
llvm-svn: 88804
2009-11-14 20:09:13 +00:00
Sanjiv Gupta
b38d6287b8
revert 88761 as it fails builds.
...
llvm-svn: 88762
2009-11-14 07:22:25 +00:00
Sanjiv Gupta
3db18af363
Fix debug info crashes for PIC16.
...
llvm-svn: 88761
2009-11-14 06:19:49 +00:00
Evan Cheng
b8c04e1226
Added getSubRegIndex(A,B) that returns subreg index of A to B. Use it to replace broken code in VirtRegRewriter.
...
llvm-svn: 88753
2009-11-14 03:42:17 +00:00
Evan Cheng
9b46e74f42
- Change TargetInstrInfo::reMaterialize to pass in TargetRegisterInfo.
...
- If destination is a physical register and it has a subreg index, use the
sub-register instead.
This fixes PR5423.
llvm-svn: 88745
2009-11-14 02:55:43 +00:00
Evan Cheng
c56b0a0f14
Fix PR5412: Fix an inverted check and another missing sub-register check.
...
llvm-svn: 88738
2009-11-14 02:09:09 +00:00
Dan Gohman
b36274632d
Enable the tail call optimization when the caller returns undef.
...
llvm-svn: 88737
2009-11-14 02:06:30 +00:00
Jakob Stoklund Olesen
2ece9d4854
Fix bug in -split-phi-edges.
...
When splitting an edge after a machine basic block with fall-through, we
forgot to insert a jump instruction. Fix this by calling updateTerminator() on
the fall-through block when relevant.
Also be more precise in PHIElimination::isLiveIn.
llvm-svn: 88728
2009-11-14 00:38:13 +00:00
Jakob Stoklund Olesen
28f746c6fa
Update MachineDominator information
...
llvm-svn: 88727
2009-11-14 00:38:06 +00:00
Lang Hames
8b2d2c7537
Added an API to the SlotIndexes pass to allow new instructions to be inserted into the numbering.
...
PreAllocSplitting is now using this API to insert code.
llvm-svn: 88725
2009-11-14 00:02:51 +00:00
Evan Cheng
e2907b91de
Fix PR5411. Bug in UpdateKills. A reg def partially define its super-registers.
...
llvm-svn: 88719
2009-11-13 23:16:41 +00:00
Jakob Stoklund Olesen
a8d26951eb
Fix PHIElimination optimization that uses MBB->getBasicBlock.
...
The BasicBlock associated with a MachineBasicBlock does not necessarily
correspond to the code in the MBB.
Don't insert a new IR BasicBlock when splitting critical edges. We are not
supposed to modify the IR during codegen, and we should be able to do just
fine with a NULL BB.
llvm-svn: 88707
2009-11-13 21:56:15 +00:00
Jakob Stoklund Olesen
ec4eff6c6a
Add MachineFunction::verify() to call the machine code verifier directly.
...
llvm-svn: 88706
2009-11-13 21:56:09 +00:00
Jakob Stoklund Olesen
28a81d4c5a
Fix polarity of a CFG check in machine verifier.
...
llvm-svn: 88704
2009-11-13 21:55:54 +00:00
Dan Gohman
30f404fb4a
Use .data() instead of .c_str() when nul-termination is not needed.
...
llvm-svn: 88703
2009-11-13 21:55:31 +00:00
David Greene
97a1f550d1
Move DebugInfo checks into EmitComments and remove them from
...
target-specific AsmPrinters. Not all comments need DebugInfo.
Re-enable the line numbers comment test.
llvm-svn: 88697
2009-11-13 21:34:57 +00:00
Dan Gohman
972293611d
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.
llvm-svn: 88692
2009-11-13 21:02:15 +00:00
Evan Cheng
f629fdcab2
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.
llvm-svn: 88690
2009-11-13 20:36:40 +00:00
David Goodwin
e1d06f2239
Allow target to specify regclass for which antideps will only be broken along the critical path.
...
llvm-svn: 88682
2009-11-13 19:52:48 +00:00
Dan Gohman
01b65e1e48
Don't let a noalias difference disrupt the tailcall optimization.
...
llvm-svn: 88672
2009-11-13 18:49:38 +00:00
Devang Patel
7f5ae01388
Ignore nameless variables.
...
llvm-svn: 87069
2009-11-13 02:25:26 +00:00
Dale Johannesen
f57a58c4fe
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
af38b4195e
Simplify code a bit
...
llvm-svn: 87040
2009-11-12 23:13:08 +00:00
Bill Wendling
507f0b33a6
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
1e8e66866e
Do some cleanups suggested by Chris.
...
llvm-svn: 87034
2009-11-12 21:49:55 +00:00
David Greene
7c84128066
Set the ReloadReuse AsmPrinter flag where appropriate.
...
llvm-svn: 87030
2009-11-12 21:07:54 +00:00
Daniel Dunbar
be0325cd14
Fix -Asserts warning.
...
llvm-svn: 87024
2009-11-12 20:53:43 +00:00
Bill Wendling
63f6c52635
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
58e7c6145b
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
da70783da7
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
7828d47a9b
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
805a319014
Rename registers to break output dependencies in addition to anti-dependencies.
...
llvm-svn: 87015
2009-11-12 19:08:21 +00:00
Devang Patel
c024e96ca3
"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
deacae0dd9
RegScavenger::enterBasicBlock should always reset register state.
...
llvm-svn: 86972
2009-11-12 07:49:10 +00:00
Jim Grosbach
f373f8c459
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
b6f852353a
Make the BranchFolderPass class local to BranchFolding.cpp.
...
llvm-svn: 86928
2009-11-12 01:59:26 +00:00
Dan Gohman
8931850b74
Minor code cleanups.
...
llvm-svn: 86926
2009-11-12 01:51:28 +00:00
Lang Hames
41dcc7ba71
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
f8ec4856e4
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
cfdaf6609a
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
93c57d5ff0
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
82bc831061
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
9623ba83ce
Revert this line of 86871.
...
llvm-svn: 86875
2009-11-11 19:56:05 +00:00
Devang Patel
e37dd6ef40
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
05a9a66c9e
Check in the changes to this file too.
...
llvm-svn: 86873
2009-11-11 19:49:34 +00:00
Dan Gohman
9f47de10e3
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
01582996dd
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
b0f32c095c
Fix indentation level.
...
llvm-svn: 86856
2009-11-11 18:42:28 +00:00
Dan Gohman
b72c986b78
Whitespace cleanups.
...
llvm-svn: 86855
2009-11-11 18:38:14 +00:00
Dan Gohman
60b5c20890
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
281338a3d2
Minor code simplification.
...
llvm-svn: 86853
2009-11-11 18:18:34 +00:00
Daniel Dunbar
d29c05945a
Fix -Asserts warning.
...
llvm-svn: 86794
2009-11-11 03:09:50 +00:00
Bill Wendling
33ab3cd1bc
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
b3f18462ca
Do not assume first function scope seen represents current function.
...
llvm-svn: 86771
2009-11-11 00:31:36 +00:00
Devang Patel
eb421ea5de
While creating DbgScopes, do not forget parent scope.
...
llvm-svn: 86763
2009-11-11 00:18:40 +00:00
Devang Patel
06e690849a
Ignore variable if scope info is not available.
...
llvm-svn: 86753
2009-11-10 23:20:04 +00:00
Dale Johannesen
20e1cd09ba
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
5c983cb2ab
Implement support to debug inlined functions.
...
llvm-svn: 86748
2009-11-10 23:06:00 +00:00
Jakob Stoklund Olesen
b92c9347ba
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
35918309f2
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
737962bca6
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
ae83652ce1
Remove an unused variable.
...
llvm-svn: 86642
2009-11-10 01:37:57 +00:00
Dan Gohman
4d8fef974a
Minor code simplification.
...
llvm-svn: 86641
2009-11-10 01:36:20 +00:00
Jeffrey Yasskin
23ac706aab
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
93a4f29c67
Fixed to address code review. No functional changes.
...
llvm-svn: 86634
2009-11-10 00:48:55 +00:00
David Goodwin
538f9c25f8
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
9885f20a6d
Remove an unneeded #include.
...
llvm-svn: 86601
2009-11-09 22:28:30 +00:00
Mike Stump
c2b669b3b2
Fix for 64-bit builds.
...
llvm-svn: 86600
2009-11-09 22:28:21 +00:00
Dan Gohman
c64e578e5a
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
2c17fdab6d
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
8ef26198d2
Constify MachineFunctionAnalysis' TargetMachine reference.
...
llvm-svn: 86564
2009-11-09 18:18:49 +00:00
Evan Cheng
e3acd9adb5
Hide a couple of options.
...
llvm-svn: 86522
2009-11-09 06:49:37 +00:00
Evan Cheng
4cd6cb4137
80 col.
...
llvm-svn: 86521
2009-11-09 06:49:22 +00:00
Lang Hames
3126c532b2
Moved some ManagedStatics out of the SlotIndexes header.
...
llvm-svn: 86446
2009-11-08 08:49:59 +00:00
Anton Korobeynikov
0a13189111
Add 8 bit libcalls and make use of them for msp430
...
llvm-svn: 86384
2009-11-07 17:14:39 +00:00
Chris Lattner
d5eaa6d39b
Fix PR5421 by APInt'izing switch lowering.
...
llvm-svn: 86354
2009-11-07 07:50:34 +00:00
Lang Hames
b5bff25ba7
Update some globals to use ManagedStatic.
...
llvm-svn: 86342
2009-11-07 05:50:28 +00:00
Mon P Wang
ea09038f22
Fix memoizing of CvtRndSatSDNode
...
llvm-svn: 86340
2009-11-07 04:46:25 +00:00
Evan Cheng
8eaaffb9da
- Add TargetInstrInfo::isIdentical(). It's similar to MachineInstr::isIdentical
...
except it doesn't care if the definitions' virtual registers differ. This is
used by machine LICM and other MI passes to perform CSE.
- Teach Thumb2InstrInfo::isIdentical() to check two t2LDRpci_pic are identical.
Since pc relative constantpool entries are always different, this requires it
it check if the values can actually the same.
llvm-svn: 86328
2009-11-07 03:52:02 +00:00
Kenneth Uildriks
91ceaa85a2
Add code to check at SelectionDAGISel::LowerArguments time to see if return values can be lowered to registers. Coming soon, code to perform sret-demotion if return values cannot be lowered to registers
...
llvm-svn: 86324
2009-11-07 02:11:54 +00:00
Jakob Stoklund Olesen
df21edc554
Fix inverted conflict test in -early-coalesce.
...
A non-identity copy cannot be coalesced when the phi join destination register
is live at the copy site.
Also verify the condition that the PHI join source register is only used in
the PHI join. Otherwise the coalescing is invalid.
llvm-svn: 86322
2009-11-07 01:58:40 +00:00