oota-llvm.git
15 years agoGeneralize bugpoint's concept of a "safe" backend, and add options
Dan Gohman [Mon, 8 Dec 2008 04:02:47 +0000 (04:02 +0000)]
Generalize bugpoint's concept of a "safe" backend, and add options
to allow the "safe" backend to be run with a different path, and/or
with different command-line options.

This enables the following use cases:
 - bugpoint llc against an llc command from a different build
 - bugpoint llc against the same llc with different command-line options
 - and more...

Also, document the existing "custom" interpreter options.

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

15 years agoFixes for Visual Studio users. Patch by OvermindDL1 on llvm-dev!
Nick Lewycky [Mon, 8 Dec 2008 00:45:02 +0000 (00:45 +0000)]
Fixes for Visual Studio users. Patch by OvermindDL1 on llvm-dev!

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

15 years agoUse bool instead of int, now that it no longer evokes a warning.
Dan Gohman [Sun, 7 Dec 2008 21:33:27 +0000 (21:33 +0000)]
Use bool instead of int, now that it no longer evokes a warning.

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

15 years agoUse intptr_t instead of unsigned here, which is more appropriate
Dan Gohman [Sun, 7 Dec 2008 21:28:00 +0000 (21:28 +0000)]
Use intptr_t instead of unsigned here, which is more appropriate
in a really obscure way, but more importantly has the side effect
of avoiding a GCC warning in the case that IntType is bool.

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

15 years agoadd an assert. the cast<> below would catch this but a message is more
Chris Lattner [Sun, 7 Dec 2008 18:45:15 +0000 (18:45 +0000)]
add an assert.  the cast<> below would catch this but a message is more
useful.

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

15 years agofactor some code better.
Chris Lattner [Sun, 7 Dec 2008 18:42:51 +0000 (18:42 +0000)]
factor some code better.

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

15 years agofactor some code, fixing some fixme's.
Chris Lattner [Sun, 7 Dec 2008 18:39:13 +0000 (18:39 +0000)]
factor some code, fixing some fixme's.

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

15 years agofix a typo duncan noticed!
Chris Lattner [Sun, 7 Dec 2008 18:21:37 +0000 (18:21 +0000)]
fix a typo duncan noticed!

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

15 years agoCMake: Added Tool.cpp to tools/llvmc/driver.
Oscar Fuentes [Sun, 7 Dec 2008 17:01:16 +0000 (17:01 +0000)]
CMake: Added Tool.cpp to tools/llvmc/driver.

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

15 years agoMan page update.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:48:07 +0000 (16:48 +0000)]
Man page update.

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

15 years agoDescribe recent changes in the documentation.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:47:42 +0000 (16:47 +0000)]
Describe recent changes in the documentation.

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

15 years agoMake 'extern' an option property.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:47:12 +0000 (16:47 +0000)]
Make 'extern' an option property.

Makes (forward) work better.

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

15 years agoPlugin updates: support more options.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:46:23 +0000 (16:46 +0000)]
Plugin updates: support more options.

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

15 years agoJoin tools couldn't be used in the middle of the toolchain.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:45:37 +0000 (16:45 +0000)]
Join tools couldn't be used in the middle of the toolchain.

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

15 years agoBetter error message.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:45:12 +0000 (16:45 +0000)]
Better error message.

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

15 years agoRe-apply Cedric's changes.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:44:47 +0000 (16:44 +0000)]
Re-apply Cedric's changes.

Use B instead of Beg (for consistency), but NodeA and NodeB instead of A
and B.

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

15 years agoAdd some clarifying comments.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:44:15 +0000 (16:44 +0000)]
Add some clarifying comments.

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

15 years agoEnable the Clang plugin by default.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:43:42 +0000 (16:43 +0000)]
Enable the Clang plugin by default.

This will eventually replace `ccc`. The command `llvmc -clang` now uses
the Clang toolchain instead of `llvm-gcc`.

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

15 years agoUpdate plugins to use (actions).
Mikhail Glushenkov [Sun, 7 Dec 2008 16:43:17 +0000 (16:43 +0000)]
Update plugins to use (actions).

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

15 years agoTry to guess when the auto-generated cl::Sink option should be marked 'extern'.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:42:47 +0000 (16:42 +0000)]
Try to guess when the auto-generated cl::Sink option should be marked 'extern'.

