Commit Graph

13709 Commits

Author SHA1 Message Date
Douglas Gregor
f3e3f21db1 Rip out realpath() support. It's expensive, and often a bad idea, and
I have another way to achieve the same goal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 23:33:15 +00:00
Jakob Stoklund Olesen
f0ac26c511 Move calcLiveBlockInfo() and the BlockInfo struct into SplitAnalysis.
No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125231 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 22:50:26 +00:00
Douglas Gregor
025feadb97 Add llvm::sys::path::canonical(), which provides the canonicalized
name of a path, after resolving symbolic links and eliminating excess
path elements such as "foo/../" and "./".

This routine still needs a Windows implementation, but I don't have a
Windows machine available. Help? Please?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125228 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 22:11:23 +00:00
Dan Gohman
697ffd61a4 Optimize po_iterator: don't do redundant lookups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125211 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 19:25:31 +00:00
Chris Lattner
81a0dc9115 Teach instsimplify some tricks about exact/nuw/nsw shifts.
improve interfaces to instsimplify to take this info.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125196 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 17:15:04 +00:00
Chris Lattner
aeaf3d484b Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/Exact
versions of creation functions.  Eventually, the "insertion point" versions
of these should just be removed, we do have IRBuilder afterall.

Do a massive rewrite of much of pattern match.  It is now shorter and less
redundant and has several other widgets I will be using in other patches.
Among other changes, m_Div is renamed to m_IDiv (since it only matches 
integer divides) and m_Shift is gone (it used to match all binops!!) and
we now have m_LogicalShift for the one client to use.

Enhance IRBuilder to have "isExact" arguments to things like CreateUDiv
and reduce redundancy within IRbuilder by having these methods chain to
each other more instead of duplicating code.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125194 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 17:00:45 +00:00
Chris Lattner
413c3bd9fd enrich folder interfaces around exactness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 16:44:36 +00:00
Chris Lattner
74f5c5abea refactor ConstantExpr interfaces a bit around "exactness".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 16:43:07 +00:00
Richard Osborne
59982f3ffc Add intrinsic for setc instruction on the XCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125186 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 13:22:12 +00:00
NAKAMURA Takumi
e29b0aca51 lib/Support/Errno.cpp: Check strerror_s() with HAVE_DECL_STRERROR_S in config.h.*.
AC_CHECK_FUNCS seeks a symbol only in libs. We should check the declaration in string.h.

FIXME: I have never seen mingw(s) have strerror_s() (not _strerror_s()).
FIXME: Autoconf/CMake may seek strerror_s() with the definition MINGW_HAS_SECURE_API in future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125172 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:18:48 +00:00
Rafael Espindola
b4cc031a3e Don't open the file again in the gold plugin. To be able to do this, update
MemoryBuffer::getOpenFile to not close the file descriptor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125128 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 22:40:47 +00:00
Jakob Stoklund Olesen
8a61da8a68 Add LiveIntervals::addKillFlags() to recompute kill flags after register allocation.
This is a lot easier than trying to get kill flags right during live range
splitting and rematerialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125113 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 21:13:03 +00:00
Jakob Stoklund Olesen
11513e5d1e Add LiveIntervals::shrinkToUses().
After uses of a live range are removed, recompute the live range to only cover
the remaining uses. This is necessary after rematerializing the value before
some (but not all) uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 00:03:05 +00:00
Bruno Cardoso Lopes
e7a54520b3 Implement support for custom target specific asm parsing of operands.
Motivation: Improve the parsing of not usual (different from registers or
immediates) operand forms.

This commit implements only the generic support. The ARM specific modifications
will come next.

A table like the one below is autogenerated for every instruction
containing a 'ParserMethod' in its AsmOperandClass

