Commit Graph

12633 Commits

Author SHA1 Message Date
Dan Gohman 9c9ce53b29 Add hooks to FoldingSetTrait to allow specializations to provide
implementations of equality comparison and hash computation. This
can be used to optimize node lookup by avoiding creating lots of
temporary ID values just for hashing and comparison purposes.

llvm-svn: 111130
2010-08-16 15:30:39 +00:00
Dan Gohman b8640b6d73 Tidy up whitespace in comments.
llvm-svn: 111129
2010-08-16 15:04:39 +00:00
Dan Gohman 02341b2023 Constify FoldingSetNodeIDRef's Data.
llvm-svn: 111128
2010-08-16 15:03:24 +00:00
Dan Gohman 27c98e6303 Reverse the order of GetNodeProfile's arguments, for consistency
with FoldingSetTrait::Profile.

llvm-svn: 111127
2010-08-16 14:53:42 +00:00
Dan Gohman 1cab72a44f Fix indentation in example code in a comment.
llvm-svn: 111125
2010-08-16 14:45:36 +00:00
Mikhail Glushenkov 938e976b90 llvmc: remove dynamic plugins.
llvm-svn: 111094
2010-08-15 07:07:12 +00:00
Dan Gohman 4a63fad976 Teach SimplifyCFG how to simplify indirectbr instructions.
- Eliminate redundant successors.
 - Convert an indirectbr with one successor into a direct branch.

Also, generalize SimplifyCFG to be able to be run on a function entry block.
It knows quite a few simplifications which are applicable to the entry
block, and it only needs a few checks to avoid trouble with the entry block.

llvm-svn: 111060
2010-08-14 00:29:42 +00:00
Jim Grosbach a030fa5297 Add a local stack object block allocation pass. This is still an
experimental pass that allocates locals relative to one another before
register allocation and then assigns them to actual stack slots as a block
later in PEI. This will eventually allow targets with limited index offset
range to allocate additional base registers (not just FP and SP) to
more efficiently reference locals, as well as handle situations where
locals cannot be referenced via SP or FP at all (dynamic stack realignment
together with variable sized objects, for example). It's currently
incomplete and almost certainly buggy. Work in progress.

Disabled by default and gated via the -enable-local-stack-alloc command
line option.

rdar://8277890

llvm-svn: 111059
2010-08-14 00:15:52 +00:00
Jim Grosbach c0b5c19547 tidy up comments
llvm-svn: 111040
2010-08-13 20:32:35 +00:00
Jim Grosbach 5af43f04dc tidy up 80 column and whitespace
llvm-svn: 111033
2010-08-13 20:08:59 +00:00
Dan Gohman 874d74ef75 Implement hasComputableLoopEvolution for Add, Mul, and Trunc operators,
since they can support trivial implementations. This avoids potentially
expensive traversals of the operands.

llvm-svn: 111031
2010-08-13 20:03:15 +00:00
Benjamin Kramer 2df195eea1 Use getAllOnesValue, saves a copy and looks better.
llvm-svn: 110991
2010-08-13 00:29:44 +00:00
Jakob Stoklund Olesen 0910689353 Also recompute HasPHIKill flags in LiveInterval::RenumberValues.
If a phi-def value were removed from the interval, the phi-kill flags are no
longer valid.

llvm-svn: 110949
2010-08-12 20:38:03 +00:00
Jakob Stoklund Olesen 073cd8004a Remove trailing whitespace.
llvm-svn: 110944
2010-08-12 20:01:23 +00:00
Duncan Sands 501dff76ce Add a 'normalize' method to the Triple class, which takes a mucked up
target triple and straightens it out.  This does less than gcc's script
config.sub, for example it turns i386-mingw32 into i386--mingw32 not
i386-pc-mingw32, but it does a decent job of turning funky triples into
something that the rest of the Triple class can understand.  The plan
is to use this to canonicalize triple's when they are first provided
by users, and have the rest of LLVM only deal with canonical triples.
Once this is done the special case workarounds in the Triple constructor
can be removed, making the class more regular and easier to use.  The
comments and unittests for the Triple class are already adjusted in this
patch appropriately for this brave new world of increased uniformity.

llvm-svn: 110909
2010-08-12 11:31:39 +00:00
Daniel Dunbar 2ecc3bb4f7 MC/AsmParser: Push the burdon of emitting diagnostics about unmatched
instructions onto the target specific parser, which can do a better job.

llvm-svn: 110889
2010-08-12 00:55:38 +00:00
Daniel Dunbar 167b9d7f30 tblgen/AsmMatcher: Always emit the match function as 'MatchInstructionImpl',
target specific parsers can adapt the TargetAsmParser to this.

llvm-svn: 110888
2010-08-12 00:55:32 +00:00
Daniel Dunbar b524afbae3 configure: Add detection of the linker version string.
- Review appreciated, as long as you understand that I understand that this is
   a horrible hack.

llvm-svn: 110883
2010-08-11 23:53:59 +00:00
Nick Lewycky d385c22cf3 Clean up ConstantRange a bit:
- remove ashr which never worked.
 - fix lshr and shl and add tests.
 - remove dead function "intersect1Wrapped".
 - add a new sub method to subtract ranges, with test.

llvm-svn: 110861
2010-08-11 22:04:36 +00:00
Dan Gohman a97e78b4ac Make LoopPass::getContainedPass return a LoopPass* instead of a Pass*
and remove casts from all its callers.

