Commit Graph

55933 Commits

Author SHA1 Message Date
Chris Lattner
9aa1e246dd tidy up some stuff duncan pointed out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 17:48:19 +00:00
Johnny Chen
d248ffb7d5 Minor change, change the order of two "let Inst{...}" stmts within multiclass
T2I_bin_ii12rs definition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 17:41:33 +00:00
Eric Christopher
968b35ff47 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 08:24:49 +00:00
Evan Cheng
6f279e0bda ReplaceAllUsesOfValueWith may delete other nodes that the one being replaced. Do not delete dead nodes again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 02:36:12 +00:00
Evan Cheng
b093bd0565 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 01:29:19 +00:00
Eric Christopher
d74a7d4e2c Remove extraneous include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 00:05:33 +00:00
Tobias Grosser
fde781b8d6 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:41 +00:00
Tobias Grosser
365ccd3a91 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:25 +00:00
Tobias Grosser
ecd4694458 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:06 +00:00
Chris Lattner
8d10f9d4a8 teach ComputeNumSignBits to look through PHI nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:44:37 +00:00
Chris Lattner
e3874deb61 filecheckize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:42:23 +00:00
Chris Lattner
075f692939 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:41:00 +00:00
Chris Lattner
bd1fccfad5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 21:59:23 +00:00
Chris Lattner
ef7634ca48 factor this code better and reduce nesting at the same
time, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 21:53:27 +00:00
David Greene
60dd36592f Revert r92939. These intrinsics get matched to LLVM instructions,
so removing at Chris' request.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 21:43:58 +00:00
Evan Cheng
347a9cb507 APInt'fy TargetLowering::SimplifySetCC to fix PR5963.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 20:58:44 +00:00
David Greene
0d2856aa19 Add some "missing" instrinsics to make the SSE intrinsic set a bit more
orthogonal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:47:43 +00:00
Benjamin Kramer
2e0de6f771 Simplify code. No intended functionality/performance change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:46:15 +00:00
Eric Christopher
e6c74c9c2a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:45:14 +00:00
Eric Christopher
a07b750405 We need to put any kind of data with a relocation into a
not-readonly segment on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:44:05 +00:00
Devang Patel
0386f01e06 Use separate namespace for named metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92931 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:39:36 +00:00
Kovarththanan Rajaratnam
3c37bb8dbe Fix occurrence typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 18:46:52 +00:00
Chris Lattner
ddac706747 constant materialization could be improved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 17:53:10 +00:00
Benjamin Kramer
3d594fd299 Kill dead store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 17:50:57 +00:00
Benjamin Kramer
e7078aed24 Remove dead variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 17:29:08 +00:00
Benjamin Kramer
7b1e2a50a5 Use pop_back_val instead of back()+pop_back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 17:27:56 +00:00
Benjamin Kramer
66b581ef49 Use a do-while loop instead of while + boolean.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 13:50:07 +00:00
Duncan Sands
452394d812 Correct spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 09:05:26 +00:00
Duncan Sands
5d8ea117a0 Be less stingy as to how many selects and phi nodes we
are prepared to look through.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 05:48:42 +00:00
Douglas Gregor
2772ea831c More trivial optimizations to a function well outside the critical path
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 02:24:06 +00:00
Chris Lattner
4039bd0550 handle ConstantVector while I'm in here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 01:20:20 +00:00
Chris Lattner
a0e9a2475c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 01:16:21 +00:00
Evan Cheng
17751dac3e Fix a minor regression from my dag combiner changes. One more place which needs to look pass truncates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 00:54:06 +00:00
Douglas Gregor
ad6b6da8aa 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92884 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 00:51:54 +00:00
Jakob Stoklund Olesen
d1862037f0 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 00:51:04 +00:00
Jim Grosbach
9631864688 80 column violations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 23:54:42 +00:00
Jakob Stoklund Olesen
541e9ae3ad Allow double defs after tail duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92874 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 23:52:46 +00:00
Jakob Stoklund Olesen
30ac0467ce Add Target hook to duplicate machine instructions.
Some instructions refer to unique labels, and so cannot be trivially cloned
with CloneMachineInstr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 23:47:07 +00:00
Jim Grosbach
ce3e769c15 Addressing mode 6 (load/store) instructions can't encode an immediate offset
for stack references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92871 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 23:45:18 +00:00
Jim Grosbach
80c2b0d9ef Anti-dependency breaking needs to be careful regarding instructions with
multiple register definitions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 22:21:25 +00:00
Eric Christopher
130063207d Move the object size intrinsic optimization to inst-combine and make
it work for any integer size return type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 20:04:44 +00:00
Evan Cheng
54eb4c2991 Comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 19:43:21 +00:00
Evan Cheng
d40d03e1bd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 19:38:29 +00:00
Douglas Gregor
b419a5cfe9 Fix struct/class mismatch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 17:16:00 +00:00
Victor Hernandez
76bf310b7a When parsing function-local metadata, create a function-local MDNode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 17:00:21 +00:00
Jim Grosbach
2973b57093 80 column and whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 16:48:02 +00:00
Duncan Sands
e10920d678 Fix a README item: have functionattrs look through selects and
phi nodes when deciding which pointers point to local memory.
I actually checked long ago how useful this is, and it isn't
very: it hardly ever fires in the testsuite, but since Chris
wants it here it is!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 15:37:47 +00:00
Mikhail Glushenkov
0ecbdeb14f Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92831 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 09:20:39 +00:00
Lang Hames
421c0733fd Fixed malformed -*- lines in PBQP headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 08:53:34 +00:00
Duncan Sands
7c422ac216 Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 08:45:52 +00:00