oota-llvm.git
14 years agoClean up unnecessary return and brackets
Victor Hernandez [Thu, 14 Jan 2010 01:46:02 +0000 (01:46 +0000)]
Clean up unnecessary return and brackets

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

14 years agoAdd MDNode::getFunction(), which figures out the metadata's function, if it has funct...
Victor Hernandez [Thu, 14 Jan 2010 01:45:14 +0000 (01:45 +0000)]
Add MDNode::getFunction(), which figures out the metadata's function, if it has function that it is local to.

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

14 years agoDon't fold insufficiently aligned ldr/str into ldm/stm instructions.
Jakob Stoklund Olesen [Thu, 14 Jan 2010 00:54:10 +0000 (00:54 +0000)]
Don't fold insufficiently aligned ldr/str into ldm/stm instructions.

An unaligned ldr causes a trap, and is then emulated by the kernel with
awesome performance. The darwin kernel does not emulate unaligned ldm/stm
Thumb2 instructions, so don't generate them.

This fixes the miscompilation of Multisource/Applications/JM/lencod for Thumb2.

Generating unaligned ldr/str pairs from a 16-bit aligned memcpy is probably
also a bad idea, but that is beyond the scope of this patch.

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

14 years agoErm, previous patch was wrong; Thanks Bill\!
Stuart Hastings [Thu, 14 Jan 2010 00:34:53 +0000 (00:34 +0000)]
Erm, previous patch was wrong; Thanks Bill\!

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

14 years agoEnable assertions by default for Apple-style builds.
Stuart Hastings [Thu, 14 Jan 2010 00:22:05 +0000 (00:22 +0000)]
Enable assertions by default for Apple-style builds.

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

14 years agothis is an SSE-specific issue.
Chris Lattner [Wed, 13 Jan 2010 23:29:11 +0000 (23:29 +0000)]
this is an SSE-specific issue.

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

14 years agoX86 if conversion + tail merging issues from PR6032.
Chris Lattner [Wed, 13 Jan 2010 23:28:40 +0000 (23:28 +0000)]
X86 if conversion + tail merging issues from PR6032.

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

14 years agoWhen the visitSub method was split into visitSub and visitFSub, this xform was
Bill Wendling [Wed, 13 Jan 2010 23:23:17 +0000 (23:23 +0000)]
When the visitSub method was split into visitSub and visitFSub, this xform was
added to the FSub version. However, the original version of this xform guarded
against doing this for floating point (!Op0->getType()->isFPOrFPVector()).

This is causing LLVM to perform incorrect xforms for code like:

void func(double *rhi, double *rlo, double xh, double xl, double yh, double yl){
  double mh, ml;
  double c = 134217729.0;
  double up, u1, u2, vp, v1, v2;

  up = xh*c;
  u1 = (xh - up) + up;
  u2 = xh - u1;

  vp = yh*c;
  v1 = (yh - vp) + vp;
  v2 = yh - v1;

  mh = xh*yh;
  ml = (((u1*v1 - mh) + (u1*v2)) + (u2*v1)) + (u2*v2);
  ml += xh*yl + xl*yh;

  *rhi = mh + ml;
  *rlo = (mh - (*rhi)) + ml;
}

The last line was optimized away, but rl is intended to be the difference
between the infinitely precise result of mh + ml and after it has been rounded
to double precision.

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

14 years agoAdd getSource() to SuccIterator
Tobias Grosser [Wed, 13 Jan 2010 22:21:43 +0000 (22:21 +0000)]
Add getSource() to SuccIterator

Get the source BB of an iterator.

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

14 years agoExtend SuccIterator
Tobias Grosser [Wed, 13 Jan 2010 22:21:28 +0000 (22:21 +0000)]
Extend SuccIterator

Implement most of the missing methods to make SuccIterator random access.
operator[] is still missing.

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

14 years agothis test requires SSE, thanks to jyasskin for pointing this out.
Chris Lattner [Wed, 13 Jan 2010 21:51:41 +0000 (21:51 +0000)]
this test requires SSE, thanks to jyasskin for pointing this out.

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

