1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

10263 Commits

Author SHA1 Message Date
Chris Lattner
c9b5e915c2 sink most of the meat in smallvector back from SmallVectorTemplateCommon
down into SmallVectorImpl.  This requires sprinking a ton of this->'s in,
but gives us a place to factor.

llvm-svn: 91522
2009-12-16 08:05:48 +00:00
Chris Lattner
19ee3f5216 substantial refactoring of SmallVector, now most code is in SmallVectorTemplateCommon,
and there is a new SmallVectorTemplateBase class in between it and SmallVectorImpl.
SmallVectorTemplateBase can be specialized based on isPodLike.

llvm-svn: 91518
2009-12-16 06:55:45 +00:00
Victor Hernandez
e91192950c MDNodes that refer to an instruction are local to a function; in that case, explicitly keep track of the function they are local to
llvm-svn: 91497
2009-12-16 02:52:09 +00:00
Jeffrey Yasskin
d50951dc1e Change indirect-globals to use a dedicated allocIndirectGV. This lets us
remove start/finishGVStub and the BufferState helper class from the
MachineCodeEmitter interface.  It has the side-effect of not setting the
indirect global writable and then executable on ARM, but that shouldn't be
necessary.

llvm-svn: 91464
2009-12-15 22:42:46 +00:00
Devang Patel
ffb33d1df8 Add support to emit debug info for C++ namespaces.
llvm-svn: 91440
2009-12-15 19:16:48 +00:00
Chris Lattner
b3db396df3 a few improvements:
1. Use std::equal instead of reinventing it.
2. don't run dtors in destroy_range if element is pod-like.
3. Use isPodLike to decide between memcpy/uninitialized_copy 
   instead of is_class.  isPodLike is more generous in some cases.

llvm-svn: 91427
2009-12-15 08:34:01 +00:00
Chris Lattner
f4e5966cf1 hoist the begin/end/capacity members and a few trivial methods
up into the non-templated SmallVectorBase class.

llvm-svn: 91426
2009-12-15 08:29:22 +00:00
Chris Lattner
f1a0d32b5f improve isPodLike to know that all non-class types are pod.
llvm-svn: 91425
2009-12-15 07:40:44 +00:00
Chris Lattner
521f59a9f5 Lang verified that SlotIndex is "pod like" even though it isn't a pod.
llvm-svn: 91423
2009-12-15 07:27:58 +00:00
Chris Lattner
587962c667 Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.

llvm-svn: 91421
2009-12-15 07:26:43 +00:00
Chris Lattner
05651d4544 add an ALWAYS_INLINE macro, which does the obvious thing.
llvm-svn: 91416
2009-12-15 06:14:33 +00:00
John McCall
9ebba8d98e Names from dependent base classes are not found by unqualified lookup.
llvm-svn: 91407
2009-12-15 03:10:26 +00:00
Mikhail Glushenkov
93c8d86be9 Validate the generated C++ code in llvmc tests.
Checks that the code generated by 'tblgen --emit-llvmc' can be actually
compiled. Also fixes two bugs found in this way:

- forward_transformed_value didn't work with non-list arguments
- cl::ZeroOrOne is now called cl::Optional

llvm-svn: 91404
2009-12-15 03:04:52 +00:00
Bill Wendling
e972f48c8f 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.

llvm-svn: 91392
2009-12-15 01:54:51 +00:00
Bill Wendling
d2e25c606e 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

llvm-svn: 91376
2009-12-15 00:39:24 +00:00
Dan Gohman
44a8b5decd Move Flag and isVoid after the vector types, since bit arithmetic with
those enum values is less common.

llvm-svn: 91361
2009-12-14 23:36:03 +00:00
Dan Gohman
ec4e132814 Fix these asserts to check the invariant that the code actually
depends on.

llvm-svn: 91360
2009-12-14 23:34:36 +00:00
Dan Gohman
8fcc52aafd Update this comment.
llvm-svn: 91356
2009-12-14 23:13:31 +00:00
Dan Gohman
d16b19ff3e Move several function bodies which are rarely inlined out of line.
llvm-svn: 91319
2009-12-14 19:43:09 +00:00
Dan Gohman
8e0956f734 Micro-optimize these functions in the case where they are not inlined.
llvm-svn: 91316
2009-12-14 19:32:31 +00:00
Dan Gohman
d8ea4d2eb0 Make the IVUses member private.
llvm-svn: 91291
2009-12-14 17:14:32 +00:00
Dan Gohman
c6a7652b5e Drop Loop::isNotAlreadyContainedIn in favor of Loop::contains. The
former was just exposing a LoopInfoBase implementation detail.

