oota-llvm.git
14 years agoteach sext optimization to handle truncs from types that are not
Chris Lattner [Sun, 10 Jan 2010 20:30:41 +0000 (20:30 +0000)]
teach sext optimization to handle truncs from types that are not
the dest of the sext.

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

14 years agoteach zext optimization how to deal with truncs that don't come from
Chris Lattner [Sun, 10 Jan 2010 20:25:54 +0000 (20:25 +0000)]
teach zext optimization how to deal with truncs that don't come from
the zext dest type.  This allows us to handle test52/53 in cast.ll,
and allows llvm-gcc to generate much better code for PR4216 in -m64
mode:

_test_bitfield:                                             ## @test_bitfield
orl $32962, %edi
movl %edi, %eax
andl $-25350, %eax
ret

This also fixes a bug handling vector extends, ensuring that the
mask produced is a vector constant, not an integer constant.

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

14 years agofix a buggy assertion, CreateIntegerCast should allow
Chris Lattner [Sun, 10 Jan 2010 20:21:42 +0000 (20:21 +0000)]
fix a buggy assertion, CreateIntegerCast should allow
integer vectors as well as just integers.

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

14 years agoSuppress a warning on gcc 4.4.
Mikhail Glushenkov [Sun, 10 Jan 2010 18:48:49 +0000 (18:48 +0000)]
Suppress a warning on gcc 4.4.

warning: suggest parentheses around ‘&&’ within ‘||’.

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

14 years agosimplify CanEvaluateSExtd to return a bool now that we have a
Chris Lattner [Sun, 10 Jan 2010 07:57:20 +0000 (07:57 +0000)]
simplify CanEvaluateSExtd to return a bool now that we have a
simpler profitability predicate.

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

14 years agothe NumCastsRemoved argument to CanEvaluateSExtd is dead, remove it.
Chris Lattner [Sun, 10 Jan 2010 07:42:21 +0000 (07:42 +0000)]
the NumCastsRemoved argument to CanEvaluateSExtd is dead, remove it.

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

14 years agonow that the cost model has changed, we can always consider
Chris Lattner [Sun, 10 Jan 2010 07:40:50 +0000 (07:40 +0000)]
now that the cost model has changed, we can always consider
elimination of a sign extend to be a win, which simplifies
the client of CanEvaluateSExtd, and allows us to eliminate
more casts (examples taken from real code).

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

14 years agoCompute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnr...
Victor Hernandez [Sun, 10 Jan 2010 07:14:18 +0000 (07:14 +0000)]
Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().

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

14 years agochange the preferred canonical form for a sign extension to be
Chris Lattner [Sun, 10 Jan 2010 07:08:30 +0000 (07:08 +0000)]
change the preferred canonical form for a sign extension to be
lshr+ashr instead of trunc+sext.  We want to avoid type
conversions whenever possible, it is easier to codegen expressions
without truncates and extensions.

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

14 years agofix indentation of switch statements, no functionality change.
Chris Lattner [Sun, 10 Jan 2010 06:59:55 +0000 (06:59 +0000)]
fix indentation of switch statements, no functionality change.

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

14 years agofix pasto that broke bootstrap.
Chris Lattner [Sun, 10 Jan 2010 06:50:04 +0000 (06:50 +0000)]
fix pasto that broke bootstrap.

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

14 years agosimplify CanEvaluateZExtd now that we don't care about the number of
Chris Lattner [Sun, 10 Jan 2010 02:50:04 +0000 (02:50 +0000)]
simplify CanEvaluateZExtd now that we don't care about the number of
bits known clear in the result and don't care about the # casts
eliminated.  TD is also dead but keeping it for now.

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

14 years agotwo changes:
Chris Lattner [Sun, 10 Jan 2010 02:39:31 +0000 (02:39 +0000)]
two changes:
1) don't try to optimize a sext or zext that is only used by a trunc, let
   the trunc get optimized first.  This avoids some pointless effort in
   some common cases since instcombine scans down a block in the first pass.