14 years agomakeNameProper is now private!
Chris Lattner [Wed, 13 Jan 2010 21:31:39 +0000 (21:31 +0000)]
makeNameProper is now private!

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

14 years agofix ELF section mangling stuff for weak symbols to not use
Chris Lattner [Wed, 13 Jan 2010 21:29:21 +0000 (21:29 +0000)]
fix ELF section mangling stuff for weak symbols to not use
obsolete Mangler interfaces.

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

14 years agoFix comment typo
Victor Hernandez [Wed, 13 Jan 2010 21:25:04 +0000 (21:25 +0000)]
Fix comment typo

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

14 years agotidy
Chris Lattner [Wed, 13 Jan 2010 21:21:29 +0000 (21:21 +0000)]
tidy

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

14 years agoreduce duplicate mangling logic by using MCSymbol::printMangledName.
Chris Lattner [Wed, 13 Jan 2010 21:12:34 +0000 (21:12 +0000)]
reduce duplicate mangling logic by using MCSymbol::printMangledName.

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

14 years agoexpose a static function as a static method on the MCSymbol class.
Chris Lattner [Wed, 13 Jan 2010 21:09:59 +0000 (21:09 +0000)]
expose a static function as a static method on the MCSymbol class.

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

14 years agoFixed a couple of places for Thumb MOV where encoding bits are underspecified.
Johnny Chen [Wed, 13 Jan 2010 21:00:26 +0000 (21:00 +0000)]
Fixed a couple of places for Thumb MOV where encoding bits are underspecified.

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

14 years agoFix pasto
Jakob Stoklund Olesen [Wed, 13 Jan 2010 19:54:39 +0000 (19:54 +0000)]
Fix pasto

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

14 years agostop the CBE from using deprecated Mangler stuff.
Chris Lattner [Wed, 13 Jan 2010 19:54:07 +0000 (19:54 +0000)]
stop the CBE from using deprecated Mangler stuff.

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

14 years agoWrite function-local metadata as a metadata subblock of a funciton block
Victor Hernandez [Wed, 13 Jan 2010 19:37:33 +0000 (19:37 +0000)]
Write function-local metadata as a metadata subblock of a funciton block

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

14 years agoEnumerate function-local metadata (and its types and operands) only during function...
Victor Hernandez [Wed, 13 Jan 2010 19:36:16 +0000 (19:36 +0000)]
Enumerate function-local metadata (and its types and operands) only during function-incorporation, global metadata continues to be enumerated during creation of ValueEnumerator

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

14 years agoParse function-local metadata inside function blocks
Victor Hernandez [Wed, 13 Jan 2010 19:34:08 +0000 (19:34 +0000)]
Parse function-local metadata inside function blocks

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

14 years agoUse the GV version of getNameWithPrefix in TargetLoweringObjectFileCOFF::
Chris Lattner [Wed, 13 Jan 2010 19:19:17 +0000 (19:19 +0000)]
Use the GV version of getNameWithPrefix in TargetLoweringObjectFileCOFF::
SelectSectionForGlobal, unbreaking weak globals with no-name.

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

14 years agoCommit some changes I had managed to lose last night while refactoring the code....
Evan Cheng [Wed, 13 Jan 2010 19:16:39 +0000 (19:16 +0000)]
Commit some changes I had managed to lose last night while refactoring the code. Avoid change use of PHI instructions because it's not legal to insert any instructions before them.
This fixes PR6027.

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

14 years agojust finish MCizing FnStubInfo which cleans it up and simplifies it.
Chris Lattner [Wed, 13 Jan 2010 19:13:16 +0000 (19:13 +0000)]
just finish MCizing FnStubInfo which cleans it up and simplifies it.

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

14 years agodon't call getNameWithPrefix repeatedly and unnecesarily.
Chris Lattner [Wed, 13 Jan 2010 19:05:36 +0000 (19:05 +0000)]
don't call getNameWithPrefix repeatedly and unnecesarily.

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

