oota-llvm.git
14 years agoInitial support for different kinds of FU reservation.
Anton Korobeynikov [Wed, 7 Apr 2010 18:19:32 +0000 (18:19 +0000)]
Initial support for different kinds of FU reservation.

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

14 years agoFactor out scoreboard into separate class. This way we might have several different...
Anton Korobeynikov [Wed, 7 Apr 2010 18:19:24 +0000 (18:19 +0000)]
Factor out scoreboard into separate class. This way we might have several different score boards.

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

14 years agoSome bits of A9 scheduling: VFP
Anton Korobeynikov [Wed, 7 Apr 2010 18:19:18 +0000 (18:19 +0000)]
Some bits of A9 scheduling: VFP

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

14 years agoSeparate const from non-const stuff during mergeing
Anton Korobeynikov [Wed, 7 Apr 2010 18:19:13 +0000 (18:19 +0000)]
Separate const from non-const stuff during mergeing

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

14 years agoSome initial version of global merger
Anton Korobeynikov [Wed, 7 Apr 2010 18:19:07 +0000 (18:19 +0000)]
Some initial version of global merger

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

14 years agoAdd hook to insert late LLVM=>LLVM passes just before isel
Anton Korobeynikov [Wed, 7 Apr 2010 18:18:42 +0000 (18:18 +0000)]
Add hook to insert late LLVM=>LLVM passes just before isel

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

14 years agofix 80 col violation, patch by Alastair Lynn
Chris Lattner [Wed, 7 Apr 2010 18:13:33 +0000 (18:13 +0000)]
fix 80 col violation, patch by Alastair Lynn

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

14 years agoadd a comment line that got dropped
Chris Lattner [Wed, 7 Apr 2010 18:10:38 +0000 (18:10 +0000)]
add a comment line that got dropped

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

14 years agothis has a pr!
Chris Lattner [Wed, 7 Apr 2010 18:04:56 +0000 (18:04 +0000)]
this has a pr!

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

14 years agofix a latent bug my inline asm stuff exposed:
Chris Lattner [Wed, 7 Apr 2010 18:03:19 +0000 (18:03 +0000)]
fix a latent bug my inline asm stuff exposed:
MachineOperand::isIdenticalTo wasn't handling metadata operands.

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

14 years agoRemove unused method.
Benjamin Kramer [Wed, 7 Apr 2010 11:23:46 +0000 (11:23 +0000)]
Remove unused method.

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

14 years agoWorkaround the breakage in r100616 by guarding all timers with
Torok Edwin [Wed, 7 Apr 2010 10:44:46 +0000 (10:44 +0000)]
Workaround the breakage in r100616 by guarding all timers with
TimePassesIsEnabled. This should allow make check to pass.

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

14 years agoUse the "NamedGroupTimer" class to categorize DWARF emission better.
Bill Wendling [Wed, 7 Apr 2010 09:28:04 +0000 (09:28 +0000)]
Use the "NamedGroupTimer" class to categorize DWARF emission better.

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

14 years agoUse raw_ostream.
Benjamin Kramer [Wed, 7 Apr 2010 09:26:51 +0000 (09:26 +0000)]
Use raw_ostream.

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

14 years agoRemove XFAIL for vg_leak as the leaks are fixed by 100601.
Sanjiv Gupta [Wed, 7 Apr 2010 07:06:48 +0000 (07:06 +0000)]
Remove XFAIL for vg_leak as the leaks are fixed by 100601.

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

14 years agoUpdate langref for memcpy, memmove, and memset
Mon P Wang [Wed, 7 Apr 2010 06:35:53 +0000 (06:35 +0000)]
Update langref for memcpy, memmove, and memset

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

14 years agoAdd comments for missed opportunities.
Evan Cheng [Wed, 7 Apr 2010 06:00:33 +0000 (06:00 +0000)]
Add comments for missed opportunities.

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

14 years agoFix typo.
Evan Cheng [Wed, 7 Apr 2010 05:59:12 +0000 (05:59 +0000)]
Fix typo.

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