static const OperandMatchEntry OperandMatchTable[20] = {
 /* Mnemonic, Operand List Mask, Operand Class, Features */
 { "cdp", 29 /* 0, 2, 3, 4 */, MCK_Coproc, Feature_IsThumb|Feature_HasV6 },
 { "cdp", 58 /* 1, 3, 4, 5 */, MCK_Coproc, Feature_IsARM },

A matcher function very similar (but lot more naive) to
MatchInstructionImpl scans the table. After the mnemonic match, the
features are checked and if the "to be parsed" operand index is
present in the mask, there's a real match. Then, a switch like the one
below dispatch the parsing to the custom method provided in
'ParseMethod':

 case MCK_Coproc:
   return TryParseCoprocessorOperandName(Operands);




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125030 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 19:38:32 +00:00
Chris Lattner
f067d584a8 implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125006 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 16:40:21 +00:00
Duncan Sands
163a84bbce Add an m_Div pattern for matching either a udiv or an sdiv and use it
to simplify the "(X/Y)*Y->X when the division is exact" transform.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125004 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 09:36:32 +00:00
Duncan Sands
1dbf0df996 Add IRBuilder methods for creating an exact udiv, like for exact sdiv.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 09:21:52 +00:00
Chris Lattner
35bda8914c enhance vmcore to know that udiv's can be exact, and add a trivial
instcombine xform to exercise this.

Nothing forms exact udivs yet though.  This is progress on PR8862



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124992 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-06 21:44:57 +00:00
NAKAMURA Takumi
1f6832a858 Windows/DynamicLibrary.inc: Split explicit symbols into explicit_symbols.inc.
config.h.* have conditions whether each symbol is defined or not.
Autoconf and CMake may check symbols in libgcc.a for JIT on Mingw.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124950 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 15:11:53 +00:00
Eric Christopher
4e8af6db18 Rewrite how the indirect call bonus is handled. This now works by:
a) Making it a per call site bonus for functions that we can move from
indirect to direct calls.
b) Reduces the bonus from 500 to 100 per call site.
c) Subtracts the size of the possible newly inlineable call from the
bonus to only add a bonus if we can inline a small function to devirtualize
it.

Also changes the bonus from a positive that's subtracted to a negative
that's added.

Fixes the remainder of rdar://8546196 by reducing the object file size
after inlining by 84%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 00:49:15 +00:00
Devang Patel
6c3ea9012e Merge .debug_loc entries whenever possible to reduce debug_loc size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 22:57:18 +00:00
Jason W Kim
2d7a53aec2 Teach ARM/MC/ELF about EF_ARM_EABI_VERSION. The magic number is set to
5 to match the current doc.
Added FIXME reminder Make it really configurable later.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124899 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 21:41:11 +00:00
Jakob Stoklund Olesen
cb6404711b Add LiveIntervals::getLastSplitPoint().
A live range cannot be split everywhere in a basic block. A split must go before
the first terminator, and if the variable is live into a landing pad, the split
must happen before the call that can throw.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 19:33:11 +00:00
Daniel Dunbar
cf12067ae0 MC/AsmMatcher: Add support for custom conversion functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124870 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 17:12:15 +00:00
Andrew Trick
92e946630d Introducing a new method of tracking register pressure. We can't
precisely track pressure on a selection DAG, but we can at least keep
it balanced. This design accounts for various interesting aspects of
selection DAGS: register and subregister copies, glued nodes, dead
nodes, unused registers, etc.

Added SUnit::NumRegDefsLeft and ScheduleDAGSDNodes::RegDefIter.

Note: I disabled PrescheduleNodesWithMultipleUses when register
pressure is enabled, based on no evidence other than I don't think it
makes sense to have both enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 03:18:17 +00:00
Bob Wilson
c67b1a3a76 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 23:17:44 +00:00
Bob Wilson
b84fe78d34 Edit a comment for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 23:17:40 +00:00
Oscar Fuentes
d931dca6e5 Moved to Clang's source tree its configuration options and associated
macros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124824 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 22:47:59 +00:00
Richard Osborne
17c1e51d22 Add XCore intrinsics for resource instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 13:14:25 +00:00
Eric Christopher
0f43811903 Reapply this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124779 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 06:18:29 +00:00
Eric Christopher
463a2977b1 Temporarily revert 124765 in an attempt to find the cycle breaking bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 05:40:54 +00:00
Oscar Fuentes
254f35ca4a Platform tests for sys/uio.h' header and writev' function.
This is the cmake equivalent for r124769.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124775 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 04:23:07 +00:00
Daniel Dunbar
b0cfa6cab8 raw_fd_ostream: Add a SetUseAtomicWrites() method (uses writev).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124771 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 03:32:32 +00:00
Daniel Dunbar
3e46293c27 Regenerate configure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124770 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 02:40:02 +00:00
Jakob Stoklund Olesen
2cd2111959 Defer SplitKit value mapping until all defs are available.
The greedy register allocator revealed some problems with the value mapping in
SplitKit. We would sometimes start mapping values before all defs were known,
and that could change a value from a simple 1-1 mapping to a multi-def mapping
that requires ssa update.

The new approach collects all defs and register assignments first without
filling in any live intervals. Only when finish() is called, do we compute
liveness and mapped values. At this time we know with certainty which values map
to multiple values in a split range.