This would be much easier to do if the CommandLine library didn't use
global state. Global state is evil.

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

15 years agoAdd a (progn)-like construct for (actions). Implemented as a DAG list.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:42:22 +0000 (16:42 +0000)]
Add a (progn)-like construct for (actions). Implemented as a DAG list.

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

15 years agoAdd tests for tblgen's LLVMC backend.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:41:50 +0000 (16:41 +0000)]
Add tests for tblgen's LLVMC backend.

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

15 years agoUse (actions) instead of option properties, support external options.
Mikhail Glushenkov [Sun, 7 Dec 2008 16:41:11 +0000 (16:41 +0000)]
Use (actions) instead of option properties, support external options.

Also includes a major refactoring. See documentation for more
information.

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

15 years agoadd support for caching pointer dependence queries. Nothing uses this yet
Chris Lattner [Sun, 7 Dec 2008 08:50:20 +0000 (08:50 +0000)]
add support for caching pointer dependence queries.  Nothing uses this yet
so it "can't" break anything.  That said, it does appear to work.

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

15 years agofix a bug I introduced in simplifycfg handling single entry phi
Chris Lattner [Sun, 7 Dec 2008 07:22:45 +0000 (07:22 +0000)]
fix a bug I introduced in simplifycfg handling single entry phi
nodes. FoldSingleEntryPHINodes deletes the PHI, so there is no
need to delete it afterward.

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

15 years agoSwitch to top-down mode and fix a crasher this exposed caused by an error in the
Owen Anderson [Sun, 7 Dec 2008 05:33:18 +0000 (05:33 +0000)]
Switch to top-down mode and fix a crasher this exposed caused by an error in the
live interval updating.

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

15 years agoFix typo, psuedo -> pseudo.
Nick Lewycky [Sun, 7 Dec 2008 03:49:52 +0000 (03:49 +0000)]
Fix typo, psuedo -> pseudo.

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

15 years agoSome internal refactoring to make it easier to cache results.
Chris Lattner [Sun, 7 Dec 2008 02:56:57 +0000 (02:56 +0000)]
Some internal refactoring to make it easier to cache results.

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

15 years agoIntroduce a new MemDep::getNonLocalPointerDependency
Chris Lattner [Sun, 7 Dec 2008 02:15:47 +0000 (02:15 +0000)]
Introduce a new MemDep::getNonLocalPointerDependency
method.  This will eventually take over load/store dep
queries from getNonLocalDependency.  For now it works
fine, but is incredibly slow because it does no caching.
Lets not switch GVN to use it until that is fixed :)

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

15 years agopush the "pointer case" up the analysis stack a bit. This causes
Chris Lattner [Sun, 7 Dec 2008 01:50:16 +0000 (01:50 +0000)]
push the "pointer case" up the analysis stack a bit.  This causes
duplication of logic (in 2 places) to determine what pointer a
load/store touches.  This will be addressed in a future commit.

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

15 years agomake clients have to know how to call getCallSiteDependencyFrom
Chris Lattner [Sun, 7 Dec 2008 01:21:14 +0000 (01:21 +0000)]
make clients have to know how to call getCallSiteDependencyFrom
instead of making getDependencyFrom do it.

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

15 years agorename some variables for consistency
Chris Lattner [Sun, 7 Dec 2008 00:39:19 +0000 (00:39 +0000)]
rename some variables for consistency

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

15 years agoI love how using out of scope variables is not an error with GCC, no really I do.
Chris Lattner [Sun, 7 Dec 2008 00:38:27 +0000 (00:38 +0000)]
I love how using out of scope variables is not an error with GCC, no really I do.

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

15 years agoRename getCallSiteDependency -> getCallSiteDependencyFrom to
Chris Lattner [Sun, 7 Dec 2008 00:35:51 +0000 (00:35 +0000)]
Rename getCallSiteDependency -> getCallSiteDependencyFrom to
emphasize the scanning and make it more similar to
getDependencyFrom

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

15 years agoa memdep query on a volatile load/store will always return
Chris Lattner [Sun, 7 Dec 2008 00:28:02 +0000 (00:28 +0000)]
a memdep query on a volatile load/store will always return
clobber with the current implementation.  Instead of returning
a "precise clobber" just return a fuzzy one.  This doesn't
matter to any clients anyway and should speed up analysis time
very very slightly.

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