14 years agoHave the inst emitter add the !srcloc mdnode to the machine instr.
Chris Lattner [Wed, 7 Apr 2010 05:38:05 +0000 (05:38 +0000)]
Have the inst emitter add the !srcloc mdnode to the machine instr.
Have the asmprinter use the mdnode to scavenge a source location if
present.  Document this nonsense in langref.

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

14 years agoremove another magic number.
Chris Lattner [Wed, 7 Apr 2010 05:27:36 +0000 (05:27 +0000)]
remove another magic number.

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

14 years agoThree changes:
Chris Lattner [Wed, 7 Apr 2010 05:20:54 +0000 (05:20 +0000)]
Three changes:
1. Introduce some enums and accessors in the InlineAsm class
   that eliminate a ton of magic numbers when handling inline
   asm SDNode.
2. Add a new MDNodeSDNode selection dag node type that holds
   a MDNode (shocking!)
3. Add a new argument to ISD::INLINEASM nodes that hold !srcloc
   metadata, propagating it to the instruction emitter, which
   drops it.

No functionality change.

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

14 years agofix a crash on invalid metadata, e.g.: call i32 @foo(), XXXX
Chris Lattner [Wed, 7 Apr 2010 04:08:57 +0000 (04:08 +0000)]
fix a crash on invalid metadata, e.g.:  call i32 @foo(), XXXX

We would return the error without inserting the new instruction
into the program, so it wouldn't get deallocated, and an abort
would trigger when the module was deleted.

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

14 years agoFix memory leaks for external symbol name strings.
Sanjiv Gupta [Wed, 7 Apr 2010 03:36:01 +0000 (03:36 +0000)]
Fix memory leaks for external symbol name strings.

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

14 years agoClean up some signedness oddities in this code noticed by clang.
John McCall [Wed, 7 Apr 2010 01:49:15 +0000 (01:49 +0000)]
Clean up some signedness oddities in this code noticed by clang.

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

14 years agoMove printing of target-indepedent DEBUG_VALUE comments
Dale Johannesen [Wed, 7 Apr 2010 01:15:14 +0000 (01:15 +0000)]
Move printing of target-indepedent DEBUG_VALUE comments
into AsmPrinter.  Target-dependent form is still generated
by FastISel and still handled in X86 code.

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

14 years agoPost regalloc LICM. Work in progress.
Evan Cheng [Wed, 7 Apr 2010 00:41:17 +0000 (00:41 +0000)]
Post regalloc LICM. Work in progress.

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

14 years agoDo not emit specification DIE with DW_AT_specification attribute for member functions...
Devang Patel [Tue, 6 Apr 2010 23:53:48 +0000 (23:53 +0000)]
Do not emit specification DIE with DW_AT_specification attribute for member functions of a funcation local class. This trips gdb's partial scan of DIEs at load time. Fixes Radar 7833483.

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

14 years agoLet that which does not matter truly slide.
Jakob Stoklund Olesen [Tue, 6 Apr 2010 23:44:44 +0000 (23:44 +0000)]
Let that which does not matter truly slide.

This test only cares about alignment, so don't test for other cruft.
An upcoming llvm-gcc patch needs this.

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

14 years agoFix a number of clang -Wsign-compare warnings that didn't have an obvious
John McCall [Tue, 6 Apr 2010 23:35:53 +0000 (23:35 +0000)]
Fix a number of clang -Wsign-compare warnings that didn't have an obvious
solution.  The only reason these don't fire with gcc-4.2 is that gcc turns off
part of -Wsign-compare in C++ on accident.

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

14 years agoRevert 100573, it's causing some testsuite problems.
Dale Johannesen [Tue, 6 Apr 2010 22:45:26 +0000 (22:45 +0000)]
Revert 100573, it's causing some testsuite problems.

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

14 years agoMove printing of DEBUG_VALUE comments to target-independent place.
Dale Johannesen [Tue, 6 Apr 2010 22:21:07 +0000 (22:21 +0000)]
Move printing of DEBUG_VALUE comments to target-independent place.
There is probably a more elegant way to do this.

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

