1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

3896 Commits

Author SHA1 Message Date
Evan Cheng
0eaa723739 Properly handle kills of a physical register which has sub-registers that are read by later instructions.
llvm-svn: 37739
2007-06-26 21:03:35 +00:00
Duraid Madina
c4b17f9a08 tidy this file up a bit
llvm-svn: 37725
2007-06-26 00:21:58 +00:00
Duraid Madina
1d8c70bf83 A bunch of fixes to the BigBlock allocator improve compile-time by ~20%
and code quality by ~2% on my tests.

A big thank you to Roman Levenstein for this patch! See
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070618/050717.html
for more details.

llvm-svn: 37724
2007-06-25 23:46:54 +00:00
Dan Gohman
354f02e03d Generalize MVT::ValueType and associated functions to be able to represent
extended vector types. Remove the special SDNode opcodes used for pre-legalize
vector operations, and the special MVT::Vector type used with them. Adjust
lowering and legalize to work with the normal SDNode kinds instead, and to
use the normal MVT functions to work with vector types instead of using the
two special operands that the pre-legalize nodes held.

This allows pre-legalize and post-legalize DAGs, and the code that operates
on them, to be more consistent. Pre-legalize vector operators can be handled
more consistently with scalar operators. And, -view-dag-combine1-dags and
-view-legalize-dags now look prettier for vector code.

llvm-svn: 37719
2007-06-25 16:23:39 +00:00
Dan Gohman
a62327ea40 Move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits from
TargetLowering to SelectionDAG so that they have more convenient
access to the current DAG, in preparation for the ValueType routines
being changed from standalone functions to members of SelectionDAG for
the pre-legalize vector type changes.

llvm-svn: 37704
2007-06-22 14:59:07 +00:00
Duraid Madina
fe6e41b4f9 check in the BigBlock local register allocator
llvm-svn: 37703
2007-06-22 08:27:12 +00:00
Evan Cheng
85169b9b40 std::set is really really terrible. Switch to SmallPtrSet to reduce compile time. For Duraid's example. The overall isel time is reduced from 0.6255 sec to 0.1876 sec.
llvm-svn: 37701
2007-06-22 01:35:51 +00:00
Dan Gohman
72af1305fb Tidy up ValueType names in comments.
llvm-svn: 37688
2007-06-21 14:48:26 +00:00
Dan Gohman
1815e9bdb3 Rename TargetLowering::getNumElements and friends to
TargetLowering::getNumRegisters and similar, to avoid confusion with
the actual number of elements for vector types.

llvm-svn: 37687
2007-06-21 14:42:22 +00:00
Evan Cheng
f26fc091ac Xforms:
(add (select cc, 0, c), x) -> (select cc, x, (add, x, c))
(sub x, (select cc, 0, c)) -> (select cc, x, (sub, x, c))

llvm-svn: 37685
2007-06-21 07:39:16 +00:00
Evan Cheng
5e2aabd3ad Avoid if-converting simple block that ends with unconditional branch or fallthrough unless it branches / falls to the 'false' block. Not profitable, may end up increasing code size.
llvm-svn: 37660
2007-06-19 21:45:13 +00:00
Dan Gohman
485cb57eab Pass a SelectionDAG into SDNode::dump everywhere it's used, in prepration
for needing the DAG node to print pre-legalize extended value types, and
to get better debug messages with target-specific nodes.

llvm-svn: 37656
2007-06-19 14:13:56 +00:00
Chris Lattner
653c0ccfbe document and hide two options.
llvm-svn: 37651
2007-06-19 05:47:49 +00:00
Dan Gohman
b60d8a92c9 Replace M_REMATERIALIZIBLE and the newly-added isOtherReMaterializableLoad
with a general target hook to identify rematerializable instructions. Some
instructions are only rematerializable with specific operands, such as loads
from constant pools, while others are always rematerializable. This hook
allows both to be identified as being rematerializable with the same
mechanism.