llvm-svn: 91286
2009-12-14 17:06:50 +00:00
Bill Wendling
e4328758f9 Whitespace changes, comment clarification. No functional changes.
llvm-svn: 91274
2009-12-14 06:51:19 +00:00
Lang Hames
9b6e6492ad Moved spill weight calculation out of SimpleRegisterCoalescing and into its own pass: CalculateSpillWeights.
llvm-svn: 91273
2009-12-14 06:49:42 +00:00
Anton Korobeynikov
5236d41ee7 Fix weird typo which leads to unallocated memory access for nodes with 4 results.
llvm-svn: 91233
2009-12-13 01:00:59 +00:00
Jeffrey Yasskin
9cba192e78 Make it easier to use the llvm_unreachable and DEBUG macros without "using
namespace llvm" by qualifying their implementations with ::llvm::.

llvm-svn: 91206
2009-12-12 04:08:32 +00:00
Dan Gohman
2e616e859b Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
llvm-svn: 91158
2009-12-11 21:31:27 +00:00
Dan Gohman
c22d542754 Make getUniqueExitBlocks's precondition assert more precise, to
avoid spurious failures. This fixes PR5758.

llvm-svn: 91147
2009-12-11 20:05:23 +00:00
Gabor Greif
8508c1f18e 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.

llvm-svn: 91123
2009-12-11 15:30:07 +00:00
Duncan Sands
d73da0fbb9 Add utility method for determining whether a function argument
has the 'nest' attribute.

llvm-svn: 91109
2009-12-11 08:36:17 +00:00
Bill Wendling
8f04cee7e1 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.

llvm-svn: 91101
2009-12-11 03:14:18 +00:00
Bill Wendling
0082253b13 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.

llvm-svn: 91092
2009-12-11 01:49:14 +00:00
Anders Carlsson
25a1bae472 Add qualifiers for calls to member functions in dependent bases.
llvm-svn: 91087
2009-12-11 01:04:42 +00:00
Douglas Gregor
8e4cabd047 Remove a broken, unused header
llvm-svn: 91058
2009-12-10 19:52:22 +00:00
Jakob Stoklund Olesen
c1a6340d54 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.

llvm-svn: 91049
2009-12-10 17:48:32 +00:00
Eric Christopher
ff291e48aa Silence conversion warning from 64 to 32-bit.
llvm-svn: 90962
2009-12-09 08:29:32 +00:00
Chris Lattner
366b8ac755 enhance NonLocalDepEntry to keep the per-block phi translated address
of the query.

llvm-svn: 90958
2009-12-09 07:31:04 +00:00
Daniel Dunbar
a8dc0ca084 DeltaAlgorithm: Add a virtual destructor and home.
llvm-svn: 90957
2009-12-09 07:19:48 +00:00
Chris Lattner
e0207b46d2 change NonLocalDepEntry from being a typedef for an std::pair to be its
own small class.  No functionality change.

llvm-svn: 90956
2009-12-09 07:08:01 +00:00
Lang Hames
a5a7da896e 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.

llvm-svn: 90951
2009-12-09 05:39:12 +00:00
Daniel Dunbar
b7c5aa749a Remove unneeded ';' and a class/struct mismatch (noticed by clang).
llvm-svn: 90934
2009-12-09 02:58:09 +00:00
Chris Lattner
dda5ca59e2 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.

llvm-svn: 90926
2009-12-09 01:59:31 +00:00
Evan Cheng
7941695285 Move isConsecutiveLoad to SelectionDAG. It's not target dependent and it's primary used by selectdag passes.
llvm-svn: 90922
2009-12-09 01:36:00 +00:00
Evan Cheng
293ec7b394 Add const qualifier.
llvm-svn: 90918
2009-12-09 01:10:37 +00:00
Evan Cheng
b925774a74 Refactor InferAlignment out of DAGCombine.
llvm-svn: 90917
2009-12-09 01:04:59 +00:00
Chris Lattner
3211af28ba fix many input tracking bugs.
llvm-svn: 90915
2009-12-09 00:56:14 +00:00
Chris Lattner
b0d20540ad instructions defined in CurBB may be intermediate nodes of the computation.
llvm-svn: 90908
2009-12-09 00:10:55 +00:00
Chris Lattner
83cb0b1450 add dumping and sanity checking support.
llvm-svn: 90906
2009-12-09 00:01:00 +00:00
Chris Lattner
604cebbfc1 make sure that PHITransAddr keeps its 'InstInputs' list up to
date when instsimplify kicks in.

llvm-svn: 90901
2009-12-08 23:42:51 +00:00
Devang Patel
11874672da Revert 90858 90875 and 90805 for now.
llvm-svn: 90898
2009-12-08 23:21:45 +00:00