Commit Graph

10706 Commits

Author SHA1 Message Date
Victor Hernandez dd7418ae3f 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 e0d8e14e11 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 1f4690c624 Add support to emit debug info for C++ namespaces.
llvm-svn: 91440
2009-12-15 19:16:48 +00:00
Chris Lattner 4179fa0357 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 6087a3e76b 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 62e04783c0 improve isPodLike to know that all non-class types are pod.
llvm-svn: 91425
2009-12-15 07:40:44 +00:00
Chris Lattner 9c45e03664 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 45d040bd85 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 a867a58a26 add an ALWAYS_INLINE macro, which does the obvious thing.
llvm-svn: 91416
2009-12-15 06:14:33 +00:00
John McCall 106c10881e Names from dependent base classes are not found by unqualified lookup.
llvm-svn: 91407
2009-12-15 03:10:26 +00:00
Mikhail Glushenkov 096fc103fb 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 07beddceb7 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 e8a525a196 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 28dea2a58b 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 897a5ac615 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 2e1cf19924 Update this comment.
llvm-svn: 91356
2009-12-14 23:13:31 +00:00
Dan Gohman 1cfbfc86cf Move several function bodies which are rarely inlined out of line.
llvm-svn: 91319
2009-12-14 19:43:09 +00:00
Dan Gohman fd5de58ec1 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 66e7d522fe Make the IVUses member private.
llvm-svn: 91291
2009-12-14 17:14:32 +00:00
Dan Gohman 57eb6cda7a 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 277381f69a Whitespace changes, comment clarification. No functional changes.
llvm-svn: 91274
2009-12-14 06:51:19 +00:00
Lang Hames d17e296301 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 94b6310136 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 7f1c9c2ff6 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 1d459e4937 Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
llvm-svn: 91158
2009-12-11 21:31:27 +00:00
Dan Gohman 84ba039cf2 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 cb4685c012 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 5d96f3fcb6 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 a1bce0c42e 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 a581aacdce 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 fb8d445090 Add qualifiers for calls to member functions in dependent bases.
llvm-svn: 91087
2009-12-11 01:04:42 +00:00
Douglas Gregor 9f8ca58e30 Remove a broken, unused header
llvm-svn: 91058
2009-12-10 19:52:22 +00:00
Jakob Stoklund Olesen 497161c40b 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 f92d732c99 Silence conversion warning from 64 to 32-bit.
llvm-svn: 90962
2009-12-09 08:29:32 +00:00
Chris Lattner eea0f58393 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 d333139411 DeltaAlgorithm: Add a virtual destructor and home.
llvm-svn: 90957
2009-12-09 07:19:48 +00:00
Chris Lattner 0c31547168 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 1ab2b49e6d 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 0d886ca091 Remove unneeded ';' and a class/struct mismatch (noticed by clang).
llvm-svn: 90934
2009-12-09 02:58:09 +00:00
Chris Lattner 972e6d8d00 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 f5938d5d27 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 1750009f38 Add const qualifier.
llvm-svn: 90918
2009-12-09 01:10:37 +00:00
Evan Cheng 34a23ea371 Refactor InferAlignment out of DAGCombine.
llvm-svn: 90917
2009-12-09 01:04:59 +00:00
Chris Lattner 11da6b0050 fix many input tracking bugs.
llvm-svn: 90915
2009-12-09 00:56:14 +00:00
Chris Lattner cfd76375e3 instructions defined in CurBB may be intermediate nodes of the computation.
llvm-svn: 90908
2009-12-09 00:10:55 +00:00
Chris Lattner 0aa75680d6 add dumping and sanity checking support.
llvm-svn: 90906
2009-12-09 00:01:00 +00:00
Chris Lattner 5cf4b74b45 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 512001ac7d Revert 90858 90875 and 90805 for now.
llvm-svn: 90898
2009-12-08 23:21:45 +00:00
Evan Cheng dc3e58eb89 Revert 90789 for now. It caused massive compile time regression. Post-ra scheduler slowed down dramatically with this.
llvm-svn: 90868
2009-12-08 19:34:53 +00:00
Chris Lattner 6425a23c8c fix a typo (and -> add) and fix GetAvailablePHITranslatedSubExpr to not
side-effect the current object.

llvm-svn: 90837
2009-12-08 06:06:26 +00:00
Oscar Fuentes a929407244 Removed VC++ compatibility code from DataTypes.h.in.
This header file is not used on VC++ builds.

llvm-svn: 90829
2009-12-08 02:49:54 +00:00
Oscar Fuentes 15c4bc673a 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!

