Commit Graph

33339 Commits

Author SHA1 Message Date
Dan Gohman a866514528 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 2e84e3f7b7 Make minor adjustments to whitespace and comments to reduce differences
between SSE1 instructions and their respective SSE2 analogues.

llvm-svn: 37718
2007-06-25 15:44:19 +00:00
Dan Gohman 33209bd6b8 Fix loadv2i32 to be loadv4i32, though it isn't actually used anywhere yet.
llvm-svn: 37717
2007-06-25 15:19:03 +00:00
Dan Gohman e33c4b739b Say AT&T instead of Intel in the comments for AT&T support.
llvm-svn: 37716
2007-06-25 15:11:25 +00:00
Anton Korobeynikov ec9038bc69 Provide hook for alloca on VCPP. Patch by Scott Graham
llvm-svn: 37715
2007-06-25 07:12:14 +00:00
Owen Anderson 191eb06352 1) Fix an issue with non-deterministic iteration order in phi_translate
2) Remove some maximal-set computing code that is no longer used.
3) Use a post-order CFG traversal to compute ANTIC_IN instead of a postdom traversal.
This causes the ANTIC_IN calculation to converge much faster.  Thanks to Daniel Berlin for suggesting this.

With this patch, the time to optimize 403.gcc decreased from 17.5s to 7.5s, and Anton's huge
testcase decreased from 62 minutes to 38 seconds.

llvm-svn: 37714
2007-06-25 05:41:12 +00:00
Nick Lewycky 8735f44104 Fix value ranges.
llvm-svn: 37713
2007-06-24 20:14:22 +00:00
Owen Anderson 7fb6da8e4d Fix a silly mistake that was causing failures.
llvm-svn: 37712
2007-06-24 08:42:24 +00:00
Owen Anderson bfd1673366 Rename variables to expose the fact that this test is failing.
llvm-svn: 37711
2007-06-24 08:17:41 +00:00
Nick Lewycky 0f986fdbfa Remove tabs.
llvm-svn: 37710
2007-06-24 04:40:16 +00:00
Nick Lewycky 26e25d340e Remove use of ETForest. Also cleaned up issues around unreachable basic
blocks, and optimizing within one basic block.

llvm-svn: 37709
2007-06-24 04:36:20 +00:00
Owen Anderson 49409f6501 Rework topo_sort so eliminate some behavior that scaled terribly. This reduces the time to optimize 403.gcc from 18.2s to 17.5s,
and has an even larger effect on larger testcases.

llvm-svn: 37708
2007-06-22 21:31:16 +00:00
Owen Anderson 21a1131565 Perform fewer set insertions while calculating ANTIC_IN. This reduces the amount of time to optimize 403.gcc from 21.9s to 18.2s.
llvm-svn: 37707
2007-06-22 18:27:04 +00:00
Owen Anderson 92c7b22e1a Remove some code that I was using for collecting performance information that should not have been committed.
llvm-svn: 37706
2007-06-22 17:04:40 +00:00
Owen Anderson 0c550df9d2 Fix the build.
llvm-svn: 37705
2007-06-22 16:59:54 +00:00
Dan Gohman 309d3d51b3 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 81a752aa95 check in the BigBlock local register allocator
llvm-svn: 37703
2007-06-22 08:27:12 +00:00
Owen Anderson f6e21871ad Avoid excessive calls to find_leader when calculating AVAIL_OUT. This reduces the time to optimize 403.gcc from 23.5s to 21.9s.
llvm-svn: 37702
2007-06-22 03:14:03 +00:00
Evan Cheng e3c4419953 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
Dale Johannesen 485531ea9b Quote complex names for Darwin X86 and ARM.
llvm-svn: 37700
2007-06-22 00:54:56 +00:00
Owen Anderson d50a29d613 Reserve space in vectors before topologically sorting into them. This improves the time to optimize 403.gcc from 28s to 23.5s.
llvm-svn: 37699
2007-06-22 00:43:22 +00:00
Owen Anderson 28a2d449fa Make a bunch of optimizations for compile time to GVNPRE, including smarter set unions, deferring blocks rather than computing maximal sets, and smarter use of sets. With these enhancements, the time to optimize 273.perlbmk goes from 5.3s to 2.7s.
llvm-svn: 37698
2007-06-22 00:20:30 +00:00
Owen Anderson 6d7b6f1ab8 Fix a bug in SmallPtrSet that was causing GVNPRE to enter an infinite loop.
llvm-svn: 37697
2007-06-22 00:11:18 +00:00
Chris Lattner 836e8f3f39 Two changes:
1. Make SmallPtrSet::erase faster in the small case by replacing a memmove
    with a pointer copy.
 2. Fix a bug where the null terminator at the end of the array in the small
    case was not copied

llvm-svn: 37696
2007-06-21 23:23:32 +00:00
Devang Patel 703de8fea8 CallGraphSCCPass manager may require other passes.
Use schedulePass() to accomodate these requirement instead of directly
assigning a manager to new CallGraph PassManager.

llvm-svn: 37695
2007-06-21 22:29:02 +00:00
Owen Anderson 7c3a5513f7 Have internal df_iterator's use SmallPtrSet instead of std::set. This provides compile time speedups to any pass using df_iterator.
llvm-svn: 37694
2007-06-21 21:25:36 +00:00
Evan Cheng e15ea75168 Fix tests.
llvm-svn: 37693
2007-06-21 18:22:42 +00:00
Chris Lattner fb032b176b Significantly improve the documentation of the instcombine divide/compare
transformation.  Also, keep track of which end of the integer interval overflows
occur on.  This fixes Transforms/InstCombine/2007-06-21-DivCompareMiscomp.ll
and rdar://5278853, a miscompilation of perl.

llvm-svn: 37692
2007-06-21 18:11:19 +00:00
Chris Lattner 181ebd6f88 new testcase miscompiled by instcombine, reduced from perl
llvm-svn: 37691
2007-06-21 18:09:25 +00:00
Owen Anderson 2ff912bf33 Change lots of sets from std::set to SmallPtrSet. This reduces the time required to optimize 253.perlbmk from 10.9s to 5.3s.
llvm-svn: 37690
2007-06-21 17:57:53 +00:00
Devang Patel d5258a23a5 Move code to update dominator information after basic block is split
from LoopSimplify.cpp to Dominator.cpp

llvm-svn: 37689
2007-06-21 17:23:45 +00:00
Dan Gohman 8e8d34b220 Tidy up ValueType names in comments.
llvm-svn: 37688
2007-06-21 14:48:26 +00:00
Dan Gohman 04deef3a49 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 5fcb5a5c74 New tests.
llvm-svn: 37686
2007-06-21 07:40:00 +00:00
Evan Cheng aa5f5d960d 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
Owen Anderson 27876a3ff9 Eliminate a redundant check. This speeds up optimization of 253.perlbmk from 13.5 seconds to 10.9 seconds.
llvm-svn: 37683
2007-06-21 01:59:05 +00:00
Owen Anderson fd5683ad7a Comment-ize the functions in GVNPRE.
llvm-svn: 37681
2007-06-21 00:19:05 +00:00
Chris Lattner 3bbec59e8b refactor a bunch of code out of visitICmpInstWithInstAndIntCst into its own
routine.