llvm-svn: 110848
2010-08-11 20:34:43 +00:00
Dan Gohman 30d0382efe Remove BasicBlockPass::runOnFunction, which was unused.
llvm-svn: 110847
2010-08-11 20:28:16 +00:00
Bruno Cardoso Lopes b7ef82baab Remove rsqrt/sqrt_nr intrinsics since there are no more builtins for them on clang
llvm-svn: 110845
2010-08-11 19:21:05 +00:00
Dan Gohman fe8e2eae16 Delete FunctionPass::run, which is unused.
llvm-svn: 110843
2010-08-11 19:11:05 +00:00
Dan Gohman b223a0e074 Delete FunctionPass::runOnModule, which is unused.
llvm-svn: 110842
2010-08-11 19:05:53 +00:00
Dan Gohman a5a25036bb Don't use unsigned char for alignments in TargetData. There aren't
that many of these things, so the memory savings isn't significant,
and there are now situations where there can be alignments greater
than 128.

llvm-svn: 110836
2010-08-11 18:15:01 +00:00
Jakob Stoklund Olesen 852a2c19dd Fix a FIXME. The SlotIndex::Slot enum should be private.
llvm-svn: 110826
2010-08-11 16:50:17 +00:00
Daniel Dunbar 2eca0252c3 llvm-mc: Add -show-inst-operands, for dumping the parsed instruction representation before matching.
llvm-svn: 110791
2010-08-11 06:37:09 +00:00
Daniel Dunbar ebace2248f MCAsmParser: Add dump() hook to MCParsedAsmOperand.
llvm-svn: 110790
2010-08-11 06:37:04 +00:00
Bruno Cardoso Lopes 8c9c9c77c8 Remove AVX 256-bit cast intrinsics now that clang is using __builtin_shufflevector for those
llvm-svn: 110772
2010-08-11 02:15:33 +00:00
Bruno Cardoso Lopes 4134f97e56 Remove AVX 256-bit unpack and interleave intrinsics now that clang is using __builtin_shufflevector for those
llvm-svn: 110769
2010-08-11 01:44:11 +00:00
Bruno Cardoso Lopes 90b238c68b Remove AVX 256-bit shuffle intrinsics now that clang is using __builtin_shufflevector for those
llvm-svn: 110767
2010-08-11 01:18:26 +00:00
Rafael Espindola ccab1dddd1 Make it possible to set the cpu used for codegen.
llvm-svn: 110759
2010-08-11 00:15:13 +00:00
Oscar Fuentes daf5881128 Avoid multiple definition warnings when both config.h and
llvm-config.h are included.

This is the cmake counterpart of r110547. See bug #7809.

llvm-svn: 110753
2010-08-10 23:48:22 +00:00
Dan Gohman e18c2d6f99 Rename and reorder the arguments to isImpliedCond, for consistency and clarity.
llvm-svn: 110750
2010-08-10 23:46:30 +00:00
Devang Patel 3e4d04230b Add missing argument. CreateCompositeTypeEx() users, please verify.
llvm-svn: 110717
2010-08-10 20:22:49 +00:00
Rafael Espindola 0045646633 Make it possible to set the flags passed to the assembler.
Nick, please review.

llvm-svn: 110705
2010-08-10 18:55:09 +00:00
Jakob Stoklund Olesen 53c5022040 Implement register class inflation.
When splitting a live range, the new registers have fewer uses and the
permissible register class may be less constrained. Recompute the register class
constraint from the uses of new registers created for a split. This may let them
be allocated from a larger set, possibly avoiding a spill.

llvm-svn: 110703
2010-08-10 18:37:40 +00:00
Jakob Stoklund Olesen 284c2dbfd7 Recalculate the spill weight and allocation hint for virtual registers created
during live range splitting.

llvm-svn: 110686
2010-08-10 17:07:22 +00:00
Mikhail Glushenkov fc838009d6 Trailing whitespace.
llvm-svn: 110679
2010-08-10 14:49:24 +00:00
Bruno Cardoso Lopes 2ccdcad5d9 Remove replicate intrinsics, clang will generate shufflevector for those. The shuffles can't be matched by x86 codegen yet, but will soon
llvm-svn: 110647
2010-08-10 02:25:35 +00:00
Bruno Cardoso Lopes 413db95b09 Use i32 instead of i8 for dot product intrinsic
llvm-svn: 110643
2010-08-10 01:40:05 +00:00
Jakob Stoklund Olesen e00c49da11 Transpose the calculation of spill weights such that we are calculating one
register at a time. This turns out to be slightly faster than iterating over
instructions, but more importantly, it allows us to compute spill weights for
new registers created after the spill weight pass has run.

Also compute the allocation hint at the same time as the spill weight. This
allows us to use the spill weight as a cost metric for copies, and choose the
most profitable hint if there is more than one possibility.

The new hints provide a very small (< 0.1%) but universal code size improvement.

llvm-svn: 110631
2010-08-10 00:02:26 +00:00
Bruno Cardoso Lopes 1aeaba6c73 Fix the last argument type of AVX vblend intrinsics
llvm-svn: 110628
2010-08-10 00:00:22 +00:00
Bill Wendling ca67835eaa Merge the OptimizeExts and OptimizeCmps passes into one PeepholeOptimizer
pass. This pass should expand with all of the small, fine-grained optimization
passes to reduce compile time and increase happiment.

llvm-svn: 110627
2010-08-09 23:59:04 +00:00
Kevin Enderby 7221b76c32 Next bit of support for the dwarf .file directive. This patch takes the
previously collected info from the .file directives and outputs the encoded
bytes for it.  For now this is only in the Mach-O streamer but at some point
will move to a more generic place.

llvm-svn: 110617
2010-08-09 22:52:14 +00:00
Devang Patel c7cf14f5f6 Refactor.
llvm-svn: 110607
2010-08-09 21:39:24 +00:00
Rafael Espindola 4ef89f5200 Make it possible to set the target triple and expose that with an option in the
gold plugin.