llvm-svn: 37644
2007-06-19 01:48:05 +00:00
Evan Cheng
12b3002673 Replace TargetInstrInfo::CanBeDuplicated() with a M_NOT_DUPLICABLE bit.
llvm-svn: 37643
2007-06-19 01:26:51 +00:00
Chris Lattner
68f9f9fa3b add isVarArg to CCState
llvm-svn: 37640
2007-06-19 00:11:09 +00:00
Evan Cheng
b752a87db1 Fix some fragile code wrt CFG edge updating.
llvm-svn: 37634
2007-06-18 22:44:57 +00:00
Evan Cheng
978058bcd7 Move CorrectExtraCFGEdges() from BranchFolding.cpp to a MachineBasicBlock method.
llvm-svn: 37633
2007-06-18 22:43:58 +00:00
Chris Lattner
5b93ff84b9 make ComputeTopDownOrdering significantly faster and use less stack space
by making it non-recursive

llvm-svn: 37629
2007-06-18 21:28:10 +00:00
Dan Gohman
46f036ccb0 Make chain dependencies blue, in addition to being dashed.
llvm-svn: 37626
2007-06-18 15:30:16 +00:00
Evan Cheng
b3cefc0824 Properly remove duplicate instructions as result of diamond if-conversion. Other bug fixes.
llvm-svn: 37623
2007-06-18 08:37:25 +00:00
Evan Cheng
1732a41371 Really turn if-converter loose:
1. Consider all possible ifcvt cases at once. No longer restricted to bottom
   up iterative approach.
2. Sort all possible cases based on a cost function. Perform the most profitable
   ones first invalidate others that target the same blocks.
3. Fixed a number of bugs related to block duplication.

llvm-svn: 37613
2007-06-16 09:34:52 +00:00
Tanya Lattner
4c078c1ace Codegen support (stripped out) for the annotate attribute.
llvm-svn: 37608
2007-06-15 22:26:58 +00:00
Evan Cheng
759b3cca3c Not every predicable block can be safely duplicated.
llvm-svn: 37607
2007-06-15 21:18:05 +00:00
Chris Lattner
c08e8abb53 Fix CodeGen/X86/inline-asm-x-scalar.ll:test4, by retaining regclass info
for tied register constraints.

llvm-svn: 37601
2007-06-15 19:11:01 +00:00
Evan Cheng
88c463eb8c MachineInstr::isPredicable() is no longer needed.
llvm-svn: 37599
2007-06-15 19:06:07 +00:00
Duncan Sands
deef6fe78b Workaround for PR1508.
llvm-svn: 37597
2007-06-15 19:04:19 +00:00
Evan Cheng
a6504bc2e0 Extra edges are deleted later if needed.
llvm-svn: 37593
2007-06-15 17:34:48 +00:00
Evan Cheng
f4d3d695b2 Allow small blocks to be duplicated to enable if-conversion.
llvm-svn: 37590
2007-06-15 07:36:12 +00:00
Evan Cheng
6f348e1c75 No really, clear predcessors states.
llvm-svn: 37581
2007-06-14 23:34:09 +00:00
Evan Cheng
b1b1914582 If BB is predicated, invalidate its predecessor(s) which would if-convert it. It needs to be re-analyzed.
llvm-svn: 37580
2007-06-14 23:13:19 +00:00
Dan Gohman
2fd7d26df8 Rename MVT::getVectorBaseType to MVT::getVectorElementType.
llvm-svn: 37579
2007-06-14 22:58:02 +00:00
Evan Cheng
26d68261ae Fix typo.
llvm-svn: 37577
2007-06-14 21:26:08 +00:00
Dan Gohman
35f2b4d716 Add a target hook to allow loads from constant pools to be rematerialized, and an
implementation for x86.

llvm-svn: 37576
2007-06-14 20:50:44 +00:00
Evan Cheng
a2c2479e22 Fix some stupid bugs that have effectively disabled if-conversion.
llvm-svn: 37575
2007-06-14 20:28:52 +00:00
Duncan Sands
51e6294637 Only correctly lower exception handing intrinsics if exception handling is
turned on.  Likewise for scanning of invokes to mark landing pads.

llvm-svn: 37570
2007-06-13 16:53:21 +00:00
Dan Gohman
6415b2548e Introduce new SelectionDAG node opcodes VEXTRACT_SUBVECTOR and
VCONCAT_VECTORS. Use these for CopyToReg and CopyFromReg legalizing in
the case that the full register is to be split into subvectors instead
of scalars. This replaces uses of VBIT_CONVERT to present values as
vector-of-vector types in order to make whole subvectors accessible via
BUILD_VECTOR and EXTRACT_VECTOR_ELT.