llvm-svn: 37679
2007-06-20 23:46:26 +00:00
Owen Anderson 06c1e585c9 Split runOnFunction into many smaller functions. This make it easier to get accurate performance analysis of GVNPRE.
llvm-svn: 37678
2007-06-20 22:10:02 +00:00
Tanya Lattner 872bf1bdc3 Modify deleting global variable with an even easier way.
llvm-svn: 37676
2007-06-20 20:46:37 +00:00
Devang Patel eeff910244 Update AnalysisGroup documentation to document restriction that allows
only one ImmutablePass in a group.

llvm-svn: 37675
2007-06-20 18:51:14 +00:00
Tanya Lattner 1a08cf311e Add blurb on deleting global variables.
llvm-svn: 37674
2007-06-20 18:33:15 +00:00
Owen Anderson b0714bb7bb Make GVNPRE accurate report whether it modified the function or not.
llvm-svn: 37673
2007-06-20 18:30:20 +00:00
Evan Cheng 85010166a6 Added some if-conversion tests.
llvm-svn: 37672
2007-06-20 18:26:15 +00:00
Owen Anderson 7b0fb44ca9 Get rid of an unneeded helper function.
llvm-svn: 37670
2007-06-20 00:43:33 +00:00
Evan Cheng 77d61e6f6d Be more conservative of duplicating blocks.
llvm-svn: 37669
2007-06-19 23:55:02 +00:00
Owen Anderson 1ad2c10215 Use a DenseMap instead of an std::map for the value numbering. This reduces the time to optimize lencod on a PPC Debug build from ~300s to ~140s.
llvm-svn: 37668
2007-06-19 23:23:54 +00:00
Owen Anderson 2320d430bd Make dependsOnInvoke much more specific in what it tests, which in turn make it much faster to run. This reduces the time to optimize lencondwith a debug build on PPC from ~450s to ~300s.
llvm-svn: 37667
2007-06-19 23:07:16 +00:00
Tanya Lattner c655839d71 Moved Inliner.h to include/llvm/Transforms/IPO/InlinerPass.h
llvm-svn: 37666
2007-06-19 22:31:52 +00:00
Tanya Lattner ab11b1c702 Inliner pass header file was moved.
llvm-svn: 37665
2007-06-19 22:29:50 +00:00
Tanya Lattner 39be2d896d Move inliner pass header file.
llvm-svn: 37664
2007-06-19 22:29:02 +00:00
Evan Cheng a955c02c9b 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
Evan Cheng c3c949b473 Allow predicated immediate ARM to ARM calls.
llvm-svn: 37659
2007-06-19 21:05:09 +00:00
Chris Lattner cd74c3ea7c Fix pr1448
llvm-svn: 37658
2007-06-19 16:46:48 +00:00
Dan Gohman 32f53bbd85 Rename ScalarEvolution::deleteInstructionFromRecords to
deleteValueFromRecords and loosen the types to all it to accept
Value* instead of just Instruction*, since this is what
ScalarEvolution uses internally anyway. This allows more flexibility
for future uses.

llvm-svn: 37657
2007-06-19 14:28:31 +00:00
Dan Gohman a7644dd9b9 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
Owen Anderson 1370faf889 Handle constants in phi nodes properly. This fixes test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll
llvm-svn: 37655
2007-06-19 07:35:36 +00:00
Chris Lattner b4777f087a silence warning when assertions are disabled.
llvm-svn: 37654
2007-06-19 06:40:46 +00:00
Owen Anderson 0b7c12be82 Testcase for instances where a constant only occurs as an operand to a phi node.
llvm-svn: 37653
2007-06-19 05:55:01 +00:00
Chris Lattner 5551482f16 don't use binutils 2.17
llvm-svn: 37652
2007-06-19 05:52:36 +00:00
Chris Lattner 37228f6ce5 document and hide two options.
llvm-svn: 37651
2007-06-19 05:47:49 +00:00
Chris Lattner 7936d91f70 describe an argument, hide it.
llvm-svn: 37650
2007-06-19 05:46:06 +00:00
Chris Lattner 09a33a4f64 silence a bogus warning Duraid ran into.
llvm-svn: 37649
2007-06-19 05:43:49 +00:00
Owen Anderson 3552c9e845 Add a new testcase for memory corruption issues.
llvm-svn: 37648
2007-06-19 05:41:22 +00:00
Owen Anderson 91c54950b3 Be careful to erase values from all of the appropriate sets when they're not needed anymore. This fixes a few more memory-related issues.
llvm-svn: 37647
2007-06-19 05:37:32 +00:00
Owen Anderson b9cbaed623 Remember to clear the maximal sets between functions.
Thanks to Nicholas for valgrinding this.

llvm-svn: 37646
2007-06-19 04:32:55 +00:00
Owen Anderson b56fba0c5a Refactor GVNPRE to use a much smart method of uniquing value sets, and centralize a lot of the value numbering information. No functionality change.
llvm-svn: 37645
2007-06-19 03:31:41 +00:00
Dan Gohman 9e82064924 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 a7ca624028 Replace TargetInstrInfo::CanBeDuplicated() with a M_NOT_DUPLICABLE bit.
llvm-svn: 37643
2007-06-19 01:26:51 +00:00
Evan Cheng 7d5696860b Replace CanBeDuplicated() with a M_NOT_DUPLICABLE bit.
llvm-svn: 37642
2007-06-19 01:21:41 +00:00
Chris Lattner 944200be45 If a function is vararg, never pass inreg arguments in registers. Thanks to
Anton for half of this patch.

llvm-svn: 37641
2007-06-19 00:13:10 +00:00
Chris Lattner 26be02febf add isVarArg to CCState
llvm-svn: 37640
2007-06-19 00:11:09 +00:00
Chris Lattner f401b2b4c3 add isvararg tracking to CCState
llvm-svn: 37639
2007-06-19 00:10:25 +00:00
Chris Lattner f2b72bf921 testcase for PR1513
llvm-svn: 37638
2007-06-19 00:08:42 +00:00
Evan Cheng 6ba3e8b27d New test case: identity operation of RHS / LHS of a VECTOR_SHUFFLE.
llvm-svn: 37637
2007-06-19 00:06:08 +00:00
Evan Cheng cea02ffd05 Look for VECTOR_SHUFFLE that's identity operation on either LHS or RHS. This can happen before DAGCombiner catches it.
llvm-svn: 37636
2007-06-19 00:02:56 +00:00
Tanya Lattner bed1d4d877 Update docs for llvm.var.annotation intrinsic.
llvm-svn: 37635
2007-06-18 23:42:37 +00:00
Evan Cheng 0598b2d5eb Fix some fragile code wrt CFG edge updating.
llvm-svn: 37634
2007-06-18 22:44:57 +00:00
Evan Cheng 2afd702c20 Move CorrectExtraCFGEdges() from BranchFolding.cpp to a MachineBasicBlock method.
llvm-svn: 37633
2007-06-18 22:43:58 +00:00
Tanya Lattner aab2200844 Modify annotate intrinsic to take 2 additional args: file and line number.
Fix up Annotate attribute test case.
Fix DebugFilename.c test case to look for right file name.