llvm-svn: 110604
2010-08-09 21:09:46 +00:00
Duncan Sands 8c811cc831 Remove the ValueMap operator=, which was wrong (it did't correct the
Map pointers of any contained ValueMapCallbackVH's) and unused.

llvm-svn: 110577
2010-08-09 16:44:56 +00:00
Zhongxing Xu 8f4ce879f4 Change the Interval type to signed in ImmutableIntervalMap.h.
llvm-svn: 110562
2010-08-09 03:43:39 +00:00
Benjamin Kramer 7fc5a94f4e Remove unused variable.
llvm-svn: 110551
2010-08-08 19:54:10 +00:00
Duncan Sands 67f8b16067 Remove the ValueMap copy constructor. It's not used anywhere,
and removing it catches the mistake of passing a ValueMap by
copy rather than by reference.

llvm-svn: 110549
2010-08-08 12:57:48 +00:00
Eric Christopher e8f47dd13a Add a bit of a hack to avoid multiple defines of variables in
config.h and llvm-config.h.  This could probably be improved.

llvm-svn: 110547
2010-08-08 09:18:29 +00:00
Bill Wendling 798617b1ab Use the "isCompare" machine instruction attribute instead of calling the
relatively expensive comparison analyzer on each instruction. Also rename the
comparison analyzer method to something more in line with what it actually does.

This pass is will eventually be folded into the Machine CSE pass.

llvm-svn: 110539
2010-08-08 05:04:59 +00:00
Oscar Fuentes 2b1077fb1d CMake: set configure macro LLVM_PREFIX
llvm-svn: 110536
2010-08-08 04:32:21 +00:00
Oscar Fuentes 74f92e1102 CMake: configure header llvm-config.h
This is the cmake equivalent of r110532, which fixed bug #7809.

llvm-svn: 110535
2010-08-08 04:17:18 +00:00
Eric Christopher f24446d0c5 Fix PR7809 by creating a header for just llvm variables that can be
included in exported interfaces.  Update a couple of exported interfaces.

llvm-svn: 110532
2010-08-08 02:44:17 +00:00
Bill Wendling 18e853f458 Add back in r109901, which adds a Compare flag to the target instructions. It's
useful after all.

llvm-svn: 110531
2010-08-08 01:49:35 +00:00
Benjamin Kramer a7d0ccfe7f Roll back my last two commits, valgrind complains.
llvm-svn: 110518
2010-08-07 13:27:41 +00:00
Benjamin Kramer b9525dea59 A reference to the Timer's name is safe, it outlives the contents of the vector.
llvm-svn: 110517
2010-08-07 13:07:57 +00:00
Benjamin Kramer be05173105 Shrink PassNameParser's binary size with array_pod_sort.
llvm-svn: 110512
2010-08-07 11:45:42 +00:00
Owen Anderson a5a3ff586f Remove layering violation.
llvm-svn: 110505
2010-08-07 06:01:13 +00:00
Owen Anderson 1a9078b862 Add an inverse() method to ConstantRange.
llvm-svn: 110504
2010-08-07 05:47:46 +00:00
Nick Lewycky 5caa7c58db Fix typo.
llvm-svn: 110502
2010-08-07 05:25:29 +00:00
Dan Gohman 6b99da0aab Remove assignPassManager's default arguments. It's really
confusing to have different arguments for the same virtual
function at different levels of the class hierarchy.

llvm-svn: 110500
2010-08-07 01:25:32 +00:00
Dan Gohman a19631f437 More #include cleanups.
llvm-svn: 110499
2010-08-07 01:18:18 +00:00
Dan Gohman 1b4a087317 Delete this explicit assignment operator; it's equivalent to
the implicit one.

llvm-svn: 110498
2010-08-07 01:17:47 +00:00
Dan Gohman 404c58847e Tidy up PMStack. Add a bunch of consts, use std::vector instead of
std::deque, since this is a stack and only supports push/pop on
one end, and remove an unimplemented declaration.

llvm-svn: 110495
2010-08-07 00:53:01 +00:00
Dan Gohman 093b42fc7c Tidy some #includes and forward-declarations, and move the C binding code
out of PassManager.cpp and into Core.cpp with the rest of the C binding code.

llvm-svn: 110494
2010-08-07 00:43:20 +00:00
Owen Anderson 07d0637000 Add a convenience constructor.
llvm-svn: 110493
2010-08-07 00:42:06 +00:00
Dan Gohman 71b30e0db6 Make AnalysisImpls private.
llvm-svn: 110492
2010-08-07 00:34:52 +00:00
Owen Anderson b650ad0861 Add a predicate to determine if a call is an inline asm statement.
llvm-svn: 110488
2010-08-07 00:19:59 +00:00
Rafael Espindola f16a9bc5b9 Some cleanup. Use a class (OptionInfo) instead of a pair of a pair and remove
some default values that are not used.

llvm-svn: 110485
2010-08-06 23:03:52 +00:00
Bruno Cardoso Lopes 93cc666a58 Patterns to match AVX 256-bit vzero intrinsics
llvm-svn: 110480
2010-08-06 22:10:01 +00:00
Dan Gohman 0f7892b8ae Eliminate PromoteMemoryToRegisterID; just use addPreserved("mem2reg")
instead, as an example of what this looks like.

llvm-svn: 110478
2010-08-06 21:48:06 +00:00
Jim Grosbach 8e4e2aaa2f tidy up
llvm-svn: 110476
2010-08-06 21:31:35 +00:00
Daniel Dunbar bcb332475c MC: Add default value for AddrSpace argument to EmitValue.
llvm-svn: 110475
2010-08-06 21:24:05 +00:00
Jakob Stoklund Olesen 8c0f693150 Add LiveInterval::RenumberValues - Garbage collection for VNInfos.
After heavy editing of a live interval, it is much easier to simply renumber the
live values instead of trying to keep track of the unused ones.

llvm-svn: 110463
2010-08-06 18:46:59 +00:00
Owen Anderson a7aed18624 Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Dan Gohman e68958fcdf Implement a proper getModRefInfo for va_arg.
llvm-svn: 110458
2010-08-06 18:24:38 +00:00
Jim Grosbach 0cb2c7a25e spelling
llvm-svn: 110457
2010-08-06 18:24:36 +00:00
Rafael Espindola 027d5bcf89 Fix eabi calling convention when a 64 bit value shadows r3.
Without this what was happening was:

* R3 is not marked as "used"
* ARM backend thinks it has to save it to the stack because of vaarg
* Offset computation correctly ignores it
* Offsets are wrong

llvm-svn: 110446
2010-08-06 15:35:32 +00:00
Dan Gohman 7b7e304d9a Add a comment.
llvm-svn: 110426
2010-08-06 02:04:07 +00:00
Bill Wendling e8bb340203 Revert r109901. The implementation of <rdar://problem/7405933> (r110423) doesn't
need the Compare flag after all.

--- Reverse-merging r109901 into '.':
U    include/llvm/Target/TargetInstrDesc.h
U    include/llvm/Target/Target.td
U    utils/TableGen/InstrInfoEmitter.cpp
U    utils/TableGen/CodeGenInstruction.cpp
U    utils/TableGen/CodeGenInstruction.h

llvm-svn: 110424
2010-08-06 01:36:09 +00:00
Bill Wendling 7de9d52c13 Add the Optimize Compares pass (disabled by default).
This pass tries to remove comparison instructions when possible. For instance,
if you have this code:

   sub r1, 1
   cmp r1, 0
   bz  L1

and "sub" either sets the same flag as the "cmp" instruction or could be
converted to set the same flag, then we can eliminate the "cmp" instruction all
together. This is a important for ARM where the ALU instructions could set the
CPSR flag, but need a special suffix ('s') to do so.

llvm-svn: 110423
2010-08-06 01:32:48 +00:00
Owen Anderson bda59bd247 Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Bruno Cardoso Lopes 085ce5c5e1 Remove unused AVX intrinsics
llvm-svn: 110407
2010-08-06 00:04:07 +00:00
Dan Gohman 78d7c080e0 Make AA private, since subclasses shouldn't (aren't don't) access it directly.
llvm-svn: 110398
2010-08-05 23:44:45 +00:00
Owen Anderson 755aceb5d0 Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Dan Gohman ddb2d65c50 Remove IntrWriteMem, as it's the default. Rename IntrWriteArgMem
to IntrReadWriteArgMem, as it's for reading as well as writing.

llvm-svn: 110395
2010-08-05 23:36:21 +00:00
Eric Christopher b7ad70d1e8 Revert my last commit, apparently it's a runtime issue.
llvm-svn: 110387
2010-08-05 22:48:32 +00:00
Eric Christopher d7d0517cc2 Remove unnecessary include.
llvm-svn: 110385
2010-08-05 22:28:22 +00:00
Gabor Greif 638c823211 remove the private hack from CallInst, it was not supposed to hit the branch anyway
as a positive consequence the CallSite::getCallee() methods now can be rewritten to be
a bit more efficient

llvm-svn: 110380
2010-08-05 21:25:49 +00:00
Owen Anderson d3c94af142 Give ConstantRange an operator=
llvm-svn: 110376
2010-08-05 20:51:10 +00:00
Jakob Stoklund Olesen 4583355a78 Remove double-def checking from MachineVerifier, so a register does not have to
be killed before being redefined.

These checks are usually disabled, and usually fail when enabled. We de facto
allow live registers to be redefined without a kill, the corresponding
assertions in RegScavenger were removed long ago.

llvm-svn: 110362
2010-08-05 18:59:59 +00:00
Dan Gohman a1c0f8b5c8 Delete obsolete comments.
llvm-svn: 110277
2010-08-04 23:08:15 +00:00
Torok Edwin bfc17d0157 Add a missing function.
llvm-svn: 110195
2010-08-04 11:42:45 +00:00
Torok Edwin 6b43ea117f Fix build of DataFlow.h
llvm-svn: 110193
2010-08-04 09:30:20 +00:00
Dan Gohman f77b735376 Don't construct a std::string with a literal "".
llvm-svn: 110180
2010-08-04 01:14:33 +00:00
Dan Gohman 47053d972b Don't print the filename twice in file-not-found errors.
llvm-svn: 110179
2010-08-04 01:13:48 +00:00
Bruno Cardoso Lopes b8f0d52731 Fix a comment typo and add more 256-bit intrinsics
llvm-svn: 110177
2010-08-04 01:09:40 +00:00
Dan Gohman fc419ef6a0 Remove PointerAccessInfo, which nothing was using.
llvm-svn: 110167
2010-08-03 23:08:10 +00:00
Dan Gohman 5442c71f2e Thread const correctness through a bunch of AliasAnalysis interfaces and
eliminate several const_casts.

Make CallSite implicitly convertible to ImmutableCallSite.

Rename the getModRefBehavior for intrinsic IDs to
getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite,
which happens to be implicitly convertible to bool.

llvm-svn: 110155
2010-08-03 21:48:53 +00:00
Nate Begeman b69b182191 Add support for getting & setting the FPSCR application register on ARM when VFP is enabled.
Add support for using the FPSCR in conjunction with the vcvtr instruction, for controlling fp to int rounding.
Add support for the FLT_ROUNDS_ node now that the FPSCR is exposed.

llvm-svn: 110152
2010-08-03 21:31:55 +00:00
Peter Collingbourne ddaaf40d24 Add an atomic lowering pass
llvm-svn: 110113
2010-08-03 16:19:16 +00:00
Daniel Dunbar edf7b8bd4e build: Add LLVM_NATIVE_ARCHNAME, which has the sensible value, without "Target"
appended.

llvm-svn: 110109
2010-08-03 14:26:17 +00:00
Bruno Cardoso Lopes 7492a11f0c Support x86 AVX 256-bit instruction intrinsics. Right now support all of them, but
as soon as we properly codegen the simple vector operations in clang, remove the
unnecessary builti-ins/intrinsics from clang and llvm.

llvm-svn: 110094
2010-08-03 01:53:41 +00:00
Dan Gohman 4887001f81 Update some comments.
llvm-svn: 110092
2010-08-03 01:07:32 +00:00
Dan Gohman 2a190081f6 Introduce a symbolic constant for ~0u for use with AliasAnalysis.
llvm-svn: 110091
2010-08-03 01:03:11 +00:00
Dan Gohman da7182e116 Add a convenient form of AliasAnalysis::alias for the case where the sizes
are unknown.

llvm-svn: 110090
2010-08-03 00:56:30 +00:00
Dan Gohman 7cac95778f Make SCEVUnknown a CallbackVH, so that it can be notified directly
of Value deletions and RAUWs, instead of relying on ScalarEvolution's
Scalars map being notified, as that's complicated at best, and
insufficient in general.

This means SCEVUnknown needs a non-trivial destructor, so introduce
a mechanism to allow ScalarEvolution to locate all the SCEVUnknowns.

llvm-svn: 110086
2010-08-02 23:49:30 +00:00
Dan Gohman 272980b3f6 Sketch up a preliminary Type-Based Alias Analysis implementation.
llvm-svn: 110077
2010-08-02 23:11:01 +00:00
Devang Patel 33a2cdf3f9 Add explicit constructors. Patch by Renato Golin.
llvm-svn: 110072
2010-08-02 22:51:46 +00:00
Daniel Dunbar df77432f8a Targets: Add InitializeNativeTargetAsmPrinter(), patch by Jan Sjodin, although
rewritten by me to not require updating all the target initialization routine
names.

llvm-svn: 109996
2010-08-01 23:36:18 +00:00
Gabor Greif 779e4b15f1 doxygenize argument accessors
llvm-svn: 109950
2010-07-31 08:35:21 +00:00
Michael J. Spencer 6b4925e223 Add relax all support to the COFF object streamer.
llvm-svn: 109947
2010-07-31 06:22:29 +00:00
Rafael Espindola 40f18838b7 The BlockExtractorPass() constructor was not reading the BlockFile and that was
exactly what bugpoint expected it to do.

There was also only one user of
BlockExtractorPass(const std::vector<BasicBlock*> &B), so just remove it and
make BlockExtractorPass read BlockFile.

This fixes bugpoint's block extraction.

Nick, please review.

llvm-svn: 109936
2010-07-31 00:32:17 +00:00
Bill Wendling 9b8d586039 Add a "Compare" flag to the target instruction descriptor. This will be used
later to identify and possibly remove superfluous compare instructions -- those
that are testing for and setting a status flag that should already be set.

llvm-svn: 109901
2010-07-30 22:48:39 +00:00
Dan Gohman d566d2c7b5 Move MaximumAlignment to be a member of the Value class.
llvm-svn: 109891
2010-07-30 21:07:05 +00:00
Nick Lewycky 916a28b16a LibCallAliasAnalysis uses multiple inheritance, so it needs to implement
getAdjustedAnalysisPointer. Part of a fix to PR7760.

llvm-svn: 109883
2010-07-30 20:19:09 +00:00
Duncan Sands cb59bfa7ec Fix the ValueMap copy constructor. The issue is that the map keys are value
handles with a pointer to the containing map.  When a map is copied, these
pointers need to be corrected to point to the new map.  If not, then consider
the case of a map M1 which maps a value V to something.  Create a copy M2 of
M1.  At this point there are two value handles on V, one representing V as a
key in M1, the other representing V as a key in M2.  But both value handles
point to M1 as the containing map.  Now delete V.  The value handles remove
themselves from their containing map (which destroys them), but only the first
value handle is successful: the second one cannot remove itself from M1 as
(once the first one has removed itself) there is nothing there to remove; it
is therefore not destroyed.  This causes an assertion failure "All references
to V were not removed?".

llvm-svn: 109851
2010-07-30 05:49:32 +00:00
Gabor Greif 56c38bda40 remove a layer of cruft
llvm-svn: 109821
2010-07-29 23:35:00 +00:00
Nate Begeman c4a96c0e8c Add builtins for ssat/usat, similar to RealView's __ssat and __usat intrinsics.
llvm-svn: 109813
2010-07-29 22:48:09 +00:00
Eric Christopher be2bb0d337 Grammar.
llvm-svn: 109775
2010-07-29 18:11:28 +00:00
Nate Begeman 7010a71ac4 Add intrinsics __builtin_arm_qadd & __builtin_arm_qsub to allow access to the QADD & QSUB instructions.
Behave identically to __qadd & __qsub RealView instruction intrinsics.

llvm-svn: 109770
2010-07-29 17:56:55 +00:00
Benjamin Kramer a3e0ddb564 Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter.
llvm-svn: 109767
2010-07-29 17:48:06 +00:00
Benjamin Kramer bccfec653d Stop leaking std::strings in GetDwarfFile.
llvm-svn: 109746
2010-07-29 13:53:19 +00:00
Eric Christopher ef6d5933a6 Speculatively revert r109705 since it seems to be causing some build bot
angst.

llvm-svn: 109718
2010-07-29 01:25:38 +00:00
Dan Gohman 3d6ac44d96 Factor out some of the code for updating old SCEVUnknown values, and
extend it to handle the case where multiple RAUWs affect a single
SCEVUnknown.

Add a ScalarEvolution unittest to test for this situation.

llvm-svn: 109705
2010-07-29 00:17:55 +00:00
Owen Anderson cfc2a57fcd Add an erase() method to llvm::ThreadLocal.
llvm-svn: 109686
2010-07-28 22:49:43 +00:00
Owen Anderson bcaba485ce Add more doxygen comments for llvm::ThreadLocal.
llvm-svn: 109683
2010-07-28 22:30:53 +00:00
Dan Gohman 7e4163d48e Move MaximumAlignment to Value.h, now that GlobalValue.h needs it.
llvm-svn: 109656
2010-07-28 21:02:38 +00:00
Dan Gohman 390914cbe8 Make GlobalValue alignment consistent with load, store, and alloca
alignment, fixing silent truncation of alignment values.

llvm-svn: 109653
2010-07-28 20:56:48 +00:00
Kevin Enderby e5930f142a Added first bit of support for the dwarf .file directive. This patch collects
the info from the .file directive and makes file and directory tables that
will eventually be put out as part of the dwarf info in the output file.

llvm-svn: 109651
2010-07-28 20:55:35 +00:00
Daniel Dunbar e397dded7b MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).
llvm-svn: 109649
2010-07-28 20:28:45 +00:00
Dan Gohman a7e5a24093 Define a maximum supported alignment value for load, store, and
alloca instructions (constrained by their internal encoding),
and add error checking for it. Fix an instcombine bug which
generated huge alignment values (null is infinitely aligned).
This fixes undefined behavior noticed by John Regehr.