This is in preparation for adding extended ValueType values, where
having vector-of-vector types is undesirable.

llvm-svn: 37569
2007-06-13 15:12:02 +00:00
Dan Gohman
3bc1455d49 When creating CopyFromReg nodes, always use legal types. And use the
correct types for the result vector, even though it is currently bitcasted
to a different type immediately.

llvm-svn: 37568
2007-06-13 14:55:16 +00:00
Duncan Sands
32eaa9b30a The fix that was applied for PR1224 stops the compiler
crashing but breaks exception handling.  The problem
described in PR1224 is that invoke is a terminator that
can produce a value.  The value may be needed in other
blocks.  The code that writes to registers values needed
in other blocks runs before terminators are lowered (in
this case invoke) so asserted because the value was not
yet available.  The fix that was applied was to do invoke
lowering earlier, before writing values to registers.

The problem this causes is that the code to copy values
to registers can be output after the invoke call.  If
an exception is raised and control is passed to the
landing pad then this copy-code will never execute.  If
the value is needed in some code path reached via the
landing pad then that code will get something bogus.

So revert the original fix and simply skip invoke values
in the general copying to registers code.  Instead copy
the invoke value to a register in the invoke lowering code.

llvm-svn: 37567
2007-06-13 05:51:31 +00:00
Evan Cheng
d4e9443a78 Typo
llvm-svn: 37566
2007-06-13 00:04:00 +00:00
Evan Cheng
d5aaab210c Now if-converting all 4 variants of triangles.
llvm-svn: 37565
2007-06-12 23:54:05 +00:00
Lauro Ramos Venancio
c9a156f041 Fix a typo in bswap lowering.
llvm-svn: 37544
2007-06-11 23:16:16 +00:00
Evan Cheng
d6740b478b Restructure code to reduce ifcvt compile time cost.
llvm-svn: 37543
2007-06-11 22:26:22 +00:00
Reid Spencer
0c11f4ebd8 Fix the build.
llvm-svn: 37537
2007-06-10 00:19:17 +00:00
Evan Cheng
859dab4bda Don't change CFG during analysis stage. Do so during ifcvt and invalidate predecessors accordingly.
llvm-svn: 37531
2007-06-09 01:03:43 +00:00
Evan Cheng
7996fc5d23 Carefully remove extraneous CFG edges after each ifcvt.
llvm-svn: 37529
2007-06-08 22:01:07 +00:00
Evan Cheng
515e2537d7 Correct transfer predicate information.
llvm-svn: 37524
2007-06-08 19:17:12 +00:00
Evan Cheng
49720a7312 Hidden options to help debugging ifcvt issues.
llvm-svn: 37523
2007-06-08 19:10:51 +00:00
David Greene
6b14050d1e Factor live variable analysis so it does not do register coalescing
simultaneously.  Move that pass to SimpleRegisterCoalescing.

This makes it easier to implement alternative register allocation and
coalescing strategies while maintaining reuse of the existing live
interval analysis.

llvm-svn: 37520
2007-06-08 17:18:56 +00:00
Evan Cheng
a41764f141 Allow more cmp / bcc to be predicated; clean up triangle ifcvt checking code.
llvm-svn: 37518
2007-06-08 09:36:04 +00:00
Duncan Sands
f31e17574a Use more realistically sized vectors. Reserve capacity if we know in advance
how much will be used.

llvm-svn: 37515
2007-06-08 08:59:11 +00:00
Dale Johannesen
74ffb6ffb3 Make throttle a hidden parameter, per review.
llvm-svn: 37511
2007-06-08 01:08:52 +00:00
Dale Johannesen
0903dd4e52 Throttle tail merging; handling blocks with large numbers of predecessors
is too slow.