14 years agoproperly use MCSymbol to print the strings aquired from getNameWithPrefix.
Chris Lattner [Wed, 13 Jan 2010 19:00:57 +0000 (19:00 +0000)]
properly use MCSymbol to print the strings aquired from getNameWithPrefix.

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

14 years agoIntroduce Twine::toStringRef, a variant of toVector which avoids the copy if the
Benjamin Kramer [Wed, 13 Jan 2010 12:45:23 +0000 (12:45 +0000)]
Introduce Twine::toStringRef, a variant of toVector which avoids the copy if the
twine can be represented as a single StringRef. Use the new methode to simplify
some twine users.

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

14 years agoRe-enable extension optimization pass.
Evan Cheng [Wed, 13 Jan 2010 08:45:40 +0000 (08:45 +0000)]
Re-enable extension optimization pass.

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

14 years agoupgrade and MC'ize a few uses of makeNameProper.
Chris Lattner [Wed, 13 Jan 2010 08:08:33 +0000 (08:08 +0000)]
upgrade and MC'ize a few uses of makeNameProper.

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

14 years agoMC'ize this a bit and upgrade APIs
Chris Lattner [Wed, 13 Jan 2010 08:04:24 +0000 (08:04 +0000)]
MC'ize this a bit and upgrade APIs

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

