Owen Anderson [Fri, 22 Jun 2007 00:11:18 +0000 (00:11 +0000)]
Fix a bug in SmallPtrSet that was causing GVNPRE to enter an infinite loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37697
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 21 Jun 2007 23:23:32 +0000 (23:23 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37696
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 21 Jun 2007 22:29:02 +0000 (22:29 +0000)]
CallGraphSCCPass manager may require other passes.
Use schedulePass() to accomodate these requirement instead of directly
assigning a manager to new CallGraph PassManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37695
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 21 Jun 2007 21:25:36 +0000 (21:25 +0000)]
Have internal df_iterator's use SmallPtrSet instead of std::set. This provides compile time speedups to any pass using df_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37694
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 21 Jun 2007 18:22:42 +0000 (18:22 +0000)]
Fix tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37693
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 21 Jun 2007 18:11:19 +0000 (18:11 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37692
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 21 Jun 2007 18:09:25 +0000 (18:09 +0000)]
new testcase miscompiled by instcombine, reduced from perl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37691
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 21 Jun 2007 17:57:53 +0000 (17:57 +0000)]
Change lots of sets from std::set to SmallPtrSet. This reduces the time required to optimize 253.perlbmk from 10.9s to 5.3s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37690
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 21 Jun 2007 17:23:45 +0000 (17:23 +0000)]
Move code to update dominator information after basic block is split
from LoopSimplify.cpp to Dominator.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37689
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 21 Jun 2007 14:48:26 +0000 (14:48 +0000)]
Tidy up ValueType names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37688
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 21 Jun 2007 14:42:22 +0000 (14:42 +0000)]
Rename TargetLowering::getNumElements and friends to
TargetLowering::getNumRegisters and similar, to avoid confusion with
the actual number of elements for vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37687
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 21 Jun 2007 07:40:00 +0000 (07:40 +0000)]
New tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37686
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 21 Jun 2007 07:39:16 +0000 (07:39 +0000)]
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))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37685
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 21 Jun 2007 01:59:05 +0000 (01:59 +0000)]
Eliminate a redundant check. This speeds up optimization of 253.perlbmk from 13.5 seconds to 10.9 seconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37683
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 21 Jun 2007 00:19:05 +0000 (00:19 +0000)]
Comment-ize the functions in GVNPRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37681
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 20 Jun 2007 23:46:26 +0000 (23:46 +0000)]
refactor a bunch of code out of visitICmpInstWithInstAndIntCst into its own
routine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37679
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 20 Jun 2007 22:10:02 +0000 (22:10 +0000)]
Split runOnFunction into many smaller functions. This make it easier to get accurate performance analysis of GVNPRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37678
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Wed, 20 Jun 2007 20:46:37 +0000 (20:46 +0000)]
Modify deleting global variable with an even easier way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37676
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 20 Jun 2007 18:51:14 +0000 (18:51 +0000)]
Update AnalysisGroup documentation to document restriction that allows
only one ImmutablePass in a group.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37675
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Wed, 20 Jun 2007 18:33:15 +0000 (18:33 +0000)]
Add blurb on deleting global variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37674
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 20 Jun 2007 18:30:20 +0000 (18:30 +0000)]
Make GVNPRE accurate report whether it modified the function or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37673
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 20 Jun 2007 18:26:15 +0000 (18:26 +0000)]
Added some if-conversion tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37672
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 20 Jun 2007 00:43:33 +0000 (00:43 +0000)]
Get rid of an unneeded helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37670
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 19 Jun 2007 23:55:02 +0000 (23:55 +0000)]
Be more conservative of duplicating blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37669
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 19 Jun 2007 23:23:54 +0000 (23:23 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37668
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 19 Jun 2007 23:07:16 +0000 (23:07 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37667
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Tue, 19 Jun 2007 22:31:52 +0000 (22:31 +0000)]
Moved Inliner.h to include/llvm/Transforms/IPO/InlinerPass.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37666
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Tue, 19 Jun 2007 22:29:50 +0000 (22:29 +0000)]
Inliner pass header file was moved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37665
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Tue, 19 Jun 2007 22:29:02 +0000 (22:29 +0000)]
Move inliner pass header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37664
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 19 Jun 2007 21:45:13 +0000 (21:45 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37660
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 19 Jun 2007 21:05:09 +0000 (21:05 +0000)]
Allow predicated immediate ARM to ARM calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37659
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 16:46:48 +0000 (16:46 +0000)]
Fix pr1448
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37658
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 19 Jun 2007 14:28:31 +0000 (14:28 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37657
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 19 Jun 2007 14:13:56 +0000 (14:13 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37656
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 19 Jun 2007 07:35:36 +0000 (07:35 +0000)]
Handle constants in phi nodes properly. This fixes test/Transforms/GVNPRE/2007-06-18-ConstantInPhi.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37655
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 06:40:46 +0000 (06:40 +0000)]
silence warning when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37654
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 19 Jun 2007 05:55:01 +0000 (05:55 +0000)]
Testcase for instances where a constant only occurs as an operand to a phi node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37653
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 05:52:36 +0000 (05:52 +0000)]
don't use binutils 2.17
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37652
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 05:47:49 +0000 (05:47 +0000)]
document and hide two options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37651
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 05:46:06 +0000 (05:46 +0000)]
describe an argument, hide it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37650
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 05:43:49 +0000 (05:43 +0000)]
silence a bogus warning Duraid ran into.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37649
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 19 Jun 2007 05:41:22 +0000 (05:41 +0000)]
Add a new testcase for memory corruption issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37648
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 19 Jun 2007 05:37:32 +0000 (05:37 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37647
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 19 Jun 2007 04:32:55 +0000 (04:32 +0000)]
Remember to clear the maximal sets between functions.
Thanks to Nicholas for valgrinding this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37646
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 19 Jun 2007 03:31:41 +0000 (03:31 +0000)]
Refactor GVNPRE to use a much smart method of uniquing value sets, and centralize a lot of the value numbering information. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37645
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 19 Jun 2007 01:48:05 +0000 (01:48 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37644
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 19 Jun 2007 01:26:51 +0000 (01:26 +0000)]
Replace TargetInstrInfo::CanBeDuplicated() with a M_NOT_DUPLICABLE bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37643
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 19 Jun 2007 01:21:41 +0000 (01:21 +0000)]
Replace CanBeDuplicated() with a M_NOT_DUPLICABLE bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37642
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 00:13:10 +0000 (00:13 +0000)]
If a function is vararg, never pass inreg arguments in registers. Thanks to
Anton for half of this patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37641
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 00:11:09 +0000 (00:11 +0000)]
add isVarArg to CCState
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37640
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 00:10:25 +0000 (00:10 +0000)]
add isvararg tracking to CCState
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37639
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 19 Jun 2007 00:08:42 +0000 (00:08 +0000)]
testcase for PR1513
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37638
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 19 Jun 2007 00:06:08 +0000 (00:06 +0000)]
New test case: identity operation of RHS / LHS of a VECTOR_SHUFFLE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37637
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 19 Jun 2007 00:02:56 +0000 (00:02 +0000)]
Look for VECTOR_SHUFFLE that's identity operation on either LHS or RHS. This can happen before DAGCombiner catches it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37636
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Mon, 18 Jun 2007 23:42:37 +0000 (23:42 +0000)]
Update docs for llvm.var.annotation intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37635
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 18 Jun 2007 22:44:57 +0000 (22:44 +0000)]
Fix some fragile code wrt CFG edge updating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37634
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 18 Jun 2007 22:43:58 +0000 (22:43 +0000)]
Move CorrectExtraCFGEdges() from BranchFolding.cpp to a MachineBasicBlock method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37633
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Mon, 18 Jun 2007 22:23:39 +0000 (22:23 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37632
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 18 Jun 2007 21:50:49 +0000 (21:50 +0000)]
add helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37631
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 18 Jun 2007 21:32:29 +0000 (21:32 +0000)]
Fix quotes in debug messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37630
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 18 Jun 2007 21:28:10 +0000 (21:28 +0000)]
make ComputeTopDownOrdering significantly faster and use less stack space
by making it non-recursive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37629
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 18 Jun 2007 19:30:09 +0000 (19:30 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37628
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Mon, 18 Jun 2007 17:13:29 +0000 (17:13 +0000)]
Make BasicAliasAnalysis correctly register itself. Patch by Devang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37627
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 18 Jun 2007 15:30:16 +0000 (15:30 +0000)]
Make chain dependencies blue, in addition to being dashed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37626
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 18 Jun 2007 14:12:56 +0000 (14:12 +0000)]
Define the pushq instruction for x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37625
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 18 Jun 2007 14:11:31 +0000 (14:11 +0000)]
Add keyword explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37624
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Mon, 18 Jun 2007 08:37:25 +0000 (08:37 +0000)]
Properly remove duplicate instructions as result of diamond if-conversion. Other bug fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37623
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 18 Jun 2007 04:42:29 +0000 (04:42 +0000)]
Cache the results of dependsOnInvoke()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37622
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 18 Jun 2007 04:31:21 +0000 (04:31 +0000)]
Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37621
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 18 Jun 2007 04:30:44 +0000 (04:30 +0000)]
Don't perform an expensive check if it's not necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37620
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 17 Jun 2007 23:29:57 +0000 (23:29 +0000)]
ensure we don't regress on these tests. We generate aweful code in x86-32 for
these though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37619
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 16 Jun 2007 23:57:51 +0000 (23:57 +0000)]
XFAILing until I can fix properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37618
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 16 Jun 2007 23:57:15 +0000 (23:57 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37617
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sat, 16 Jun 2007 20:48:27 +0000 (20:48 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37616
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sat, 16 Jun 2007 20:33:24 +0000 (20:33 +0000)]
Fix PR1516:
When printing the uses of a function (-gen-function only), make sure to
include the constants referenced by intializers of global variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37615
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 16 Jun 2007 16:17:35 +0000 (16:17 +0000)]
Call the correct function name. Patch from Stephane Letz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37614
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sat, 16 Jun 2007 09:34:52 +0000 (09:34 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37613
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 16 Jun 2007 06:31:47 +0000 (06:31 +0000)]
Testcase for MMX int to MMX register failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37612
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Sat, 16 Jun 2007 06:17:31 +0000 (06:17 +0000)]
Fix a failure to bit_convert from integer GPR to MMX register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37611
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Sat, 16 Jun 2007 00:26:54 +0000 (00:26 +0000)]
Fix test/Transforms/GVNPRE/2007-06-15-InvokeInst.ll by ignoring all instructions that depend on invokes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37610
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Sat, 16 Jun 2007 00:25:10 +0000 (00:25 +0000)]
Testcase where GVNPRE was getting confused by invoke instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37609
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Fri, 15 Jun 2007 22:26:58 +0000 (22:26 +0000)]
Codegen support (stripped out) for the annotate attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37608
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 15 Jun 2007 21:18:05 +0000 (21:18 +0000)]
Not every predicable block can be safely duplicated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37607
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 15 Jun 2007 21:15:00 +0000 (21:15 +0000)]
Instructions with unique labels or embedded jumptables cannot be duplicated during ifcvt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37606
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 15 Jun 2007 21:13:54 +0000 (21:13 +0000)]
Added CanBeDuplicated(). It returns true if an instruction can be safely duplicated (e.g. during ifcvt).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37605
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Fri, 15 Jun 2007 20:52:47 +0000 (20:52 +0000)]
test case for annotate attribute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37604
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Fri, 15 Jun 2007 20:50:54 +0000 (20:50 +0000)]
Add local var annotation intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37603
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Fri, 15 Jun 2007 19:21:55 +0000 (19:21 +0000)]
Fold a binary operator with constant operands when expanding code for a SCEV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37602
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 15 Jun 2007 19:11:01 +0000 (19:11 +0000)]
Fix CodeGen/X86/inline-asm-x-scalar.ll:test4, by retaining regclass info
for tied register constraints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37601
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 15 Jun 2007 19:09:53 +0000 (19:09 +0000)]
make this test harder, include a tied register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37600
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 15 Jun 2007 19:06:07 +0000 (19:06 +0000)]
MachineInstr::isPredicable() is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37599
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 15 Jun 2007 19:05:13 +0000 (19:05 +0000)]
No longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37598
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 15 Jun 2007 19:04:19 +0000 (19:04 +0000)]
Workaround for PR1508.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37597
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Fri, 15 Jun 2007 18:00:55 +0000 (18:00 +0000)]
Use SCEVConstant::get instead of SCEVUnknown::get to create an
integer constant SCEV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37596
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 15 Jun 2007 17:55:15 +0000 (17:55 +0000)]
Fix test/Transforms/GVNPRE/2007-06-15-Looping.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37595
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 15 Jun 2007 17:54:05 +0000 (17:54 +0000)]
Add a testcase where GVNPRE what getting confused by a loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37594
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 15 Jun 2007 17:34:48 +0000 (17:34 +0000)]
Extra edges are deleted later if needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37593
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 15 Jun 2007 17:13:53 +0000 (17:13 +0000)]
Use "ignore" rather than grep tricks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37592
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Fri, 15 Jun 2007 14:38:12 +0000 (14:38 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37591
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 15 Jun 2007 07:36:12 +0000 (07:36 +0000)]
Allow small blocks to be duplicated to enable if-conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37590
91177308-0d34-0410-b5e6-
96231b3b80d8