Chris Lattner
474cd30fb7
rename CanEvaluateInDifferentType -> CanEvaluateTruncated and
...
simplify it now that it is only used for truncates.
llvm-svn: 93021
2010-01-08 19:19:23 +00:00
Evan Cheng
8b248e5016
Fix comment.
...
llvm-svn: 93020
2010-01-08 19:14:57 +00:00
Chris Lattner
05ae88cc8f
teach instcombine to delete sign extending shift pairs (sra(shl X, C), C) when
...
the input is already sign extended.
llvm-svn: 93019
2010-01-08 19:04:21 +00:00
Chris Lattner
0dc48180de
fix PR5978 by peeling the loop so that we avoid shifting the
...
result int by 8 for the first byte. While normally harmless,
if the result is smaller than a byte, this shift is invalid.
llvm-svn: 93018
2010-01-08 19:02:23 +00:00
Duncan Sands
c94f8aeb36
Suppress an unused variable warning when assertions are off;
...
remove some trailing whitespace while there.
llvm-svn: 93008
2010-01-08 17:51:48 +00:00
Chris Lattner
725b9ba4e5
tidy up some stuff duncan pointed out.
...
llvm-svn: 93007
2010-01-08 17:48:19 +00:00
Johnny Chen
f782ccee01
Minor change, change the order of two "let Inst{...}" stmts within multiclass
...
T2I_bin_ii12rs definition.
llvm-svn: 93006
2010-01-08 17:41:33 +00:00
Eric Christopher
067afe673c
After further thought revert the patch to make fast-isel avoid
...
putting relocations into the constant pool - this isn't needed
for correctness and in the rare occasion it happens would pull
us out of fast isel for the block.
If fast-isel application startup time ever becomes an issue we
can add better support for these addresses instead of bailing.
llvm-svn: 92995
2010-01-08 08:24:49 +00:00
Evan Cheng
f96a9ec02b
ReplaceAllUsesOfValueWith may delete other nodes that the one being replaced. Do not delete dead nodes again.
...
llvm-svn: 92988
2010-01-08 02:36:12 +00:00
Evan Cheng
4f25f87baa
Fix what looks to me obvious instruction definition bugs.
...
1. CMPXCHG8B and CMPXCHG16B did not specify implicit physical register defs and uses.
2. LCMPXCHG8B is loading 64 bit memory, not 32 bit.
llvm-svn: 92985
2010-01-08 01:29:19 +00:00
Eric Christopher
2a3196c2e5
Remove extraneous include.
...
llvm-svn: 92972
2010-01-08 00:05:33 +00:00
Tobias Grosser
b73235c0d0
Add assert to check dominance dfs numbers.
...
Compare the dominance information calculated using a dominance tree walk to the
information calculated based on DFS numbers, if XDEBUG is enabled.
llvm-svn: 92969
2010-01-07 23:50:41 +00:00
Tobias Grosser
35528e6f1d
Remove workaround in PostDominators
...
Remove a FIXME and unify code that was necessary to work around broken
updateDFSNumbers(). Before updateDFSNumbers() did not work correctly for post
dominators.
llvm-svn: 92968
2010-01-07 23:50:25 +00:00
Tobias Grosser
fbc9ea7841
Fix DFS number calculation for postdominators
...
The DFS number calculation for postdominators was broken. In the case of
multiple exits that form the post dominator root nodes, do not iterate over
all exits, but start from the virtual root node. Otherwise bbs, that are not
post dominated by any exit but by the virtual root node, will never be assigned
a DFS number.
llvm-svn: 92967
2010-01-07 23:50:06 +00:00
Chris Lattner
944f9c4ac1
teach ComputeNumSignBits to look through PHI nodes.
...
llvm-svn: 92964
2010-01-07 23:44:37 +00:00
Chris Lattner
b8ec2bccaf
filecheckize
...
llvm-svn: 92963
2010-01-07 23:42:23 +00:00
Chris Lattner
db8fa82914
Enhance instcombine to reason more strongly about promoting computation
...
that feeds into a zext, similar to the patch I did yesterday for sext.
There is a lot of room for extension beyond this patch.
llvm-svn: 92962
2010-01-07 23:41:00 +00:00
Chris Lattner
e0199dff81
Fix rdar://7517201, a regression introduced by r92849.
...
When folding a and(any_ext(load)) both the any_ext and the
load have to have only a single use.
This removes the anyext-uses.ll testcase which started failing
because it is unreduced and unclear what it is testing.
llvm-svn: 92950
2010-01-07 21:59:23 +00:00
Chris Lattner
f68e328a99
factor this code better and reduce nesting at the same
...
time, no functionality change.
llvm-svn: 92948
2010-01-07 21:53:27 +00:00
David Greene
c3f9f7a3db
Revert r92939. These intrinsics get matched to LLVM instructions,
...
so removing at Chris' request.
llvm-svn: 92947
2010-01-07 21:43:58 +00:00
Evan Cheng
4523041394
APInt'fy TargetLowering::SimplifySetCC to fix PR5963.
...
llvm-svn: 92943
2010-01-07 20:58:44 +00:00
David Greene
7c9c709d3d
Add some "missing" instrinsics to make the SSE intrinsic set a bit more
...
orthogonal.
llvm-svn: 92939
2010-01-07 19:47:43 +00:00
Benjamin Kramer
bbaf8cac38
Simplify code. No intended functionality/performance change.
...
llvm-svn: 92938
2010-01-07 19:46:15 +00:00
Eric Christopher
d218bc7a2f
If the data requires a relocation then don't attempt to
...
add it to the constant pool for fast-isel. We already
don't add it for the normal case.
llvm-svn: 92934
2010-01-07 19:45:14 +00:00
Eric Christopher
1d452e5c87
We need to put any kind of data with a relocation into a
...
not-readonly segment on darwin.
llvm-svn: 92933
2010-01-07 19:44:05 +00:00
Devang Patel
10ee76f7f4
Use separate namespace for named metadata.
...
llvm-svn: 92931
2010-01-07 19:39:36 +00:00
Kovarththanan Rajaratnam
3a038bba47
Fix occurrence typo
...
llvm-svn: 92926
2010-01-07 18:46:52 +00:00
Chris Lattner
320b635dfd
constant materialization could be improved.
...
llvm-svn: 92921
2010-01-07 17:53:10 +00:00
Benjamin Kramer
badb9914d2
Kill dead store.
...
llvm-svn: 92920
2010-01-07 17:50:57 +00:00
Benjamin Kramer
a97aab4995
Remove dead variable.
...
llvm-svn: 92919
2010-01-07 17:29:08 +00:00
Benjamin Kramer
22ec2524fd
Use pop_back_val instead of back()+pop_back.
...
llvm-svn: 92918
2010-01-07 17:27:56 +00:00
Benjamin Kramer
df696ee6b4
Use a do-while loop instead of while + boolean.
...
llvm-svn: 92912
2010-01-07 13:50:07 +00:00
Duncan Sands
fa59842d87
Correct spelling.
...
llvm-svn: 92910
2010-01-07 09:05:26 +00:00
Duncan Sands
8299315be7
Be less stingy as to how many selects and phi nodes we
...
are prepared to look through.
llvm-svn: 92898
2010-01-07 05:48:42 +00:00
Douglas Gregor
c8114b239b
More trivial optimizations to a function well outside the critical path
...
llvm-svn: 92896
2010-01-07 02:24:06 +00:00
Chris Lattner
1a64e58fa3
handle ConstantVector while I'm in here.
...
llvm-svn: 92892
2010-01-07 01:20:20 +00:00
Chris Lattner
0b0caf0877
fix a globalopt crash on 'bullet' (handling evaluation of a store
...
to an element of a vector in a static ctor) which occurs with an
unrelated patch I'm testing. Annoyingly, EvaluateStoreInto basically
does exactly the same stuff as InsertElement constant folding, but it
now handles vectors, and you can't insertelement into a vector. It
would be 'really nice' if GEP into a vector were not legal.
llvm-svn: 92889
2010-01-07 01:16:21 +00:00
Evan Cheng
51d86260ff
Fix a minor regression from my dag combiner changes. One more place which needs to look pass truncates.
...
llvm-svn: 92885
2010-01-07 00:54:06 +00:00
Douglas Gregor
b7161a0b1c
Switch StringRef::edit_distance over to using raw pointers, since both
...
std::vector and llvm::SmallVector have annoying performance
tradeoffs. No, I don't expect this to matter, and now it won't.
llvm-svn: 92884
2010-01-07 00:51:54 +00:00
Jakob Stoklund Olesen
09012552b8
Add comments.
...
llvm-svn: 92883
2010-01-07 00:51:04 +00:00
Jim Grosbach
40aafaec86
80 column violations
...
llvm-svn: 92876
2010-01-06 23:54:42 +00:00
Jakob Stoklund Olesen
b90023e707
Allow double defs after tail duplication.
...
llvm-svn: 92874
2010-01-06 23:52:46 +00:00
Jakob Stoklund Olesen
a63aa4e54b
Add Target hook to duplicate machine instructions.
...
Some instructions refer to unique labels, and so cannot be trivially cloned
with CloneMachineInstr.
llvm-svn: 92873
2010-01-06 23:47:07 +00:00
Jim Grosbach
76768e7216
Addressing mode 6 (load/store) instructions can't encode an immediate offset
...
for stack references.
llvm-svn: 92871
2010-01-06 23:45:18 +00:00
Jim Grosbach
0beaad246d
Anti-dependency breaking needs to be careful regarding instructions with
...
multiple register definitions.
llvm-svn: 92864
2010-01-06 22:21:25 +00:00
Eric Christopher
0574ce70c3
Move the object size intrinsic optimization to inst-combine and make
...
it work for any integer size return type.
llvm-svn: 92853
2010-01-06 20:04:44 +00:00
Evan Cheng
f9dade0634
Comment.
...
llvm-svn: 92850
2010-01-06 19:43:21 +00:00
Evan Cheng
25dcf9b830
Teach dag combine to fold the following transformation more aggressively:
...
(OP (trunc x), (trunc y)) -> (trunc (OP x, y))
Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel.
This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places.
llvm-svn: 92849
2010-01-06 19:38:29 +00:00
Douglas Gregor
f5646a4595
Fix struct/class mismatch
...
llvm-svn: 92841
2010-01-06 17:16:00 +00:00
Victor Hernandez
6551d8e0be
When parsing function-local metadata, create a function-local MDNode
...
llvm-svn: 92838
2010-01-06 17:00:21 +00:00