llvm-svn: 37632
2007-06-18 22:23:39 +00:00
Chris Lattner b4f2d8a056 add helper
llvm-svn: 37631
2007-06-18 21:50:49 +00:00
Devang Patel d56e4919df Fix quotes in debug messages.
llvm-svn: 37630
2007-06-18 21:32:29 +00:00
Chris Lattner e31adc8ab9 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 eed125f315 In SCEVAddExpr::get, skip over any cast operands before looking for nested
add operands after constant operands. The recent change to recognize
sign-extend expressions caused this to be exposed more often.

llvm-svn: 37628
2007-06-18 19:30:09 +00:00
Anton Korobeynikov 02b0997b28 Make BasicAliasAnalysis correctly register itself. Patch by Devang
llvm-svn: 37627
2007-06-18 17:13:29 +00:00
Dan Gohman 8c7333266c Make chain dependencies blue, in addition to being dashed.
llvm-svn: 37626
2007-06-18 15:30:16 +00:00
Dan Gohman c98815ba32 Define the pushq instruction for x86-64.
llvm-svn: 37625
2007-06-18 14:12:56 +00:00
Dan Gohman 03a7e5368a Add keyword explicit.
llvm-svn: 37624
2007-06-18 14:11:31 +00:00
Evan Cheng 51eb2c3bbe Properly remove duplicate instructions as result of diamond if-conversion. Other bug fixes.
llvm-svn: 37623
2007-06-18 08:37:25 +00:00
Owen Anderson dd998e1913 Cache the results of dependsOnInvoke()
llvm-svn: 37622
2007-06-18 04:42:29 +00:00
Owen Anderson f1c04e1ddb Fix indentation.
llvm-svn: 37621
2007-06-18 04:31:21 +00:00
Owen Anderson b364b413af Don't perform an expensive check if it's not necessary.
llvm-svn: 37620
2007-06-18 04:30:44 +00:00
Chris Lattner 5f232faf8c ensure we don't regress on these tests. We generate aweful code in x86-32 for
these though.

llvm-svn: 37619
2007-06-17 23:29:57 +00:00
Bill Wendling ec6be07c22 XFAILing until I can fix properly.
llvm-svn: 37618
2007-06-16 23:57:51 +00:00
Bill Wendling 094a4e813a Revert patch. It regresses:
define double @test2(i64 %A) {
   %B = bitcast i64 %A to double
   ret double %B
}

$ llvm-as < t.ll | llc -march=x86-64

before:

         .align  4
         .globl  _test2
_test2:
         movd %rdi, %xmm0
         ret

after:

_test2:
         subq $8, %rsp
         movq %rdi, (%rsp)
         movsd (%rsp), %xmm0
         addq $8, %rsp
         ret

llvm-svn: 37617
2007-06-16 23:57:15 +00:00
Reid Spencer 1aae9e8e12 Fix PR1517:
Use SmallPtrSet instead of std::vector to eliminate duplicate uses in a
function generated with -gen-function. This prevents the output from having
multiple duplicate declarations of constants and gvals.

llvm-svn: 37616
2007-06-16 20:48:27 +00:00
Reid Spencer 83c15f8a1b Fix PR1516:
When printing the uses of a function (-gen-function only), make sure to
include the constants referenced by intializers of global variables.

llvm-svn: 37615
2007-06-16 20:33:24 +00:00
Nick Lewycky 7aa84fe7c5 Call the correct function name. Patch from Stephane Letz.
llvm-svn: 37614
2007-06-16 16:17:35 +00:00
Evan Cheng 3a51c854d0 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
Bill Wendling c8f293b4f9 Testcase for MMX int to MMX register failure.
llvm-svn: 37612
2007-06-16 06:31:47 +00:00
Bill Wendling cd9673e565 Fix a failure to bit_convert from integer GPR to MMX register.
llvm-svn: 37611
2007-06-16 06:17:31 +00:00
Owen Anderson 658f2c4881 Fix test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll by ignoring all instructions that depend on invokes.
llvm-svn: 37610
2007-06-16 00:26:54 +00:00
Owen Anderson d2028a549f Testcase where GVNPRE was getting confused by invoke instructions.
llvm-svn: 37609
2007-06-16 00:25:10 +00:00
Tanya Lattner e199f97fa8 Codegen support (stripped out) for the annotate attribute.
llvm-svn: 37608
2007-06-15 22:26:58 +00:00
Evan Cheng 23402fcaef Not every predicable block can be safely duplicated.
llvm-svn: 37607
2007-06-15 21:18:05 +00:00
Evan Cheng 36b1f5476e Instructions with unique labels or embedded jumptables cannot be duplicated during ifcvt.
llvm-svn: 37606
2007-06-15 21:15:00 +00:00
Evan Cheng 297d43be00 Added CanBeDuplicated(). It returns true if an instruction can be safely duplicated (e.g. during ifcvt).
llvm-svn: 37605
2007-06-15 21:13:54 +00:00
Tanya Lattner a575a7dfda test case for annotate attribute
llvm-svn: 37604
2007-06-15 20:52:47 +00:00
Tanya Lattner cb1b96047d Add local var annotation intrinsic.
llvm-svn: 37603
2007-06-15 20:50:54 +00:00
Dan Gohman 00cb117b07 Fold a binary operator with constant operands when expanding code for a SCEV.
llvm-svn: 37602
2007-06-15 19:21:55 +00:00
Chris Lattner f852e339b6 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
Chris Lattner 2d7f447a7a make this test harder, include a tied register.
llvm-svn: 37600
2007-06-15 19:09:53 +00:00
Evan Cheng 234a90e83e MachineInstr::isPredicable() is no longer needed.
llvm-svn: 37599
2007-06-15 19:06:07 +00:00
Evan Cheng 32312ad370 No longer needed.
llvm-svn: 37598
2007-06-15 19:05:13 +00:00
Duncan Sands 92bf2c628c Workaround for PR1508.
llvm-svn: 37597
2007-06-15 19:04:19 +00:00
Dan Gohman 203a035251 Use SCEVConstant::get instead of SCEVUnknown::get to create an
integer constant SCEV.