14 years agoExpand SELECT and SELECT_CC for NEON vector types.
Bob Wilson [Tue, 6 Apr 2010 22:02:24 +0000 (22:02 +0000)]
Expand SELECT and SELECT_CC for NEON vector types.
Radar 7770501.

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

14 years agoAllow for the possibility that a debug-value points
Dale Johannesen [Tue, 6 Apr 2010 21:59:56 +0000 (21:59 +0000)]
Allow for the possibility that a debug-value points
to a SDNode that didn't have code generated for it.

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

14 years agoReverting 100530 & 100531 due to regressions in the GDB test suite.
Stuart Hastings [Tue, 6 Apr 2010 21:38:29 +0000 (21:38 +0000)]
Reverting 100530 & 100531 due to regressions in the GDB test suite.

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

14 years agoFix PR6696 and PR6663
Jim Grosbach [Tue, 6 Apr 2010 20:26:37 +0000 (20:26 +0000)]
Fix PR6696 and PR6663

When a frame pointer is not otherwise required, and dynamic stack alignment
is necessary solely due to the spilling of a register with larger alignment
requirements than the default stack alignment, the frame pointer can be both
used as a general purpose register and a frame pointer. That goes poorly, for
obvious reasons. This patch brings back a bit of old logic for identifying
the use of such registers and conservatively reserves the frame pointer
during register allocation in such cases.

For now, implement for X86 only since it's 32-bit linux which is hitting this,
and we want a targeted fix for 2.7. As a follow-on, this will be expanded
to handle other targets, as theoretically the problem could arise elsewhere
as well.

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

14 years agoMake this hack more specific to the Apple gcc 4.2 non-LLVM compiler.
Bill Wendling [Tue, 6 Apr 2010 20:07:21 +0000 (20:07 +0000)]
Make this hack more specific to the Apple gcc 4.2 non-LLVM compiler.

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

14 years agoDon't try to collapse DomainValues onto an incompatible SSE domain.
Jakob Stoklund Olesen [Tue, 6 Apr 2010 19:48:56 +0000 (19:48 +0000)]
Don't try to collapse DomainValues onto an incompatible SSE domain.
This fixes the Bullet regression on i386/nocona.

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

14 years agoperformance: get rid of repeated dereferencing of use_iterator by caching its result
Gabor Greif [Tue, 6 Apr 2010 19:32:30 +0000 (19:32 +0000)]
performance: get rid of repeated dereferencing of use_iterator by caching its result

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

14 years agomake more two predicates constant
Gabor Greif [Tue, 6 Apr 2010 19:24:18 +0000 (19:24 +0000)]
make more two predicates constant

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

14 years agoperformance: get rid of repeated dereferencing of use_iterator by caching its result
Gabor Greif [Tue, 6 Apr 2010 19:14:05 +0000 (19:14 +0000)]
performance: get rid of repeated dereferencing of use_iterator by caching its result

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

14 years agoconst-ize predicate ValueIsOnlyUsedLocallyOrStoredToOneGlobal
Gabor Greif [Tue, 6 Apr 2010 18:58:22 +0000 (18:58 +0000)]
const-ize predicate ValueIsOnlyUsedLocallyOrStoredToOneGlobal

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

14 years agouse CallSite to access calls vs. invokes uniformly
Gabor Greif [Tue, 6 Apr 2010 18:45:08 +0000 (18:45 +0000)]
use CallSite to access calls vs. invokes uniformly
and remove assumptions about operand order

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

14 years agothis accessor doesn't need to copy the string.
Chris Lattner [Tue, 6 Apr 2010 18:37:22 +0000 (18:37 +0000)]
this accessor doesn't need to copy the string.

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

14 years agoenhance SMDiagnostic to also maintain a pointer to the SourceMgr.
Chris Lattner [Tue, 6 Apr 2010 18:06:18 +0000 (18:06 +0000)]
enhance SMDiagnostic to also maintain a pointer to the SourceMgr.
Add a simplified constructor for clients that don't have locations
like "file not found" errors.

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