llvm-svn: 37509
2007-06-08 00:34:27 +00:00
Evan Cheng
2b9e9abed1 Only remove the edge from entry to false if false block is merged.
llvm-svn: 37503
2007-06-07 22:31:28 +00:00
Dale Johannesen
0f3c011fd5 Do not change the size of function arguments. PR 1489.
llvm-svn: 37496
2007-06-07 21:07:15 +00:00
Evan Cheng
4f73706838 ifcvt a triangle: don't merge ifcvt block with rejoin block if it can fall through to it. If merged, the resulting block is not a candidate for iterative ifcvting since it contains both predicated and non-predicated code.
llvm-svn: 37487
2007-06-07 08:13:00 +00:00
Evan Cheng
d440a235a1 Lots of bug fixes. Now finally in a reasonable state.
llvm-svn: 37485
2007-06-07 02:12:15 +00:00
Owen Anderson
b333dd064e Quick patch to fix the build, based on what it appears Evan meant to write.
Evan, please check that this is in fact correct.

llvm-svn: 37471
2007-06-06 16:22:00 +00:00
Duncan Sands
9bef60ea1a Fold the exception actions table harder: if two typeid lists start the
same, only output one copy of the common part.

llvm-svn: 37470
2007-06-06 15:37:31 +00:00
Evan Cheng
aeccfbef8b Lots of bug fixes.
llvm-svn: 37467
2007-06-06 10:16:17 +00:00
Duncan Sands
484bdb927b Additional fix for PR1422: make sure the landing pad label is placed in the
correct machine basic block - do not rely on the eh.exception intrinsic
being in the landing pad: the loop optimizers can move it out.

llvm-svn: 37463
2007-06-06 10:05:18 +00:00
Evan Cheng
4c42a30bad If a unconditional branch is added to branch to the false path during ifcvt, the predicated block cannot be iteratively ifcvted.
llvm-svn: 37456
2007-06-06 02:08:52 +00:00
Evan Cheng
cc7186df2b Minor statistics counting bug.
llvm-svn: 37451
2007-06-06 01:12:44 +00:00
Evan Cheng
2eefb6f4c3 Fix a couple of typos and be smarter about order of blocks when ifcvt a diamond.
llvm-svn: 37449
2007-06-06 00:57:55 +00:00
Evan Cheng
3db28ad9f2 Fix diamond shape ifcvt bugs.
llvm-svn: 37444
2007-06-05 23:46:14 +00:00
Evan Cheng
acf719bf83 ReplaceUsesOfBlockWith() can modify the predecessors list.
llvm-svn: 37441
2007-06-05 22:03:53 +00:00
Evan Cheng
f2a2a5a025 Do not ifcvt if either true / false path is a backedge. Not profitable in almost all cases.
llvm-svn: 37440
2007-06-05 20:38:42 +00:00
Evan Cheng
d495b2f9b9 I had a senior moment.
llvm-svn: 37433
2007-06-05 07:05:25 +00:00
Evan Cheng
a7f7c92dc9 If the predicated block requires an early exit, end the block there and add a unconditional branch to false block. AnalyzeBranch() does not understand early exits.
llvm-svn: 37430
2007-06-05 01:31:40 +00:00
Evan Cheng
7b113514d4 Fix some subtle bugs: bug during succeessor copying; incorrectly updating states of ifcvted blocks.
llvm-svn: 37429
2007-06-05 00:07:37 +00:00
Dale Johannesen
a68662e4a4 Tail merging wasn't working for predecessors of landing pads. PR 1496.
llvm-svn: 37427
2007-06-04 23:52:54 +00:00
Evan Cheng
8728a6c3fd Global ctors / dtors alignment shouldn't be hard-coded at 4. e.g. It could be 8 for 64-bit targets.
llvm-svn: 37421
2007-06-04 20:39:18 +00:00
Evan Cheng
79f53ff66d Forgot to check for if iterator reached the end.
llvm-svn: 37420
2007-06-04 20:33:36 +00:00
Dan Gohman
e6c827b537 Pass the DAG to SDNode::dump to let it do more detailed dumps in some cases.
llvm-svn: 37413
2007-06-04 16:17:33 +00:00
Dan Gohman
b69321ca1d Resolve implicit alignment before computing the FoldingSet information so
that the CSE map always contains explicit alignment information. This allows
more loads to be CSE'd when there is a mix of explicit-alignment loads and
implicit-alignment loads.

