Commit Graph

12580 Commits

Author SHA1 Message Date
Jim Grosbach
3197380143 Add ARM heuristic for when to allocate a virtual base register for stack
access. rdar://8277890&7352504

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 21:19:33 +00:00
Kevin Enderby
c1840b3da2 First bit of support for the dwarf .loc directive. This patch updates the
needed parsing for the .loc directive and saves the current info from that
into the context.  The next patch will take the current loc info after an
instruction is assembled and save that info into a vector for each section for
use to build the line number tables.  The patch after that will encode the info
from those vectors into the output file as the dwarf line tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 20:32:42 +00:00
Jim Grosbach
a273442891 Move enabling the local stack allocation pass into the target where it belongs.
For now it's still a command line option, but the interface to the generic
code doesn't need to know that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 19:05:43 +00:00
Dan Gohman
05ea54e886 Use MapValue in the Linker instead of having a private function
which does the same thing. This eliminates redundant code and
handles MDNodes better. MDNode linking still doesn't fully
work yet though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 18:50:07 +00:00
Dan Gohman
2426668562 MDNode, MDString, and NamedMDNode are not meant to be subclassed;
make their protected members private. And remove an unnecessary
explicit keyword.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 15:34:03 +00:00
Mikhail Glushenkov
d9a7316f9a llvmc: Make syntax more consistent.
CompilationGraph and LanguageMap definitions do not use special syntax anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111862 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:21:23 +00:00
Jim Grosbach
5e2475598e Remove the MFI storage of the local allocation block size. It's not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:29:29 +00:00
Chris Lattner
d80c7e1232 Add a new llvm.x86.int intrinsic, allowing access to the
x86 int and int3 instructions.  Patch by Peter Housel!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111831 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:39:25 +00:00
Mikhail Glushenkov
7555f0a2bc llvmc: Properly handle (error) in edge properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111827 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:24:08 +00:00
Mikhail Glushenkov
6bb156a681 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111825 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:23:54 +00:00
Dan Gohman
baf2883e0a formatted_tool_output_file::close needs to flush its buffer before
closing the underlying stream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:43:24 +00:00
Devang Patel
0c4720c6bd Handle qualified constants that are directly folded by FE.
PR 7920.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:25:56 +00:00
Benjamin Kramer
250eb005d9 Avoid O(n*m) complexity in StringRef::find_first(_not)_of(StringRef).
- Cache used characters in a bitset to reduce memory overhead to just 32 bytes.
- On my core2 this code is faster except when the checked string was very short
  (smaller than the list of delimiters).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:16:08 +00:00