14 years agoCode clean up. Move includes from VirtRegRewriter.h to VirtRegRewriter.cpp.
Evan Cheng [Tue, 6 Apr 2010 17:19:55 +0000 (17:19 +0000)]
Code clean up. Move includes from VirtRegRewriter.h to VirtRegRewriter.cpp.

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

14 years agoRevise debug info machinery to digest nested functions and classes.
Stuart Hastings [Tue, 6 Apr 2010 17:19:32 +0000 (17:19 +0000)]
Revise debug info machinery to digest nested functions and classes.

A certain GDB testsuite case (local.cc) has a function nested inside a
class nested inside another function.  GCC presents the innermost
function to llvm-convert first.  Heretofore, the debug info mistakenly
placed the inner function at module scope.  This patch walks the GCC
context links and instantiates the outer class and function so the
debug info is properly nested.  Radar 7426545.

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

14 years agoAdding SAFECode to the list of projects that work with LLVM 2.7.
John Criswell [Tue, 6 Apr 2010 14:52:14 +0000 (14:52 +0000)]
Adding SAFECode to the list of projects that work with LLVM 2.7.

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

14 years agoRemove assert to treat memmove and memset like memcpy
Mon P Wang [Tue, 6 Apr 2010 08:27:51 +0000 (08:27 +0000)]
Remove assert to treat memmove and memset like memcpy

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

14 years agoUse a ManagedCleanup to prevent leaking the PassRegistrar map. In breaks the
Owen Anderson [Tue, 6 Apr 2010 04:20:48 +0000 (04:20 +0000)]
Use a ManagedCleanup to prevent leaking the PassRegistrar map.  In breaks the
use case where someone wants to resurrect LLVM after calling llvm_shutdown,
but I'm not aware of any clients that are affected by this.

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

14 years agoAvoid overflowing a signed integer which triggers undefined behaviour.
Jakob Stoklund Olesen [Tue, 6 Apr 2010 03:12:43 +0000 (03:12 +0000)]
Avoid overflowing a signed integer which triggers undefined behaviour.
Overflowing an unsigned integer is fine and behaves as you would expect.
Also fix a pasto, allowing SignExtend64 to take a 64-bit argument.

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

14 years agoAdd a const qualifier.
Dan Gohman [Tue, 6 Apr 2010 01:31:12 +0000 (01:31 +0000)]
Add a const qualifier.

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

14 years agopropagate cookie management out one layer of function calls.
Chris Lattner [Tue, 6 Apr 2010 00:58:50 +0000 (00:58 +0000)]
propagate cookie management out one layer of function calls.

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

14 years agoreport errors through LLVMContext's inline asm handler if available.
Chris Lattner [Tue, 6 Apr 2010 00:55:39 +0000 (00:55 +0000)]
report errors through LLVMContext's inline asm handler if available.

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

14 years agoGive MachineModuleInfo an actual Module*.
Chris Lattner [Tue, 6 Apr 2010 00:51:52 +0000 (00:51 +0000)]
Give MachineModuleInfo an actual Module*.

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

14 years agogive LLVMContext an inline asm diagnostic hook member.
Chris Lattner [Tue, 6 Apr 2010 00:44:45 +0000 (00:44 +0000)]
give LLVMContext an inline asm diagnostic hook member.

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

14 years agoRemove unnecessary include.
Devang Patel [Tue, 6 Apr 2010 00:38:32 +0000 (00:38 +0000)]
Remove unnecessary include.

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

14 years agogive the SourceMgr object a cookie.
Chris Lattner [Tue, 6 Apr 2010 00:33:43 +0000 (00:33 +0000)]
give the SourceMgr object a cookie.

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

14 years agoGive llvm::SourceMgr the ability to have a client-specified
Chris Lattner [Tue, 6 Apr 2010 00:26:48 +0000 (00:26 +0000)]
Give llvm::SourceMgr the ability to have a client-specified
diagnostic handler.

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

