Dan Gohman
ad9cbaba40
Fix an assertion failure in legalizing bitcast operators on targets where
...
vectors are split down to single elements as part of legalization.
llvm-svn: 37785
2007-06-29 00:09:08 +00:00
Evan Cheng
e233ec5e46
Type of vector extract / insert index operand should be iPTR.
...
llvm-svn: 37784
2007-06-29 00:01:20 +00:00
Owen Anderson
f1665858f3
Add support for performing GVNPRE on select instructions. This fixes test/Transforms/GVNPRE/select.ll.
...
llvm-svn: 37783
2007-06-28 23:51:21 +00:00
Dan Gohman
c6bdcfa8c0
Add new TargetLowering code to provide the final register type that an
...
illegal value type will be transformed to, for code that needs the
register type after all transformations instead of just after the first
transformation.
Factor out the code that uses this information to do copy-from-regs and
copy-to-regs for various purposes into separate functions so that they
are done consistently.
llvm-svn: 37781
2007-06-28 23:29:44 +00:00
Lauro Ramos Venancio
04172124dd
Fix a bug in my previous patch.
...
llvm-svn: 37778
2007-06-28 20:06:38 +00:00
Lauro Ramos Venancio
eb29d717b3
When linking two modules, we should copy the alias.
...
llvm-svn: 37776
2007-06-28 19:02:54 +00:00
Devang Patel
03d844eebd
- Undo previous check and allow loop switch for condtion that is not inside
...
loop.
- Avoid loop unswich for loop header branch.
- While cloning dominators fix typo and handle self dominating blocks.
llvm-svn: 37772
2007-06-28 02:05:46 +00:00
Devang Patel
7f468af921
Update LoopUnswitch pass to preserve DomiantorTree.
...
llvm-svn: 37771
2007-06-28 00:49:00 +00:00
Devang Patel
50d5420cdc
If a condition is not inside a loop then the condition is suitable
...
to loop unswitch candidate for the loop.
llvm-svn: 37770
2007-06-28 00:44:10 +00:00
Owen Anderson
9372f36b3c
Make many sets a much more reasonable size. This decreases the time to optimize
...
Anton's testcase from 35.5s to 34.7s.
llvm-svn: 37769
2007-06-28 00:34:34 +00:00
Bill Wendling
cc1f4cafa2
Set implied features based upon the CPU's feature list.
...
llvm-svn: 37768
2007-06-27 23:34:06 +00:00
Devang Patel
28d2851f39
Remove ETForest.
...
llvm-svn: 37765
2007-06-27 20:53:52 +00:00
Evan Cheng
e67385d712
If a livein is not used in the block. It's live through.
...
llvm-svn: 37764
2007-06-27 18:47:28 +00:00
Evan Cheng
26542e347a
Partial fix for PR1502: If a EH register is needed in a successor of landing pad, add it as livein to all the blocks in the paths between the landing pad and the specified block.
...
llvm-svn: 37763
2007-06-27 18:45:32 +00:00
Owen Anderson
97dd99d761
Use cached information that has already been computed to make clean() simpler and faster. This is a small speedup on most cases.
...
llvm-svn: 37761
2007-06-27 17:38:29 +00:00
Owen Anderson
a7927caa56
Fold a lot of code into two cases: binary instructions and ternary instructions.
...
This saves many lines of code duplication. No functionality change.
llvm-svn: 37759
2007-06-27 17:03:03 +00:00
Dan Gohman
cb89e19a6d
Rename ("shrinkify") MVT::isExtendedValueType to MVT::isExtendedVT.
...
llvm-svn: 37758
2007-06-27 16:08:04 +00:00
Dan Gohman
ce1bca0bf9
Remove a redundant newline in the asm output for ELF .rodata sections.
...
llvm-svn: 37756
2007-06-27 15:09:47 +00:00
Dan Gohman
c1c4b0972f
Use getVectorTypeBreakdown in FunctionLoweringInfo::CreateRegForValue
...
to compute the number and type of registers needed for vector values
instead of computing it manually. This fixes PR1529.
llvm-svn: 37755
2007-06-27 14:34:07 +00:00
Dan Gohman
69a6154359
Make the comment for ScalarizeVectorOp mention that it is only for use
...
with single-element vectors.
llvm-svn: 37752
2007-06-27 14:06:22 +00:00
Zhou Sheng
011fc80616
Fix a bug.
...
llvm-svn: 37751
2007-06-27 09:50:26 +00:00
Duraid Madina
d32d8b9726
ok, this is something of a dirty hack, but it seems to work. (fixes e.g.
...
the SPASS miscompilation)
llvm-svn: 37750
2007-06-27 09:01:14 +00:00
Duraid Madina
73b0d188c8
ok, this much doesn't seem to bork anything
...
llvm-svn: 37749
2007-06-27 08:31:07 +00:00
Duraid Madina
94cd67290b
revert evan's fixes (and my doofusness) since they had a huge code
...
quality hit. will look at this soon.
llvm-svn: 37748
2007-06-27 08:11:59 +00:00
Duraid Madina
c0d3c96333
pull evan's fixes - should help the nightly tester (but there are still
...
some issues)
llvm-svn: 37747
2007-06-27 07:07:13 +00:00
Evan Cheng
480cd89fa1
Replace std::set with SmallPtrSet.
...
llvm-svn: 37746
2007-06-27 05:23:00 +00:00
Owen Anderson
97de56ae2b
Add support for performing GVNPRE on the three vector-specific operations.
...
llvm-svn: 37745
2007-06-27 04:10:46 +00:00
Evan Cheng
f74e333161
Fix an obvious bug. Old code only worked for the entry block.
...
llvm-svn: 37743
2007-06-27 01:16:36 +00:00
Owen Anderson
dc1d567274
1. Correct some comments and clean up some dead code.
...
2. When calculating ANTIC_IN, only iterate the changed blocks. For most average
inputs this is a small speedup, but for cases with unusual CFGs, this can be a significant win.
llvm-svn: 37742
2007-06-26 23:29:41 +00:00
Evan Cheng
5c0f03bce4
Correctly handle implcit def / use operands.
...
llvm-svn: 37740
2007-06-26 21:05:13 +00:00
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
Evan Cheng
5506831e5b
Silence a warning.
...
llvm-svn: 37737
2007-06-26 18:31:22 +00:00
Dan Gohman
94432fe813
Use utostr from StringExtras.h instead of ostringstream from <sstream>.
...
llvm-svn: 37731
2007-06-26 15:14:48 +00:00
Dan Gohman
9cbc3fb1ab
Revert the earlier change that removed the M_REMATERIALIZABLE machine
...
instruction flag, and use the flag along with a virtual member function
hook for targets to override if there are instructions that are only
trivially rematerializable with specific operands (i.e. constant pool
loads).
llvm-svn: 37728
2007-06-26 00:48:07 +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
Chris Lattner
64e8e4af59
fix Transforms/Inline/2007-06-25-WeakInline.ll by not inlining functions
...
with weak linkage.
llvm-svn: 37723
2007-06-25 21:50:09 +00:00
Owen Anderson
fb09af59e0
Use the built-in postorder iterators rather than computing a postorder walk by hand.
...
llvm-svn: 37721
2007-06-25 18:25:31 +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
dc8a1730f7
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
f40db01c32
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
d3b3703430
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
c8aa8f8ba7
Provide hook for alloca on VCPP. Patch by Scott Graham
...
llvm-svn: 37715
2007-06-25 07:12:14 +00:00
Owen Anderson
293173ccd2
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
59c02f6336
Fix value ranges.
...
llvm-svn: 37713
2007-06-24 20:14:22 +00:00
Owen Anderson
e16e7f2d3d
Fix a silly mistake that was causing failures.
...
llvm-svn: 37712
2007-06-24 08:42:24 +00:00
Nick Lewycky
c238dd7dca
Remove tabs.
...
llvm-svn: 37710
2007-06-24 04:40:16 +00:00
Nick Lewycky
fff717bc50
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
4713f37034
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
65af4e7d2b
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
1fe94b16dc
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
89558a0db6
Fix the build.
...
llvm-svn: 37705
2007-06-22 16:59:54 +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
Owen Anderson
92c7510376
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
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
Dale Johannesen
e1c767df50
Quote complex names for Darwin X86 and ARM.
...
llvm-svn: 37700
2007-06-22 00:54:56 +00:00
Owen Anderson
0abfa1ecb2
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
e121e85517
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
41515dcd4b
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
3ac68a90f2
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
0b2cb3ec61
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
Chris Lattner
4624e16f16
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
Owen Anderson
eb29dac190
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
bfb1c7192e
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
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
Owen Anderson
a783224b25
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
b06cc18b7c
Comment-ize the functions in GVNPRE.
...
llvm-svn: 37681
2007-06-21 00:19:05 +00:00
Chris Lattner
26537049eb
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
ff60973eb8
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
Owen Anderson
58265d2391
Make GVNPRE accurate report whether it modified the function or not.
...
llvm-svn: 37673
2007-06-20 18:30:20 +00:00
Owen Anderson
815c4d384b
Get rid of an unneeded helper function.
...
llvm-svn: 37670
2007-06-20 00:43:33 +00:00
Evan Cheng
5da7b6f0fc
Be more conservative of duplicating blocks.
...
llvm-svn: 37669
2007-06-19 23:55:02 +00:00
Owen Anderson
997c4e5e47
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
5a902e6afc
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
b2aae813b6
Moved Inliner.h to include/llvm/Transforms/IPO/InlinerPass.h
...
llvm-svn: 37666
2007-06-19 22:31:52 +00:00
Tanya Lattner
a2e912bf51
Inliner pass header file was moved.
...
llvm-svn: 37665
2007-06-19 22:29:50 +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
Evan Cheng
c49382e48f
Allow predicated immediate ARM to ARM calls.
...
llvm-svn: 37659
2007-06-19 21:05:09 +00:00
Dan Gohman
bb705e230a
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
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
Owen Anderson
0eafdcafe7
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
653c0ccfbe
document and hide two options.
...
llvm-svn: 37651
2007-06-19 05:47:49 +00:00
Chris Lattner
81e8a18e7c
describe an argument, hide it.
...
llvm-svn: 37650
2007-06-19 05:46:06 +00:00
Chris Lattner
6809b4b4fa
silence a bogus warning Duraid ran into.
...
llvm-svn: 37649
2007-06-19 05:43:49 +00:00
Owen Anderson
f74f94d859
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
d3d1716516
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
dc858f6498
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
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
e13fac05d7
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
68f9f9fa3b
add isVarArg to CCState
...
llvm-svn: 37640
2007-06-19 00:11:09 +00:00
Evan Cheng
80f0d5ae45
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
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
Devang Patel
f57b9f4d5d
Fix quotes in debug messages.
...
llvm-svn: 37630
2007-06-18 21:32:29 +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
5db3ad4b32
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
76361958e8
Make BasicAliasAnalysis correctly register itself. Patch by Devang
...
llvm-svn: 37627
2007-06-18 17:13:29 +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
Dan Gohman
bff1054303
Define the pushq instruction for x86-64.
...
llvm-svn: 37625
2007-06-18 14:12:56 +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
Owen Anderson
58098f3560
Cache the results of dependsOnInvoke()
...
llvm-svn: 37622
2007-06-18 04:42:29 +00:00
Owen Anderson
8956588783
Fix indentation.
...
llvm-svn: 37621
2007-06-18 04:31:21 +00:00
Owen Anderson
c45b435273
Don't perform an expensive check if it's not necessary.
...
llvm-svn: 37620
2007-06-18 04:30:44 +00:00
Bill Wendling
94f3474832
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
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
Bill Wendling
a1f8f0aa97
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
0c8b051523
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
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
Evan Cheng
e6d0631c68
Instructions with unique labels or embedded jumptables cannot be duplicated during ifcvt.
...
llvm-svn: 37606
2007-06-15 21:15:00 +00:00
Dan Gohman
1c73ccb4d3
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
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
Dan Gohman
a3ea76f018
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
5a2d597072
Fix test/Transforms/GVNPRE/2007-06-15-Looping.ll
...
llvm-svn: 37595
2007-06-15 17:55:15 +00:00
Evan Cheng
a6504bc2e0
Extra edges are deleted later if needed.
...
llvm-svn: 37593
2007-06-15 17:34:48 +00:00
Dan Gohman
838ba27094
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
f4d3d695b2
Allow small blocks to be duplicated to enable if-conversion.
...
llvm-svn: 37590
2007-06-15 07:36:12 +00:00
Chris Lattner
3a979f2fa5
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
145fdc7e2a
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
c2985cea59
Enhance BinaryOperator::isNot to support vector not.
...
llvm-svn: 37585
2007-06-15 06:04:24 +00:00
Chris Lattner
6c32b44b4c
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
96c6cf8b89
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
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
Dale Johannesen
62f49dd524
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
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
Dan Gohman
74c92798d8
Eliminate some redundant newlines in asm output.
...
llvm-svn: 37574
2007-06-14 15:00:27 +00:00
Christopher Lamb
68017d151b
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
7e3253f115
Handle blocks with 2 unconditional branches in AnalyzeBranch.
...
llvm-svn: 37571
2007-06-13 17:59: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
Owen Anderson
67084c3848
Fix test/Transforms/GVNPRE/2007-06-12-PhiTranslate.ll
...
llvm-svn: 37564
2007-06-12 22:43:57 +00:00
Devang Patel
fbde93ba1f
isReachableFromEntry() is not suitable for post dominator.
...
llvm-svn: 37562
2007-06-12 17:50:25 +00:00
Devang Patel
b4e2a776cb
Remove redundant check.
...
llvm-svn: 37561
2007-06-12 17:35:20 +00:00
Devang Patel
8c07212a59
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
Owen Anderson
f476df648e
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
Dale Johannesen
f223789fea
Sink CmpInst's to their uses to reduce register pressure.
...
llvm-svn: 37554
2007-06-12 16:50:17 +00:00
Devang Patel
ab4cb51479
Break DominatorTree from ETNode.
...
Remove unused PostETForest.
llvm-svn: 37551
2007-06-12 00:54:38 +00:00
Owen Anderson
8fd2a040de
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
Devang Patel
520e92a7f4
Use SmallPtrSet instaed of std::set
...
llvm-svn: 37548
2007-06-12 00:40:51 +00:00
Devang Patel
31da507473
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
73d23a5f70
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
bc3887310b
Add and use DominatorTreeBase::findNearestCommonDominator().
...
llvm-svn: 37545
2007-06-11 23:31:22 +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
Devang Patel
336e38d425
Simplify.
...
llvm-svn: 37542
2007-06-11 21:45:31 +00:00
Devang Patel
8fba00d86d
simplify
...
llvm-svn: 37541
2007-06-11 21:25:31 +00:00
Devang Patel
35df53ab56
Simplify. Dominator Tree is required so always available.
...
llvm-svn: 37540
2007-06-11 21:18:00 +00:00
Owen Anderson
cdb51c9ac4
Handle functions with multiple exit blocks properly.
...
llvm-svn: 37539
2007-06-11 16:25:17 +00:00
Devang Patel
a8e236cab7
Use DominatorTree instead of ETForest.
...
llvm-svn: 37538
2007-06-11 15:40:48 +00:00
Reid Spencer
0c11f4ebd8
Fix the build.
...
llvm-svn: 37537
2007-06-10 00:19:17 +00:00
Owen Anderson
532366fb7d
Perform PRE of comparison operators.
...
llvm-svn: 37536
2007-06-09 18:35:31 +00:00
Chris Lattner
5f85da00bb
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
e965432273
fix mmx handling bug
...
llvm-svn: 37533
2007-06-09 05:01:50 +00:00
Nick Lewycky
e03bd9ddbb
Fix edge case.
...
llvm-svn: 37532
2007-06-09 04:20:33 +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
Owen Anderson
1e60429027
Collect statistics from GVN-PRE.
...
llvm-svn: 37530
2007-06-08 22:02:36 +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
1a6c0341fd
Add a utility routine to check for unpredicated terminator instruction.
...
llvm-svn: 37528
2007-06-08 21:59:56 +00:00
Lauro Ramos Venancio
ec8ae8443a
Define AsmTransCBE for ARM.
...
llvm-svn: 37527
2007-06-08 21:06:23 +00:00
Owen Anderson
2cf00c37de
Fix typo in a comment.
...
llvm-svn: 37526
2007-06-08 20:57:08 +00:00
Owen Anderson
4621335527
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
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
Evan Cheng
4c6df8ba37
Fix ARM condition code subsumission check.
...
llvm-svn: 37517
2007-06-08 09:14:47 +00:00
Evan Cheng
8eff719058
tBcc is not a barrier.
...
llvm-svn: 37516
2007-06-08 09:13:23 +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
Owen Anderson
64daf17aa0
Small bugfix, and const-ify some methods (Thanks, Bill).
...
llvm-svn: 37513
2007-06-08 01:52:45 +00:00
Devang Patel
cfb3a761ae
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
74ffb6ffb3
Make throttle a hidden parameter, per review.
...
llvm-svn: 37511
2007-06-08 01:08:52 +00:00
Owen Anderson
ccd2616fbb
Add partial redundancy elimination.
...
llvm-svn: 37510
2007-06-08 01:03:01 +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
Devang Patel
d544f5262e
Use DominatorTree instead of ETForest.
...
llvm-svn: 37507
2007-06-08 00:17:13 +00:00
Devang Patel
b5554f450a
Do not preserve ETForest.
...
llvm-svn: 37506
2007-06-08 00:02:08 +00:00
Devang Patel
67ede3d635
Use DominatorTree instead of ETForest.
...
llvm-svn: 37505
2007-06-07 23:53:38 +00:00
Devang Patel
9772222f41
Add instruction level dominates(A,B) interface.
...
llvm-svn: 37504
2007-06-07 23:52:40 +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
Devang Patel
8d261e921f
Do not require ETForest. Now it is unused by LICM.
...
llvm-svn: 37502
2007-06-07 22:21:15 +00:00
Devang Patel
3daf3625ab
Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.
...
llvm-svn: 37501
2007-06-07 22:17:16 +00:00
Devang Patel
a466c96f77
Use DominatorTree instead of ETForest.
...
This allows faster immediate domiantor walk.
llvm-svn: 37500
2007-06-07 21:57:03 +00:00
Devang Patel
5678b94d16
Use DominatorTree instead of ETForest.
...
llvm-svn: 37499
2007-06-07 21:42:15 +00:00
Devang Patel
de2a20aefe
Use DominatorTree instead of ETForest.
...
llvm-svn: 37498
2007-06-07 21:35:27 +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
Devang Patel
5c0808db4f
Use DominatorTree instead of ETForest.
...
llvm-svn: 37495
2007-06-07 18:45:06 +00:00
Devang Patel
700d930e73
Use DominatorTree instead of ETForest.
...
llvm-svn: 37494
2007-06-07 18:40:55 +00:00