Benjamin Kramer
79ed2c597a StringRef tweaks:
- Respect find_first_of(char's From parameter instead of silently dropping it.
- Prefer std::string() to std::string("")


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 17:44:13 +00:00
Michael J. Spencer
da0bfcdaf9 MC: Add partial x86-64 support to COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 05:58:13 +00:00
Bruno Cardoso Lopes
3157ef1c13 This is the first step towards refactoring the x86 vector shuffle code. The
general idea here is to have a group of x86 target specific nodes which are
going to be selected during lowering and then directly matched in isel.

The commit includes the addition of those specific nodes and a *bunch* of
patterns, and incrementally we're going to switch between them and what we
have right now. Both the patterns and target specific nodes can change as
we move forward with this work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 22:55:05 +00:00
Dan Gohman
a3833f18bf CreateTemporaryType doesn't needs its Context argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 22:39:47 +00:00
Bill Wendling
55ae515f9d Create the new linker type "linker_private_weak_def_auto".
It's similar to "linker_private_weak", but it's known that the address of the
object is not taken. For instance, functions that had an inline definition, but
the compiler decided not to inline it. Note, unlike linker_private and
linker_private_weak, linker_private_weak_def_auto may have only default
visibility.  The symbols are removed by the linker from the final linked image
(executable or dynamic library).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111684 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 22:05:50 +00:00
Dan Gohman
489b29b0a4 Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 22:02:26 +00:00
Dan Gohman
c85829617b Reword NamedMDNode's comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 18:22:57 +00:00
Dan Gohman
8d18006cf2 Delete SlowOperationInformer, which is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 18:07:37 +00:00
Mikhail Glushenkov
3120c18e08 Add include guards to Support/Regex.h.
If the omission was intentional, please add a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111657 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 17:38:44 +00:00
Mikhail Glushenkov
7112c86fc2 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 17:38:38 +00:00
Jim Grosbach
7e75cabba0 Add explicit initializer for UseLocalStackAllocationBlock in MFI constructor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 17:34:22 +00:00
Dan Gohman
a1f89deb56 Delete raw_stdout_ostream and raw_stderr_ostream, which are unused
outside of outs() and errs() themselves, and they don't really
need custom classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:39:41 +00:00
Dan Gohman
00d1cdeca9 Add an inspirational quote.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:36:19 +00:00
Dan Gohman
27f7aad50b Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:35:30 +00:00
Dan Gohman
8df0e01046 Move raw_ostream's Error flag into raw_fd_ostream, as that's the only
class which is using it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:34:20 +00:00
Dan Gohman
634d661965 Export error-handling functions in formatted_tool_output_file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:27:38 +00:00
Mikhail Glushenkov
03b6d4e04c llvmc: Cut global namespace pollution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 11:24:44 +00:00
Mikhail Glushenkov
68e18b3054 Disambiguate calls to WriteGraph() to disable ADL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 11:24:35 +00:00
Mikhail Glushenkov
c0086edac4 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 11:24:31 +00:00
Bob Wilson
b31a11b466 Replace the arm.neon.vmovls and vmovlu intrinsics with vector sign-extend and
zero-extend operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 04:54:02 +00:00
Dan Gohman
af0636f4d6 Introduce a new tool_output_file class, which extends raw_ostream with
functionality that most command-line tools need: ensuring that the
output file gets deleted if the tool is interrupted or encounters an
error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 00:48:10 +00:00
Jim Grosbach
e2f556933e Better handling of offsets on frame index references. rdar://8277890
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:52:25 +00:00
Bob Wilson
79976e9ff1 Update comment to remove special case for vector extending loads. An
extending vector load should extend each element in the same way as the
corresponding scalar extending load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:39:00 +00:00
Eric Christopher
638ff6d315 Re-re-revert this patch. It seems to be causing performance
and correctness regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 17:21:10 +00:00
Jim Grosbach
a0fc005321 Update local stack block allocation to let PEI do the allocs if no additional
base registers were required. This will allow for slightly better packing
of the locals when alignment padding is necessary after callee saved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 02:47:08 +00:00
Dan Gohman
8a757aeac4 Revert r111199; it breaks -debug-pass=Structure output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 01:29:07 +00:00
Eric Christopher
e81043a7df Reapply the virtual register patch from 109102. The places where we were
depending on the number of virtual registers appear to have all been handled
now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 01:25:50 +00:00
Sean Hunt
726a3d284e Finish full attribute class emission for clang.
For more information, see the accompanying clang patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:23:09 +00:00
Dan Gohman
2499990699 Make raw_fd_ostream consider itself the owner of STDOUT_FILENO when
constructed with an output filename of "-". In particular, allow the
file descriptor to be closed, and close the file descriptor in the
destructor if it hasn't been explicitly closed already, to ensure
that any write errors are detected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 22:26:19 +00:00
Chris Lattner
30963fbe8f move gep decomposition out of ValueTracking into BasicAA. The form of
decomposition that it is doing is very basicaa specific and is only used
by basicaa.

Now with less tree breakingness.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 22:07:29 +00:00
Dan Gohman
e16068240e Introduce a ScopedFatalErrorHandler class to make it easy to register
fatal error handlers which automatically get unregistered at the end
of a scope.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111398 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 20:16:39 +00:00
Jakob Stoklund Olesen
cf16bea74e Revert r111394. It was too aggressive.
We must complete the DFS, otherwise we might miss needed phi-defs, and
prematurely color live ranges with a non-dominating value.

This is not a big deal since we get to color more of the CFG and the next
mapValue call will be faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 20:06:05 +00:00
Jakob Stoklund Olesen
4d440bd786 Aggressively prune the DFS when inserting phi-defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 19:00:11 +00:00
Jakob Stoklund Olesen
6709c7bcda Add df_iterator::getPathLength and getPath as a way of getting a path from the
entry node to the current node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 19:00:05 +00:00
Daniel Dunbar
4ae56d725d Revert r111375, "move gep decomposition out of ValueTracking into BasicAA. The
form of", it doesn't pass tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 18:43:08 +00:00
Owen Anderson
00ac77ef88 Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 18:39:01 +00:00
Chris Lattner
6b63037306 move gep decomposition out of ValueTracking into BasicAA. The form of
decomposition that it is doing is very basicaa specific and is only used
by basicaa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 18:22:17 +00:00
Jim Grosbach
74d803a58c Add hook for re-using virtual base registers for local stack slot access.
Nothing fancy, just ask the target if any currently available base reg
is in range for the instruction under consideration and use the first one
that is. Placeholder ARM implementation simply returns false for now.

ongoing saga of rdar://8277890



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 17:57:37 +00:00
Chris Lattner
c62a4b0f03 don't emit zero bit fields with Emit, fixing undefined behavior,
PR7778


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 00:29:18 +00:00
Chris Lattner
7f7274ce7f Don't pass in a null pointer to std::string's ctor, an empty string
ref should produce an empty std::string.  This fixes PR7879.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 00:11:25 +00:00
Jim Grosbach
dc140c6e7b Add materialization of virtual base registers for frame indices allocated into
the local block. Resolve references to those indices to a new base register.
For simplification and testing purposes, a new virtual base register is
allocated for each frame index being resolved. The result is truly horrible,
but correct, code that's good for exercising the new code paths.

Next up is adding thumb1 support, which should be very simple. Following that
will be adding base register re-use and implementing a reasonable ARM
heuristic for when a virtual base register should be generated at all.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:41:55 +00:00
Daniel Dunbar
a8fa798246 CrashRecovery: Add CrashRecoveryContext::GetCurrent(), so clients can find the active context from anywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:32:37 +00:00
Daniel Dunbar
c0c815e887 CrashRecovery: Make CrashRecoveryContext static methods thread safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:32:34 +00:00
Anton Korobeynikov
d7343ddce5 Add some win64 coff goodness.
Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 21:05:54 +00:00
Benjamin Kramer
e5b57347e9 Sketch i386 relocations handling, from Roman Divacky.
Hello world builds & runs now on i386/ELF with -integrated-as.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 18:20:28 +00:00
Jim Grosbach
8708ead5a4 Add hook to examine an instruction referencing a frame index to determine
whether to allocate a virtual frame base register to resolve the frame
index reference in it. Implement a simple version for ARM to aid debugging.

In LocalStackSlotAllocation, scan the function for frame index references
to local frame indices and ask the target whether to allocate virtual
frame base registers for any it encounters. Purely infrastructural for
debug output. Next step is to actually allocate base registers, then add
intelligent re-use of them.

rdar://8277890



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 18:13:53 +00:00
Benjamin Kramer
73c32f60c4 Revert r111230, we have to find a better place for the host-specific code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111232 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 15:50:23 +00:00
Benjamin Kramer
8466efc36f Micro-optimize MCObjectWriter to do a byteswap if necessary and then write the
whole integer to the stream instead of doing byte-sized writes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111230 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 13:55:45 +00:00
Benjamin Kramer
755525ad23 There is this new "LLVM" compiler that supports __builtin_bswap but thinks it's gcc 4.2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111228 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 11:45:38 +00:00
Dan Gohman
65bffec2c2 Make dumpPassStructure be a PMDataManager abstraction, rather than
a Pass abstraction, since that's the level it's actually used at.
Rename Pass' dumpPassStructure to dumpPass.

This eliminates an awkward use of getAsPass() to convert a PMDataManager*
into a Pass* just to permit a dumpPassStructure call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 22:45:12 +00:00
Jim Grosbach
4861ed60ac Better handle alignment requirements for local objects in pre-regalloc frame
mapping. Have the local block track its alignment requirement, and then
apply that when the block itself is allocated. Previously, offsets could
get adjusted in PEI to be different, relative to one another, than the
block allocation thought they would be, which defeats the point of doing
the allocation this way. Continuing rdar://8277890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 22:30:41 +00:00
Dan Gohman
9fb7d04cfc Make some of PMTopLevelManager's members non-public. In particular,
make its constructor protected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 22:03:47 +00:00
Dan Gohman
7578ea887d Eliminate the TopLevelManagerType enum; instead, just make
PMTopLevelManager's constructor take a PMDataManager *, which already
provides the needed abstraction support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 21:38:42 +00:00
Matt Fleming
3565a06ebf Add ELF ObjectWriter and Streamer support.
I forgot to add these files in commit 111172.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:57:57 +00:00
Matt Fleming
6b2e257e74 Add ELF ObjectWriter and Streamer support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:35:43 +00:00
Matt Fleming
a8bf473fb1 Layout helper function.
Introduce a helper method to add a section to the end of a layout. This
will be used by the ELF ObjectWriter code to add the metadata sections
(symbol table, etc) to the end of an object file.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:35:06 +00:00
Matt Fleming
6c8b3d2f1f Record a symbol's size which is needed for ELF symbol tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:34:31 +00:00
Matt Fleming
3e09669bc4 ELF entry size support.
Some ELF sections contain fixed-sized entries. Provide a way to record
the entry size of a section.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:33:46 +00:00
Jim Grosbach
63249347c2 track local frame size in MFI, not local to the pass, since PEI needs it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:06:15 +00:00
Dan Gohman
7d0e3c01f3 Revert r111031. The way LLVM defines loop invariance, the property of an
expression being loop invariant is not equivalent to the property of
properly dominating the loop header.

Other optimizations have also made this optimization less important.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:34:25 +00:00
Dan Gohman
081ad68e68 Placate overzealous compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:01:55 +00:00
Dan Gohman
2f199f9952 Move SCEVNAryExpr's virtual member functions out of line, and convert
them to iterators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:21:27 +00:00
Dan Gohman
aadb5f5adb Specialize FoldingSetTrait<SCEV>, providing implementations of node
comparison and hash computation which don't require constructing
temporary ID values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:31:45 +00:00
Dan Gohman
3063410e52 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:30:39 +00:00
Dan Gohman
0ba422ba6e Tidy up whitespace in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:04:39 +00:00
Dan Gohman
1878aba8e4 Constify FoldingSetNodeIDRef's Data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:03:24 +00:00
Dan Gohman
6616f7e2f1 Reverse the order of GetNodeProfile's arguments, for consistency
with FoldingSetTrait::Profile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 14:53:42 +00:00
Dan Gohman
83fb63d5b3 Fix indentation in example code in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 14:45:36 +00:00
Mikhail Glushenkov
b3d36293c2 llvmc: remove dynamic plugins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 07:07:12 +00:00
Dan Gohman
e2c6d131d1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111060 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 00:29:42 +00:00
Jim Grosbach
3d72367d30 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 00:15:52 +00:00
Jim Grosbach
73bb0186a5 tidy up comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:32:35 +00:00
Jim Grosbach
31529c7b6c tidy up 80 column and whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:08:59 +00:00
Dan Gohman
ef0bedaba7 Implement hasComputableLoopEvolution for Add, Mul, and Trunc operators,
since they can support trivial implementations. This avoids potentially
expensive traversals of the operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:03:15 +00:00
Benjamin Kramer
452b93e7dc Use getAllOnesValue, saves a copy and looks better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 00:29:44 +00:00
Jakob Stoklund Olesen
fff2c4726b 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:38:03 +00:00
Jakob Stoklund Olesen
1b2932024f Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110944 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:01:23 +00:00
Duncan Sands
335db22392 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 11:31:39 +00:00
Daniel Dunbar
f1e29d4c21 MC/AsmParser: Push the burdon of emitting diagnostics about unmatched
instructions onto the target specific parser, which can do a better job.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 00:55:38 +00:00
Daniel Dunbar
4f98f83459 tblgen/AsmMatcher: Always emit the match function as 'MatchInstructionImpl',
target specific parsers can adapt the TargetAsmParser to this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 00:55:32 +00:00
Daniel Dunbar
ee0f32d723 configure: Add detection of the linker version string.
- Review appreciated, as long as you understand that I understand that this is
   a horrible hack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 23:53:59 +00:00
Nick Lewycky
7f9ef4bb51 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 22:04:36 +00:00
Dan Gohman
bd4d66d56a Make LoopPass::getContainedPass return a LoopPass* instead of a Pass*
and remove casts from all its callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 20:34:43 +00:00
Dan Gohman
fa5c2a67c3 Remove BasicBlockPass::runOnFunction, which was unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 20:28:16 +00:00
Bruno Cardoso Lopes
ec1355b17b Remove rsqrt/sqrt_nr intrinsics since there are no more builtins for them on clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 19:21:05 +00:00
Dan Gohman
1f9a1608a6 Delete FunctionPass::run, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 19:11:05 +00:00
Dan Gohman
73e8800229 Delete FunctionPass::runOnModule, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 19:05:53 +00:00
Dan Gohman
b68f274b6d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 18:15:01 +00:00
Jakob Stoklund Olesen
dfa28b157d Fix a FIXME. The SlotIndex::Slot enum should be private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 16:50:17 +00:00
Daniel Dunbar
3c14ca47fc llvm-mc: Add -show-inst-operands, for dumping the parsed instruction representation before matching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 06:37:09 +00:00
Daniel Dunbar
b3cb696794 MCAsmParser: Add dump() hook to MCParsedAsmOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 06:37:04 +00:00
Bruno Cardoso Lopes
1a76359347 Remove AVX 256-bit cast intrinsics now that clang is using __builtin_shufflevector for those
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 02:15:33 +00:00
Bruno Cardoso Lopes
9fb2ffd568 Remove AVX 256-bit unpack and interleave intrinsics now that clang is using __builtin_shufflevector for those
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110769 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 01:44:11 +00:00
Bruno Cardoso Lopes
b89c631b77 Remove AVX 256-bit shuffle intrinsics now that clang is using __builtin_shufflevector for those
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 01:18:26 +00:00
Oscar Fuentes
0a16b22e64 Avoid multiple definition warnings when both config.h and
llvm-config.h are included.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 23:48:22 +00:00
Dan Gohman
af08a36bd6 Rename and reorder the arguments to isImpliedCond, for consistency and clarity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 23:46:30 +00:00
Devang Patel
6bf058c9aa Add missing argument. CreateCompositeTypeEx() users, please verify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110717 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 20:22:49 +00:00
Jakob Stoklund Olesen
9db3ea46cb 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 18:37:40 +00:00
Jakob Stoklund Olesen
08e93b14c3 Recalculate the spill weight and allocation hint for virtual registers created
during live range splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 17:07:22 +00:00
Mikhail Glushenkov
1e67278dd5 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110679 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 14:49:24 +00:00
Bruno Cardoso Lopes
0115387005 Remove replicate intrinsics, clang will generate shufflevector for those. The shuffles can't be matched by x86 codegen yet, but will soon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 02:25:35 +00:00
Bruno Cardoso Lopes
77497bf196 Use i32 instead of i8 for dot product intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 01:40:05 +00:00
Jakob Stoklund Olesen
df30cf9e61 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 00:02:26 +00:00
Bruno Cardoso Lopes
d5955f5a23 Fix the last argument type of AVX vblend intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 00:00:22 +00:00
Bill Wendling
6cdb1abe4e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 23:59:04 +00:00
Kevin Enderby
b07ce60981 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 22:52:14 +00:00
Devang Patel
2739896cdd Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110607 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 21:39:24 +00:00
Duncan Sands
fffe6cf084 Remove the ValueMap operator=, which was wrong (it did't correct the
Map pointers of any contained ValueMapCallbackVH's) and unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 16:44:56 +00:00
Zhongxing Xu
ba57509221 Change the Interval type to signed in ImmutableIntervalMap.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110562 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 03:43:39 +00:00
Benjamin Kramer
991808005a Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 19:54:10 +00:00
Duncan Sands
3850f5ceda 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 12:57:48 +00:00
Eric Christopher
d442d2846a Add a bit of a hack to avoid multiple defines of variables in
config.h and llvm-config.h.  This could probably be improved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 09:18:29 +00:00
Bill Wendling
c98af3370f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 05:04:59 +00:00
Oscar Fuentes
652eb506a7 CMake: set configure macro LLVM_PREFIX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 04:32:21 +00:00
Oscar Fuentes
118eb57d76 CMake: configure header llvm-config.h
This is the cmake equivalent of r110532, which fixed bug #7809.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 04:17:18 +00:00
Eric Christopher
eec5008e77 Fix PR7809 by creating a header for just llvm variables that can be
included in exported interfaces.  Update a couple of exported interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 02:44:17 +00:00
Bill Wendling
73739d0bf1 Add back in r109901, which adds a Compare flag to the target instructions. It's
useful after all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 01:49:35 +00:00
Benjamin Kramer
fff0f11989 Roll back my last two commits, valgrind complains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 13:27:41 +00:00
Benjamin Kramer
0055fac724 A reference to the Timer's name is safe, it outlives the contents of the vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110517 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 13:07:57 +00:00
Benjamin Kramer
5aa8df22e7 Shrink PassNameParser's binary size with array_pod_sort.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 11:45:42 +00:00
Owen Anderson
0aede9e2a8 Remove layering violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110505 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 06:01:13 +00:00
Owen Anderson
9773e45a1e Add an inverse() method to ConstantRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 05:47:46 +00:00
Nick Lewycky
dbac071050 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110502 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 05:25:29 +00:00
Dan Gohman
8d570bf8e9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 01:25:32 +00:00
Dan Gohman
4afefdec65 More #include cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 01:18:18 +00:00
Dan Gohman
fc8b58e1d4 Delete this explicit assignment operator; it's equivalent to
the implicit one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 01:17:47 +00:00
Dan Gohman
4bdeede8c7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:53:01 +00:00
Dan Gohman
11112e0d7b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:43:20 +00:00
Owen Anderson
634bab148c Add a convenience constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:42:06 +00:00
Dan Gohman
9510214936 Make AnalysisImpls private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:34:52 +00:00
Owen Anderson
6f615f8d48 Add a predicate to determine if a call is an inline asm statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110488 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:19:59 +00:00
Rafael Espindola
565aafc997 Some cleanup. Use a class (OptionInfo) instead of a pair of a pair and remove
some default values that are not used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 23:03:52 +00:00
Bruno Cardoso Lopes
4945dd8314 Patterns to match AVX 256-bit vzero intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 22:10:01 +00:00
Dan Gohman
60493c3f4f Eliminate PromoteMemoryToRegisterID; just use addPreserved("mem2reg")
instead, as an example of what this looks like.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 21:48:06 +00:00
Jim Grosbach
f691229384 tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110476 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 21:31:35 +00:00
Daniel Dunbar
c257c669df MC: Add default value for AddrSpace argument to EmitValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 21:24:05 +00:00
Jakob Stoklund Olesen
23436597a8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:46:59 +00:00
Owen Anderson
90c579de5a Reapply r110396, with fixes to appease the Linux buildbot gods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:33:48 +00:00
Dan Gohman
e26a7b5e21 Implement a proper getModRefInfo for va_arg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:24:38 +00:00
Jim Grosbach
e6f60645c7 spelling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:24:36 +00:00
Rafael Espindola
55e9587469 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 15:35:32 +00:00
Dan Gohman
13214eb8cc Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 02:04:07 +00:00
Bill Wendling
5b55ff0c15 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 01:36:09 +00:00
Bill Wendling
e4ddbdfd3c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 01:32:48 +00:00
Owen Anderson
1f74590e9d Revert r110396 to fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 00:23:35 +00:00
Bruno Cardoso Lopes
f6d6df4006 Remove unused AVX intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110407 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 00:04:07 +00:00
Dan Gohman
cb74993bdc Make AA private, since subclasses shouldn't (aren't don't) access it directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110398 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:44:45 +00:00
Owen Anderson
9ccaf53ada 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:42:04 +00:00
Dan Gohman
7365c091f9 Remove IntrWriteMem, as it's the default. Rename IntrWriteArgMem
to IntrReadWriteArgMem, as it's for reading as well as writing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:36:21 +00:00
Eric Christopher
6387176c31 Revert my last commit, apparently it's a runtime issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 22:48:32 +00:00
Eric Christopher
436843662d Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 22:28:22 +00:00
Gabor Greif
3ecf355c7a 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 21:25:49 +00:00
Owen Anderson
9850a28866 Give ConstantRange an operator=
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 20:51:10 +00:00
Jakob Stoklund Olesen
73cf709a08 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 18:59:59 +00:00
Dan Gohman
f66514ad3a Delete obsolete comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 23:08:15 +00:00
Torok Edwin
e89652ccad Add a missing function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 11:42:45 +00:00
Torok Edwin
484959a26c Fix build of DataFlow.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 09:30:20 +00:00
Dan Gohman
26e064ff32 Don't construct a std::string with a literal "".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110180 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:14:33 +00:00
Dan Gohman
5825545553 Don't print the filename twice in file-not-found errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110179 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:13:48 +00:00
Bruno Cardoso Lopes
12cf5018be Fix a comment typo and add more 256-bit intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:09:40 +00:00
Dan Gohman
a41af344c2 Remove PointerAccessInfo, which nothing was using.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 23:08:10 +00:00
Dan Gohman
79fca6fea8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 21:48:53 +00:00
Nate Begeman
d1fb583128 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 21:31:55 +00:00
Peter Collingbourne
3bababf880 Add an atomic lowering pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 16:19:16 +00:00
Daniel Dunbar
b1247c313d build: Add LLVM_NATIVE_ARCHNAME, which has the sensible value, without "Target"
appended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 14:26:17 +00:00
Bruno Cardoso Lopes
e5c500b37d 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 01:53:41 +00:00
Dan Gohman
e53e3772f3 Update some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 01:07:32 +00:00
Dan Gohman
ef1cfac9e5 Introduce a symbolic constant for ~0u for use with AliasAnalysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 01:03:11 +00:00
Dan Gohman
847a84efd2 Add a convenient form of AliasAnalysis::alias for the case where the sizes
are unknown.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 00:56:30 +00:00
Dan Gohman
ab37f50838 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:49:30 +00:00
Dan Gohman
c182cb5784 Sketch up a preliminary Type-Based Alias Analysis implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:11:01 +00:00
Devang Patel
5b164b5a5c Add explicit constructors. Patch by Renato Golin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 22:51:46 +00:00
Daniel Dunbar
b7a56ad907 Targets: Add InitializeNativeTargetAsmPrinter(), patch by Jan Sjodin, although
rewritten by me to not require updating all the target initialization routine
names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 23:36:18 +00:00
Gabor Greif
0114b9990a doxygenize argument accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 08:35:21 +00:00
Michael J. Spencer
e2195d8b35 Add relax all support to the COFF object streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 06:22:29 +00:00
Rafael Espindola
d720670393 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109936 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 00:32:17 +00:00
Bill Wendling
1844b1a5a4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 22:48:39 +00:00
Dan Gohman
e16829b401 Move MaximumAlignment to be a member of the Value class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 21:07:05 +00:00
Nick Lewycky
b2bdf941f6 LibCallAliasAnalysis uses multiple inheritance, so it needs to implement
getAdjustedAnalysisPointer. Part of a fix to PR7760.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 20:19:09 +00:00
Duncan Sands
bcc2393369 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?".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 05:49:32 +00:00
Gabor Greif
436ed471cc remove a layer of cruft
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109821 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 23:35:00 +00:00
Nate Begeman
0e0a20eb38 Add builtins for ssat/usat, similar to RealView's __ssat and __usat intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 22:48:09 +00:00
Eric Christopher
c728ad4349 Grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109775 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 18:11:28 +00:00
Nate Begeman
692433bc2d Add intrinsics __builtin_arm_qadd & __builtin_arm_qsub to allow access to the QADD & QSUB instructions.
Behave identically to __qadd & __qsub RealView instruction intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:56:55 +00:00
Benjamin Kramer
1abcd06856 Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:48:06 +00:00
Benjamin Kramer
3bce5adb32 Stop leaking std::strings in GetDwarfFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 13:53:19 +00:00
Eric Christopher
e6cbfa6b09 Speculatively revert r109705 since it seems to be causing some build bot
angst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:25:38 +00:00