oota-llvm.git
12 years ago2010 is upon us.
Chris Lattner [Sat, 9 Jan 2010 18:40:31 +0000 (18:40 +0000)]
2010 is upon us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93062 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse WriteAsOperand instead of getName() to print loop header names,
Dan Gohman [Sat, 9 Jan 2010 18:17:45 +0000 (18:17 +0000)]
Use WriteAsOperand instead of getName() to print loop header names,
so that unnamed blocks are handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93059 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTighten up the vim LLVM IR syntax highlighting regex for labels, and add a
Dan Gohman [Sat, 9 Jan 2010 17:22:48 +0000 (17:22 +0000)]
Tighten up the vim LLVM IR syntax highlighting regex for labels, and add a
highlighting rule for identifiers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93056 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSet the vim auto-indent setting for open braces after case statements to
Dan Gohman [Sat, 9 Jan 2010 17:15:21 +0000 (17:15 +0000)]
Set the vim auto-indent setting for open braces after case statements to
follow LLVM source convention.

Before:
  case X: {
            stuff;
          }

After:
  case X: {
    stuff;
  }

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93055 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed linking of modules containing aliases to constant bitcasts. Existing behaviour...
David Chisnall [Sat, 9 Jan 2010 16:27:31 +0000 (16:27 +0000)]
Fixed linking of modules containing aliases to constant bitcasts.  Existing behaviour first tried to replace the aliases with the global that they aliased (rather than the bitcast), causing a crash on an assert because the types didn't match.  When this was fixed, it then did the same thing creating the new alias (creating an alias with a different type to its aliasee).

Linking modules containing aliases to GEPs is still not quite right.  GEPs that are equivalent to bitcasts will be replaced by bitcasts, GEPs that are not will just break.  Aliases to GEPs that are not equivalent to bitcasts are horribly broken anyway (it might be worth adding an assert when creating the alias to prevent these being created; they just cause problems later).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93052 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSuppress use of uninitialized variable warning.
Duncan Sands [Sat, 9 Jan 2010 08:30:33 +0000 (08:30 +0000)]
Suppress use of uninitialized variable warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93046 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoonly factor from expressions whose uses are empty and whose
Chris Lattner [Sat, 9 Jan 2010 06:01:36 +0000 (06:01 +0000)]
only factor from expressions whose uses are empty and whose
base is the right expression type.  This fixes PR5981.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93045 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert an earlier change to SIGN_EXTEND_INREG for vectors. The VTSDNode
Dan Gohman [Sat, 9 Jan 2010 02:13:55 +0000 (02:13 +0000)]
Revert an earlier change to SIGN_EXTEND_INREG for vectors. The VTSDNode
really does need to be a vector type, because
TargetLowering::getOperationAction for SIGN_EXTEND_INREG uses that type,
and it needs to be able to distinguish between vectors and scalars.