llvm-svn: 37596
2007-06-15 18:00:55 +00:00
Owen Anderson acaed06827 Fix test/Transforms/GVNPRE/2007-06-15-Looping.ll
llvm-svn: 37595
2007-06-15 17:55:15 +00:00
Owen Anderson ad9743225e Add a testcase where GVNPRE what getting confused by a loop.
llvm-svn: 37594
2007-06-15 17:54:05 +00:00
Evan Cheng cd5f5e3ecd Extra edges are deleted later if needed.
llvm-svn: 37593
2007-06-15 17:34:48 +00:00
Duncan Sands 8e21e69efb Use "ignore" rather than grep tricks.
llvm-svn: 37592
2007-06-15 17:13:53 +00:00
Dan Gohman cb9e09ad57 Add a SCEV class and supporting code for sign-extend expressions.
This created an ambiguity for expandInTy to decide when to use
sign-extension or zero-extension, but it turns out that most of its callers
don't actually need a type conversion, now that LLVM types don't have
explicit signedness. Drop expandInTy in favor of plain expand, and change
the few places that actually need a type conversion to do it themselves.

llvm-svn: 37591
2007-06-15 14:38:12 +00:00
Evan Cheng 92fb5453c3 Allow small blocks to be duplicated to enable if-conversion.
llvm-svn: 37590
2007-06-15 07:36:12 +00:00
Chris Lattner 373389260f Generalize many transforms to work on ~ of vectors in addition to ~ of
integer ops.  This implements Transforms/InstCombine/and-or-not.ll
test3/test4, and finishes off PR1510

llvm-svn: 37589
2007-06-15 06:23:19 +00:00
Chris Lattner 9923af42cf add vector versions of this test
llvm-svn: 37588
2007-06-15 06:22:32 +00:00
Chris Lattner ce4d2dd644 m_not should match vector not
llvm-svn: 37587
2007-06-15 06:13:47 +00:00
Chris Lattner 72e3958003 add a Constant::getAllOnesValue helper function, which works on integers
AND vectors.

llvm-svn: 37586
2007-06-15 06:10:53 +00:00
Chris Lattner 1edec381a5 Enhance BinaryOperator::isNot to support vector not.
llvm-svn: 37585
2007-06-15 06:04:24 +00:00
Chris Lattner 481e28b1f5 Implement two xforms:
1. ~(~X | Y) === (X & ~Y)
2. (A|B) & ~(A&B) -> A^B

This allows us to transform  ~(~(a|b) | (a&b)) -> a^b.

This implements PR1510 for scalar values.

llvm-svn: 37584
2007-06-15 05:58:24 +00:00
Chris Lattner a8de4cccd9 testcase for PR1510
llvm-svn: 37583
2007-06-15 05:57:20 +00:00
Chris Lattner f14e5175ed delete some obviously dead vector operations, which deletes a few thousand
operations from Duraids example.

llvm-svn: 37582
2007-06-15 05:26:55 +00:00
Evan Cheng add977670f No really, clear predcessors states.
llvm-svn: 37581
2007-06-14 23:34:09 +00:00
Evan Cheng 9fc56c079d 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 5c4413120f Rename MVT::getVectorBaseType to MVT::getVectorElementType.
llvm-svn: 37579
2007-06-14 22:58:02 +00:00
Dale Johannesen 616627b002 Do not treat FP_REG_KILL as terminator in branch analysis (X86).
llvm-svn: 37578
2007-06-14 22:03:45 +00:00
Evan Cheng e08f0eefa6 Fix typo.
llvm-svn: 37577
2007-06-14 21:26:08 +00:00
Dan Gohman 4a4a8eb00e 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 1e6f08b2a2 Fix some stupid bugs that have effectively disabled if-conversion.
llvm-svn: 37575
2007-06-14 20:28:52 +00:00
Dan Gohman 3a8e2a8b2f Eliminate some redundant newlines in asm output.
llvm-svn: 37574
2007-06-14 15:00:27 +00:00
Duncan Sands 40f775bf67 Fix typos.
llvm-svn: 37573
2007-06-14 11:27:07 +00:00
Christopher Lamb f274efef9f Add support to tablegen for specifying subregister classes on a per register class basis.
llvm-svn: 37572
2007-06-13 22:20:15 +00:00
Dale Johannesen c68554683d Handle blocks with 2 unconditional branches in AnalyzeBranch.
llvm-svn: 37571
2007-06-13 17:59:52 +00:00
Duncan Sands 7413736a7e 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 26455c4ae0 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 cbd51c8b60 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 97f7236e70 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 cbaaff58bf Typo
llvm-svn: 37566
2007-06-13 00:04:00 +00:00
Evan Cheng 9acfa7b063 Now if-converting all 4 variants of triangles.
llvm-svn: 37565
2007-06-12 23:54:05 +00:00
Owen Anderson 4036ad485f Fix test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll
llvm-svn: 37564
2007-06-12 22:43:57 +00:00
Owen Anderson b1c82db828 Add a test where phi translation was producing a null result.
llvm-svn: 37563
2007-06-12 22:42:35 +00:00
Devang Patel 149a7616dc isReachableFromEntry() is not suitable for post dominator.
llvm-svn: 37562
2007-06-12 17:50:25 +00:00
Devang Patel 47419ee142 Remove redundant check.
llvm-svn: 37561
2007-06-12 17:35:20 +00:00
Devang Patel 2f9d2bcb19 Protect updateDFSNumbers()
llvm-svn: 37560
2007-06-12 17:30:56 +00:00
Devang Patel dcf0c03ff7 Check A dominates B and vise versa first while searching for nearest
common dominator.

llvm-svn: 37559
2007-06-12 17:17:57 +00:00
Chris Lattner 2150cde0e4 one final bugfix
llvm-svn: 37558
2007-06-12 17:01:15 +00:00
Chris Lattner 2b0bf4fc3b modernize example
llvm-svn: 37557
2007-06-12 17:00:26 +00:00
Owen Anderson 4276984012 Refactor some code, and fix test/Transforms/GVNPRE/2007-06-12-NoExit.ll by being more careful when using
post-dominator information.

llvm-svn: 37556
2007-06-12 16:57:50 +00:00
Owen Anderson 6d1df658c0 Testcase where GVNPRE crashes on functions with no exit nodes.
llvm-svn: 37555
2007-06-12 16:56:00 +00:00
Dale Johannesen edfec0b515 Sink CmpInst's to their uses to reduce register pressure.
llvm-svn: 37554
2007-06-12 16:50:17 +00:00
Devang Patel e87776a7cb Make DFS number manipulation methods private.
llvm-svn: 37553
2007-06-12 05:49:31 +00:00
Owen Anderson 3c0c1376ea Make the run line for this test correct. Thanks to Chris for spotting it.
llvm-svn: 37552
2007-06-12 04:40:48 +00:00
Devang Patel a6ff5bf9ba Break DominatorTree from ETNode.
Remove unused PostETForest.