llvm-svn: 109643
2010-07-28 20:12:04 +00:00
Dan Gohman 44ee74292f Add some extra friend declarations to fix a gcc-4.0 compile error.
This is a temporary fix, until more elaborate changes are ready.

llvm-svn: 109593
2010-07-28 17:09:24 +00:00
Daniel Dunbar 19a3b37441 Support: Add CrashRecoveryContext helper object.
- Designed as a simple wrapper to allow clients to attempt to catch crashes
   (memory errors, assertion violations, etc.) and do some kind of recovery.

 - Currently doesn't actually attempt to catch crashes.

llvm-svn: 109586
2010-07-28 15:40:20 +00:00
Gabor Greif 02fbd6b8ce we are supposed to only create proper CallSites from an instruction (esp. CallInst and InvokeInst)
llvm-svn: 109576
2010-07-28 10:44:59 +00:00
Dan Gohman a3659efe09 Add a comment.
llvm-svn: 109565
2010-07-28 00:21:18 +00:00
Owen Anderson 462b205ffe Fill out the interface of DenseSet a bit.
llvm-svn: 109562
2010-07-27 23:55:47 +00:00
Gabor Greif 0630a71742 reintroduce original (asserting) semantics of CallSite(Instruction *II)
add instead a CallSite(Value* V) constructor that is consistent with ImmutableCallSize
and use that one in client code