Also, in SelectionDAG::FindModifiedNodeSlot, add the operands to the
FoldingSetNodeID before the load/store information instead of after, so
that it matches what is done elsewhere.

llvm-svn: 37411
2007-06-04 15:49:41 +00:00
Evan Cheng
c86e3086da Let IfConverter loose. Allow more aggressive subsumptions; reorder basic blocks to expose more ifcvt opportunities; code clean up and fixes.
llvm-svn: 37409
2007-06-04 06:47:22 +00:00
Evan Cheng
0dbe4d04db Move ReplaceUsesOfBlockWith() out of BranchFolding into a MachineBasicBlock general facility.
llvm-svn: 37408
2007-06-04 06:44:01 +00:00
Duncan Sands
f37bc8207e The semantics of invoke require that we always jump to the unwind block
(landing pad) when an exception unwinds through the call.  This doesn't
quite match the way the dwarf unwinder works: by default it only jumps to
the landing pad if the catch or filter specification matches, and otherwise
it keeps on unwinding.  There are two ways of specifying to the unwinder
that it should "always" (more on why there are quotes here later) jump to
the landing pad: follow the specification by a 0 typeid, or follow it by
the typeid for the NULL typeinfo.  GCC does the first, and this patch makes
LLVM do the same as gcc.  However there is a problem: the unwinder performs
optimizations based on C++ semantics (it only expects destructors to be
run if the 0 typeid fires - known as "cleanups"), meaning it assumes that no
exceptions will be raised and that the raised exception will be reraised
at the end of the cleanup code.  So if someone writes their own LLVM code
using the exception intrinsics they will get a nasty surprise if they don't
follow these rules.  The other possibility of using the typeid corresponding
to NULL (catch-all) causes the unwinder to make no assumptions, so this is
probably what we should use in the long-run.  However since we are still
having trouble getting exception handling working properly, for the moment
it seems best to closely imitate GCC.

llvm-svn: 37399
2007-06-02 17:16:06 +00:00
Duncan Sands
37925d3f39 Integrate exception filter support and exception catch support. This
simplifies the code in DwarfWriter, allows for multiple filters and
makes it trivial to specify filters accompanied by cleanups or catch-all
specifications (see next patch).  What a deal!  Patch blessed by Anton.

llvm-svn: 37398
2007-06-02 16:53:42 +00:00
Zhou Sheng
60714d7922 Make LowerCTPOP() support arbitrary bitwidth integer type.
llvm-svn: 37397
2007-06-02 04:10:33 +00:00
Dale Johannesen
63d49a09aa Fix CorrectExtraCFGEdges to allow for multiple LandingPad targets.
llvm-svn: 37394
2007-06-02 00:08:15 +00:00
Dale Johannesen
071dbb1f87 Fancier algorithm in tail-merge comment implemented, so remove comment.
llvm-svn: 37393
2007-06-01 23:04:28 +00:00
Dale Johannesen
fd7f1ad2f7 Implement smarter algorithm for choosing which blocks to tail-merge.
See test/CodeGen/X86/test-pic-jtbl.ll for a case where it works well;
shaves another 10K off our favorite benchmark.  I was hesitant about
this because of compile speed, but seems to do OK on a bootstrap.

llvm-svn: 37392
2007-06-01 23:02:45 +00:00
Evan Cheng
d7793e4561 Correctly mark early-exit on the false path.
llvm-svn: 37387
2007-06-01 20:29:21 +00:00
Duncan Sands
b1cc3f9881 Since TypeInfos are passed as i8 pointers, a NULL TypeInfo should be passed
as a null i8 pointer not as a 0 i32.

llvm-svn: 37383
2007-06-01 08:18:30 +00:00
Evan Cheng
ce6bae7667 Ifcvt triangle: don't ifcvt 'true' BB if it has other predecessors; don't merge 'false' BB if it has other predecessors.
llvm-svn: 37382
2007-06-01 07:41:07 +00:00
Evan Cheng
8e188afada Remove a bogus check. Even terminators in a ifcvt need to be predicated. Unconditional branches can usually be converted to conditional ones.
llvm-svn: 37380
2007-06-01 00:55:26 +00:00
Evan Cheng
7c081d0d02 Allow multiple ifcvt candidates to share children blocks; add some debugging code.
llvm-svn: 37379
2007-06-01 00:12:12 +00:00
Dale Johannesen
4ca6f07cf0 Arrange for only 1 of multiple branches to landing pad to be kept.
Do not remove empty landing pads (EH table needs to be updated)