Also, fix some more issues with legalization of vector casts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93043 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoclean up this code, add a fixme.
Chris Lattner [Sat, 9 Jan 2010 02:02:37 +0000 (02:02 +0000)]
clean up this code, add a fixme.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93042 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDelete NamedMDSymTable while destrucing Module.
Devang Patel [Sat, 9 Jan 2010 01:44:59 +0000 (01:44 +0000)]
Delete NamedMDSymTable while destrucing Module.
Disable  copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93041 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd DEBUG_DECLARE. Not used yet.
Dale Johannesen [Sat, 9 Jan 2010 01:24:25 +0000 (01:24 +0000)]
Add DEBUG_DECLARE.  Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93040 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoNamedMDNode is never used so there is no need to enumerate it here.
Devang Patel [Sat, 9 Jan 2010 01:24:03 +0000 (01:24 +0000)]
NamedMDNode is never used so there is no need to enumerate it here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93039 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix nondeterministic behavior.
Julien Lerouge [Sat, 9 Jan 2010 01:06:49 +0000 (01:06 +0000)]
Fix nondeterministic behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93038 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoNamedMDNode element is either null or MDNode. Otherwise this is a malformed NamedMDNo...
Devang Patel [Sat, 9 Jan 2010 01:02:22 +0000 (01:02 +0000)]
NamedMDNode element is either null or MDNode. Otherwise this is a malformed NamedMDNode record.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93037 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDerive NamedMDNode from Value.
Devang Patel [Sat, 9 Jan 2010 00:30:14 +0000 (00:30 +0000)]
Derive NamedMDNode from Value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93032 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDan pointed out checking whether a node is dead by comparing its opcode to ISD::DELET...
Evan Cheng [Sat, 9 Jan 2010 00:21:08 +0000 (00:21 +0000)]
Dan pointed out checking whether a node is dead by comparing its opcode to ISD::DELETED_NODE is not safe. Use a DAGUpdateListener to remove dead nodes from work list instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93031 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd DEBUG_VALUE. Not used yet.
Dale Johannesen [Fri, 8 Jan 2010 23:51:25 +0000 (23:51 +0000)]
Add DEBUG_VALUE.  Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93030 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a critical bug in 64-bit atomic operation lowering for 32-bit. The results of...
Evan Cheng [Fri, 8 Jan 2010 23:41:50 +0000 (23:41 +0000)]
Fix a critical bug in 64-bit atomic operation lowering for 32-bit. The results of the cmpxchg8b instructions are being thrown away when it branches back to the top of the checking loop. This means the loop always compares against the old value and this can result in a dead lock.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93028 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoGrammar thinko.
Eric Christopher [Fri, 8 Jan 2010 21:42:39 +0000 (21:42 +0000)]
Grammar thinko.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93027 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unnecessary dyn_cast and add a comment. Part of a WIP.
Eric Christopher [Fri, 8 Jan 2010 21:37:11 +0000 (21:37 +0000)]
Remove unnecessary dyn_cast and add a comment.  Part of a WIP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93026 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomplement a theoretical fixme.
Chris Lattner [Fri, 8 Jan 2010 19:28:47 +0000 (19:28 +0000)]
mplement a theoretical fixme.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93024 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorename CanEvaluateInDifferentType -> CanEvaluateTruncated and
Chris Lattner [Fri, 8 Jan 2010 19:19:23 +0000 (19:19 +0000)]
rename CanEvaluateInDifferentType -> CanEvaluateTruncated and
simplify it now that it is only used for truncates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93021 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix comment.
Evan Cheng [Fri, 8 Jan 2010 19:14:57 +0000 (19:14 +0000)]
Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93020 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoteach instcombine to delete sign extending shift pairs (sra(shl X, C), C) when
Chris Lattner [Fri, 8 Jan 2010 19:04:21 +0000 (19:04 +0000)]
teach instcombine to delete sign extending shift pairs (sra(shl X, C), C) when
the input is already sign extended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93019 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agofix PR5978 by peeling the loop so that we avoid shifting the
Chris Lattner [Fri, 8 Jan 2010 19:02:23 +0000 (19:02 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93018 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSuppress an unused variable warning when assertions are off;
Duncan Sands [Fri, 8 Jan 2010 17:51:48 +0000 (17:51 +0000)]
Suppress an unused variable warning when assertions are off;
remove some trailing whitespace while there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93008 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agotidy up some stuff duncan pointed out.
Chris Lattner [Fri, 8 Jan 2010 17:48:19 +0000 (17:48 +0000)]
tidy up some stuff duncan pointed out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93007 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMinor change, change the order of two "let Inst{...}" stmts within multiclass
Johnny Chen [Fri, 8 Jan 2010 17:41:33 +0000 (17:41 +0000)]
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

12 years agoAfter further thought revert the patch to make fast-isel avoid
Eric Christopher [Fri, 8 Jan 2010 08:24:49 +0000 (08:24 +0000)]
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

12 years agoReplaceAllUsesOfValueWith may delete other nodes that the one being replaced. Do...
Evan Cheng [Fri, 8 Jan 2010 02:36:12 +0000 (02:36 +0000)]
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

12 years agoFix what looks to me obvious instruction definition bugs.
Evan Cheng [Fri, 8 Jan 2010 01:29:19 +0000 (01:29 +0000)]
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

12 years agoRemove extraneous include.
Eric Christopher [Fri, 8 Jan 2010 00:05:33 +0000 (00:05 +0000)]
Remove extraneous include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92972 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd assert to check dominance dfs numbers.
Tobias Grosser [Thu, 7 Jan 2010 23:50:41 +0000 (23:50 +0000)]
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

12 years agoRemove workaround in PostDominators
Tobias Grosser [Thu, 7 Jan 2010 23:50:25 +0000 (23:50 +0000)]
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

12 years agoFix DFS number calculation for postdominators
Tobias Grosser [Thu, 7 Jan 2010 23:50:06 +0000 (23:50 +0000)]
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

12 years agoteach ComputeNumSignBits to look through PHI nodes.
Chris Lattner [Thu, 7 Jan 2010 23:44:37 +0000 (23:44 +0000)]
teach ComputeNumSignBits to look through PHI nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92964 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agofilecheckize
Chris Lattner [Thu, 7 Jan 2010 23:42:23 +0000 (23:42 +0000)]
filecheckize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92963 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnhance instcombine to reason more strongly about promoting computation
Chris Lattner [Thu, 7 Jan 2010 23:41:00 +0000 (23:41 +0000)]
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

12 years agoFix rdar://7517201, a regression introduced by r92849.
Chris Lattner [Thu, 7 Jan 2010 21:59:23 +0000 (21:59 +0000)]
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

12 years agofactor this code better and reduce nesting at the same
Chris Lattner [Thu, 7 Jan 2010 21:53:27 +0000 (21:53 +0000)]
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

12 years agoRevert r92939. These intrinsics get matched to LLVM instructions,
David Greene [Thu, 7 Jan 2010 21:43:58 +0000 (21:43 +0000)]
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

12 years agoAPInt'fy TargetLowering::SimplifySetCC to fix PR5963.
Evan Cheng [Thu, 7 Jan 2010 20:58:44 +0000 (20:58 +0000)]
APInt'fy TargetLowering::SimplifySetCC to fix PR5963.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92943 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd some "missing" instrinsics to make the SSE intrinsic set a bit more
David Greene [Thu, 7 Jan 2010 19:47:43 +0000 (19:47 +0000)]
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

12 years agoSimplify code. No intended functionality/performance change.
Benjamin Kramer [Thu, 7 Jan 2010 19:46:15 +0000 (19:46 +0000)]
Simplify code. No intended functionality/performance change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92938 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIf the data requires a relocation then don't attempt to
Eric Christopher [Thu, 7 Jan 2010 19:45:14 +0000 (19:45 +0000)]
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

12 years agoWe need to put any kind of data with a relocation into a
Eric Christopher [Thu, 7 Jan 2010 19:44:05 +0000 (19:44 +0000)]
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

12 years agoUse separate namespace for named metadata.
Devang Patel [Thu, 7 Jan 2010 19:39:36 +0000 (19:39 +0000)]
Use separate namespace for named metadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92931 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix occurrence typo
Kovarththanan Rajaratnam [Thu, 7 Jan 2010 18:46:52 +0000 (18:46 +0000)]
Fix occurrence typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92926 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoconstant materialization could be improved.
Chris Lattner [Thu, 7 Jan 2010 17:53:10 +0000 (17:53 +0000)]
constant materialization could be improved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92921 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoKill dead store.
Benjamin Kramer [Thu, 7 Jan 2010 17:50:57 +0000 (17:50 +0000)]
Kill dead store.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92920 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove dead variable.
Benjamin Kramer [Thu, 7 Jan 2010 17:29:08 +0000 (17:29 +0000)]
Remove dead variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92919 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse pop_back_val instead of back()+pop_back.
Benjamin Kramer [Thu, 7 Jan 2010 17:27:56 +0000 (17:27 +0000)]
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

12 years agoUse a do-while loop instead of while + boolean.
Benjamin Kramer [Thu, 7 Jan 2010 13:50:07 +0000 (13:50 +0000)]
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

12 years agoCorrect spelling.
Duncan Sands [Thu, 7 Jan 2010 09:05:26 +0000 (09:05 +0000)]
Correct spelling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92910 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBe less stingy as to how many selects and phi nodes we
Duncan Sands [Thu, 7 Jan 2010 05:48:42 +0000 (05:48 +0000)]
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

12 years agoMore trivial optimizations to a function well outside the critical path
Douglas Gregor [Thu, 7 Jan 2010 02:24:06 +0000 (02:24 +0000)]
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

12 years agohandle ConstantVector while I'm in here.
Chris Lattner [Thu, 7 Jan 2010 01:20:20 +0000 (01:20 +0000)]
handle ConstantVector while I'm in here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92892 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agofix a globalopt crash on 'bullet' (handling evaluation of a store
Chris Lattner [Thu, 7 Jan 2010 01:16:21 +0000 (01:16 +0000)]
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

12 years agoFix a minor regression from my dag combiner changes. One more place which needs to...
Evan Cheng [Thu, 7 Jan 2010 00:54:06 +0000 (00:54 +0000)]
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

12 years agoSwitch StringRef::edit_distance over to using raw pointers, since both
Douglas Gregor [Thu, 7 Jan 2010 00:51:54 +0000 (00:51 +0000)]
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

12 years agoAdd comments.
Jakob Stoklund Olesen [Thu, 7 Jan 2010 00:51:04 +0000 (00:51 +0000)]
Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92883 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago80 column violations
Jim Grosbach [Wed, 6 Jan 2010 23:54:42 +0000 (23:54 +0000)]
80 column violations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92876 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAllow double defs after tail duplication.
Jakob Stoklund Olesen [Wed, 6 Jan 2010 23:52:46 +0000 (23:52 +0000)]
Allow double defs after tail duplication.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92874 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd Target hook to duplicate machine instructions.
Jakob Stoklund Olesen [Wed, 6 Jan 2010 23:47:07 +0000 (23:47 +0000)]
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

12 years agoAddressing mode 6 (load/store) instructions can't encode an immediate offset
Jim Grosbach [Wed, 6 Jan 2010 23:45:18 +0000 (23:45 +0000)]
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

12 years agoAnti-dependency breaking needs to be careful regarding instructions with
Jim Grosbach [Wed, 6 Jan 2010 22:21:25 +0000 (22:21 +0000)]
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

12 years agoMove the object size intrinsic optimization to inst-combine and make
Eric Christopher [Wed, 6 Jan 2010 20:04:44 +0000 (20:04 +0000)]
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

12 years agoComment.
Evan Cheng [Wed, 6 Jan 2010 19:43:21 +0000 (19:43 +0000)]
Comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92850 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach dag combine to fold the following transformation more aggressively:
Evan Cheng [Wed, 6 Jan 2010 19:38:29 +0000 (19:38 +0000)]
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

12 years agoFix struct/class mismatch
Douglas Gregor [Wed, 6 Jan 2010 17:16:00 +0000 (17:16 +0000)]
Fix struct/class mismatch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92841 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen parsing function-local metadata, create a function-local MDNode
Victor Hernandez [Wed, 6 Jan 2010 17:00:21 +0000 (17:00 +0000)]
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

12 years ago80 column and whitespace cleanup
Jim Grosbach [Wed, 6 Jan 2010 16:48:02 +0000 (16:48 +0000)]
80 column and whitespace cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92837 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a README item: have functionattrs look through selects and
Duncan Sands [Wed, 6 Jan 2010 15:37:47 +0000 (15:37 +0000)]
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

12 years agoFormatting.
Mikhail Glushenkov [Wed, 6 Jan 2010 09:20:39 +0000 (09:20 +0000)]
Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92831 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed malformed -*- lines in PBQP headers.
Lang Hames [Wed, 6 Jan 2010 08:53:34 +0000 (08:53 +0000)]
Fixed malformed -*- lines in PBQP headers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92830 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPartially address a README by having functionattrs consider calls to
Duncan Sands [Wed, 6 Jan 2010 08:45:52 +0000 (08:45 +0000)]
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

12 years agoThis is testing a darwin specific feature, so only turn
Duncan Sands [Wed, 6 Jan 2010 05:49:26 +0000 (05:49 +0000)]
This is testing a darwin specific feature, so only turn
it on for darwin (it fails on linux).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92826 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agotweaks suggested by Duncan
Chris Lattner [Wed, 6 Jan 2010 05:32:15 +0000 (05:32 +0000)]
tweaks suggested by Duncan

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92824 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReenable debug info on PPC. Works well enough to
Dale Johannesen [Wed, 6 Jan 2010 02:21:00 +0000 (02:21 +0000)]
Reenable debug info on PPC.  Works well enough to
bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92818 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure debug info hook gets called when emitting
Dale Johannesen [Wed, 6 Jan 2010 02:20:18 +0000 (02:20 +0000)]
Make sure debug info hook gets called when emitting
synonyms for PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92817 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach instcombine's sext elimination logic to be more aggressive.
Chris Lattner [Wed, 6 Jan 2010 01:56:21 +0000 (01:56 +0000)]
Teach instcombine's sext elimination logic to be more aggressive.
Previously, instcombine would only promote an expression tree to
the larger type if doing so eliminated two casts.  This is because
a need to manually do the sign extend after the promoted expression
tree with two shifts.  Now, we keep track of whether the result of
the computation is going to be properly sign extended already.  If
so, we can unconditionally promote the expression, which allows us
to zap more sext's.

This implements rdar://6598839 (aka gcc pr38751)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92815 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and...
Jakob Stoklund Olesen [Wed, 6 Jan 2010 00:29:28 +0000 (00:29 +0000)]
Add <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and kills.

An instruction like this:

  %reg1097:1<def> = VMOVSR %R3<kill>, 14, %reg0

Must be replaced with this when substituting physical registers:

  %S0<def> = VMOVSR %R3<kill>, 14, %reg0, %D0<imp-def>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92812 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThe previous code could potentially cause a cycle. Allow ordering w.r.t. a 0 order.
Bill Wendling [Wed, 6 Jan 2010 00:23:35 +0000 (00:23 +0000)]
The previous code could potentially cause a cycle. Allow ordering w.r.t. a 0 order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92810 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoOnly check the ordering if there is an ordering for each nodes.
Bill Wendling [Wed, 6 Jan 2010 00:09:23 +0000 (00:09 +0000)]
Only check the ordering if there is an ordering for each nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92807 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a semi-primitive form of scheduling via the "SDNode ordering" to the
Bill Wendling [Tue, 5 Jan 2010 23:48:12 +0000 (23:48 +0000)]
Add a semi-primitive form of scheduling via the "SDNode ordering" to the
bottom-up scheduler. We prefer the lower order number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92806 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agosimplify this code.
Chris Lattner [Tue, 5 Jan 2010 23:00:30 +0000 (23:00 +0000)]
simplify this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92800 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove this test from test/Transforms/IndVarSimplify to
Dan Gohman [Tue, 5 Jan 2010 22:52:54 +0000 (22:52 +0000)]
Move this test from test/Transforms/IndVarSimplify to
test/CodeGen/X86, as doesn't use -indvars, and it does use
llc -march=x86-64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92799 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't assign the shift the same type as the variable being shifted. This could
Bill Wendling [Tue, 5 Jan 2010 22:39:10 +0000 (22:39 +0000)]
Don't assign the shift the same type as the variable being shifted. This could
result in illegal types for the SHL operator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92797 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUndo r92785, it caused test failure.
Johnny Chen [Tue, 5 Jan 2010 22:37:28 +0000 (22:37 +0000)]
Undo r92785, it caused test failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92796 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomake this a static function instead of a method.
Chris Lattner [Tue, 5 Jan 2010 22:30:42 +0000 (22:30 +0000)]
make this a static function instead of a method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92795 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
Dan Gohman [Tue, 5 Jan 2010 22:26:32 +0000 (22:26 +0000)]
Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
uses several kinds of opcode values which are not declared within
that enum. This fixes PR5946.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92794 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRe-add parsing of function-local metadata; this time with testcase.
Victor Hernandez [Tue, 5 Jan 2010 22:22:14 +0000 (22:22 +0000)]
Re-add parsing of function-local metadata; this time with testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92793 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomore rearrangement and cleanup, fix my test failure.
Chris Lattner [Tue, 5 Jan 2010 22:21:18 +0000 (22:21 +0000)]
more rearrangement and cleanup, fix my test failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92792 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agocleanup
Chris Lattner [Tue, 5 Jan 2010 22:07:33 +0000 (22:07 +0000)]
cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92790 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoremove two trunc xforms that are subsumed by EvaluateInDifferentType.
Chris Lattner [Tue, 5 Jan 2010 22:01:41 +0000 (22:01 +0000)]
remove two trunc xforms that are subsumed by EvaluateInDifferentType.
The only difference is that EvaluateInDifferentType checks to ensure
they are profitable before doing them :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92788 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomerge some tests.
Chris Lattner [Tue, 5 Jan 2010 21:54:09 +0000 (21:54 +0000)]
merge some tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92786 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd Rt2 to the asm format string for 32-bit Thumb load/store register dual
Johnny Chen [Tue, 5 Jan 2010 21:51:46 +0000 (21:51 +0000)]
Add Rt2 to the asm format string for 32-bit Thumb load/store register dual
instructions.  Thumb does not have the restriction that t2 = t+1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92785 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomerge cast2 into cast.ll
Chris Lattner [Tue, 5 Jan 2010 21:48:13 +0000 (21:48 +0000)]
merge cast2 into cast.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92784 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAllow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}
Devang Patel [Tue, 5 Jan 2010 21:47:32 +0000 (21:47 +0000)]
Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92783 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoremove useless test.
Chris Lattner [Tue, 5 Jan 2010 21:46:22 +0000 (21:46 +0000)]
remove useless test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92782 91177308-0d34-0410-b5e6-96231b3b80d8