llvm-svn: 109553
2010-07-27 22:53:28 +00:00
Gabor Greif 63f55c49f2 remove bogus assert, use static_cast for additional checking
left two new asserts commented out, because they would fire in clang, have to hunt those down first

llvm-svn: 109544
2010-07-27 21:46:11 +00:00
Chris Lattner 425592a9d8 make lookup failures not fatal.
llvm-svn: 109530
2010-07-27 18:59:50 +00:00
Mikhail Glushenkov d359cf2e44 Return -1 only on failure to execute a program.
Also fix some comments.

llvm-svn: 109499
2010-07-27 11:19:36 +00:00
Duncan Sands eb58ed8b5a In commit 91421, isPod was changed from false to true for these value handles.
Change it back again: destructors and constructors need to be run.

llvm-svn: 109498
2010-07-27 09:09:05 +00:00
Tobias Grosser fc763867d5 RegionInfo: Add getMaxRegionExit()
getMaxRegionExit returns the exit of the maximal refined region starting
at a specific basic block.

llvm-svn: 109496
2010-07-27 08:39:43 +00:00
Tobias Grosser 1bec81a888 Add function to query RegionInfo about loops.
* contains(Loop), * getOutermostLoop()
* Improve getNameStr() to return a sensible name, if basic blocks are not named.