llvm-svn: 37551
2007-06-12 00:54:38 +00:00
Owen Anderson a75dd4dc56 Fix a few more bugs, including an instance of walking in reverse topological rather than topological order. This
fixes a testcase extracted from llvm-test.

llvm-svn: 37550
2007-06-12 00:50:47 +00:00
Owen Anderson ee35eab57f Add a GVN-PRE basic regression test.
llvm-svn: 37549
2007-06-12 00:49:33 +00:00
Devang Patel d324360352 Use SmallPtrSet instaed of std::set
llvm-svn: 37548
2007-06-12 00:40:51 +00:00
Devang Patel 9576fac800 Check immediate dominators first while searching for nearset common dominator.
Fix 80 col violations.

llvm-svn: 37547
2007-06-12 00:35:38 +00:00
Devang Patel 88ea2dbc68 Maintain DFS number in DomTreeNode itself.
This means now ETNodes are not useful anymore.

llvm-svn: 37546
2007-06-12 00:14:41 +00:00
Devang Patel 78b9c68164 Add and use DominatorTreeBase::findNearestCommonDominator().
llvm-svn: 37545
2007-06-11 23:31:22 +00:00
Lauro Ramos Venancio 4c2f003971 Fix a typo in bswap lowering.
llvm-svn: 37544
2007-06-11 23:16:16 +00:00
Evan Cheng 4dd31a7b1b Restructure code to reduce ifcvt compile time cost.
llvm-svn: 37543
2007-06-11 22:26:22 +00:00
Devang Patel 536ac4dca7 Simplify.
llvm-svn: 37542
2007-06-11 21:45:31 +00:00
Devang Patel d18054afcf simplify
llvm-svn: 37541
2007-06-11 21:25:31 +00:00
Devang Patel ab2eee89a4 Simplify. Dominator Tree is required so always available.
llvm-svn: 37540
2007-06-11 21:18:00 +00:00
Owen Anderson d184c18074 Handle functions with multiple exit blocks properly.
llvm-svn: 37539
2007-06-11 16:25:17 +00:00
Devang Patel c43f32b935 Use DominatorTree instead of ETForest.
llvm-svn: 37538
2007-06-11 15:40:48 +00:00
Reid Spencer 14b62a553e Fix the build.
llvm-svn: 37537
2007-06-10 00:19:17 +00:00
Owen Anderson 223718c40e Perform PRE of comparison operators.
llvm-svn: 37536
2007-06-09 18:35:31 +00:00
Chris Lattner e359887116 rename C files to end with .c
llvm-svn: 37535
2007-06-09 06:10:47 +00:00
Chris Lattner 75372ad603 fix x86-64 mmx calling convention for real, which passes in integer gprs.
llvm-svn: 37534
2007-06-09 05:08:10 +00:00
Chris Lattner a4a49e37ab fix mmx handling bug
llvm-svn: 37533
2007-06-09 05:01:50 +00:00
Nick Lewycky d18b16034a Fix edge case.
llvm-svn: 37532
2007-06-09 04:20:33 +00:00
Evan Cheng 2117d1f20e 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
Owen Anderson 7d76b2a774 Collect statistics from GVN-PRE.
llvm-svn: 37530
2007-06-08 22:02:36 +00:00
Evan Cheng 288f1545a6 Carefully remove extraneous CFG edges after each ifcvt.
llvm-svn: 37529
2007-06-08 22:01:07 +00:00
Evan Cheng 5514bbef46 Add a utility routine to check for unpredicated terminator instruction.
llvm-svn: 37528
2007-06-08 21:59:56 +00:00
Lauro Ramos Venancio c7ebbaa10e Define AsmTransCBE for ARM.
llvm-svn: 37527
2007-06-08 21:06:23 +00:00
Owen Anderson b232efaf48 Fix typo in a comment.
llvm-svn: 37526
2007-06-08 20:57:08 +00:00
Owen Anderson 55994f2453 Fix a bug that was causing the elimination phase not to replace values when it should be.
With this patch, GVN-PRE now correctly optimizes the example from the thesis.

Many thanks to Daniel Berlin for helping me find errors in this.

llvm-svn: 37525
2007-06-08 20:44:02 +00:00
Evan Cheng df1a42935b Correct transfer predicate information.
llvm-svn: 37524
2007-06-08 19:17:12 +00:00
Evan Cheng e93ccc013f Hidden options to help debugging ifcvt issues.
llvm-svn: 37523
2007-06-08 19:10:51 +00:00
Devang Patel 082c6ae383 Fix spelling.
llvm-svn: 37522
2007-06-08 17:59:02 +00:00
David Greene a0bb97c848 Add entry to CREDITS.
llvm-svn: 37521
2007-06-08 17:20:08 +00:00
David Greene 02f6e9b621 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
Chris Lattner a59fb10de8 wording fix noticed by Ivan Novick
llvm-svn: 37519
2007-06-08 16:52:14 +00:00
Evan Cheng 7783f82e21 Allow more cmp / bcc to be predicated; clean up triangle ifcvt checking code.
llvm-svn: 37518
2007-06-08 09:36:04 +00:00
Evan Cheng 6740da9407 Fix ARM condition code subsumission check.
llvm-svn: 37517
2007-06-08 09:14:47 +00:00
Evan Cheng f62a5afb98 tBcc is not a barrier.
llvm-svn: 37516
2007-06-08 09:13:23 +00:00
Duncan Sands dc8fc1550e 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
Owen Anderson 2e5efc30c2 Small bugfix, and const-ify some methods (Thanks, Bill).
llvm-svn: 37513
2007-06-08 01:52:45 +00:00
Devang Patel becc466451 Update LoopSimplify to require and preserve DominatorTree only.
Now LoopSimplify does not require nor preserve ETForest.

llvm-svn: 37512
2007-06-08 01:50:32 +00:00
Dale Johannesen 86798e5e11 Make throttle a hidden parameter, per review.
llvm-svn: 37511
2007-06-08 01:08:52 +00:00
Owen Anderson be80240b29 Add partial redundancy elimination.
llvm-svn: 37510
2007-06-08 01:03:01 +00:00
Dale Johannesen 52fcf022f7 Throttle tail merging; handling blocks with large numbers of predecessors
is too slow.