15 years agodon't bother touching volatile stores, they will just return clobber on
Chris Lattner [Sun, 7 Dec 2008 00:25:15 +0000 (00:25 +0000)]
don't bother touching volatile stores, they will just return clobber on
everything interesting anyway.

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

15 years agoremove the ability to get memdep info for vaarg. I don't think the
Chris Lattner [Sun, 7 Dec 2008 00:21:18 +0000 (00:21 +0000)]
remove the ability to get memdep info for vaarg.  I don't think the
original impl was correct and noone actually makes the query anyway.

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

15 years agomake getDependencyFrom private.
Chris Lattner [Sun, 7 Dec 2008 00:16:50 +0000 (00:16 +0000)]
make getDependencyFrom private.

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

15 years agoimprove a note.
Chris Lattner [Sun, 7 Dec 2008 00:15:10 +0000 (00:15 +0000)]
improve a note.

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

15 years agosome more PRE/GVN/DSE related notes.
Chris Lattner [Sat, 6 Dec 2008 22:52:12 +0000 (22:52 +0000)]
some more PRE/GVN/DSE related notes.

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

15 years agoadd a note
Chris Lattner [Sat, 6 Dec 2008 22:49:05 +0000 (22:49 +0000)]
add a note

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

15 years agosome random notes.
Chris Lattner [Sat, 6 Dec 2008 19:28:22 +0000 (19:28 +0000)]
some random notes.

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

15 years agoMinor cleanup. Use dyn_cast, not isa/cast pairs. No functionality change.
Nick Lewycky [Sat, 6 Dec 2008 17:57:05 +0000 (17:57 +0000)]
Minor cleanup. Use dyn_cast, not isa/cast pairs. No functionality change.

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

15 years agoClean up some ARM GV asm printing out; minor fixes to match what gcc does.
Evan Cheng [Sat, 6 Dec 2008 02:00:55 +0000 (02:00 +0000)]
Clean up some ARM GV asm printing out; minor fixes to match what gcc does.

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

15 years agoReimplement the inner loop of DSE. It now uniformly uses getDependence(),
Chris Lattner [Sat, 6 Dec 2008 00:53:22 +0000 (00:53 +0000)]
Reimplement the inner loop of DSE. It now uniformly uses getDependence(),
doesn't do its own local caching, and is slightly more aggressive about
free/store dse (see testcase).  This eliminates the last external client
of MemDep::getDependenceFrom().

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

15 years agoDon't use plain %x to print pointer values. I had changed it from %p
Dan Gohman [Fri, 5 Dec 2008 23:39:24 +0000 (23:39 +0000)]
Don't use plain %x to print pointer values. I had changed it from %p
since %p isn't formatted consistently, but obviously plain %x is wrong.
PRIxPTR with a cast to uintptr_t would work here, but that requires
inconvenient build-system changes. %lu works on all current and
foreseable future hosts.

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

15 years agoFix test to pass on Linux.
Dale Johannesen [Fri, 5 Dec 2008 22:38:21 +0000 (22:38 +0000)]
Fix test to pass on Linux.

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

15 years agoForgot a file.
Dale Johannesen [Fri, 5 Dec 2008 21:55:35 +0000 (21:55 +0000)]
Forgot a file.

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

15 years agoMake LoopStrengthReduce smarter about hoisting things out of
Dale Johannesen [Fri, 5 Dec 2008 21:47:27 +0000 (21:47 +0000)]
Make LoopStrengthReduce smarter about hoisting things out of
loops when they can be subsumed into addressing modes.

Change X86 addressing mode check to realize that
some PIC references need an extra register.
(I believe this is correct for Linux, if not, I'm sure
someone will tell me.)

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

15 years agoMake a few major changes to memdep and its clients:
Chris Lattner [Fri, 5 Dec 2008 21:04:20 +0000 (21:04 +0000)]
Make a few major changes to memdep and its clients:
1. Merge the 'None' result into 'Normal', making loads
   and stores return their dependencies on allocations as Normal.
2. Split the 'Normal' result into 'Clobber' and 'Def' to
   distinguish between the cases when memdep knows the value is
   produced from when we just know if may be changed.
3. Move some of the logic for determining whether readonly calls
   are CSEs into memdep instead of it being in GVN.  This still
   leaves verification that the arguments are hte same to GVN to
   let it know about value equivalences in different contexts.