llvm-svn: 109490
2010-07-27 04:17:13 +00:00
Bill Wendling 0ff1ef650b It's better to have the arrays, which would trigger the creation of stack
protectors, to be near the stack protectors on the stack. Accomplish this by
tagging the stack object with a predicate that indicates that it would trigger
this. In the prolog-epilog inserter, assign these objects to the stack after the
stack protector but before the other objects.

llvm-svn: 109481
2010-07-27 01:55:19 +00:00
Dan Gohman 86ac5d85a4 Use AssertingVH for InsertedValues and InsertedPostIncValues, to verify
that the values they refer to aren't being deleted underneath them.

Make sure these containters get cleared by clear(), which IndVarSimplify
and LSR both use before deleting instructions.

llvm-svn: 109478
2010-07-27 01:19:06 +00:00
Dan Gohman 9306a8ec1b Add a comment.
llvm-svn: 109435
2010-07-26 21:05:37 +00:00
Gabor Greif ed79dcb1ab re-commit r109220, the compile error has already been fixed
Simplifying use_iterators by dereferencing
is not a good idea. The codebase does not depend
in this any more, and it may introduce hidden
runtime cost. If you get compile errors, please
dereference your iterator before passing to cast<>
(and friends).

Also: please consider caching the result of
operator* and reusing that instead of dereferencing
many times.

