Commit Graph

13691 Commits

Author SHA1 Message Date
Chris Lattner
13fb0db0c2 hoist GlobalValue::removeDeadConstantUsers up to being a method on Constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:41:42 +00:00
Devang Patel
a4defc00eb Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:33:27 +00:00
Nadav Rotem
093399cbf3 Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 21:22:27 +00:00
NAKAMURA Takumi
6904f05e60 Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 12:24:17 +00:00
Stuart Hastings
a901129169 Swap VT and DebugLoc operands of getExtLoad() for consistency with
other getNode() methods.  Radar 9002173.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125665 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-16 16:23:55 +00:00
Rafael Espindola
908159b46a Gas is very inconsistent about when a relaxation/relocation is needed. Do
the right thing and stop trying to copy it. Fixes PR8944.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125648 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-16 03:25:55 +00:00
Rafael Espindola
7768a9dce1 Add support for pushsection and popsection. Patch by Joerg Sonnenberger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125629 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-16 01:08:29 +00:00
Nick Lewycky
8a670edf1b Teach PatternMatch that splat vectors could be floating point as well as
integer. Fixes PR9228!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125613 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 23:13:23 +00:00
Devang Patel
fc0569e55a Move DbgInfoPrinter specific utlities inside DbgInfoPrinter.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125571 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 17:36:11 +00:00
Duncan Sands
ab4c366274 Spelling fix: consequtive -> consecutive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125563 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 09:23:02 +00:00
Chris Lattner
04b2f0d99f fix comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125543 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 00:23:53 +00:00
Chris Lattner
2ca5c8644e convert ConstantVector::get to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 00:14:00 +00:00
Chris Lattner
04df049014 fix some typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125536 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 00:06:37 +00:00
Jakob Stoklund Olesen
eb9f040f0d Move more fragments of spill weight calculation into CalcSpillWeights.h
Simplify the spill weight calculation a bit by bypassing
getApproximateInstructionCount() and using LiveInterval::getSize() directly.
This changes the computed spill weights, but only by a constant factor in each
function. It should not affect how spill weights compare against each other, and
so it shouldn't affect code generation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125530 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 23:15:38 +00:00
Chris Lattner
7583190422 revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125504 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 18:15:46 +00:00
Rafael Espindola
9de3a0701a Move broken HasCommonSymbols to ELFWriter.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125490 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 16:51:08 +00:00
Chris Lattner
283c8caccd Switch ConstantVector::get to use ArrayRef instead of a pointer+size
idiom.  Change various clients to simplify their code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125487 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 07:55:32 +00:00
Chris Lattner
2b9bc422a5 add a new ArrayRef class. This is intended to replace the idiom we
use in many places where we pass a pointer and size to abstract APIs
that can take C arrays, std::vector, SmallVector, etc.  It is to arrays
what StringRef is to strings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125486 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 07:35:09 +00:00
Chris Lattner
463b3c2a99 fix two comment thinkos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125481 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 06:14:42 +00:00
Nick Lewycky
551b6751a0 Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125480 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 06:14:20 +00:00
Chris Lattner
a18da59d40 missed a header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125471 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 22:30:09 +00:00
Chris Lattner
d8c7ff0019 fix thinko :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125466 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 19:53:36 +00:00
Chris Lattner
e075118489 Revisit my fix for PR9028: the issue is that DAGCombine was
generating i8 shift amounts for things like i1024 types.  Add
an assert in getNode to prevent this from occuring in the future,
fix the buggy transformation, revert my previous patch, and
document this gotcha in ISDOpcodes.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125465 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 19:09:16 +00:00
Chris Lattner
16e036fa8f add a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125453 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 08:04:16 +00:00
Zhanyong Wan
63cc3a85cc Adds llvm::sys::path::is_separator() to test whether a char is a path separator
on the host OS.  Reviewed by dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125406 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 21:24:40 +00:00
Jim Grosbach
e5ec5a4177 Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125385 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 18:45:44 +00:00
Douglas Gregor
78b9649d46 Poison the relational operators ==, !=, <, <=, >=, > on llvm::Optional
objects, since they'll end up using the implicit conversion to "bool"
and causing some very "fun" surprises.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125380 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 18:13:20 +00:00
Chris Lattner
1f78d51be6 make the constantexpr interfaces for inbounds GEPs follow the same style
as other constantexpr flags, reducing redundancy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125365 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 05:34:33 +00:00
Rafael Espindola
ef1860a117 Remove std::string version of getNameWithPrefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125363 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 05:23:09 +00:00
Jim Grosbach
98311ecb4a Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125327 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 01:21:00 +00:00
Owen Anderson
e02db88816 Clean trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125304 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 19:56:23 +00:00
Chris Lattner
81baf14fdf switch the constantexpr, target folder, and IRBuilder interfaces
for NSW/NUW binops to follow the pattern of exact binops.  This
allows someone to use Builder.CreateAdd(x, y, "tmp", MaybeNUW);


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125270 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 07:01:55 +00:00
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