Commit Graph

10691 Commits

Author SHA1 Message Date
Bill Wendling
614407a9d2 Initial work on disabling the scheduler. This is a work in progress, and this
stuff isn't used just yet.

We want to model the GCC `-fno-schedule-insns' and `-fno-schedule-insns2'
flags. The hypothesis is that the people who use these flags know what they are
doing, and have hand-optimized the C code to reduce latencies and other
conflicts.

The idea behind our scheme to turn off scheduling is to create a map "on the
side" during DAG generation. It will order the nodes by how they appeared in the
code. This map is then used during scheduling to get the ordering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 01:54:51 +00:00
Bill Wendling
43cf6c3939 Revert these. They may have been causing 483_xalancbmk to fail:
$ svn merge -c -91161 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91161 into '.':
U    lib/CodeGen/BranchFolding.cpp
U    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91113 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91113 into '.':
G    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91101 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91101 into '.':
U    include/llvm/CodeGen/MachineBasicBlock.h
G    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91092 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91092 into '.':
G    include/llvm/CodeGen/MachineBasicBlock.h
G    lib/CodeGen/MachineBasicBlock.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 00:39:24 +00:00
Dan Gohman
e3040e4ae5 Move Flag and isVoid after the vector types, since bit arithmetic with
those enum values is less common.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:36:03 +00:00
Dan Gohman
83644f6b6d Fix these asserts to check the invariant that the code actually
depends on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:34:36 +00:00
Dan Gohman
80d8930d28 Update this comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:13:31 +00:00
Dan Gohman
eda23faedb Move several function bodies which are rarely inlined out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 19:43:09 +00:00
Dan Gohman
a4f8ecd85d Micro-optimize these functions in the case where they are not inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 19:32:31 +00:00
Dan Gohman
35d913e6f3 Make the IVUses member private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 17:14:32 +00:00
Dan Gohman
440b40d865 Drop Loop::isNotAlreadyContainedIn in favor of Loop::contains. The
former was just exposing a LoopInfoBase implementation detail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 17:06:50 +00:00
Bill Wendling
85de1e5bad Whitespace changes, comment clarification. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 06:51:19 +00:00
Lang Hames
a937f220e1 Moved spill weight calculation out of SimpleRegisterCoalescing and into its own pass: CalculateSpillWeights.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 06:49:42 +00:00
Anton Korobeynikov
60283f9bc9 Fix weird typo which leads to unallocated memory access for nodes with 4 results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-13 01:00:59 +00:00
Jeffrey Yasskin
66b856683f Make it easier to use the llvm_unreachable and DEBUG macros without "using
namespace llvm" by qualifying their implementations with ::llvm::.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 04:08:32 +00:00
Dan Gohman
87862e77bb Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 21:31:27 +00:00
Dan Gohman
050959cd08 Make getUniqueExitBlocks's precondition assert more precise, to
avoid spurious failures. This fixes PR5758.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 20:05:23 +00:00
Gabor Greif
d01518630a Simplify this class by removing the result cache.
This change removes the DefaultConstructible
and CopyAssignable constraints on the template
parameter T (the first one).

The second template parameter (R) is defaulted to be
identical to the first and controls the result type.
By specifying it to be (const T&) additionally the
CopyConstructible constraint on T can be removed.

This allows to use StringSwitch e.g. for llvm::Constant
instances.

Regarding the other review feedback regarding performance
because of taking pointers, this class should be completely
optimizable like before, since all methods are inline and
the pointer dereferencing and result value caching should be
possible behind the scenes by the "as-if" rule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 15:30:07 +00:00
Duncan Sands
be1ce0a867 Add utility method for determining whether a function argument
has the 'nest' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 08:36:17 +00:00
Bill Wendling
64bdde2093 Address comments on last patch:
- Loosen the restrictions when checking of it branches to a landing pad.
- Make the loop more efficient by checking the '.insert' return value.
- Do cheaper checks first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 03:14:18 +00:00
Bill Wendling
4bde1ab82d A machine basic block may end in an unconditional branch, however it may have
more than one successor. Normally, these extra successors are dead. However,
some of them may branch to exception handling landing pads. If we remove those
successors, then the landing pads could go away if all predecessors to it are
removed. Before, it was checking if the direct successor was the landing
pad. But it could be the result of jumping through multiple basic blocks to get
to it. If we were to only check for the existence of an EH_LABEL in the basic
block and not remove successors if it's in there, then it could stop actually
dead basic blocks from being removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:49:14 +00:00
Anders Carlsson
da920fa4f9 Add qualifiers for calls to member functions in dependent bases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:04:42 +00:00
Douglas Gregor
e4a70cd19c Remove a broken, unused header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 19:52:22 +00:00
Jakob Stoklund Olesen
cf97036675 Also attempt trivial coalescing for live intervals that end in a copy.
The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch is more conservative than r90502, and does not break
483.xalancbmk/i686. It still breaks the PowerPC bootstrap, so it is disabled
by default, and can be enabled with the -trivial-coalesce-ends option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 17:48:32 +00:00
Eric Christopher
1e8c6934f2 Silence conversion warning from 64 to 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 08:29:32 +00:00
Chris Lattner
dad451cb7c enhance NonLocalDepEntry to keep the per-block phi translated address
of the query.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:31:04 +00:00
Daniel Dunbar
022840e960 DeltaAlgorithm: Add a virtual destructor and home.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:19:48 +00:00
Chris Lattner
e18b97121c change NonLocalDepEntry from being a typedef for an std::pair to be its
own small class.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:08:01 +00:00
Lang Hames
6194569d22 Added a new "splitting" spiller.
When a call is placed to spill an interval this spiller will first try to
break the interval up into its component values. Single value intervals and
intervals which have already been split (or are the result of previous splits)
are spilled by the default spiller.