llvm-svn: 37509
2007-06-08 00:34:27 +00:00
Devang Patel bc3b9a1c8a Add new method - nearestCommonDominator().
llvm-svn: 37508
2007-06-08 00:21:17 +00:00
Devang Patel aee309e353 Use DominatorTree instead of ETForest.
llvm-svn: 37507
2007-06-08 00:17:13 +00:00
Devang Patel 8ecffa996a Do not preserve ETForest.
llvm-svn: 37506
2007-06-08 00:02:08 +00:00
Devang Patel 31257adce9 Use DominatorTree instead of ETForest.
llvm-svn: 37505
2007-06-07 23:53:38 +00:00
Devang Patel 46d92cae96 Add instruction level dominates(A,B) interface.
llvm-svn: 37504
2007-06-07 23:52:40 +00:00
Evan Cheng 1236ef7bcc Only remove the edge from entry to false if false block is merged.
llvm-svn: 37503
2007-06-07 22:31:28 +00:00
Devang Patel 3f4c6fe7e8 Do not require ETForest. Now it is unused by LICM.
llvm-svn: 37502
2007-06-07 22:21:15 +00:00
Devang Patel cf470e5255 Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.
llvm-svn: 37501
2007-06-07 22:17:16 +00:00
Devang Patel fc7fdef7d2 Use DominatorTree instead of ETForest.
This allows faster immediate domiantor walk.

llvm-svn: 37500
2007-06-07 21:57:03 +00:00
Devang Patel df6355ccf8 Use DominatorTree instead of ETForest.
llvm-svn: 37499
2007-06-07 21:42:15 +00:00
Devang Patel fb582f8dda Use DominatorTree instead of ETForest.
llvm-svn: 37498
2007-06-07 21:35:27 +00:00
Devang Patel 895ab0c570 Add basic block level properlyDominates(A,B) interface.
llvm-svn: 37497
2007-06-07 21:34:22 +00:00
Dale Johannesen 9a4d987a5f Do not change the size of function arguments. PR 1489.
llvm-svn: 37496
2007-06-07 21:07:15 +00:00
Devang Patel 5b8a5516e4 Use DominatorTree instead of ETForest.
llvm-svn: 37495
2007-06-07 18:45:06 +00:00
Devang Patel 593e766fb5 Use DominatorTree instead of ETForest.
llvm-svn: 37494
2007-06-07 18:40:55 +00:00
Devang Patel 171bbf61ed Add BasicBlock level dominates(A,B) interface.
llvm-svn: 37493
2007-06-07 18:39:40 +00:00
Devang Patel af41e4a192 Maintain ETNode as part of DomTreeNode.
This adds redundancy for now.

llvm-svn: 37492
2007-06-07 17:47:21 +00:00
Tanya Lattner 5801c23e05 Formating fixes.
llvm-svn: 37491
2007-06-07 17:12:16 +00:00
Tanya Lattner a1d8eeb7da Correct typo. Should be "not allowed"
llvm-svn: 37490
2007-06-07 16:44:52 +00:00
Duncan Sands c3a9cd4c70 Make the struct bigger, in an attempt to get a "struct return" on more
platforms.

llvm-svn: 37489
2007-06-07 09:35:33 +00:00
Duncan Sands 3f35c524b9 Make this test pass if llvm-g++ was built without exception handling support.
llvm-svn: 37488
2007-06-07 09:00:48 +00:00
Evan Cheng d3f3f0adad 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
Zhou Sheng 0ae22e99c8 Add assert to check if the attributes ZExt/SExt, NoAlias are apply to the
correct type of parameters.

llvm-svn: 37486
2007-06-07 06:12:03 +00:00
Evan Cheng be9859eea2 Lots of bug fixes. Now finally in a reasonable state.
llvm-svn: 37485
2007-06-07 02:12:15 +00:00
Evan Cheng 842be09d86 Stupid cut-n-paste bug caused me soooo much grief. Why wasn't there a compilation warning? I blame it on the FE folks.
llvm-svn: 37484
2007-06-07 01:37:54 +00:00
Lauro Ramos Venancio f04823af30 Fix bugpoint to run -llc-safe with -Xlinker.
llvm-svn: 37483
2007-06-06 23:10:56 +00:00
Lauro Ramos Venancio 85703e3796 Propagate alignment, section name and visibility when linking "appending
global values".
Fix noinline linkage.

llvm-svn: 37482
2007-06-06 22:01:12 +00:00
Tanya Lattner cb90f1d881 Instruct the inliner to obey the noinline attribute. Add test case.
llvm-svn: 37481
2007-06-06 21:59:26 +00:00
Tanya Lattner c7c8b5a3d8 Really use attribute.
llvm-svn: 37480
2007-06-06 21:00:46 +00:00
Tanya Lattner 65cdd36e54 Test case for noinline attribute.
llvm-svn: 37479
2007-06-06 20:52:16 +00:00
Chris Lattner 34404e3247 simplify this code and fix PR1493, now that llvm-gcc3 is dead.
llvm-svn: 37478
2007-06-06 20:51:41 +00:00
Chris Lattner e7a1a4c889 if internalize is disabled, don't run the pass at all!
llvm-svn: 37477
2007-06-06 20:51:14 +00:00
Tanya Lattner e50637d987 Revert changes for noinline.
llvm-svn: 37476
2007-06-06 20:46:40 +00:00
Devang Patel def2d9790a Add new dominator tree node into dominator tree node map.
llvm-svn: 37475
2007-06-06 20:08:11 +00:00
Chris Lattner 00538a1931 update to match latest changes
llvm-svn: 37474
2007-06-06 18:28:13 +00:00
Lauro Ramos Venancio be59acbfcc Add a test for PR1499.
llvm-svn: 37473
2007-06-06 17:10:02 +00:00
Lauro Ramos Venancio 368e8872db Fix PR1499.
llvm-svn: 37472
2007-06-06 17:08:48 +00:00
Owen Anderson cfb6f40424 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 29d1dc6f1a 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
Nick Lewycky df543f4b84 Optimize this test. Firstly, only Instructions may use other Instructions.
Secondly, checking whether removal succeeded tells you whether it was in
the map to begin with.

llvm-svn: 37469
2007-06-06 11:26:20 +00:00
Evan Cheng e8c3cbf971 Mark these instructions clobbersPred. They modify the condition code register.
llvm-svn: 37468
2007-06-06 10:17:05 +00:00
Evan Cheng 9030b98aca Lots of bug fixes.
llvm-svn: 37467
2007-06-06 10:16:17 +00:00
Evan Cheng d04409154f Added clobbersPred.
llvm-svn: 37466
2007-06-06 10:15:28 +00:00
Evan Cheng 452a818c6a Add clobbersPred - instruction that clobbers condition code / register which are used to predicate instructions.
llvm-svn: 37465
2007-06-06 10:14:55 +00:00
Evan Cheng fcde8e52b3 Add a machine instruction flag indicating the instruction can clobber condition code / register(s) used to predicate instructions.
llvm-svn: 37464
2007-06-06 10:13:55 +00:00
Duncan Sands 61166501a1 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
Duncan Sands fe940d8d74 "Simplified" testcase for PR1422.
llvm-svn: 37462
2007-06-06 09:59:53 +00:00
Bruno Cardoso Lopes 35e43c49b0 Initial Mips support, here we go! =)
- Modifications from the last patch included
  (issues pointed by Evan Cheng are now fixed).
- Added more MipsI instructions.
- Added more patterns to match branch instructions.