llvm-svn: 90828
2009-12-08 02:40:09 +00:00
Victor Hernandez 58fd941eab Rename DIFactory::InsertValue() as DIFactory::InsertDbgValueIntrinsic()
llvm-svn: 90807
2009-12-07 21:54:43 +00:00
Devang Patel b074d1783b Add support to emit debug info for c++ style namespaces.
llvm-svn: 90805
2009-12-07 21:41:32 +00:00
Chris Lattner dccf7ad8b9 add accessor, improve comment.
llvm-svn: 90792
2009-12-07 19:45:30 +00:00
Dan Gohman 6aaf4232e5 Apply Pekka Jääskeläinen's patch to raise the first virtual register
number in order to accomodate targets with more than 1024 registers.

llvm-svn: 90789
2009-12-07 19:38:26 +00:00
Victor Hernandez fb7c680b61 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.
 

llvm-svn: 90788
2009-12-07 19:36:34 +00:00
Chris Lattner e60244db8c checkpoint of the new PHITransAddr code, still not done and not used by
anything.

llvm-svn: 90779
2009-12-07 18:36:53 +00:00
Mikhail Glushenkov 67c106664b Deprecate 'unpack_values'.
Use 'forward_values' + 'comma_separated' instead.

llvm-svn: 90774
2009-12-07 18:25:54 +00:00
Mikhail Glushenkov 6b6be99632 Implement 'forward_value' and 'forward_transformed_value'.
llvm-svn: 90770
2009-12-07 17:03:05 +00:00
Evan Cheng cc77062194 Pre-regalloc tale duplication. Work in progress.
llvm-svn: 90759
2009-12-07 10:15:19 +00:00
John Mosby 7bc9bb3555 fixed some typos in method comments, reworded some comments for clarity
llvm-svn: 90754
2009-12-07 09:06:37 +00:00
Oscar Fuentes 8b6d88d2f8 Fixes the Atomic implementation if compiled by MSVC compiler.
sys::cas_flag should be long on this platform, InterlockedAdd() is
defined only for the Itanium architecture (according to MSDN).

Patch by Michael Beck!

llvm-svn: 90748
2009-12-07 05:29:59 +00:00
Anton Korobeynikov 27a0ecfa39 Add MSP430 interrupt calling conv. No functionality change yet.
llvm-svn: 90738
2009-12-07 02:27:35 +00:00
Chris Lattner 7a141b3d88 remove extraneous comma clang warns about
llvm-svn: 90707
2009-12-06 16:58:41 +00:00
Chris Lattner d15e11ad98 Add helper methods for forming shift operations with a constant
shift amount.

llvm-svn: 90694
2009-12-06 01:56:22 +00:00
Dan Gohman 35f5646ef0 Remove old DBG_LABEL code.
llvm-svn: 90669
2009-12-05 17:56:26 +00:00
Dan Gohman 6e7073b846 Remove the unused DisableLegalizeTypes option and related code.
llvm-svn: 90668
2009-12-05 17:51:33 +00:00
Bill Wendling f89986235d Temporarily revert r90502. It was causing the llvm-gcc bootstrap on PPC to fail.
llvm-svn: 90653
2009-12-05 07:30:23 +00:00
Nick Lewycky c86b6fbb40 Document that memory use intrinsics may also return Def results.
llvm-svn: 90651
2009-12-05 06:37:52 +00:00
Dan Gohman 18f94469dc Make TargetSelectInstruction protected and called from FastISel.cpp
instead of SelectionDAGISel.cpp.

llvm-svn: 90636
2009-12-05 01:27:58 +00:00
Dan Gohman 047a767d74 Remove the target hook TargetInstrInfo::BlockHasNoFallThrough in favor of
MachineBasicBlock::canFallThrough(), which is target-independent and more
thorough.

llvm-svn: 90634
2009-12-05 00:44:40 +00:00
David Greene f96c416900 Remove an unneeded include.
llvm-svn: 90627
2009-12-05 00:03:24 +00:00
David Greene c5f3d8e343 Fix a bad merge.
llvm-svn: 90616
2009-12-04 23:08:02 +00:00
David Greene e373c9a71a Update the TargetInstrInfo interfaces so hasLoad/StoreFrom/ToStackSlot
can return a MachineMemOperand.

llvm-svn: 90615
2009-12-04 23:00:50 +00:00
Bob Wilson 9e2792690b Fix indentation.
llvm-svn: 90613
2009-12-04 22:46:47 +00:00
Evan Cheng 6154dbd5ee Add a pre-regalloc tail duplication pass.
llvm-svn: 90567
2009-12-04 09:42:45 +00:00
Chris Lattner b63051caf6 add the start of a class used to handle phi translation in memdep and
gvn (this is just a skeleton so far).  This will ultimately be used
to fix a nasty miscompilation with GVN.