14 years agoRemove MaybeOwningPtr. We're going to use reference-counting instead.
Douglas Gregor [Mon, 5 Apr 2010 23:53:46 +0000 (23:53 +0000)]
Remove MaybeOwningPtr. We're going to use reference-counting instead.

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

14 years agoProperly enable load clustering.
Jakob Stoklund Olesen [Mon, 5 Apr 2010 23:48:02 +0000 (23:48 +0000)]
Properly enable load clustering.

Operand 2 on a load instruction does not have to be a RegisterSDNode for this to
work.

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

14 years agoFix an obvious copy-n-paste bug. It's not known to cause any miscompilation.
Evan Cheng [Mon, 5 Apr 2010 23:33:29 +0000 (23:33 +0000)]
Fix an obvious copy-n-paste bug. It's not known to cause any miscompilation.

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

14 years agoGive AsmParser an option to control whether it finalizes
Chris Lattner [Mon, 5 Apr 2010 23:15:42 +0000 (23:15 +0000)]
Give AsmParser an option to control whether it finalizes
the stream.  New demo:

$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
$ otool -tv t.o
t.o:
(__TEXT,__text) section
_foo:
0000000000000000 subq $0x08,%rsp
0000000000000004 movl %edi,(%rsp)
0000000000000007 movl %edi,%eax
0000000000000009 incl %eax
000000000000000b movl %eax,(%rsp)
000000000000000e movl %eax,0x04(%rsp)
0000000000000012 addq $0x08,%rsp
0000000000000016 ret

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

14 years agoadd .o file writing for inline asm in llc. Here's a silly
Chris Lattner [Mon, 5 Apr 2010 23:11:24 +0000 (23:11 +0000)]
add .o file writing for inline asm in llc.  Here's a silly
demo:

$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
<inline asm>:1:2: error: unrecognized instruction
abc incl    %eax
^
LLVM ERROR: Error parsing inline asm

Only problem seems to be that the parser finalizes OutStreamer
at the end of the first inline asm, which isn't what we want.
For example:

$ cat asm.c
int foo(int X) {
 __asm__ ("incl    %0" : "+r" (X));
 return X;
}
$ clang asm.c -S -o - -emit-llvm | llc
...
subq $8, %rsp
movl %edi, (%rsp)
movl %edi, %eax
## InlineAsm Start
incl    %eax
## InlineAsm End
movl %eax, (%rsp)
movl %eax, 4(%rsp)
addq $8, %rsp
ret
$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
$ otool -tv t.o
t.o:
(__TEXT,__text) section
_foo:
0000000000000000 subq $0x08,%rsp
0000000000000004 movl %edi,(%rsp)
0000000000000007 movl %edi,%eax
0000000000000009 incl %eax
$

don't stop at inc!

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

14 years agoadd a comment.
Chris Lattner [Mon, 5 Apr 2010 23:07:42 +0000 (23:07 +0000)]
add a comment.

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

14 years agotidy #includes.
Chris Lattner [Mon, 5 Apr 2010 23:07:18 +0000 (23:07 +0000)]
tidy #includes.

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

14 years agoOutput floating point representations in DWARF format. This is done by outputing
Bill Wendling [Mon, 5 Apr 2010 22:59:21 +0000 (22:59 +0000)]
Output floating point representations in DWARF format. This is done by outputing
the FP encoding directly as a hex representation.

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

14 years agoupdate unit test for api change.
Chris Lattner [Mon, 5 Apr 2010 22:49:48 +0000 (22:49 +0000)]
update unit test for api change.

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

14 years agostringref-ize the MemoryBuffer::get apis. This requires
Chris Lattner [Mon, 5 Apr 2010 22:42:30 +0000 (22:42 +0000)]
stringref-ize the MemoryBuffer::get apis.  This requires
a co-committed clang patch.

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

14 years agoAdd nounwind.
Evan Cheng [Mon, 5 Apr 2010 22:30:05 +0000 (22:30 +0000)]
Add nounwind.

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