This also has the advantage that we can compute live ranges based on the
remaining uses after rematerializing at split points.

The current implementation has many opportunities for compile time optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 00:54:23 +00:00
Devang Patel
e7d93877c6 Add support to describe template value parameter in debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 22:35:53 +00:00
Devang Patel
7e2cb11655 Add support to describe template parameter type in debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124752 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 21:38:25 +00:00
Duncan Sands
ae200c60c3 Remove NoVendor and NoOS, added in commit 123990, from Triple. While it
may be useful to understand "none", this is not the place for it.  Tweak
the fix to Normalize while there: the fix added in 123990 works correctly,
but I like this way better.  Finally, now that Triple understands some
non-trivial environment values, teach the unittests about them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124720 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 10:08:38 +00:00
Dan Gohman
46985a1440 Fix reassociate to clear optional flags, such as nsw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124712 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 02:02:34 +00:00
Evan Cheng
31959b19a7 Given a pair of floating point load and store, if there are no other uses of
the load, then it may be legal to transform the load and store to integer
load and store of the same width.

This is done if the target specified the transformation as profitable. e.g.
On arm, this can transform:
vldr.32 s0, []
vstr.32 s0, []

to

ldr r12, []
str r12, []

rdar://8944252


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 01:06:55 +00:00
Bob Wilson
63f8659d69 Fix comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 00:46:09 +00:00
Jay Foad
0faa60938a Make SwitchInst::removeCase() more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 09:22:34 +00:00
Duncan Sands
f9e4a986c0 Add a m_Undef pattern for convenience. This is so that code that uses
pattern matching can also pattern match undef, creating a more uniform
style.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 09:06:20 +00:00
Duncan Sands
93c780288d Add a m_SignBit pattern for convenience.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124656 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 08:50:33 +00:00
Duncan Sands
7681c6da60 Have m_One also match constant vectors for which every element is 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124655 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 08:39:12 +00:00
Eric Christopher
8e2da0ce9d Reapply 124275 since the Dragonegg failure was unreproducible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124641 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 01:16:32 +00:00
Evan Cheng
2bffee2ee7 Patches to build EFI with Clang/LLVM. By Carl Norum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 01:14:13 +00:00
Devang Patel
e9a7ea6865 Keep track of incoming argument's location while emitting LiveIns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 21:38:14 +00:00
Oscar Fuentes
78e2074eee Adds some platform checks to cmake/config-ix.cmake and fixes checking
for dlopen/dlerror.

Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 18:25:25 +00:00
NAKAMURA Takumi
e85dcb54d1 CMake: Fix a few definition to suppress warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124583 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 09:41:20 +00:00
Bill Wendling
b476302b24 This is #included by .c files. Remove C++-style comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124552 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 21:54:26 +00:00
Frits van Bommel
1fca2c32cc Move InstCombine's knowledge of fdiv to SimplifyInstruction().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124534 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 15:26:31 +00:00
Evan Cheng
c3f507f98a Re-apply r124518 with fix. Watch out for invalidated iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 04:46:23 +00:00
Evan Cheng
b0a42fdb36 Revert r124518. It broke Linux self-host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 02:43:04 +00:00
Evan Cheng
5e6940788f Re-commit r124462 with fixes. Tail recursion elim will now dup ret into unconditional predecessor to enable TCE on demand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124518 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 01:29:26 +00:00
Andrew Trick
04317cc618 Implementation of path profiling.
Modified patch by Adam Preuss.