llvm-svn: 90518
2009-12-04 02:10:16 +00:00
Mike Stump 94d3e9b094 Create yet another helper for Invoke.
llvm-svn: 90514
2009-12-04 01:53:15 +00:00
Mike Stump bcb77c985b Add some helpers for Invoke to mirror CreateCall helpers.
llvm-svn: 90508
2009-12-04 01:26:26 +00:00
Jakob Stoklund Olesen ca9cf65455 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 takes care of a few more cases that r90163 missed.

llvm-svn: 90502
2009-12-04 00:16:04 +00:00
Devang Patel eb57c59b66 Add support to emit debug info for virtual functions and virtual base classes.
llvm-svn: 90474
2009-12-03 19:11:07 +00:00
Daniel Dunbar ff53d4694c Add an implementation of the delta debugging algorithm.
- This is a pretty slow / memory intensive implementation, and I will likely
   change it to an iterative model, but it works.

llvm-svn: 90447
2009-12-03 11:12:42 +00:00
Andreas Neustifter b87d0f0662 Use ProfileInfo-API in ProfileInfo Loader and do more assertions.
llvm-svn: 90446
2009-12-03 11:00:37 +00:00
Andreas Neustifter 312288b30c Converted ProfileInfo to template, added more API for ProfileInfo-preserving.
llvm-svn: 90445
2009-12-03 09:30:12 +00:00
Evan Cheng 7145382389 Fill out codegen SSA updater. It's not yet tested.
llvm-svn: 90395
2009-12-03 02:31:43 +00:00
Chris Lattner 73570673de remove some dead std::ostream using code.
llvm-svn: 90366
2009-12-03 00:55:04 +00:00
Chris Lattner a48f44d9ee improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!

llvm-svn: 90365
2009-12-03 00:50:42 +00:00
Bill Wendling 1ed59c63e3 This initial code is meant to convert TargetData to use an AbstractTypesUser so
that it doesn't have dangling pointers when abstract types are resolved. This
modifies it somewhat to address comments: making the "StructLayoutMap" an
anonymous structure, calling "removeAbstractTypeUser" when appropriate, and
adding asserts where helpful.

llvm-svn: 90362
2009-12-03 00:17:12 +00:00
Evan Cheng 20e9d030c9 Skeleton for MachineInstr level SSA updater.
llvm-svn: 90353
2009-12-02 22:02:52 +00:00
Jim Grosbach 2c3a6c6589 Factor the stack alignment calculations out into a target independent pass.
No functionality change.

llvm-svn: 90336
2009-12-02 19:30:24 +00:00
Devang Patel a5749bda2c Add utility routine to create subprogram definition entry from subprogram declaration entry.
llvm-svn: 90282
2009-12-01 23:09:02 +00:00
Dan Gohman b2ae02979f Add edge source labels to SelectionDAG graphs, now that the graph printing
framework omits differentiated edge sources in the case where the labels
are empty strings.

llvm-svn: 90254
2009-12-01 19:20:00 +00:00
Jakob Stoklund Olesen defc47088a Move PHIElimination::isLiveOut method to LiveVariables.
We want LiveVariables clients to use methods rather than accessing the
getVarInfo data structure directly. That way it will be possible to change the
LiveVariables representation.

llvm-svn: 90240
2009-12-01 17:13:31 +00:00
Gabor Greif 7ee0efd289 typo
llvm-svn: 90236
2009-12-01 15:53:33 +00:00
Gabor Greif 6b822ce675 demonstrate usage of Cases() mapping several strings to the same value; remove trailing spaces
llvm-svn: 90230
2009-12-01 12:53:56 +00:00
Eric Christopher 4b25bac791 Remove the gcc builtins from the intrinsics, we'll lower them
explicitly so we can check arguments.

llvm-svn: 90199
2009-12-01 03:18:26 +00:00
Evan Cheng 1d31fc9123 Fix PR5614: parts of a physical register def may be killed the rest.
llvm-svn: 90180
2009-12-01 00:44:45 +00:00
Dan Gohman ec30044cf7 Fix typos in comments.
llvm-svn: 90164
2009-11-30 23:30:43 +00:00
Bob Wilson 505ddaa4dc Remove isProfitableToDuplicateIndirectBranch target hook. It is profitable
for all the processors where I have tried it, and even when it might not help
performance, the cost is quite low.  The opportunities for duplicating
indirect branches are limited by other factors so code size does not change
much due to tail duplicating indirect branches aggressively.

llvm-svn: 90144
2009-11-30 18:35:03 +00:00