14 years agoFix ADD32rr_alt instruction encoding bug. Patch by Marius Wachtler.
Evan Cheng [Mon, 5 Apr 2010 22:21:09 +0000 (22:21 +0000)]
Fix ADD32rr_alt instruction encoding bug. Patch by Marius Wachtler.

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

14 years agofix a really nasty bug that Evan was tracking in SCCP. When resolving
Chris Lattner [Mon, 5 Apr 2010 22:14:48 +0000 (22:14 +0000)]
fix a really nasty bug that Evan was tracking in SCCP.  When resolving
undefs in branches/switches, we have two cases: a branch on a literal
undef or a branch on a symbolic value which is undef.  If we have a
literal undef, the code was correct: forcing it to a constant is the
right thing to do.

If we have a branch on a symbolic value that is undef, we should force
the symbolic value to a constant, which then makes the successor block
live.  Forcing the condition of the branch to being a constant isn't
safe if later paths become live and the value becomes overdefined.  This
is the case that 'forcedconstant' is designed to handle, so just use it.

This fixes rdar://7765019 but there is no good testcase for this, the
one I have is too insane to be useful in the future.

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

14 years agosome code cleanups, use SwitchInst::findCaseValue, reduce indentation
Chris Lattner [Mon, 5 Apr 2010 21:18:32 +0000 (21:18 +0000)]
some code cleanups, use SwitchInst::findCaseValue, reduce indentation

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

14 years agoCode clean up.
Evan Cheng [Mon, 5 Apr 2010 21:16:25 +0000 (21:16 +0000)]
Code clean up.

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

14 years agoRemove FIXME.
Eric Christopher [Mon, 5 Apr 2010 21:14:32 +0000 (21:14 +0000)]
Remove FIXME.

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

14 years agoIntroduce MaybeOwningPtr, a smart pointer that may (or may not) have
Douglas Gregor [Mon, 5 Apr 2010 21:09:22 +0000 (21:09 +0000)]
Introduce MaybeOwningPtr, a smart pointer that may (or may not) have
ownership over the pointer it contains. Useful when we want to
communicate ownership while still having several clients holding on to
the same pointer *without* introducing reference counting.

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

14 years agoFix OProfileJITEventListener build for new DebugLoc.
Jeffrey Yasskin [Mon, 5 Apr 2010 21:09:12 +0000 (21:09 +0000)]
Fix OProfileJITEventListener build for new DebugLoc.

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

14 years agoAdd a comment.
Dan Gohman [Mon, 5 Apr 2010 20:24:08 +0000 (20:24 +0000)]
Add a comment.

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

14 years agolowering a volatile llvm.memcpy to a libc memcpy is ok.
Chris Lattner [Mon, 5 Apr 2010 20:11:45 +0000 (20:11 +0000)]
lowering a volatile llvm.memcpy to a libc memcpy is ok.
PR6779

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

14 years agoDon't do code sinking on unreachable blocks. It's unprofitable and hazardous.
Dan Gohman [Mon, 5 Apr 2010 19:17:22 +0000 (19:17 +0000)]
Don't do code sinking on unreachable blocks. It's unprofitable and hazardous.

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

14 years agoAdd an isReachableFromEntry to MachineDominators, following the one
Dan Gohman [Mon, 5 Apr 2010 19:16:38 +0000 (19:16 +0000)]
Add an isReachableFromEntry to MachineDominators, following the one
in Dominators.

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

14 years agoUpdate to note that clang has a baseline now. Dropping x86-32 for MacOS.
Tanya Lattner [Mon, 5 Apr 2010 18:35:37 +0000 (18:35 +0000)]
Update to note that clang has a baseline now. Dropping x86-32 for MacOS.

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

14 years agodon't use emitlabel in the arm asm printer yet, the order
Chris Lattner [Mon, 5 Apr 2010 17:52:31 +0000 (17:52 +0000)]
don't use emitlabel in the arm asm printer yet, the order
isn't well specified.  ARM really needs to have its instprinter
finished at some point.

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