4. Change memdep's call/call dependency analysis to use
   getModRefInfo(CallSite,CallSite) instead of doing something
   very weak.  This only really matters for things like DSA, but
   someday maybe we'll have some other decent context sensitive
   analyses :)
5. This reimplements the guts of memdep to handle the new results.
6. This simplifies GVN significantly:
   a) readonly call CSE is slightly simpler
   b) I eliminated the "getDependencyFrom" chaining for load
      elimination and load CSE doesn't have to worry about
      volatile (they are always clobbers) anymore.
   c) GVN no longer does any 'lastLoad' caching, leaving it to
      memdep.
7. The logic in DSE is simplified a bit and sped up.  A potentially
   unsafe case was eliminated.

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

15 years agoDemangle and pretty-print symbols in internal backtraces. Patch by
Dan Gohman [Fri, 5 Dec 2008 20:12:48 +0000 (20:12 +0000)]
Demangle and pretty-print symbols in internal backtraces. Patch by
Wesley Peck, with a few fixes by me.

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

15 years agoRevert invalid r60393. It causes llvm-gcc bootstrap fails in release builds.
Anton Korobeynikov [Fri, 5 Dec 2008 19:38:49 +0000 (19:38 +0000)]
Revert invalid r60393. It causes llvm-gcc bootstrap fails in release builds.
See PR3160 for details

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

15 years agoThis test also requires -mattr=+sse41.
Evan Cheng [Fri, 5 Dec 2008 19:26:37 +0000 (19:26 +0000)]
This test also requires -mattr=+sse41.

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

15 years agoMake it illegal to call getDependency* on non-memory instructions
Chris Lattner [Fri, 5 Dec 2008 18:46:19 +0000 (18:46 +0000)]
Make it illegal to call getDependency* on non-memory instructions
like binary operators.

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

15 years agoReason #3 from 60595 doesn't hold true. If we can fold a PIC load from constpool...
Evan Cheng [Fri, 5 Dec 2008 17:41:31 +0000 (17:41 +0000)]
Reason #3 from 60595 doesn't hold true. If we can fold a PIC load from constpool into a use, the rewrite happens at time of spill (not in VirtRegMap). Later on, if the GlobalBaseReg is spilled, the spiller can see the use uses GlobalBaseReg and do the right thing.

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

15 years agoEffectively undo 60461 in PIC mode which simply transform V_SET0 / V_SETALLONES into...
Evan Cheng [Fri, 5 Dec 2008 17:23:48 +0000 (17:23 +0000)]
Effectively undo 60461 in PIC mode which simply transform V_SET0 / V_SETALLONES into a load from constpool in order to fold into restores. This is not safe to do when PIC base is being used for a number of reasons:
1. GlobalBaseReg may have been spilled.
2. It may not be live at the use.
3. Spiller doesn't know this is happening so it won't prevent GlobalBaseReg from being spilled later (That by itself is a nasty hack. It's needed because we don't insert the reload until later).

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

15 years agoFix test/Transforms/GVN/pre-load.ll
Chris Lattner [Fri, 5 Dec 2008 17:04:12 +0000 (17:04 +0000)]
Fix test/Transforms/GVN/pre-load.ll

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

15 years agoFix comment.
Evan Cheng [Fri, 5 Dec 2008 17:00:16 +0000 (17:00 +0000)]
Fix comment.

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

15 years agoThe use of the construct:
Cedric Venet [Fri, 5 Dec 2008 13:37:30 +0000 (13:37 +0000)]
The use of the construct:
  for(Type1 B = ...;;) { Type2 B ; ... }
is bad: code is hard to read and VS VS don't like it (it ignore the second declaration of B).
This patch fix the problem in tablegen. Please don't write code like this.

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

15 years agoMake IsValueFullyAvailableInBlock safe.
Chris Lattner [Fri, 5 Dec 2008 07:49:08 +0000 (07:49 +0000)]
Make IsValueFullyAvailableInBlock safe.

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

15 years agoadd a new pop_back_val method which returns the value popped. This is
Chris Lattner [Fri, 5 Dec 2008 07:11:05 +0000 (07:11 +0000)]
add a new pop_back_val method which returns the value popped.  This is
heretical from a STL standpoint, but is oh-so-useful for things that
can't throw exceptions when copied, like, well, everything in LLVM.

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