14 years agoadd a fixme, ELF MCSection isn't quite right and weak unnamed globals are broken
Chris Lattner [Wed, 13 Jan 2010 08:02:14 +0000 (08:02 +0000)]
add a fixme, ELF MCSection isn't quite right and weak unnamed globals are broken
on linux (even though they are pointless, they shouldn't ICE).

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

14 years agoFor now, avoid issuing extract_subreg to reuse lower 8-bit, it's not safe in 32-bit.
Evan Cheng [Wed, 13 Jan 2010 08:01:32 +0000 (08:01 +0000)]
For now, avoid issuing extract_subreg to reuse lower 8-bit, it's not safe in 32-bit.

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

14 years agoAdd comment; refactor; avoid pulling in DT if it's not used.
Evan Cheng [Wed, 13 Jan 2010 07:59:13 +0000 (07:59 +0000)]
Add comment; refactor; avoid pulling in DT if it's not used.

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

14 years agoeliminate some uses of Mangler::makeNameProper.
Chris Lattner [Wed, 13 Jan 2010 07:56:59 +0000 (07:56 +0000)]
eliminate some uses of Mangler::makeNameProper.

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

14 years agodon't add the \1 to the name.
Chris Lattner [Wed, 13 Jan 2010 07:50:21 +0000 (07:50 +0000)]
don't add the \1 to the name.

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

14 years agoremove uses of deprecated functions, this generates slightly
Chris Lattner [Wed, 13 Jan 2010 07:30:49 +0000 (07:30 +0000)]
remove uses of deprecated functions, this generates slightly
different BlockAddress labels, but nothing semantically important.

Add a FIXME that BlockAddress codegen is broken if the LLVM BB has
an empty name (e.g. strip was run).

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

14 years agouse the new form of getNameWithPrefix, not makeNameProper.
Chris Lattner [Wed, 13 Jan 2010 07:16:53 +0000 (07:16 +0000)]
use the new form of getNameWithPrefix, not makeNameProper.
Among other things, this would do very weird things if the
basic block name had (e.g.) a space in it on darwin:
makeNameProper would add quotes, then the mcsymbol would
escape the quotes.

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

14 years agoadd new isSingleStringRef()/getSingleStringRef() methods to twine,
Chris Lattner [Wed, 13 Jan 2010 07:12:06 +0000 (07:12 +0000)]
add new isSingleStringRef()/getSingleStringRef() methods to twine,
and use them to avoid a copy of a string in getNameWithPrefix in
the common case.  It seems like Value::setName and other places
should use this as well?

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

14 years agough, my last patch just sped up a method and changed all the clients
Chris Lattner [Wed, 13 Jan 2010 07:01:09 +0000 (07:01 +0000)]
ugh, my last patch just sped up a method and changed all the clients
that I want to completely eliminate.  Add fixme's so I remember this
in the future, and add the missing helper that they should be upgraded
to use instead.

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

14 years agochange Mangler::makeNameProper to return its result in a SmallVector
Chris Lattner [Wed, 13 Jan 2010 06:38:18 +0000 (06:38 +0000)]
change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string.  Based on this change:

1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
   making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
   prefixes, not use temporary std::strings, and to avoid other crimes.

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

14 years agomy mistake, Mangler::makeNameProper wants to take a twine, not a stringref!
Chris Lattner [Wed, 13 Jan 2010 05:02:57 +0000 (05:02 +0000)]
my mistake, Mangler::makeNameProper wants to take a twine, not a stringref!

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

14 years agochange makeNameProper to take a stringref instead of std::string.
Chris Lattner [Wed, 13 Jan 2010 04:55:33 +0000 (04:55 +0000)]
change makeNameProper to take a stringref instead of std::string.

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

14 years agogive StringRef a const_iterator member.
Chris Lattner [Wed, 13 Jan 2010 04:50:20 +0000 (04:50 +0000)]
give StringRef a const_iterator member.

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

14 years agofix assert in AsmPrinter::EmitGlobalConstantLargeInt to match reality.
Chris Lattner [Wed, 13 Jan 2010 04:39:46 +0000 (04:39 +0000)]
fix assert in AsmPrinter::EmitGlobalConstantLargeInt to match reality.

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

14 years agoreduce nesting and code duplication in AsmPrinter::EmitGlobalConstantLargeInt.
Chris Lattner [Wed, 13 Jan 2010 04:38:16 +0000 (04:38 +0000)]
reduce nesting and code duplication in AsmPrinter::EmitGlobalConstantLargeInt.

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

14 years agoreduce indentation and add a fast-path to EmitGlobalConstant for 8-byte
Chris Lattner [Wed, 13 Jan 2010 04:34:19 +0000 (04:34 +0000)]
reduce indentation and add a fast-path to EmitGlobalConstant for 8-byte
integers on 64-bit systems.

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

14 years agoreduce indentation and use early exits in AsmPrinter::EmitConstantValueOnly
Chris Lattner [Wed, 13 Jan 2010 04:29:19 +0000 (04:29 +0000)]
reduce indentation and use early exits in AsmPrinter::EmitConstantValueOnly

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

14 years agoRevert 93270 pending investigation of how stray non-constant values end up in ValueEn...
Victor Hernandez [Wed, 13 Jan 2010 03:18:30 +0000 (03:18 +0000)]
Revert 93270 pending investigation of how stray non-constant values end up in ValueEnumerator's ValueList during WriteConstants()

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

14 years agoDisable opt-ext pass to unbreak the build for now.
Evan Cheng [Wed, 13 Jan 2010 01:51:43 +0000 (01:51 +0000)]
Disable opt-ext pass to unbreak the build for now.

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

14 years agoRemove debug option I accidentally left in.
Evan Cheng [Wed, 13 Jan 2010 01:43:20 +0000 (01:43 +0000)]
Remove debug option I accidentally left in.

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

14 years agoFix a comment.
Dale Johannesen [Wed, 13 Jan 2010 01:39:38 +0000 (01:39 +0000)]
Fix a comment.

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

14 years agoUpdate CMake file.
Ted Kremenek [Wed, 13 Jan 2010 01:02:47 +0000 (01:02 +0000)]
Update CMake file.

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

14 years agoRemove the JustSP single-register regclass.
Jakob Stoklund Olesen [Wed, 13 Jan 2010 00:43:06 +0000 (00:43 +0000)]
Remove the JustSP single-register regclass.

It was only being used by instructions with the t_addrmode_sp addressing mode,
and that is pattern matched in a way that guarantees SP is used. There is
never any register allocation done from this class.

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

14 years agoTry to fix the ARM and PPC buildbots. The -mattr=vector-unaligned-mem
Jeffrey Yasskin [Wed, 13 Jan 2010 00:31:43 +0000 (00:31 +0000)]
Try to fix the ARM and PPC buildbots. The -mattr=vector-unaligned-mem
flag doesn't exist there, and this is an x86 test.

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

14 years agoAdd a quick pass to optimize sign / zero extension instructions. For targets where...
Evan Cheng [Wed, 13 Jan 2010 00:30:23 +0000 (00:30 +0000)]
Add a quick pass to optimize sign / zero extension instructions. For targets where the pre-extension values are available in the subreg of the result of the extension, replace the uses of the pre-extension value with the result + extract_subreg.

For now, this pass is fairly conservative. It only perform the replacement when both the pre- and post- extension values are used in the block. It will miss cases where the post-extension values are live, but not used.

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

14 years agoFurther progration of metadata operands. The
Dale Johannesen [Wed, 13 Jan 2010 00:00:24 +0000 (00:00 +0000)]
Further progration of metadata operands.  The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.

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

14 years agoMake WriteConstants() more robust against stray values in ValueEnumerator's ValueList
Victor Hernandez [Tue, 12 Jan 2010 23:37:59 +0000 (23:37 +0000)]
Make WriteConstants() more robust against stray values in ValueEnumerator's ValueList

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

14 years agoFix a comment typo.
Bob Wilson [Tue, 12 Jan 2010 22:18:56 +0000 (22:18 +0000)]
Fix a comment typo.

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

14 years agouse consistent tag kinds for ilist_traits
Chris Lattner [Tue, 12 Jan 2010 22:00:04 +0000 (22:00 +0000)]
use consistent tag kinds for ilist_traits

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

14 years ago1) Use the new SimplifyInstructionsInBlock routine instead of the copy
Chris Lattner [Tue, 12 Jan 2010 20:41:47 +0000 (20:41 +0000)]
1) Use the new SimplifyInstructionsInBlock routine instead of the copy
in JT.