2) Change the cost model for zext elimination to consider an 'and' cheaper
   than a zext.  This allows us to do it more aggressively, and for the next
   patch to simplify the code quite a bit.

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

14 years agoenhance CanEvaluateZExtd to handle shift left and sext, allowing
Chris Lattner [Sun, 10 Jan 2010 02:22:12 +0000 (02:22 +0000)]
enhance CanEvaluateZExtd to handle shift left and sext, allowing
more expressions to be promoted and casts eliminated.

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

14 years agoremove an xform subsumed by EvaluateInDifferentType.
Chris Lattner [Sun, 10 Jan 2010 01:35:55 +0000 (01:35 +0000)]
remove an xform subsumed by EvaluateInDifferentType.

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

14 years agoFix nondeterministic behavior.
Julien Lerouge [Sun, 10 Jan 2010 01:07:22 +0000 (01:07 +0000)]
Fix nondeterministic behavior.

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

14 years agoclean up this xform by using m_Trunc.
Chris Lattner [Sun, 10 Jan 2010 01:04:31 +0000 (01:04 +0000)]
clean up this xform by using m_Trunc.

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

14 years agoinline and remove the rest of commonIntCastTransforms.
Chris Lattner [Sun, 10 Jan 2010 01:00:46 +0000 (01:00 +0000)]
inline and remove the rest of commonIntCastTransforms.

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

14 years agoInline the expression type promotion/demotion stuff out of
Chris Lattner [Sun, 10 Jan 2010 00:58:42 +0000 (00:58 +0000)]
Inline the expression type promotion/demotion stuff out of
commonIntCastTransforms into the callers, eliminating a switch,
and allowing the static predicate  methods to be moved down to
live next to the corresponding function.  No functionality
change.

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

14 years agohopefully unbreak the ocaml bindings.
Chris Lattner [Sat, 9 Jan 2010 23:25:21 +0000 (23:25 +0000)]
hopefully unbreak the ocaml bindings.

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

14 years agoadd 3 passes which have been added but aren't used afaik.
Chris Lattner [Sat, 9 Jan 2010 22:30:40 +0000 (22:30 +0000)]
add 3 passes which have been added but aren't used afaik.

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

14 years ago"In order to ease automatic bindings generation, it would be helpful if boolean value...
Chris Lattner [Sat, 9 Jan 2010 22:27:07 +0000 (22:27 +0000)]
"In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."

Patch by James Y Knight!

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

14 years agoClarify the requirements for a "tail call" to actually be optimized into a
Jeffrey Yasskin [Sat, 9 Jan 2010 19:44:16 +0000 (19:44 +0000)]
Clarify the requirements for a "tail call" to actually be optimized into a
jump.  People clearly weren't finding the extra requirements in
CodeGenerator.html.

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

14 years agofix bogus test
Chris Lattner [Sat, 9 Jan 2010 19:24:49 +0000 (19:24 +0000)]
fix bogus test

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

14 years agofix bogus test
Chris Lattner [Sat, 9 Jan 2010 19:24:18 +0000 (19:24 +0000)]
fix bogus test

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

14 years agofix PR5983, reject function bodies with no blocks per the grammar.
Chris Lattner [Sat, 9 Jan 2010 19:20:07 +0000 (19:20 +0000)]
fix PR5983, reject function bodies with no blocks per the grammar.

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

14 years agoimprove documentation for linkonce to be less confusing.
Chris Lattner [Sat, 9 Jan 2010 19:15:14 +0000 (19:15 +0000)]
improve documentation for linkonce to be less confusing.

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

14 years agoFix http://llvm.org/PR5729: x86-64 tail calls were putting their targets into
Jeffrey Yasskin [Sat, 9 Jan 2010 18:56:43 +0000 (18:56 +0000)]
Fix llvm.org/PR5729: x86-64 tail calls were putting their targets into
R11, and then asserting that the target was in R9.  Since R9 isn't reserved for
the target anymore, and is used as an argument, this patch changes the
assertion.

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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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