15 years agoDrop the reg argument to isRegReDefinedByTwoAddr, which was redundant.
Dan Gohman [Fri, 5 Dec 2008 05:45:42 +0000 (05:45 +0000)]
Drop the reg argument to isRegReDefinedByTwoAddr, which was redundant.

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

15 years agoUpdate comments. There is no getArgumentAccesses.
Dan Gohman [Fri, 5 Dec 2008 05:35:21 +0000 (05:35 +0000)]
Update comments. There is no getArgumentAccesses.

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

15 years agoTeach StackSlotColoring to update MachineMemOperands when
Dan Gohman [Fri, 5 Dec 2008 05:31:14 +0000 (05:31 +0000)]
Teach StackSlotColoring to update MachineMemOperands when
changing the stack slots on an instruction, to keep them
consistent with the actual memory addresses.

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

15 years agoIgnore IMPLICIT_DEF instructions when computing physreg liveness.
Dan Gohman [Fri, 5 Dec 2008 05:30:02 +0000 (05:30 +0000)]
Ignore IMPLICIT_DEF instructions when computing physreg liveness.
While they appear to provide a normal clobbering def, they don't
in the case of the awkward IMPLICIT_DEF+INSERT_SUBREG idiom. It
would be good to change INSERT_SUBREG; until then, this change
allows post-regalloc scheduling to cope in a mildly conservative
way.

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

15 years agoRe-did 60519. It turns out Darwin's handling of hidden visibility symbols are a bit...
Evan Cheng [Fri, 5 Dec 2008 01:06:39 +0000 (01:06 +0000)]
Re-did 60519. It turns out Darwin's handling of hidden visibility symbols are a bit more complicate than I expected. Both declarations and weak definitions still need a stub indirection. However, the stubs are in data section and they contain the addresses of the actual symbols.

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

15 years agoCellSPU: Add new directory under tests/CodeGen/CellSPU to retain tests that
Scott Michel [Fri, 5 Dec 2008 00:01:00 +0000 (00:01 +0000)]
CellSPU: Add new directory under tests/CodeGen/CellSPU to retain tests that
aren't part of the test suite but are generally useful nonetheless, and can
be expanded later to test the backend against the actual Cell SPU system.

There's basically no other good place to put this code, so put it here for
the time being.

- vecoperations.c: Vector shuffles for all supported vector types, tests
  for v16i8 add and multiply.

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

15 years agoHave raw_fd_ostream keep track of the position in the file to make tell() go faster...
Ted Kremenek [Thu, 4 Dec 2008 22:51:11 +0000 (22:51 +0000)]
Have raw_fd_ostream keep track of the position in the file to make tell() go faster by not requiring a flush().

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

15 years agoEnable LoopIndexSplit pass.
Devang Patel [Thu, 4 Dec 2008 21:40:31 +0000 (21:40 +0000)]
Enable LoopIndexSplit pass.

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

15 years agoRewrite code that 1) filters loops and 2) calculates new loop bounds.
Devang Patel [Thu, 4 Dec 2008 21:38:42 +0000 (21:38 +0000)]
Rewrite code that 1) filters loops and 2) calculates new loop bounds.
This fixes many bugs. I will add more test cases in a separate check-in.

Some day, the code that manipulates CFG and updates dom. info could use refactoring help.

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

15 years agoFactor out some common code.
Owen Anderson [Thu, 4 Dec 2008 21:20:30 +0000 (21:20 +0000)]
Factor out some common code.

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

15 years agoCellSPU: Fix bug 3055
Scott Michel [Thu, 4 Dec 2008 21:01:44 +0000 (21:01 +0000)]
CellSPU: Fix bug 3055
- Add v4f32, v2f64 to LowerVECTOR_SHUFFLE
- Look for vector rotate in shuffle elements, generate a vector rotate
  instead of a full-blown shuffle when opportunity presents itself.
- Generate larger test harness and fix a few interesting but obscure bugs.

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

15 years agoWhen allocating a stack temporary, use the correct
Duncan Sands [Thu, 4 Dec 2008 18:08:40 +0000 (18:08 +0000)]
When allocating a stack temporary, use the correct
number of bytes for types such as i1 which are not
a multiple of 8 bits in length.

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

15 years agoMissing closing brace and reverse conditional condition on NDEBUG
Scott Michel [Thu, 4 Dec 2008 17:16:59 +0000 (17:16 +0000)]
Missing closing brace and reverse conditional condition on NDEBUG

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