2) When cloning blocks for PHI or xor conditions, use
instsimplify to simplify the code as we go.  This allows us to
squish common cases early in JT which opens up opportunities for
subsequent iterations, and allows it to completely simplify the
testcase.

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

14 years agoadd a helper function.
Chris Lattner [Tue, 12 Jan 2010 19:40:54 +0000 (19:40 +0000)]
add a helper function.

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

14 years agoUse Twine, instead of StringRef, for consistency.
Devang Patel [Tue, 12 Jan 2010 18:57:56 +0000 (18:57 +0000)]
Use Twine, instead of StringRef, for consistency.

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

14 years agoUse ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.
Devang Patel [Tue, 12 Jan 2010 18:34:06 +0000 (18:34 +0000)]
Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.

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

14 years agoEliminate or_not_add and just use AddedComplexity so isel tries or_is_add patterns...
Evan Cheng [Tue, 12 Jan 2010 18:31:19 +0000 (18:31 +0000)]
Eliminate or_not_add and just use AddedComplexity so isel tries or_is_add patterns first.

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

14 years agoAdd nounwind.
Evan Cheng [Tue, 12 Jan 2010 18:29:23 +0000 (18:29 +0000)]
Add nounwind.

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

14 years agoRevert commit 93204, since it causes the assembler to barf
Duncan Sands [Tue, 12 Jan 2010 17:46:16 +0000 (17:46 +0000)]
Revert commit 93204, since it causes the assembler to barf
on x86-64 linux with messages like this:
Error: Incorrect register `%r14' used with `l' suffix

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

14 years agoFix typo.
Duncan Sands [Tue, 12 Jan 2010 08:30:46 +0000 (08:30 +0000)]
Fix typo.

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

14 years agoTweak commit 91745, which changed target data for both Mingw and Cygwin,
Duncan Sands [Tue, 12 Jan 2010 08:21:07 +0000 (08:21 +0000)]
Tweak commit 91745, which changed target data for both Mingw and Cygwin,
to not touch Cygwin: the change caused llvm-gcc build failures due to
long double getting the wrong size.  Patch by Aaron Gray.

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

14 years agoMake several tests less fragile.
Dan Gohman [Tue, 12 Jan 2010 04:52:47 +0000 (04:52 +0000)]
Make several tests less fragile.

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