llvm-svn: 109425
2010-07-26 18:48:07 +00:00
Owen Anderson aa7f66ba67 Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.
llvm-svn: 109424
2010-07-26 18:48:03 +00:00
Dan Gohman 0141c13b22 Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogus
dependence on DominanceFrontier. Instead, add an explicit DominanceFrontier
pass in StandardPasses.h to ensure that it gets scheduled at the right
time.

Declare that loop unrolling preserves ScalarEvolution, and shuffle some
getAnalysisUsages.

This eliminates one LoopSimplify and one LCCSA run in the standard
compile opts sequence.

llvm-svn: 109413
2010-07-26 18:11:16 +00:00
Michael J. Spencer b5fc138547 MC: Add WinCOFFObjectWriter implementation.
Origonal Windows COFF implementation by Nathan Jedffords.

llvm-svn: 109389
2010-07-26 02:17:32 +00:00
Lang Hames 2e3f20b9aa Factored out a bit of common code to mark VNInfos for deletion.
llvm-svn: 109388
2010-07-26 01:49:41 +00:00
Anton Korobeynikov 19edda0323 Hook in GlobalMerge pass
llvm-svn: 109359
2010-07-24 21:52:08 +00:00
Anton Korobeynikov 3c8eb80d93 Add hook to insert late LLVM=>LLVM passes just before isel
llvm-svn: 109354
2010-07-24 20:48:54 +00:00
Chris Lattner 6ca585fc41 add a new NullablePtr class which makes it more obvious in API
that a pointer can be null, forcing clients to think about it.

llvm-svn: 109348
2010-07-24 18:47:46 +00:00
Evan Cheng 37b740c4bf Add an ILP scheduler. This is a register pressure aware scheduler that's
appropriate for targets without detailed instruction iterineries.
The scheduler schedules for increased instruction level parallelism in
low register pressure situation; it schedules to reduce register pressure
when the register pressure becomes high.

On x86_64, this is a win for all tests in CFP2000. It also sped up 256.bzip2
by 16%.

llvm-svn: 109300
2010-07-24 00:39:05 +00:00
Owen Anderson 893483000d Fix use-after-free error.
llvm-svn: 109288
2010-07-23 23:27:43 +00:00
Evan Cheng df907f4594 - Allow target to specify when is register pressure "too high". In most cases,
it's too late to start backing off aggressive latency scheduling when most
  of the registers are in use so the threshold should be a bit tighter.
- Correctly handle live out's and extract_subreg etc.
- Enable register pressure aware scheduling by default for hybrid scheduler.
  For ARM, this is almost always a win on # of instructions. It's runtime
  neutral for most of the tests. But for some kernels with high register
  pressure it can be a huge win. e.g. 464.h264ref reduced number of spills by
  54 and sped up by 20%.

llvm-svn: 109279
2010-07-23 22:39:59 +00:00
Dan Gohman 7038bd5c1a Eliminate getCanonicalInductionVariableIncrement's last user and
eliminate it.

llvm-svn: 109270
2010-07-23 21:34:51 +00:00
Eric Christopher 17a8ebcccf Revert r109102 for now as it's causing JIT miscompilations.
I'll try to track down why a bit later.

llvm-svn: 109223
2010-07-23 12:16:56 +00:00
Eric Christopher 849a8cf815 Revert 109220.
llvm-svn: 109221
2010-07-23 08:53:17 +00:00
Gabor Greif 1025f21ef3 Simplifying use_iterators by dereferencing
is not a good idea. The codebase does not depend
in this any more, and it may introduce hidden
runtime cost. If you get compile errors, please
dereference your iterator before passing to cast<>
(and friends).

Also: please consider caching the result of
operator* and reusing that instead of dereferencing
many times.

llvm-svn: 109220
2010-07-23 08:36:07 +00:00
Mikhail Glushenkov 204fbaf5c2 StringRef'icate.
llvm-svn: 109217
2010-07-23 04:19:39 +00:00
Mikhail Glushenkov 1e5d7c6e82 Get rid of exceptions in llvmc.
llvmc can be now compiled with llvm-gcc on Windows.

llvm-svn: 109215
2010-07-23 03:42:55 +00:00
Chris Lattner c0a14c1622 give StringMap a new ctor which allows you to initialize it
with an existing allocator.  The interesting use case of this
is that it allows "StringMap<whatever, BumpPtrAllocator&>" for
when you want to allocate out of a preexisting bump pointer
allocator owned by someone else.

llvm-svn: 109213
2010-07-23 03:29:59 +00:00
Chris Lattner 6ba9d4483f modernize stringset interface
llvm-svn: 109212
2010-07-23 03:21:53 +00:00
Eric Christopher c2f81007c0 Warnings patrol.
llvm-svn: 109174
2010-07-22 21:51:30 +00:00
Chris Lattner 749ca32da1 eliminate the TargetInstrInfo::GetInstSizeInBytes hook.
ARM/PPC/MSP430-specific code (which are the only targets that
implement the hook) can directly reference their target-specific
instrinfo classes.

llvm-svn: 109171
2010-07-22 21:27:00 +00:00
Chris Lattner 8f3adc9057 remove the JIT "NeedsExactSize" feature and supporting logic.
llvm-svn: 109167
2010-07-22 21:17:55 +00:00
Gabor Greif 4e2e9f4517 fit in 80 columns
llvm-svn: 109108
2010-07-22 14:13:14 +00:00
Duncan Sands 0525393a79 Increase the max physreg size. Patch by Pekka Jääskeläinen.
llvm-svn: 109102
2010-07-22 13:10:14 +00:00
Tobias Grosser 336734aca6 Add new RegionInfo pass.
The RegionInfo pass detects single entry single exit regions in a function,
where a region is defined as any subgraph that is connected to the remaining
graph at only two spots.
Furthermore an hierarchical region tree is built.
Use it by calling "opt -regions analyze" or "opt -view-regions".