15 years agoStart simplifying a switch that has a successor that is a switch.
Chris Lattner [Thu, 4 Dec 2008 06:31:07 +0000 (06:31 +0000)]
Start simplifying a switch that has a successor that is a switch.

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

15 years agoThis code is apparently quite confused. In the meantime,
Chris Lattner [Thu, 4 Dec 2008 06:14:27 +0000 (06:14 +0000)]
This code is apparently quite confused.  In the meantime,
get it building when NDEBUG is set.

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

15 years agoTemporarily revert r60519. It was causing a bootstrap failure:
Bill Wendling [Thu, 4 Dec 2008 04:07:00 +0000 (04:07 +0000)]
Temporarily revert r60519. It was causing a bootstrap failure:

/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/xgcc -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.5.0/bin/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.5.0/lib/ -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.5.0/include -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.5.0/sys-include -DHAVE_CONFIG_H -I. -I../../../llvm-gcc.src/libgomp -I. -I../../../llvm-gcc.src/libgomp/config/posix -I../../../llvm-gcc.src/libgomp -Wall -pthread -Werror -O2 -g -O2 -MT barrier.lo -MD -MP -MF .deps/barrier.Tpo -c ../../../llvm-gcc.src/libgomp/barrier.c  -fno-common -DPIC -o .libs/barrier.o
checking for sys/file.h... /var/folders/zG/zGE-ZJOGFiGjv0B5cs5oYE+++TM/-Tmp-//cc34Jg5P.s:13:non-relocatable subtraction expression, "_gomp_tls_key" minus "L1$pb"
/var/folders/zG/zGE-ZJOGFiGjv0B5cs5oYE+++TM/-Tmp-//cc34Jg5P.s:13:symbol: "_gomp_tls_key" can't be undefined in a subtraction expression
make[4]: *** [barrier.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/xgcc -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.5.0/bin/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.5.0/lib/ -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.5.0/include -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.5.0/sys-include -DHAVE_CONFIG_H -I. -I../../../llvm-gcc.src/libgomp -I. -I../../../llvm-gcc.src/libgomp/config/posix -I../../../llvm-gcc.src/libgomp -Wall -pthread -Werror -O2 -g -O2 -MT alloc.lo -MD -MP -MF .deps/alloc.Tpo -c ../../../llvm-gcc.src/libgomp/alloc.c -o alloc.o >/dev/null 2>&1
yes
checking for sys/param.h... make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-target-libgomp] Error 2
make[1]: *** Waiting for unfinished jobs....

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

15 years agoCellSPU:
Scott Michel [Thu, 4 Dec 2008 03:02:42 +0000 (03:02 +0000)]
CellSPU:
- First patch from Nehal Desai, a new contributor at Aerospace. Nehal's patch
  fixes sign/zero/any-extending loads for integers and floating point. Example
  code, compiled w/o debugging or optimization where he first noticed the bug:

  int main(void) {
    float a = 99.0;
    printf("%d\n", a);
    return 0;
  }

  Verified that this code actually works on a Cell SPU.

Changes by Scott Michel:
- Fix bug in the value type list constructed by SPUISD::LDRESULT to include
  both the load result's result and chain, not just the chain alone.
- Simplify LowerLOAD and remove extraneous and unnecessary chains.
- Remove unused SPUISD pseudo instructions.

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

15 years agoUse register names instead of numbers in debug output.
Dan Gohman [Thu, 4 Dec 2008 02:15:26 +0000 (02:15 +0000)]
Use register names instead of numbers in debug output.

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

15 years agoMake debug output more informative.
Dan Gohman [Thu, 4 Dec 2008 02:14:57 +0000 (02:14 +0000)]
Make debug output more informative.

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

15 years agoVisibility hidden GVs do not require extra load of symbol address from the GOT or...
Evan Cheng [Thu, 4 Dec 2008 01:56:50 +0000 (01:56 +0000)]
Visibility hidden GVs do not require extra load of symbol address from the GOT or non-lazy-ptr.

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

15 years agoAdd minimal support for disambiguating memory references. Currently
Dan Gohman [Thu, 4 Dec 2008 01:35:46 +0000 (01:35 +0000)]
Add minimal support for disambiguating memory references. Currently
the main thing this covers is spills to distinct spill slots.

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