llvm-svn: 37461
2007-06-06 07:42:06 +00:00
Tanya Lattner 277bbbc1be Ignore llvm.noinline
llvm-svn: 37460
2007-06-06 05:53:50 +00:00
Nick Lewycky 3e84212897 Fix PR1487 and Transforms/IndVar/2007-06-06-DeleteDanglesPtr.ll
llvm-svn: 37459
2007-06-06 04:12:20 +00:00
Nick Lewycky 3b70bb2778 new testcase for PR1487
llvm-svn: 37458
2007-06-06 04:11:21 +00:00
Nick Lewycky 91ed6efc24 Inform ScalarEvolutions that we're deleting Values.
This is the obviously correct part of the fix for PR1487.

llvm-svn: 37457
2007-06-06 03:51:56 +00:00
Evan Cheng e4ec918be0 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
Owen Anderson 634a063c1d Add simple full redundancy elimination.
llvm-svn: 37455
2007-06-06 01:27:49 +00:00
Chris Lattner 1b7b6e76ec Fix PR1495 and CodeGen/X86/2007-06-05-LSR-Dominator.ll
llvm-svn: 37454
2007-06-06 01:23:55 +00:00
Chris Lattner 6b79636532 add accessor
llvm-svn: 37453
2007-06-06 01:22:09 +00:00
Chris Lattner af56be7f2c new testcase for PR1495
llvm-svn: 37452
2007-06-06 01:21:46 +00:00
Evan Cheng b30a89457c Minor statistics counting bug.
llvm-svn: 37451
2007-06-06 01:12:44 +00:00
Devang Patel 5aced6a54a Break friendship.
llvm-svn: 37450
2007-06-06 00:59:48 +00:00
Evan Cheng 30565998bb 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
Devang Patel 3c6ab49051 Rename.
llvm-svn: 37448
2007-06-06 00:49:02 +00:00
Devang Patel d7d3d71c7a Simplify class hierarchy.
llvm-svn: 37447
2007-06-06 00:46:36 +00:00
Devang Patel 506310d3dd Avoid non-trivial loop unswitching while optimizing for size.
llvm-svn: 37446
2007-06-06 00:21:03 +00:00
Chris Lattner 31f82dff21 Fix a user-reported error building with GCC 3.4.4 on Cygwin.
llvm-svn: 37445
2007-06-05 23:49:06 +00:00
Evan Cheng 7948422b78 Fix diamond shape ifcvt bugs.
llvm-svn: 37444
2007-06-05 23:46:14 +00:00
Owen Anderson ddbe430732 Fix a misunderstanding of the algorithm. Really, we should be tracking values
and expression separately.  We can get around this, however, by only keeping
opaque values in TMP_GEN.

llvm-svn: 37443
2007-06-05 23:46:12 +00:00
Owen Anderson c84720913a Don't leak memory.
llvm-svn: 37442
2007-06-05 22:11:49 +00:00
Evan Cheng c1a0b8ce1d ReplaceUsesOfBlockWith() can modify the predecessors list.
llvm-svn: 37441
2007-06-05 22:03:53 +00:00
Evan Cheng 3e5bf0827c 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
Devang Patel 3e6519e9fa Fix PR 1497
Use separate pass id for CFGOnlyPrinter.

llvm-svn: 37439
2007-06-05 20:24:36 +00:00
Devang Patel 753b63cb5b New test.
llvm-svn: 37438
2007-06-05 20:23:20 +00:00
Evan Cheng 5c48958a61 Print predicate of the second instruction of the two-piece constant MI.
llvm-svn: 37437
2007-06-05 18:55:18 +00:00
Owen Anderson 9b89e4b561 Fix a small bug, some 80 cols violations, and add some more debugging output.
llvm-svn: 37436
2007-06-05 17:31:23 +00:00
Dan Gohman 151169df1e Allow insertelement, extractelement, and shufflevector to be hoisted/sunk
by LICM.

llvm-svn: 37435
2007-06-05 16:05:55 +00:00
Evan Cheng 252695f0f6 PIC label asm printing cosmetic changes.
llvm-svn: 37434
2007-06-05 07:36:38 +00:00
Evan Cheng 2c1acd6d9e I had a senior moment.
llvm-svn: 37433
2007-06-05 07:05:25 +00:00
Zhou Sheng 2444a9adeb Commit first round work of PR1373. "noalias" is now fully supported in
VMCore, BitCode, and Assembly. Documentation and test case paramattrs.ll
updated also.

llvm-svn: 37432
2007-06-05 05:28:26 +00:00
Evan Cheng 59754300a8 New test.
llvm-svn: 37431
2007-06-05 01:45:08 +00:00
Evan Cheng 6e4babe8cc 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 17aad8164e 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
Bill Wendling 6357bf20fa Patches by Chuck Rose to unbreak V Studio builds.
Thanks Chuck!

llvm-svn: 37428
2007-06-04 23:52:59 +00:00
Dale Johannesen 0558dda319 Tail merging wasn't working for predecessors of landing pads. PR 1496.
llvm-svn: 37427
2007-06-04 23:52:54 +00:00
Devang Patel b3adb9876a s/ETNode::getChildren/ETNode::getETNodeChildren/g
llvm-svn: 37426
2007-06-04 23:45:02 +00:00
Owen Anderson 3c9d8eef21 Don't use std::set_difference when the two sets are sorted differently. Compute
the difference manually instead.

This allows GVNPRE to produce correct analysis for the example in the GVNPRE
paper.

llvm-svn: 37425
2007-06-04 23:34:56 +00:00
Owen Anderson 3df5299f94 Fix a bunch of small bugs, and improve the debugging output significantly.
llvm-svn: 37424
2007-06-04 23:28:33 +00:00
Chris Lattner d7897d40b6 When rebuilding constant structs, make sure to honor the isPacked bit.
This fixes PR1491 and GlobalOpt/2007-06-04-PackedStruct.ll

llvm-svn: 37423
2007-06-04 22:23:42 +00:00
Chris Lattner 084c20fcc0 new testcase for PR1491
llvm-svn: 37422
2007-06-04 22:23:17 +00:00
Evan Cheng 53ce7de03b 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 91233153bf Forgot to check for if iterator reached the end.
llvm-svn: 37420
2007-06-04 20:33:36 +00:00
Evan Cheng 59ca6a846f Misuse of hasExternalLinkage(), should be checking isDeclaration().
llvm-svn: 37419
2007-06-04 18:54:57 +00:00
Owen Anderson 38b6b22a41 Make phi_translate correct.
llvm-svn: 37418
2007-06-04 18:05:26 +00:00
Devang Patel 4a7c2830d4 Add FIXMEs.
llvm-svn: 37417
2007-06-04 17:38:00 +00:00
Devang Patel f7a4aad658 Remove unused method.
llvm-svn: 37416
2007-06-04 16:49:36 +00:00
Devang Patel ebc5b96735 s/DominatorTree::createNewNode/DominatorTree::addNewBlock/g
llvm-svn: 37415
2007-06-04 16:43:25 +00:00
Devang Patel a89566aefd Add basic block level interface to change immediate dominator
and create new node.