14 years agoReapply the MOV64r0 patch, with a fix: MOV64r0 clobbers EFLAGS.
Dan Gohman [Tue, 12 Jan 2010 04:42:54 +0000 (04:42 +0000)]
Reapply the MOV64r0 patch, with a fix: MOV64r0 clobbers EFLAGS.

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

14 years agoUpdate a partially obsolete comment.
Dan Gohman [Tue, 12 Jan 2010 04:32:35 +0000 (04:32 +0000)]
Update a partially obsolete comment.

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

14 years agoFix a typo in a comment.
Dan Gohman [Tue, 12 Jan 2010 04:30:26 +0000 (04:30 +0000)]
Fix a typo in a comment.

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

14 years agotidy up
Chris Lattner [Tue, 12 Jan 2010 02:07:50 +0000 (02:07 +0000)]
tidy up

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

14 years agoTeach jump threading to duplicate small blocks when the branch
Chris Lattner [Tue, 12 Jan 2010 02:07:17 +0000 (02:07 +0000)]
Teach jump threading to duplicate small blocks when the branch
condition is a xor with a phi node.  This eliminates nonsense
like this from 176.gcc in several places:

 LBB166_84:
        testl   %eax, %eax
-       setne   %al
-       xorb    %cl, %al
-       notb    %al
-       testb   $1, %al
-       je      LBB166_85
+       je      LBB166_69
+       jmp     LBB166_85

This is rdar://7391699

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

14 years agoAdd MO_Metadata as an operand kind. Not used yet.
Dale Johannesen [Tue, 12 Jan 2010 02:01:53 +0000 (02:01 +0000)]
Add MO_Metadata as an operand kind.  Not used yet.

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

14 years agoAdd TargetInstrInfo::isCoalescableInstr. It returns true if the specified
Evan Cheng [Tue, 12 Jan 2010 00:09:37 +0000 (00:09 +0000)]
Add TargetInstrInfo::isCoalescableInstr. It returns true if the specified
instruction is copy like where the source and destination registers can
overlap. This is to be used by the coalescable to coalesce the source and
destination registers of instructions like X86::MOVSX64rr32. Apparently
some crazy people believe the coalescer is too simple.

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

14 years agosome cleanup, and make it obvious that ProcessJumpOnPHI only works
Chris Lattner [Mon, 11 Jan 2010 23:41:09 +0000 (23:41 +0000)]
some cleanup, and make it obvious that ProcessJumpOnPHI only works
on branches by renaming it and checking for a branch at the call site.

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

14 years agodisable this testcase, PR5997
Chris Lattner [Mon, 11 Jan 2010 23:18:33 +0000 (23:18 +0000)]
disable this testcase, PR5997

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

14 years agoAdd manual ISD::OR fastisel selection routines. TableGen is no longer autogen them...
Evan Cheng [Mon, 11 Jan 2010 22:59:27 +0000 (22:59 +0000)]
Add manual ISD::OR fastisel selection routines. TableGen is no longer autogen them after 93152 and 93191.

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

14 years agoAdd documentation for llvm.dbg.value intrinsic
Victor Hernandez [Mon, 11 Jan 2010 22:53:48 +0000 (22:53 +0000)]
Add documentation for llvm.dbg.value intrinsic

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

14 years agoreenable the piece that turns trunc(zext(x)) -> x even if zext has multiple uses,
Chris Lattner [Mon, 11 Jan 2010 22:49:40 +0000 (22:49 +0000)]
reenable the piece that turns trunc(zext(x)) -> x even if zext has multiple uses,
codegen has no apparent problem with the trunc version of this, because it turns
into a simple subreg idiom

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

14 years agoDisable folding sext(trunc(x)) -> x (and other similar cast/cast cases) when the
Chris Lattner [Mon, 11 Jan 2010 22:45:25 +0000 (22:45 +0000)]
Disable folding sext(trunc(x)) -> x (and other similar cast/cast cases) when the
trunc has multiple uses.  Codegen is not able to coalesce the subreg case
correctly and so this leads to higher register pressure and spilling (see PR5997).

This speeds up 256.bzip2 from 8.60 -> 8.04s on my machine, ~7%.

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