15 years agoadd a debugging option to help track down j-t problems.
Chris Lattner [Thu, 4 Dec 2008 00:07:59 +0000 (00:07 +0000)]
add a debugging option to help track down j-t problems.

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

15 years agoRewrite the liveness bookkeeping code to fix a bunch of
Dan Gohman [Wed, 3 Dec 2008 23:07:27 +0000 (23:07 +0000)]
Rewrite the liveness bookkeeping code to fix a bunch of
issues with subreg operands and tied operands.

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

15 years agoMake the debugging dump be a full line.
Dale Johannesen [Wed, 3 Dec 2008 22:45:31 +0000 (22:45 +0000)]
Make the debugging dump be a full line.

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

15 years agoRemove an unused field.
Dale Johannesen [Wed, 3 Dec 2008 22:43:56 +0000 (22:43 +0000)]
Remove an unused field.

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

15 years agoHave PseudoSourceValue override Value::dump, so that it works
Dan Gohman [Wed, 3 Dec 2008 21:37:21 +0000 (21:37 +0000)]
Have PseudoSourceValue override Value::dump, so that it works
on PseudoSourceValue values. This also fixes a FIXME in
lib/VMCode/AsmWriter.cpp.

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

15 years agoFix a misspelled function name.
Dale Johannesen [Wed, 3 Dec 2008 20:56:12 +0000 (20:56 +0000)]
Fix a misspelled function name.

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

15 years agoFactor some code into a new FoldSingleEntryPHINodes method.
Chris Lattner [Wed, 3 Dec 2008 19:44:02 +0000 (19:44 +0000)]
Factor some code into a new FoldSingleEntryPHINodes method.

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

15 years agoFix an inconsistency in a comment.
Dan Gohman [Wed, 3 Dec 2008 19:38:38 +0000 (19:38 +0000)]
Fix an inconsistency in a comment.

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

15 years agoUse mmx (punpckldq VR64, (mmx_v_set0)) to clear high 32-bits of a VR64 register.
Evan Cheng [Wed, 3 Dec 2008 19:38:05 +0000 (19:38 +0000)]
Use mmx (punpckldq VR64, (mmx_v_set0)) to clear high 32-bits of a VR64 register.

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

15 years agoDon't charge the full latency for anti and output dependencies. This is
Dan Gohman [Wed, 3 Dec 2008 19:37:34 +0000 (19:37 +0000)]
Don't charge the full latency for anti and output dependencies. This is
an area where eventually it would be good to use target-dependent
information.

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

15 years agoA step towards geting linux ppc to work (see PR 3099)
Dale Johannesen [Wed, 3 Dec 2008 19:33:10 +0000 (19:33 +0000)]
A step towards geting linux ppc to work (see PR 3099)

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

15 years agoWhen looking for anti-dependences on the critical path, don't bother
Dan Gohman [Wed, 3 Dec 2008 19:32:26 +0000 (19:32 +0000)]
When looking for anti-dependences on the critical path, don't bother
examining non-anti-dependence edges.

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

15 years agoAdd a comment about callee-saved registers.
Dan Gohman [Wed, 3 Dec 2008 19:30:13 +0000 (19:30 +0000)]
Add a comment about callee-saved registers.

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

15 years agoFix a really wrong comment.
Dale Johannesen [Wed, 3 Dec 2008 19:25:46 +0000 (19:25 +0000)]
Fix a really wrong comment.

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

15 years agofix a really incorrect comment.
Chris Lattner [Wed, 3 Dec 2008 19:18:54 +0000 (19:18 +0000)]
fix a really incorrect comment.

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

15 years agoSplit foldMemoryOperand into public non-virtual and protected virtual
Dan Gohman [Wed, 3 Dec 2008 18:43:12 +0000 (18:43 +0000)]
Split foldMemoryOperand into public non-virtual and protected virtual
parts, and add target-independent code to add/preserve
MachineMemOperands.

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

15 years agoRename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.
Dan Gohman [Wed, 3 Dec 2008 18:15:48 +0000 (18:15 +0000)]
Rename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.

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

15 years agoExtend X86's addFrameReference to add a MachineMemOperand for
Dan Gohman [Wed, 3 Dec 2008 18:11:40 +0000 (18:11 +0000)]
Extend X86's addFrameReference to add a MachineMemOperand for
the frame reference. This will help post-RA scheduling determine
that spills to distinct stack slots are independent.

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