llvm-svn: 37375
2007-05-31 21:54:00 +00:00
Evan Cheng
7a6edf8eab Fix a typo.
llvm-svn: 37374
2007-05-31 20:53:33 +00:00
Chris Lattner
72e07238ba Fix the asmprinter so that a globalvalue can specify an explicit alignment
smaller than the preferred alignment, but so that the target can actually
specify a minimum alignment if needed.  This fixes some objc protocol
failures Devang tracked down.

llvm-svn: 37373
2007-05-31 18:57:45 +00:00
Lauro Ramos Venancio
b5186a0078 Fix PR1424.
When a function has FP, the register scavenging spill slot offset already
was calculated.

llvm-svn: 37371
2007-05-31 18:27:58 +00:00
Evan Cheng
c9c6bbd273 Change traversal order to bottom up in preparation for more aggressive if-conversion.
llvm-svn: 37365
2007-05-30 19:49:19 +00:00
Chris Lattner
14bcacb40b Fix CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll, and PR1473.
llvm-svn: 37362
2007-05-30 16:30:06 +00:00
Dale Johannesen
b306dfb861 Changed per review comment.
llvm-svn: 37355
2007-05-30 00:32:01 +00:00
Dale Johannesen
1ba04f7d87 Make stable_sort in tail merging actually be stable (it never was, but didn't
matter until my last change).  Reenable tail merging by default.

llvm-svn: 37354
2007-05-29 23:47:50 +00:00
Evan Cheng
a1300649ba Don't merge in tail block of a diamond if it has more than one predecessors after if-conversion.
llvm-svn: 37353
2007-05-29 23:37:20 +00:00
Evan Cheng
b1ba206831 If there is an empty block between a source and its successor block, it still requires a unconditional branch.
llvm-svn: 37344
2007-05-29 22:31:16 +00:00
Evan Cheng
d8b25a2091 Add missing const qualifiers.
llvm-svn: 37341
2007-05-29 18:35:22 +00:00
Zhou Sheng
3e018c3e3e Correct the logic in LowerPartSet which cleared the bits from 0 to low-1.
llvm-svn: 37331
2007-05-26 03:43:13 +00:00
Chris Lattner
5161203d52 tighten up recursion depth again
llvm-svn: 37330
2007-05-25 02:19:06 +00:00
Evan Cheng
36164f93fd Silly boog.
llvm-svn: 37328
2007-05-25 00:59:01 +00:00
Dale Johannesen
86fb3a132a Blocks that cond-br and uncond-br/fallthrough to same block should have
only one successor.

llvm-svn: 37324
2007-05-24 18:31:55 +00:00
Dale Johannesen
ecaa8a0fb4 Fix for PR1444: do not create two successors to the same block.
Temporarily, this breaks CodeGen/Generic/2006-02-12-InsertLibraryCall.ll
by exposing an unrelated latent problem; working on that.

llvm-svn: 37323
2007-05-24 17:39:32 +00:00
Dan Gohman
2c5d31ee81 Minor comment cleanups.
llvm-svn: 37321
2007-05-24 14:36:04 +00:00
Dan Gohman
1b1932dda5 Add explicit qualification for namespace MVT members.
llvm-svn: 37320
2007-05-24 14:33:05 +00:00
Evan Cheng
439bf58dc2 Fix a typo that caused combiner to create mal-formed pre-indexed store where value store is the same as the base pointer.
llvm-svn: 37318
2007-05-24 02:35:39 +00:00
Dale Johannesen
d0b7bbe261 Two tail merging improvements:
When considering blocks with more than 2 predecessors, merge the block with
the largest number of matching insns, rather than the first block found.
Considering that 1 matching insn is enough to show a win for candidates that
already end with a branch.