14 years agoConsolidate ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, and Conve...
Victor Hernandez [Mon, 11 Jan 2010 22:31:58 +0000 (22:31 +0000)]
Consolidate ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, and ConvertValIDToValue into a more powerful ConvertValIDToValue() that does all three's work

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

14 years agoRemove trailing white spaces in post dominators header file
Tobias Grosser [Mon, 11 Jan 2010 22:22:46 +0000 (22:22 +0000)]
Remove trailing white spaces in post dominators header file

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

14 years agoAdd getNode() to post dominators.
Tobias Grosser [Mon, 11 Jan 2010 22:22:32 +0000 (22:22 +0000)]
Add getNode() to post dominators.

Implement the same interface as already available for dominators.

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

14 years agoExtend r93152 to work on OR r, r. If the source set bits are known not to overlap...
Evan Cheng [Mon, 11 Jan 2010 22:03:29 +0000 (22:03 +0000)]
Extend r93152 to work on OR r, r. If the source set bits are known not to overlap, then select as an ADD instead.

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

14 years agoreduce this to a sensible testcase.
Chris Lattner [Mon, 11 Jan 2010 21:58:19 +0000 (21:58 +0000)]
reduce this to a sensible testcase.

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

14 years agoShorten up this testcase.
David Greene [Mon, 11 Jan 2010 21:50:35 +0000 (21:50 +0000)]
Shorten up this testcase.

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

14 years agoRevert 93158. It's breaking quite a few x86_64 tests.
Evan Cheng [Mon, 11 Jan 2010 21:13:41 +0000 (21:13 +0000)]
Revert 93158. It's breaking quite a few x86_64 tests.

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

14 years agoAvoid adding PHI arguments for a predecessor that has gone away when a BRCOND was...
Jakob Stoklund Olesen [Mon, 11 Jan 2010 21:02:33 +0000 (21:02 +0000)]
Avoid adding PHI arguments for a predecessor that has gone away when a BRCOND was constant folded.

This fixes PR5980.

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

14 years agoRemove unused string functions.
Benjamin Kramer [Mon, 11 Jan 2010 20:33:12 +0000 (20:33 +0000)]
Remove unused string functions.

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

14 years agoDo not turn 8-bit OR to ADD since ADD8ri is not 3-addressfiable.
Evan Cheng [Mon, 11 Jan 2010 20:18:04 +0000 (20:18 +0000)]
Do not turn 8-bit OR to ADD since ADD8ri is not 3-addressfiable.

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

14 years agoDisable transformation of select of two loads to a select of address and then a load...
Mon P Wang [Mon, 11 Jan 2010 20:12:49 +0000 (20:12 +0000)]
Disable transformation of select of two loads to a select of address and then a load if the
loads are not in the default address space because the transformation discards src value info.

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

14 years agoAdd StrInStrNoCase, a StringRef version of CStrInCStrNoCase.
Benjamin Kramer [Mon, 11 Jan 2010 19:45:18 +0000 (19:45 +0000)]
Add StrInStrNoCase, a StringRef version of CStrInCStrNoCase.

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

14 years agoAdd top level section for named metadata.
Devang Patel [Mon, 11 Jan 2010 19:35:55 +0000 (19:35 +0000)]
Add top level section for named metadata.

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

14 years agoImprove unclear bits and inaccuracies in structure and insertvalue
Jeffrey Yasskin [Mon, 11 Jan 2010 19:19:26 +0000 (19:19 +0000)]
Improve unclear bits and inaccuracies in structure and insertvalue
documentation.

Patch by Dustin Laurence!

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

14 years agoUpdate the -tailcallopt description to match djg's improvements to the calling
Jeffrey Yasskin [Mon, 11 Jan 2010 18:53:47 +0000 (18:53 +0000)]
Update the -tailcallopt description to match djg's improvements to the calling
convention.

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

14 years agos/NextValueNo/NextMDValueNo while processing metadata.
Devang Patel [Mon, 11 Jan 2010 18:52:33 +0000 (18:52 +0000)]
s/NextValueNo/NextMDValueNo while processing metadata.

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