llvm-svn: 37414
2007-06-04 16:22:33 +00:00
Dan Gohman b4c2690446 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 a23ef8a8f2 Remove the operator<< for MVT::ValueType in preparation for MVT::ValueType
being changed from an enum to an integer type, which can't have a custom
operator<< overload.

llvm-svn: 37412
2007-06-04 16:11:03 +00:00
Dan Gohman 92a7f3a65e 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
Devang Patel d609374ab3 Fix LLVM build on NetBSD. Patch by Neil Booth.
llvm-svn: 37410
2007-06-04 15:28:57 +00:00
Evan Cheng 312b723af2 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 df75785594 Move ReplaceUsesOfBlockWith() out of BranchFolding into a MachineBasicBlock general facility.
llvm-svn: 37408
2007-06-04 06:44:01 +00:00
Devang Patel bdd1aaef10 s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Owen Anderson 0eca9aad10 Don't use the custom comparator where it's not necessary.
llvm-svn: 37406
2007-06-03 22:02:14 +00:00
Anton Korobeynikov b781886de7 Add comments to fallsthrough cases. Also, this fixes PR1492
llvm-svn: 37405
2007-06-03 19:20:49 +00:00
Anton Korobeynikov 8c32c1114f Check arguments & return types of main(). Abort in case of no match.
llvm-svn: 37404
2007-06-03 19:17:35 +00:00
Devang Patel 0e8aa7b69a s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Owen Anderson 46499645db Remove an unused method.
llvm-svn: 37402
2007-06-03 05:58:25 +00:00
Owen Anderson 0b68cda302 There's no need to have an Expression class... Value works just as well! This simplifies a lot of code.
llvm-svn: 37401
2007-06-03 05:55:58 +00:00
Chris Lattner 446548d2a3 update this entry, now that Anton implemented shift/and lowering for
switches.  There is one really easy isel thing here with tst we are not
getting.

llvm-svn: 37400
2007-06-02 18:45:14 +00:00
Duncan Sands f708f73a1b 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 c063f5f362 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 0a0ae932ca Make LowerCTPOP() support arbitrary bitwidth integer type.
llvm-svn: 37397
2007-06-02 04:10:33 +00:00
Dale Johannesen 6e7cdce773 Fix CorrectExtraCFGEdges to allow for multiple LandingPad targets.
llvm-svn: 37394
2007-06-02 00:08:15 +00:00
Dale Johannesen 9746e3a22b Fancier algorithm in tail-merge comment implemented, so remove comment.
llvm-svn: 37393
2007-06-01 23:04:28 +00:00
Dale Johannesen 3c0a13762d 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
Reid Spencer ff38cf8880 For PR1486:
Avoid overwriting the APInt instance with 0 bytes which causes the bitwidth
to be set to 0 (illegal) producing a subsequent assert.

llvm-svn: 37391
2007-06-01 22:23:29 +00:00
Devang Patel ac54a62fd2 Insert new instructions in AliasSet.
llvm-svn: 37390
2007-06-01 22:15:31 +00:00
Owen Anderson 48e93f2ce9 clean() needs to process things in topological order.
llvm-svn: 37389
2007-06-01 22:00:37 +00:00
Evan Cheng 9aa5fc8577 Opcode modifier s comes after condition code. e.g. addlts, not addslt.
llvm-svn: 37388
2007-06-01 20:51:29 +00:00
Evan Cheng 4dcf1e8582 Correctly mark early-exit on the false path.
llvm-svn: 37387
2007-06-01 20:29:21 +00:00
Owen Anderson 4c89142466 Fix Expression comparison, which in turn fixes a value numbering error.
llvm-svn: 37386
2007-06-01 17:34:47 +00:00
Evan Cheng 256144de4a Set ARM ifcvt duplication limit to 3 for now.
llvm-svn: 37385
2007-06-01 08:28:59 +00:00
Evan Cheng b964b9c025 Target specific ifcvt code duplication limit.
llvm-svn: 37384
2007-06-01 08:25:24 +00:00
Duncan Sands 706421e712 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 6a2cf070cc 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 a2ab4e5feb Make jumptable non-predicable for now.
llvm-svn: 37381
2007-06-01 00:56:15 +00:00
Evan Cheng 95c7917d92 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 20e05997f5 Allow multiple ifcvt candidates to share children blocks; add some debugging code.
llvm-svn: 37379
2007-06-01 00:12:12 +00:00
Owen Anderson 331bf6a959 Add a topological sort function.
llvm-svn: 37376
2007-05-31 22:44:11 +00:00
Dale Johannesen 1a401e68a8 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 e6ccb6c5ed Fix a typo.
llvm-svn: 37374
2007-05-31 20:53:33 +00:00
Chris Lattner 3e3ff30aa2 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 5a3e6fe365 Add a test for PR1424.
llvm-svn: 37372
2007-05-31 18:36:07 +00:00
Lauro Ramos Venancio 5b0757a401 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
Bill Wendling 96114686ae Alphabetize Bruno's entry.
llvm-svn: 37368
2007-05-31 04:14:28 +00:00
Bruno Cardoso Lopes 0a2eee18b1 New contributor added!
llvm-svn: 37367
2007-05-31 03:25:10 +00:00
Owen Anderson 81d156e16f Attempt to fix up phi_translate.
llvm-svn: 37366
2007-05-31 00:42:15 +00:00
Evan Cheng 905a8f4940 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 397c4d9ef6 Fix CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll, and PR1473.
llvm-svn: 37362
2007-05-30 16:30:06 +00:00
Chris Lattner 4217aa376a new testcase for PR1473
llvm-svn: 37361
2007-05-30 16:29:20 +00:00
Devang Patel 9b3b35d14f Fix typo.
llvm-svn: 37360
2007-05-30 15:29:37 +00:00
Duncan Sands d9e3786d2f Testcase for
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070528/050047.html

llvm-svn: 37359
2007-05-30 10:16:19 +00:00
Chris Lattner 8767920f20 Fix Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll and the second
half of PR1421, by not decimating structs with holes that are the source and
destination of a memcpy.

llvm-svn: 37358
2007-05-30 06:11:23 +00:00
Chris Lattner ed24b3b2fa Testcase for PR1421
llvm-svn: 37357
2007-05-30 06:10:46 +00:00
Chris Lattner b6506a636b new testcase for PR1421
llvm-svn: 37356
2007-05-30 05:37:18 +00:00
Dale Johannesen d14ad078c6 Changed per review comment.
llvm-svn: 37355
2007-05-30 00:32:01 +00:00
Dale Johannesen a69ebdbebc 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 20f7d30f92 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