llvm-svn: 37315
2007-05-23 21:07:20 +00:00
Anton Korobeynikov
0f184e86ab Mark all calls as "could throw", when exceptions are enabled. Emit necessary LP info too. This fixes PR1439
llvm-svn: 37311
2007-05-23 11:08:31 +00:00
Chris Lattner
d540c6429f prevent exponential recursion in isNegatibleForFree
llvm-svn: 37310
2007-05-23 07:35:22 +00:00
Evan Cheng
3f44824179 Preliminary iterative if-conversion support.
llvm-svn: 37309
2007-05-23 07:23:16 +00:00
Dale Johannesen
738f94210c name change requested by review of previous patch
llvm-svn: 37289
2007-05-22 18:31:04 +00:00
Owen Anderson
fd5693fcc4 Silence a warning.
llvm-svn: 37288
2007-05-22 18:13:40 +00:00
Dale Johannesen
fe0fe14411 Make tail merging the default, except on powerPC. There was no prior art
for a target-dependent default with a command-line override; this way
should be generally usable.

llvm-svn: 37285
2007-05-22 17:14:46 +00:00
Evan Cheng
d395b14837 If-convert early exit blocks (returns, etc.); bug fixes, etc.
llvm-svn: 37270
2007-05-21 22:22:58 +00:00
Duncan Sands
05d340bbd1 Only emit one entry in the exception action table for each action, even if
it occurs for multiple landing pads.

llvm-svn: 37267
2007-05-21 18:50:28 +00:00
Chris Lattner
27b469b945 same patch as the previous one, but the symmetric case
llvm-svn: 37249
2007-05-19 00:46:51 +00:00
Chris Lattner
2430b7c4aa Disable the (A == (B-A)) -> 2*A == B xform when the sub has multiple uses (in
this case, the xform introduces an extra operation).  This compiles
PowerPC/compare-duplicate.ll into:

_test:
        subf r2, r3, r4
        cmplw cr0, r2, r3
        bne cr0, LBB1_2 ;F

instead of:

_test:
        slwi r2, r3, 1
        subf r3, r3, r4
        cmplw cr0, r4, r2
        bne cr0, LBB1_2 ;F

This is target independent of course.

llvm-svn: 37246
2007-05-19 00:43:44 +00:00
Evan Cheng
ca7bc898aa Clean up.
llvm-svn: 37237
2007-05-18 19:32:08 +00:00
Evan Cheng
ad9ce3c5b2 Change to depth-first traversal.
llvm-svn: 37236
2007-05-18 19:26:33 +00:00
Dale Johannesen
09b2912ab7 Document an inefficiency in tail merging.
llvm-svn: 37235
2007-05-18 18:46:40 +00:00
Dan Gohman
b593ad9fb0 Qualify calls to getTypeForValueType with MVT:: too.
llvm-svn: 37233
2007-05-18 18:41:29 +00:00
Evan Cheng
1ed1741260 Some restructuring in preparation for most aggressive if-conversion.
llvm-svn: 37231
2007-05-18 18:14:37 +00:00
Dan Gohman
d6a33914fb Qualify several calls to functions in the MVT namespace, for consistency.
llvm-svn: 37230
2007-05-18 17:52:13 +00:00
Evan Cheng
234f07808b Watch out for blocks that end with a return.
llvm-svn: 37227
2007-05-18 17:06:53 +00:00
Evan Cheng
40eecb3d06 If true / false blocks fallthrough before ifcvt, add unconditional branches to ifcvt'd block.
llvm-svn: 37200
2007-05-18 01:55:58 +00:00
Dale Johannesen
ca37006ffb Remove some unneeded branches. (spotted by Evan, thanks)
llvm-svn: 37198
2007-05-18 01:28:58 +00:00
Evan Cheng
c6aa69557a Make use of target specific block size limits; bug fixes.
llvm-svn: 37195
2007-05-18 00:20:58 +00:00
Evan Cheng
b4cc6606d5 Move isSuccessor() offline, change it to use std::find.
llvm-svn: 37190
2007-05-17 23:58:53 +00:00
Chris Lattner
910abfbfd1 disable MaskedValueIsZero, ComputeMaskedBits, and SimplifyDemandedBits for
i128 integers.  The 64-bit masks are not wide enough to represent the results.
These should be converted to APInt someday.