This builds on the existing framework for block tracing, edge profiling and optimal edge profiling.
See -help-hidden for new flags.
For documentation, see the technical report "Implementation of Path Profiling..." in llvm.org/pubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124515 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 01:09:53 +00:00
Duncan Sands
593faa53fa My auto-simplifier noticed that ((X/Y)*Y)/Y occurs several times in SPEC
benchmarks, and that it can be simplified to X/Y.  (In general you can only
simplify (Z*Y)/Y to Z if the multiplication did not overflow; if Z has the
form "X/Y" then this is the case).  This patch implements that transform and
moves some Div logic out of instcombine and into InstructionSimplify.
Unfortunately instcombine gets in the way somewhat, since it likes to change
(X/Y)*Y into X-(X rem Y), so I had to teach instcombine about this too.
Finally, thanks to the NSW/NUW flags, sometimes we know directly that "Z*Y"
does not overflow, because the flag says so, so I added that logic too.  This
eliminates a bunch of divisions and subtractions in 447.dealII, and has good
effects on some other benchmarks too.  It seems to have quite an effect on
tramp3d-v4 but it's hard to say if it's good or bad because inlining decisions
changed, resulting in massive changes all over.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124487 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-28 16:51:11 +00:00
Nick Lewycky
ae479aa13e Add missing include for ptrdiff_t. Patch by Joerg Sonnenberger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-28 03:52:25 +00:00
Roman Divacky
bf7553210a Introduce virtual ParseRegister method in TargetAsmParser.
Create override of this method in X86/ARM/MBlaze.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 17:14:22 +00:00
Nick Lewycky
989e7c4d0f Add DenseSet::resize for API parity with DenseMap::resize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 09:10:42 +00:00
Jay Foad
adede0387b Simplify User::operator delete().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 21:56:10 +00:00
Eric Christopher
eabde0cf07 Temporarily revert 124275 to see if it brings the dragonegg buildbot back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124312 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 19:40:31 +00:00
David Greene
cfe33c46aa [AVX] Add INSERT_SUBVECTOR and support it on x86. This provides a
default implementation for x86, going through the stack in a similr
fashion to how the codegen implements BUILD_VECTOR.  Eventually this
will get matched to VINSERTF128 if AVX is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124307 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 19:13:22 +00:00
David Greene
91585098ef [AVX] Support EXTRACT_SUBVECTOR on x86. This provides a default
implementation of EXTRACT_SUBVECTOR for x86, going through the stack
in a similr fashion to how the codegen implements BUILD_VECTOR.
Eventually this will get matched to VEXTRACTF128 if AVX is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124292 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 15:38:49 +00:00
Eric Christopher
5d83955b8c Separate out the constant bonus from the size reduction metrics. Rework
a few loops accordingly. Should be no functional change.

This is a step for more accurate cost/benefit analysis of devirt/inlining
bonuses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124275 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 02:58:39 +00:00
Devang Patel
a2e868d34c Provide an interface to transfer SDDbgValue from one SDNode to another.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 23:27:42 +00:00
David Greene
e13359732a [AVX] Fix a typo in the extract subvector type constraints to specify
the correct number of operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124234 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 22:05:41 +00:00
David Greene
b5b80a93f6 [AVX] Add TableGen classes for vector/subvector type constraints.
This will be used to check patterns referencing a forthcoming
INSERT_SUBVECTOR SDNode and will also be used to check
EXTRACT_SUBVECTOR nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 16:16:32 +00:00
Jay Foad
afde5188f2 Avoid compiler errors when this header file is included first, by adding
a forward declaration of simplify_type<>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 14:33:33 +00:00
Duncan Sands
d70d1a5c44 According to my auto-simplifier the most common missed simplifications in
optimized code are:
  (non-negative number)+(power-of-two) != 0 -> true
and
  (x | 1) != 0 -> true
Instcombine knows about the second one of course, but only does it if X|1
has only one use.  These fire thousands of times in the testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124183 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 09:38:29 +00:00
Eric Christopher
0f13bc8c23 Perhaps a bit too much vertical whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124148 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 22:19:14 +00:00
Dan Gohman
bd1801b555 Give GetUnderlyingObject a TargetData, to keep it in sync
with BasicAA's DecomposeGEPExpression, which recently began
using a TargetData. This fixes PR8968, though the testcase
is awkward to reduce.

Also, update several off GetUnderlyingObject's users
which happen to have a TargetData handy to pass it in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124134 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 18:53:32 +00:00
Rafael Espindola
96aa78c8c5 Add support for the --noexecstack option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124077 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 17:55:27 +00:00
Cameron Zwarich
55be644df6 Convert a std::vector to a SmallVector for another 5.4% speedup on domtree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124065 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 06:54:22 +00:00
Cameron Zwarich
54cdad97eb In the simpler version of the link-eval data structure that we use in dominator
computation, the Ancestor field is always set to the Parent, so we can remove
the explicit link entirely and merge the Parent and Ancestor fields. Instead of
checking for whether an ancestor exists for a node or not, we simply check
whether the node has already been processed. This is simpler if Compress is
inlined into Eval, so I did that as well.

