Commit Graph

13613 Commits

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

llvm-svn: 125239
2011-02-09 23:33:15 +00:00
Jakob Stoklund Olesen b1b76adbd9 Move calcLiveBlockInfo() and the BlockInfo struct into SplitAnalysis.
No functional changes intended.

llvm-svn: 125231
2011-02-09 22:50:26 +00:00
Douglas Gregor 529329e859 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?

llvm-svn: 125228
2011-02-09 22:11:23 +00:00
Dan Gohman 94b2add336 Optimize po_iterator: don't do redundant lookups.
llvm-svn: 125211
2011-02-09 19:25:31 +00:00
Chris Lattner 9e4aa0259f Teach instsimplify some tricks about exact/nuw/nsw shifts.
improve interfaces to instsimplify to take this info.

llvm-svn: 125196
2011-02-09 17:15:04 +00:00
Chris Lattner b940091388 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.

llvm-svn: 125194
2011-02-09 17:00:45 +00:00
Chris Lattner abcf9d58f2 enrich folder interfaces around exactness.
llvm-svn: 125191
2011-02-09 16:44:36 +00:00
Chris Lattner 0d75eac350 refactor ConstantExpr interfaces a bit around "exactness".
llvm-svn: 125190
2011-02-09 16:43:07 +00:00
Richard Osborne d9dde78c27 Add intrinsic for setc instruction on the XCore.
llvm-svn: 125186
2011-02-09 13:22:12 +00:00
NAKAMURA Takumi 189111808e 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.
llvm-svn: 125172
2011-02-09 04:18:48 +00:00
Rafael Espindola 56e41f7f0b 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.

llvm-svn: 125128
2011-02-08 22:40:47 +00:00
Jakob Stoklund Olesen f2b16dc847 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.

llvm-svn: 125113
2011-02-08 21:13:03 +00:00
Jakob Stoklund Olesen 55fc1d0b3e 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.

llvm-svn: 125058
2011-02-08 00:03:05 +00:00
Bruno Cardoso Lopes 2315beba24 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);

llvm-svn: 125030
2011-02-07 19:38:32 +00:00
Chris Lattner a676c0fc77 implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better.

llvm-svn: 125006
2011-02-07 16:40:21 +00:00
Duncan Sands 867cb633b4 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.

llvm-svn: 125004
2011-02-07 09:36:32 +00:00
Duncan Sands 648f55b2b4 Add IRBuilder methods for creating an exact udiv, like for exact sdiv.
llvm-svn: 125002
2011-02-07 09:21:52 +00:00
Chris Lattner 35315d065b 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

llvm-svn: 124992
2011-02-06 21:44:57 +00:00
NAKAMURA Takumi 03a541f5c4 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.

llvm-svn: 124950
2011-02-05 15:11:53 +00:00
Eric Christopher 2dfbd7e0c1 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%.

llvm-svn: 124916
2011-02-05 00:49:15 +00:00
Devang Patel 116a9d7c38 Merge .debug_loc entries whenever possible to reduce debug_loc size.
llvm-svn: 124904
2011-02-04 22:57:18 +00:00
Jason W Kim 4761fba833 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.

llvm-svn: 124899
2011-02-04 21:41:11 +00:00
Jakob Stoklund Olesen 096bd8837f 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.

llvm-svn: 124894
2011-02-04 19:33:11 +00:00
Daniel Dunbar 77b7c3f1e6 MC/AsmMatcher: Add support for custom conversion functions.
llvm-svn: 124870
2011-02-04 17:12:15 +00:00
Andrew Trick d0548ae750 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.

llvm-svn: 124853
2011-02-04 03:18:17 +00:00
Bob Wilson fa95661168 Remove trailing whitespace
llvm-svn: 124830
2011-02-03 23:17:44 +00:00
Bob Wilson f0098578e8 Edit a comment for consistency.
llvm-svn: 124829
2011-02-03 23:17:40 +00:00
Oscar Fuentes ae1b988a6b Moved to Clang's source tree its configuration options and associated
macros.

llvm-svn: 124824
2011-02-03 22:47:59 +00:00
Richard Osborne a31b9c2f7c Add XCore intrinsics for resource instructions.
llvm-svn: 124794
2011-02-03 13:14:25 +00:00
Eric Christopher ede6267993 Reapply this.
llvm-svn: 124779
2011-02-03 06:18:29 +00:00
Eric Christopher 21933539f2 Temporarily revert 124765 in an attempt to find the cycle breaking bootstrap.
llvm-svn: 124778
2011-02-03 05:40:54 +00:00
Oscar Fuentes ed27eadd29 Platform tests for `sys/uio.h' header and `writev' function.
This is the cmake equivalent for r124769.

llvm-svn: 124775
2011-02-03 04:23:07 +00:00
Daniel Dunbar 4fed88704d raw_fd_ostream: Add a SetUseAtomicWrites() method (uses writev).
llvm-svn: 124771
2011-02-03 03:32:32 +00:00
Daniel Dunbar 7840c54601 Regenerate configure.
llvm-svn: 124770
2011-02-03 02:40:02 +00:00
Jakob Stoklund Olesen dca2917e25 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.

llvm-svn: 124765
2011-02-03 00:54:23 +00:00
Devang Patel be933b470a Add support to describe template value parameter in debug info.
llvm-svn: 124755
2011-02-02 22:35:53 +00:00
Devang Patel 3a9e65efb6 Add support to describe template parameter type in debug info.
llvm-svn: 124752
2011-02-02 21:38:25 +00:00
Duncan Sands fdfdbd091d 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.

llvm-svn: 124720
2011-02-02 10:08:38 +00:00
Dan Gohman 08d2c98c23 Fix reassociate to clear optional flags, such as nsw.
llvm-svn: 124712
2011-02-02 02:02:34 +00:00
Evan Cheng d42641c6b5 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

llvm-svn: 124708
2011-02-02 01:06:55 +00:00
Bob Wilson e68f70fadd Fix comment typo.
llvm-svn: 124705
2011-02-02 00:46:09 +00:00
Jay Foad 142777224c Make SwitchInst::removeCase() more efficient.
llvm-svn: 124659
2011-02-01 09:22:34 +00:00
Duncan Sands a29ea9aa4c 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.

llvm-svn: 124657
2011-02-01 09:06:20 +00:00
Duncan Sands 4b397fcdc2 Add a m_SignBit pattern for convenience.
llvm-svn: 124656
2011-02-01 08:50:33 +00:00
Duncan Sands cf0ff030a8 Have m_One also match constant vectors for which every element is 1.
llvm-svn: 124655
2011-02-01 08:39:12 +00:00
Eric Christopher 46308e666a Reapply 124275 since the Dragonegg failure was unreproducible.
llvm-svn: 124641
2011-02-01 01:16:32 +00:00
Evan Cheng d22a4a1fd6 Patches to build EFI with Clang/LLVM. By Carl Norum.
llvm-svn: 124639
2011-02-01 01:14:13 +00:00
Devang Patel 56cc5fdf09 Keep track of incoming argument's location while emitting LiveIns.
llvm-svn: 124611
2011-01-31 21:38:14 +00:00
Oscar Fuentes e866c41f5c Adds some platform checks to cmake/config-ix.cmake and fixes checking
for dlopen/dlerror.

Patch by arrowdodger!

llvm-svn: 124590
2011-01-31 18:25:25 +00:00
NAKAMURA Takumi 1703f15516 CMake: Fix a few definition to suppress warnings.
llvm-svn: 124583
2011-01-31 09:41:20 +00:00