llvm-svn: 37169
2007-05-17 18:19:23 +00:00
Chris Lattner
d441344214 add expand support for ADDC/SUBC/ADDE/SUBE so we can codegen 128-bit add/sub on 32-bit (or less) targets
llvm-svn: 37168
2007-05-17 18:15:41 +00:00
Evan Cheng
3163b77d5e Add target hook to specify block size limit for if-conversion.
llvm-svn: 37134
2007-05-16 23:45:53 +00:00
Dale Johannesen
cc99a6fc32 Don't fold bitconvert(load) for preinc/postdec loads. Likewise stores.
llvm-svn: 37130
2007-05-16 22:45:30 +00:00
Evan Cheng
ab88e91c81 isBlockPredicable() always ignore terminal instructions; add comments.
llvm-svn: 37126
2007-05-16 21:54:37 +00:00
Evan Cheng
6f761adecb Rename M_PREDICATED to M_PREDICABLE; Moved isPredicable() to MachineInstr.
llvm-svn: 37121
2007-05-16 20:56:08 +00:00
Duncan Sands
3296999dbb Output exception call-sites in address order, as required by the unwinding
runtime.

llvm-svn: 37104
2007-05-16 12:12:23 +00:00
Chris Lattner
a18b36cf45 Use a ptr set instead of a linear search to unique TokenFactor operands.
This fixes PR1423

llvm-svn: 37102
2007-05-16 06:37:59 +00:00
Evan Cheng
3fb34a4fdd Devang points out that we need an assertion here.
llvm-svn: 37097
2007-05-16 05:11:10 +00:00
Evan Cheng
a781c7788a Bug fix: should check ABI alignment, not pref. alignment.
llvm-svn: 37094
2007-05-16 02:04:50 +00:00
Evan Cheng
aafca4d4a2 Initial commit of (very basic) if converter.
llvm-svn: 37092
2007-05-16 02:00:57 +00:00
Dale Johannesen
78ae2e1acb Remove extra CFG edges before doing these passes; it makes them happier.
llvm-svn: 37089
2007-05-15 21:19:17 +00:00
Lauro Ramos Venancio
251ea5ab65 Fix an infinite recursion in GetNegatedExpression.
llvm-svn: 37086
2007-05-15 17:05:43 +00:00
Duncan Sands
eddbb07561 The index into the actions table is a ULEB128 not a SLEB128.
llvm-svn: 37084
2007-05-15 13:54:14 +00:00
Reid Spencer
b1ac506546 Un-brain-dead-ify the lowering of part set for the reverse case.
llvm-svn: 37071
2007-05-15 02:26:52 +00:00
Chris Lattner
ba648e0d45 Fix some subtle issues handling immediate values. This fixes
test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll

llvm-svn: 37069
2007-05-15 01:33:58 +00:00
Evan Cheng
eea85a767e Added getNumExplicitOperands and findFirstPredOperand.
llvm-svn: 37064
2007-05-15 01:26:09 +00:00
Chris Lattner
eba1b74df3 implement a simple fneg optimization/propagation thing. This compiles:
CodeGen/PowerPC/fneg.ll into:

_t4:
        fmul f0, f3, f4
        fmadd f1, f1, f2, f0
        blr

instead of:

_t4:
        fneg f0, f3
        fmul f0, f0, f4
        fmsub f1, f1, f2, f0
        blr

llvm-svn: 37054
2007-05-14 22:04:50 +00:00
Evan Cheng
9645be8cf5 Only worry about intervening kill if there are more than one live ranges in the interval.
llvm-svn: 37052
2007-05-14 21:23:51 +00:00
Evan Cheng
e9e48bcf28 Fix for PR1406:
v1 =
r2 = move v1
   = op r2<kill>
...
r2 = move v1
   = op r2<kill>

Clear the first r2 kill if v1 and r2 are joined.

llvm-svn: 37050
2007-05-14 21:10:05 +00:00
Evan Cheng
bb876d7323 When marking a register as being implicitly defined, make sure to clear its partial use info as well.
llvm-svn: 37046
2007-05-14 20:39:18 +00:00