This is about a 3% speedup running -domtree on test-suite + SPEC2000 & SPEC2006,
but it also opens up some opportunities for further improvement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124061 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 06:16:06 +00:00
Rafael Espindola
0cf5e3d51d Delay the creation of eh_frame so that the user can change the defaults.
Add support for SHT_X86_64_UNWIND.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124059 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 05:43:40 +00:00
Cameron Zwarich
11e222da1f Remove useless struct fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 05:11:18 +00:00
Cameron Zwarich
53e069ffab Remove friend declaration for removed function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124057 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 04:54:34 +00:00
Rafael Espindola
1c13026e8f Remove more duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124056 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 04:43:11 +00:00
Cameron Zwarich
907b56ce7a Convert a std::vector to a SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124055 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 04:30:59 +00:00
Rafael Espindola
c85dca66e6 Remove duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 04:28:49 +00:00
Cameron Zwarich
5c96c69161 Simplify some code now that we've removed the more optimal (but slower) version
of the link-eval data structure from dominator computation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124053 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 04:13:53 +00:00
Benjamin Kramer
ecb89fd06c Remove dead ivar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124028 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-22 12:13:28 +00:00
Chris Lattner
b83e60e602 add DW_TAG for rvalue refs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124019 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-22 01:47:25 +00:00
Renato Golin
859f818363 Clang was not parsing target triples involving EABI and was generating wrong IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 18:25:47 +00:00
Oscar Fuentes
5969379145 Handles libffi on the CMake build.
Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 15:42:54 +00:00
Andrew Trick
c8bfd1d78f Convert -enable-sched-cycles and -enable-sched-hazard to -disable
flags. They are still not enable in this revision.

Added TargetInstrInfo::isZeroCost() to fix a fundamental problem with
the scheduler's model of operand latency in the selection DAG.

Generalized unit tests to work with sched-cycles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 05:51:33 +00:00
Michael J. Spencer
7acdb4d237 Object: Fix type punned pointer issues by making DataRefImpl a union and using intptr_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 02:27:02 +00:00
Evan Cheng
9fe2009956 Sorry, several patches in one.
TargetInstrInfo:
Change produceSameValue() to take MachineRegisterInfo as an optional argument.
When in SSA form, targets can use it to make more aggressive equality analysis.

Machine LICM:
1. Eliminate isLoadFromConstantMemory, use MI.isInvariantLoad instead.
2. Fix a bug which prevent CSE of instructions which are not re-materializable.
3. Use improved form of produceSameValue.

ARM:
1. Teach ARM produceSameValue to look pass some PIC labels.
2. Look for operands from different loads of different constant pool entries
   which have same values.
3. Re-implement PIC GA materialization using movw + movt. Combine the pair with
   a "add pc" or "ldr [pc]" to form pseudo instructions. This makes it possible
   to re-materialize the instruction, allow machine LICM to hoist the set of
   instructions out of the loop and make it possible to CSE them. It's a bit
   hacky, but it significantly improve code quality.
4. Some minor bug fixes as well.

With the fixes, using movw + movt to materialize GAs significantly outperform the
load from constantpool method. 186.crafty and 255.vortex improved > 20%, 254.gap
and 176.gcc ~10%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 08:34:58 +00:00
Michael J. Spencer
b84551a14f Object: Add ELF support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 06:38:47 +00:00
Cameron Zwarich
229b22132b Remove an unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123877 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 03:56:35 +00:00
Cameron Zwarich
5d2cf40c40 There is no point in verifying an analysis that is never updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 05:44:04 +00:00
Cameron Zwarich
72d1695f12 Remove some now-unused DominanceFrontier methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 04:21:57 +00:00
Cameron Zwarich
b1686c32fc Remove outdated references to dominance frontiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123724 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 03:53:26 +00:00
Jim Grosbach
6bbf5eb32f Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123665 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 18:34:03 +00:00
Cameron Zwarich
419e8a6299 Roll r123609 back in with two changes that fix test failures with expensive
checks enabled:

1) Use '<' to compare integers in a comparison function rather than '<='.

2) Use the uniqued set DefBlocks rather than Info.DefiningBlocks to initialize
the priority queue.

The speedup of scalarrepl on test-suite + SPEC2000 + SPEC2006 is a bit less, at
just under 16% rather than 17%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123662 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 17:38:41 +00:00
Devang Patel
5860c6c09e Revert rr123550. It causes clang build failure on darwin9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123661 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 17:34:43 +00:00
Oscar Fuentes
3c00a83c33 Add some platform checks. Also fix a typo on a Makefile.
Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 16:35:14 +00:00
Jay Foad
0d1941a46f Remove useless Tag enumeration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123623 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 15:18:06 +00:00
Cameron Zwarich
b1086a9c6d Roll out r123609 due to failures on the llvm-x86_64-linux-checks bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 07:26:51 +00:00