14 years agoPush const through the regex engine. Fixes some of the warnings in PR6616.
Owen Anderson [Mon, 5 Apr 2010 17:50:20 +0000 (17:50 +0000)]
Push const through the regex engine. Fixes some of the warnings in PR6616.

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

14 years agofix a couple problems I introduced handling symbols
Chris Lattner [Mon, 5 Apr 2010 16:32:14 +0000 (16:32 +0000)]
fix a couple problems I introduced handling symbols
with spaces in them.  Sym->getName()  !=   OS << *Sym

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

14 years agoDisambiguate else.
Benjamin Kramer [Mon, 5 Apr 2010 10:17:15 +0000 (10:17 +0000)]
Disambiguate else.

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

14 years agotrim some prototypes.
Chris Lattner [Mon, 5 Apr 2010 06:21:01 +0000 (06:21 +0000)]
trim some prototypes.

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

14 years agoremove the now-redundant MMI pointer in SelectionDAG.
Chris Lattner [Mon, 5 Apr 2010 06:19:28 +0000 (06:19 +0000)]
remove the now-redundant MMI pointer in SelectionDAG.

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

14 years agohopefully sate the clang self host build, which is apparently
Chris Lattner [Mon, 5 Apr 2010 06:12:01 +0000 (06:12 +0000)]
hopefully sate the clang self host build, which is apparently
instantiating some folding set stuff that GCC isn't, requiring
some types to not be incomplete.

I don't know if clang is right or wrong, but unbreaking the
bot is goodness.  Here's the broken build:
http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/1813/steps/compile.llvm.stage2/logs/stdio

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

14 years agoremove some redundant MMI arguments.
Chris Lattner [Mon, 5 Apr 2010 06:10:13 +0000 (06:10 +0000)]
remove some redundant MMI arguments.

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

14 years agounthread MMI from FastISel
Chris Lattner [Mon, 5 Apr 2010 06:05:26 +0000 (06:05 +0000)]
unthread MMI from FastISel

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

14 years agoremove the MMI pointer from MachineFrameInfo.
Chris Lattner [Mon, 5 Apr 2010 05:57:52 +0000 (05:57 +0000)]
remove the MMI pointer from MachineFrameInfo.

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

14 years agoenhance MachineFunction to have a MMI pointer.
Chris Lattner [Mon, 5 Apr 2010 05:49:50 +0000 (05:49 +0000)]
enhance MachineFunction to have a MMI pointer.

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

14 years agoAdd MC and LTO, two terms I just had to explain on IRC.
Nick Lewycky [Mon, 5 Apr 2010 05:48:47 +0000 (05:48 +0000)]
Add MC and LTO, two terms I just had to explain on IRC.

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

14 years agosimplify code.
Chris Lattner [Mon, 5 Apr 2010 05:48:36 +0000 (05:48 +0000)]
simplify code.

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

14 years agoprune #includes.
Chris Lattner [Mon, 5 Apr 2010 05:43:16 +0000 (05:43 +0000)]
prune #includes.

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

14 years agoprivatize more stuff, eliminate vtables.
Chris Lattner [Mon, 5 Apr 2010 05:32:45 +0000 (05:32 +0000)]
privatize more stuff, eliminate vtables.

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

14 years agoreprivatize now that DwarfWriter is gone.
Chris Lattner [Mon, 5 Apr 2010 05:31:04 +0000 (05:31 +0000)]
reprivatize now that DwarfWriter is gone.

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

14 years agoprune #includes, MMI can never be null
Chris Lattner [Mon, 5 Apr 2010 05:28:23 +0000 (05:28 +0000)]
prune #includes, MMI can never be null

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

14 years agoprune #includes, realize the MMI can never be null.
Chris Lattner [Mon, 5 Apr 2010 05:24:55 +0000 (05:24 +0000)]
prune #includes, realize the MMI can never be null.

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

14 years agofinally blast DwarfWriter away.
Chris Lattner [Mon, 5 Apr 2010 05:12:59 +0000 (05:12 +0000)]
finally blast DwarfWriter away.

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