llvm-svn: 109089
2010-07-22 07:46:31 +00:00
Reid Kleckner d85e3c5a86 Initial modifications to MCAssembler and TargetMachine for the MCJIT.
Patch by Olivier Meurant!

llvm-svn: 109080
2010-07-22 05:58:53 +00:00
Lang Hames 1cb63afb44 If 'other' was empty 'overlapsFrom(other, other.begin());' will segfault. This avoids that.
llvm-svn: 109075
2010-07-22 02:05:10 +00:00
Dan Gohman 2637cc1a38 Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.

llvm-svn: 109061
2010-07-21 23:38:33 +00:00
Owen Anderson ac4a1ede17 Add INSTANTIATE_AG_PASS, which combines RegisterPass<> with RegisterAnalysisGroup<> for pass registration.
llvm-svn: 109058
2010-07-21 23:07:00 +00:00
Jim Grosbach 965a73a28c For ARM/Darwin, add a dwarf entry indicating whether a function is arm or thumb
rdar://8202967

llvm-svn: 109057
2010-07-21 23:03:52 +00:00
Jim Grosbach efcc2a0cfb tidy up
llvm-svn: 109042
2010-07-21 22:04:53 +00:00
Owen Anderson f6331109f0 Add the INITIALIZE_PASS macro.
llvm-svn: 109034
2010-07-21 20:46:41 +00:00
Dan Gohman 093cb79d4b Disallow null as a named metadata operand.
Make MDNode::destroy private.
Fix the one thing that used MDNode::destroy, outside of MDNode itself.

One should never delete or destroy an MDNode explicitly. MDNodes
implicitly go away when there are no references to them (implementation
details aside).

llvm-svn: 109028
2010-07-21 18:54:18 +00:00
Daniel Dunbar dd45d848a8 Use System/DataTypes.h instead of stdint.h, which isn't portable.
llvm-svn: 109026
2010-07-21 18:48:59 +00:00
Dan Gohman 846b9e15db Use TrackingVH instead of WeakVH for NamedMDNode's operands, since nodes
referenced by NamedMDNodes shouldn't be deleted.

llvm-svn: 109021
2010-07-21 18:01:42 +00:00
Owen Anderson 845b14ef66 Move the smarts of AnalysisGroup registration into PassRegistry.
llvm-svn: 109019
2010-07-21 17:52:45 +00:00
Dan Gohman c63d812f97 Delete an obsolete comment.
llvm-svn: 109017
2010-07-21 17:21:27 +00:00
Gabor Greif f97f626730 restore aesthetics
llvm-svn: 109001
2010-07-21 08:25:55 +00:00
Evan Cheng a77f3d3b37 Teach bottom up pre-ra scheduler to track register pressure. Work in progress.
llvm-svn: 108991
2010-07-21 06:09:07 +00:00
Owen Anderson 7fc9fe7553 Move the handling of PassRegistrationListener's to PassRegistry.
llvm-svn: 108966
2010-07-20 23:41:56 +00:00
Greg Clayton da9220bbef Added support to MachO.h for many defines and structures that are needed
to Parse mach-o files. All defines have been renamed to not conflict with
#defines in mach header files, all structures were left named the same but
are in the llvm::MachO namespace.

llvm-svn: 108953
2010-07-20 22:36:00 +00:00
Dan Gohman 48a995f7e9 Rename removeAllMetadata to clearMetadataHashEntries and simplify
it to just do the things that need to be done when an instruction
is deleted.

llvm-svn: 108948
2010-07-20 22:25:04 +00:00
Jakob Stoklund Olesen ed4075cc3b Implement loop splitting analysis.
Determine which loop exit blocks need a 'pre-exit' block inserted.
Recognize when this would be impossible.

llvm-svn: 108941
2010-07-20 21:46:58 +00:00
Dan Gohman f9e6cc9af1 Remove an obsolete comment.
llvm-svn: 108940
2010-07-20 21:45:17 +00:00
Dan Gohman 43aa8f03c1 Add support for remapping metadata kind IDs when reading in a
bitcode file, so that two bitcode files where the same metadata kind
name happens to have been assigned a different ID can still be
linked together.

Eliminate the restriction that metadata kind IDs can't be 0.

Change MD_dbg from 1 to 0, because we can now, and because it's
less mysterious that way.

llvm-svn: 108939
2010-07-20 21:42:28 +00:00
Owen Anderson 4154061b92 Move more functionality from Pass.cpp to PassRegistry.cpp. This global will go away eventually, but for now we still need it around.
llvm-svn: 108932
2010-07-20 21:22:24 +00:00
Eric Christopher bb610d9053 Formatting.
llvm-svn: 108926
2010-07-20 21:05:58 +00:00
Matt Fleming 0535f00eb6 Add the rest of the SHT_* values as defined in the System V ABI
ELF specification.

llvm-svn: 108924
2010-07-20 20:52:18 +00:00
Dan Gohman 47a0f0d56f Remove setDbgMetadata and getDbgMetadata; their users have been
replaced with setDebugLoc and getDebugLoc.

llvm-svn: 108914
2010-07-20 20:18:21 +00:00
Owen Anderson 660466ed42 I just fail with SVN today.
llvm-svn: 108888
2010-07-20 19:23:55 +00:00