Splitting intervals as described above may improve the performance of generated
code in some circumstances. This work is experimental however, and it still
miscompiles many benchmarks. It's not recommended for general use yet.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 05:39:12 +00:00
Daniel Dunbar
e854273892 Remove unneeded ';' and a class/struct mismatch (noticed by clang).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 02:58:09 +00:00
Chris Lattner
05e15f8897 Switch GVN and memdep to use PHITransAddr, which correctly handles
phi translation of complex expressions like &A[i+1].  This has the
following benefits:

1. The phi translation logic is all contained in its own class with
   a strong interface and verification that it is self consistent.

2. The logic is more correct than before.  Previously, if intermediate
   expressions got PHI translated, we'd miss the update and scan for
   the wrong pointers in predecessor blocks.  @phi_trans2 is a testcase
   for this.

3. We have a lot less code in memdep.

We can handle phi translation across blocks of things like @phi_trans3,
which is pretty insane :).

This patch should fix the miscompiles of 255.vortex, and I tested it 
with a bootstrap of llvm-gcc, llvm-test and dejagnu of course.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:59:31 +00:00
Evan Cheng
64fa4a9584 Move isConsecutiveLoad to SelectionDAG. It's not target dependent and it's primary used by selectdag passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:36:00 +00:00
Evan Cheng
7ced2e0b30 Add const qualifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:10:37 +00:00
Evan Cheng
f2dc5c785d Refactor InferAlignment out of DAGCombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:04:59 +00:00
Chris Lattner
6200e53f55 fix many input tracking bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 00:56:14 +00:00
Chris Lattner
af50315a29 instructions defined in CurBB may be intermediate nodes of the computation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 00:10:55 +00:00
Chris Lattner
7dedbf4ce3 add dumping and sanity checking support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 00:01:00 +00:00
Chris Lattner
43678f41a3 make sure that PHITransAddr keeps its 'InstInputs' list up to
date when instsimplify kicks in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 23:42:51 +00:00
Devang Patel
0000fadb00 Revert 90858 90875 and 90805 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 23:21:45 +00:00
Evan Cheng
e8b0915b21 Revert 90789 for now. It caused massive compile time regression. Post-ra scheduler slowed down dramatically with this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 19:34:53 +00:00
Chris Lattner
34f849098b fix a typo (and -> add) and fix GetAvailablePHITranslatedSubExpr to not
side-effect the current object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 06:06:26 +00:00
Oscar Fuentes
e019be7d4b Removed VC++ compatibility code from DataTypes.h.in.
This header file is not used on VC++ builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90829 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 02:49:54 +00:00
Oscar Fuentes
350dd4a6a6 For VC++, define the ?INT*_C macros only it they are not yet defined.
Some compatibility updates like the Boost TR1 compatibility headers
define them.

Patch contributed by OvermindDL1!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 02:40:09 +00:00
Victor Hernandez
c59b33562c Rename DIFactory::InsertValue() as DIFactory::InsertDbgValueIntrinsic()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 21:54:43 +00:00
Devang Patel
4063f6bcc7 Add support to emit debug info for c++ style namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 21:41:32 +00:00
Chris Lattner
e05a188cd6 add accessor, improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:45:30 +00:00
Dan Gohman
fb28579c56 Apply Pekka Jääskeläinen's patch to raise the first virtual register
number in order to accomodate targets with more than 1024 registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:38:26 +00:00
Victor Hernandez
2f9dac721d Introduce the "@llvm.dbg.value" debug intrinsic.
The semantics of llvm.dbg.value are that starting from where it is executed, an offset into the specified user source variable is specified to get a new value.

An example:
  call void @llvm.dbg.value(metadata !{ i32 7 }, i64 0, metadata !2)
Here the user source variable associated with metadata #2 gets the value "i32 7" at offset 0.
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90788 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:36:34 +00:00
Chris Lattner
9a8641201b checkpoint of the new PHITransAddr code, still not done and not used by
anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:36:53 +00:00
Mikhail Glushenkov
5b9b3ba2ba Deprecate 'unpack_values'.
Use 'forward_values' + 'comma_separated' instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:25:54 +00:00
Mikhail Glushenkov
8245a1dd53 Implement 'forward_value' and 'forward_transformed_value'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 17:03:05 +00:00
Evan Cheng
75eb535843 Pre-regalloc tale duplication. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 10:15:19 +00:00