1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

17226 Commits

Author SHA1 Message Date
Michael J. Spencer
44db267406 [Object][ELF] Fix incorrect size of members for the 64 version of Elf_Phdr_Impl.
llvm-svn: 171650
2013-01-06 03:57:11 +00:00
Michael J. Spencer
560b99263b [Object][ELF] Add program header iterator.
llvm-svn: 171648
2013-01-06 03:56:27 +00:00
Michael J. Spencer
3d92fd3e23 [Object][ELF] Refactor ELFRelocationIterator into ELFEntityIterator. No functionality change.
llvm-svn: 171647
2013-01-06 03:56:14 +00:00
Chandler Carruth
afc1c2b5ea Funnel the actual TargetTransformInfo pass from the SelectionDAGISel
pass into the SelectionDAG itself rather than snooping on the
implementation of that pass as exposed by the TargetMachine. This
removes the last direct client of the ScalarTargetTransformInfo class
outside of the TTI pass implementation.

llvm-svn: 171625
2013-01-05 12:32:17 +00:00
Chandler Carruth
43148d2e6e Convert the TargetTransformInfo from an immutable pass with dynamic
interfaces which could be extracted from it, and must be provided on
construction, to a chained analysis group.

The end goal here is that TTI works much like AA -- there is a baseline
"no-op" and target independent pass which is in the group, and each
target can expose a target-specific pass in the group. These passes will
naturally chain allowing each target-specific pass to delegate to the
generic pass as needed.

In particular, this will allow a much simpler interface for passes that
would like to use TTI -- they can have a hard dependency on TTI and it
will just be satisfied by the stub implementation when that is all that
is available.

This patch is a WIP however. In particular, the "stub" pass is actually
the one and only pass, and everything there is implemented by delegating
to the target-provided interfaces. As a consequence the tools still have
to explicitly construct the pass. Switching targets to provide custom
passes and sinking the stub behavior into the NoTTI pass is the next
step.

llvm-svn: 171621
2013-01-05 11:43:11 +00:00
Chandler Carruth
b37ad013ec Replicate the APIs of ScalarTargetTransformInfo and
VectorTargetTransformInfo into the TargetTransformInfo pass,
implementing them be delegating back out to the two subobjects.

This is the first step to folding the interfaces together and making
TargetTransformInfo a normal analysis pass (specifically an analysis
group which targets can provide target-specific analysis pass
implementations of).

No callers are migrated here, this just stubs out the interface. Next
step will be to migrate all the callers to directly operate on TTI
instead of STTI or VTTI respectively. That will allow replacing the
machinery for delivering TTI without changing every caller at once.

WIP, I promise all the duplicated interfaces will be removed in the end,
this just decouples the steps of the process.

llvm-svn: 171615
2013-01-05 09:56:20 +00:00
Chandler Carruth
6e67e85cf1 Switch the empty and tombstone key enumerators to not have explicit
values -- that's not required to fix the bug that was cropping up, and
the values selected made the enumeration's underlying type signed and
introduced some warnings. This fixes the -Werror build.

The underlying issue here was that the DenseMapInfo was casting values
completely outside the range of the underlying storage of the
enumeration to the enumeration's type. GCC went and "optimized" that
into infloops and other misbehavior. By providing designated special
values for these keys in the dense map, we ensure they are indeed
representable and that they won't be used for anything else.

It might be better to reuse None for the empty key and have the
tombstone share the value of the sentinel enumerator, but honestly
having 2 extra enumerators seemed not to matter and this seems a bit
simpler. I'll let Bill shuffle this around (or ask me to shuffle it
around) if he prefers it to look a different way.

I also made the switch a bit more clear (and produce a better assert)
that the enumerators are *never* going to show up and are errors if they
do.

llvm-svn: 171614
2013-01-05 08:47:26 +00:00
Chandler Carruth
d343ae4ddd While the struct being defined in the AddressingMode.h header was
unused, there were transitive includes needed.

llvm-svn: 171613
2013-01-05 08:19:20 +00:00
Chandler Carruth
8ff0753cd8 Remove unnecessary include.
llvm-svn: 171612
2013-01-05 08:12:59 +00:00
NAKAMURA Takumi
86de69e093 IR/Attributes: Provide EmptyKey and TombstoneKey in part of enum, as workaround for gcc-4.4 take #2.
I will investigate, later, what was wrong. I am too tired for now.

llvm-svn: 171611
2013-01-05 07:55:47 +00:00
NAKAMURA Takumi
f321e4c050 Whitespace.
llvm-svn: 171601
2013-01-05 05:16:53 +00:00
NAKAMURA Takumi
084069cda6 DenseMap: Appease -fstrict-aliasing on g++-4.4.
With DenseMapInfo<Enum>, it is miscompiled on g++-4.4.

    static inline Enum getEmptyKey() { return Enum(<arbitrary int/unsigned value>); }

    isEauql(getEmptyKey(), ...)

The compiler mis-assumes the return value is not aliased to Enum.

llvm-svn: 171600
2013-01-05 05:14:23 +00:00
Jakob Stoklund Olesen
31325cd313 Don't call destructors on MachineInstr and MachineOperand.
The series of patches leading up to this one makes llc -O0 run 8% faster.

When deallocating a MachineFunction, there is no need to visit all
MachineInstr and MachineOperand objects to deallocate them. All their
memory come from a BumpPtrAllocator that is about to be purged, and they
have empty destructors anyway.

This only applies when deallocating the MachineFunction.
DeleteMachineInstr() should still be used to recycle MI memory during
the codegen passes.

Remove the LeakDetector support for MachineInstr. I've never seen it
used before, and now it definitely doesn't work. With this patch, leaked
MachineInstrs would be much less of a problem since all of their memory
will be reclaimed by ~MachineFunction().

llvm-svn: 171599
2013-01-05 05:05:51 +00:00
Jakob Stoklund Olesen
af2ae34dc0 Use ArrayRecycler for MachineInstr operand lists.
Instead of an std::vector<MachineOperand>, use MachineOperand arrays
from an ArrayRecycler living in MachineFunction.

This has several advantages:

- MachineInstr now has a trivial destructor, making it possible to
  delete them in batches when destroying MachineFunction. This will be
  enabled in a later patch.

- Bypassing malloc() and free() can be faster, depending on the system
  library.

- MachineInstr objects and their operands are allocated from the same
  BumpPtrAllocator, so they will usually be next to each other in
  memory, providing better locality of reference.

- Reduce MachineInstr footprint. A std::vector is 24 bytes, the new
  operand array representation only uses 8+4+1 bytes in MachineInstr.

- Better control over operand array reallocations. In the old
  representation, the use-def chains would be reordered whenever a
  std::vector reached its capacity. The new implementation never changes
  the use-def chain order.

Note that some decisions in the code generator depend on the use-def
chain orders, so this patch may cause different assembly to be produced
in a few cases.

llvm-svn: 171598
2013-01-05 05:00:09 +00:00
Jakob Stoklund Olesen
cb0cfd567f Add MachineRegisterInfo::moveOperands().
This function works like memmove() for MachineOperands, except it also
updates any use-def chains containing the moved operands.

The use-def chains are updated without affecting the order of operands
in the list. That isn't possible when using the
removeRegOperandFromUseList() and addRegOperandToUseList() functions.

Callers to follow soon.

llvm-svn: 171597
2013-01-05 04:38:12 +00:00
Chandler Carruth
305009f8d6 Refactor the ScalarTargetTransformInfo API for querying about the
legality of an address mode to not use a struct of four values and
instead to accept them as parameters. I'd love to have named parameters
here as most callers only care about one or two of these, but the
defaults aren't terribly scary to write out.

That said, there is no real impact of this as the passes aren't yet
using STTI for this and are still relying upon TargetLowering.

llvm-svn: 171595
2013-01-05 03:36:17 +00:00
Chandler Carruth
413d8d63a5 Sink the AddressingModeMatcher helper class into an anonymous namespace
next to its only user. This helper relies on TargetLowering information
that shouldn't be generally used throughout the Transfoms library, and
so it made little sense as a generic utility.

This also consolidates the file where we need to remove the remaining
uses of TargetLowering in favor of the IR-layer abstract interface in
TargetTransformInfo.

llvm-svn: 171590
2013-01-05 02:09:22 +00:00
Bill Wendling
1760ac5cdf Add a method to create an AttributeSet from an AttrBuilder.
The Attribute class is eventually going to represent one attribute. So we need
this class to create the set of attributes. Add some iterator methods to the
builder to access its internal bits in a nice way.

llvm-svn: 171586
2013-01-05 01:36:54 +00:00
Jakob Stoklund Olesen
2166929062 Add an ArrayRecycler class.
This is similar to the existing Recycler allocator, but instead of
recycling individual objects from a BumpPtrAllocator, arrays of
different sizes can be allocated.

llvm-svn: 171581
2013-01-05 00:57:11 +00:00
Eric Christopher
3898459108 Make this an integer so we have enumeral types in the conditional
expression.

llvm-svn: 171571
2013-01-05 00:32:04 +00:00
Chandler Carruth
c082468143 Provide a default constructor for TimeValue. This was used, but only in
if-ed out code paths and on Windows. Hopefully restores the Windows
build. Thanks to Reid Kleckner for helping triage this.

llvm-svn: 171568
2013-01-05 00:23:09 +00:00
Alex Rosenberg
09515dcbcd Fix warnings from llvm-gcc as seen on darwin10 (10.6).
llvm-svn: 171567
2013-01-05 00:21:12 +00:00
Bill Wendling
c6b2b9e992 Get rid of the 'Bits' mask in the attribute builder.
The bit mask thing will be a thing of the past. It's not extensible enough. Get
rid of its use here. Opt instead for using a vector to hold the attributes.

Note: Some of this code will become obsolete once the rewrite is further along.
llvm-svn: 171553
2013-01-04 23:27:34 +00:00
Chandler Carruth
ae1954050c Add time getters to the process interface for requesting the elapsed
wall time, user time, and system time since a process started.

For walltime, we currently use TimeValue's interface and a global
initializer to compute a close approximation of total process runtime.

For user time, this adds support for an somewhat more precise timing
mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock
selected.

For system time, we have to do a full getrusage call to extract the
system time from the OS. This is expensive but unavoidable.

In passing, clean up the implementation of the old APIs and fix some
latent bugs in the Windows code. This might have manifested on Windows
ARM systems or other systems with strange 64-bit integer behavior.

The old API for this both user time and system time simultaneously from
a single getrusage call. While this results in fewer system calls, it
also results in a lower precision user time and if only user time is
desired, it introduces a higher overhead. It may be worthwhile to switch
some of the pass timers to not track system time and directly track user
and wall time. The old API also tracked walltime in a confusing way --
it just set it to the current walltime rather than providing any measure
of wall time since the process started the way buth user and system time
are tracked. The new API is more consistent here.

The plan is to eventually implement these methods for a *child* process
by using the wait3(2) system call to populate an rusage struct
representing the whole subprocess execution. That way, after waiting on
a child process its stats will become accurate and cheap to query.

llvm-svn: 171551
2013-01-04 23:19:55 +00:00
Jakob Stoklund Olesen
4c9d7d3d77 Special case Recycler::clear(BumpPtrAllocator).
A BumpPtrAllocator has an empty Deallocate() method, but
Recycler::clear() would still call it for every single object ever
allocated, bringing all those objects into cache. As a bonus,
iplist::remove() will also write to the Prev/Next pointers on all the
objects, so all those cache lines have to be written back to RAM before
the pages are given back to the OS.

Stop wasting time and memory bandwith by using the new
clearAndLeakUnsafely() function to jettison all the recycled objects.

llvm-svn: 171541
2013-01-04 22:35:45 +00:00
Jakob Stoklund Olesen
499d789d2b Add an iplist::clearAndLeakNodesUnsafely() function.
The iplist::clear() function can be quite expensive because it traverses
the entire list, calling deleteNode() and removeNodeFromList() on each
element. If node destruction and deallocation can be handled some other
way, clearAndLeakNodesUnsafely() can be used to jettison all nodes
without bringing them into cache.

The function name is meant to be ominous.

llvm-svn: 171540
2013-01-04 22:35:42 +00:00
Bill Wendling
fee1eee2b0 General cleanups.
* Remove dead methods.
* Use the 'operator==' method instead of 'contains', which isn't needed.
* Fix some comments.

No functionality change.

llvm-svn: 171523
2013-01-04 20:54:35 +00:00
Michael J. Spencer
641cf62d29 [Object][ELF] Add a maximum alignment. This is used by createELFObjectFile to create a properly aligned reader.
llvm-svn: 171520
2013-01-04 20:36:28 +00:00
Nick Kledzik
8ae5e45184 Fix how YAML I/O detects flow sequences.
Update test case to verify flow sequence is
written as a flow sequence.

llvm-svn: 171514
2013-01-04 19:32:00 +00:00
Adhemerval Zanella
fb3cdfff15 PowerPC: Fix eh_frame relocation for PIC
This patch fixes the PPC eh_frame definitions for the personality and 
frame unwinding for PIC objects. It makes PIC build correctly creates
relative relocations in the '.rela.eh_frame' segments and thus avoiding
a text relocation that generates a DT_TEXTREL segments in link phase.

llvm-svn: 171506
2013-01-04 19:08:13 +00:00
Eric Christopher
80c6027067 Add section information for the DWARF5 split debug proposal
string offset section.

llvm-svn: 171474
2013-01-04 17:59:22 +00:00
Eric Christopher
085e845222 Make comment a bit more clear.
llvm-svn: 171473
2013-01-04 17:59:17 +00:00
Nadav Rotem
cb3562a88e LoopVectorizer:
1. Add code to estimate register pressure.
2. Add code to select the unroll factor based on register pressure.
3. Add bits to TargetTransformInfo to provide the number of registers.

llvm-svn: 171469
2013-01-04 17:48:25 +00:00
Hal Finkel
ff21253111 Better comment on VTTI::getShuffleCost
llvm-svn: 171459
2013-01-03 05:02:41 +00:00
NAKAMURA Takumi
eaed684039 Compiler.h: Leave LLVM_BUILTIN_UNREACHABLE undefined if it is unavailable in host compiler.
Users of LLVM_BUILTIN_UNREACHABLE should be responsible in the case when LLVM_BUILTIN_UNREACHABLE is undefined.

Actually, (0, (p)) in LLVM_ASSUME_ALIGNED(p, a) caused thousands of warnings on g++-4.4. It was a motivation in this commit.

llvm-svn: 171455
2013-01-03 03:30:22 +00:00
Hal Finkel
121335da15 Add a subtype parameter to VTTI::getShuffleCost
In order to cost subvector insertion and extraction, we need to know
the type of the subvector being extracted.

No functionality change.

llvm-svn: 171453
2013-01-03 02:34:09 +00:00
Bill Wendling
e0967fda18 Try again to revert the bad patch. The tree was reverted for some unknown reason
before the last time.

--- Reverse-merging r171442 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp
U    lib/IR/AttributeImpl.h

llvm-svn: 171448
2013-01-03 01:54:39 +00:00
Hal Finkel
0d20c75b66 Add a default Index for VTTI::getShuffleCost
When Kind == (Broadcast or Reverse) then Index is not used; make it an optional parameter.

No functionality change.

llvm-svn: 171447
2013-01-03 01:50:51 +00:00
Bill Wendling
bc6183b1fb Revert patch. Something snuck in there that shouldn't be.
--- Reverse-merging r171441 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp

llvm-svn: 171444
2013-01-03 01:46:27 +00:00
Bill Wendling
aa9022eef7 Remove the 'contains' methods in favor of the 'operator==' method.
The 'operator==' method is a bit clearer and much less verbose for somethings
that should have only one value. Remove from the AttrBuilder for consistency.

llvm-svn: 171442
2013-01-03 01:43:05 +00:00
NAKAMURA Takumi
ecc0c04042 Revert r171427, "An intermediate step in the Attributes rewrite."
llvm-svn: 171441
2013-01-03 01:42:06 +00:00
Bill Wendling
4713ca594a An intermediate step in the Attributes rewrite.
Modify the AttrBuilder class to store the attributes as a set instead of as a
bit mask. The Attribute class will represent only one attribute instead of a
collection of attributes.

This is the wave of the future!

llvm-svn: 171427
2013-01-02 23:45:09 +00:00
Argyrios Kyrtzidis
f2a855cbd7 Use a bool instead of a bitfield in llvm/ADT/Optional.
Fixes Valgrind failures and removes bitwise operations that don't provide any benefit.
Valgrind failures reported by NAKAMURA Takumi.

llvm-svn: 171413
2013-01-02 21:19:08 +00:00
Michael J. Spencer
49cbcf460d Restrict __builtin_assume_aligned to gcc 4.7+
llvm-svn: 171408
2013-01-02 20:23:49 +00:00
Michael J. Spencer
8e9968e6f2 [Support][Endian] Add support for specifying the alignment and native unaligned types.
* Add support for specifying the alignment to use.
* Add the concept of native endianness. Used for unaligned native types.

The native alignment and read/write simplification is based on a patch by Richard Smith.

llvm-svn: 171406
2013-01-02 20:14:11 +00:00
Argyrios Kyrtzidis
d33aff0073 Don't #include stuff outside the include guards.
This defeats the include-guard optimization when parsing.

llvm-svn: 171405
2013-01-02 19:42:53 +00:00
Shuxin Yang
c985c304e2 - Add comment to two functions which might be considered as dead code.
- Fix a typo

llvm-svn: 171399
2013-01-02 18:26:31 +00:00
Chandler Carruth
aea306bbd2 Actually update the CMake and Makefile builds correctly, and update the
code that includes Intrinsics.gen directly.

This never showed up in my testing because the old Intrinsics.gen was
still kicking around in the make build system and was correct there. =[
Thankfully, some of the bots to clean rebuilds and that caught this.

llvm-svn: 171373
2013-01-02 12:09:16 +00:00
Chandler Carruth
4c1f3c24db Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

llvm-svn: 171366
2013-01-02 11:36:10 +00:00
Chandler Carruth
5f5c383ef1 Resort the #include lines in include/... and lib/... with the
utils/sort_includes.py script.

Most of these are updating the new R600 target and fixing up a few
regressions that have creeped in since the last time I sorted the
includes.

llvm-svn: 171362
2013-01-02 10:22:59 +00:00
Benjamin Kramer
ddae3440aa Add IRBuilder::CreateVectorSplat and use it to simplify code.
llvm-svn: 171349
2013-01-01 19:55:16 +00:00
Chandler Carruth
9c8c27a94c Make it explicit that the only entry points to the Program object are
through the static helper functions. This is already true throughout the
codebase.

Slowly, I'm going to re-implement these static helpers in terms of a new
process based interface which can expose more information, and remove
the program object entirely.

llvm-svn: 171335
2012-12-31 23:44:49 +00:00
Chandler Carruth
0ded277f73 Remove an unused method on Program.
I'm simplifying this interface as much as I can before merging it with
the new process interface.

llvm-svn: 171334
2012-12-31 23:44:47 +00:00
Chandler Carruth
d046ef4ad5 Remove an unused method on the Program class.
llvm-svn: 171332
2012-12-31 23:38:28 +00:00
Chandler Carruth
206011250c Go ahead and get rid of the old page size interface and convert all the
users over to the new one. No sense maintaining this "compatibility"
layer it seems.

llvm-svn: 171331
2012-12-31 23:31:56 +00:00
Chandler Carruth
13b537a99b Flesh out a page size accessor in the new API.
Implement the old API in terms of the new one. This simplifies the
implementation on Windows which can now re-use the self_process's once
initialization.

llvm-svn: 171330
2012-12-31 23:23:35 +00:00
Chandler Carruth
fab9a81b1d Remove the declspecs from small alignments that we can force with
a union. These don't actually work for by-value function arguments, and
MSVC warns if they exist even while (we hope) it aligns the argument
correctly due to the other union member.

This means MSVC will miss out on optimizations based on the alignment of
the buffer, but really, there aren't that many for x86 and MSVC is
likely not doing a great job of optimizing LLVM and Clang anyways.

llvm-svn: 171328
2012-12-31 22:18:01 +00:00
Chandler Carruth
f551cd6d46 Remove an unused function in the old Process interface.
llvm-svn: 171327
2012-12-31 22:17:59 +00:00
Nuno Lopes
0bf7a6b7e1 recommit r171298 (add support for PHI nodes to ObjectSizeOffsetVisitor). Hopefully with bugs corrected now.
llvm-svn: 171325
2012-12-31 20:45:10 +00:00
Michael J. Spencer
d221e06c0a [AlignOf] Add AlignedCharArray and refactor AlignedCharArrayUnion.
This adds AlignedCharArray<Alignment, Size>. A templated struct that contains
a member named buffer of type char[Size] that is aligned to Alignment.

llvm-svn: 171319
2012-12-31 19:54:45 +00:00
Rafael Espindola
3e79a98c7f Fix bits check in ELFObjectFile::isSectionZeroInit().
Fixes PR14723.

Patch by Sami Liedes!

llvm-svn: 171309
2012-12-31 18:20:51 +00:00
Nuno Lopes
be740c67e2 add support for GlobalAlias to ObjectSizeOffsetVisitor
llvm-svn: 171303
2012-12-31 16:23:48 +00:00
Bill Wendling
f20f04c9b6 Remove dead method.
llvm-svn: 171295
2012-12-31 11:52:55 +00:00
Bill Wendling
a4fb106bfe Add some comparison operators to compare the Attribute object with the AttrKind value.
llvm-svn: 171294
2012-12-31 11:51:54 +00:00
Chandler Carruth
a7f5a01dc6 Begin sketching out the process interface.
The coding style used here is not LLVM's style because this is modeled
after a Boost interface and thus done in the style of a candidate C++
standard library interface. I'll probably end up proposing it as
a standard C++ library if it proves to be reasonably portable and
useful.

This is just the most basic parts of the interface -- getting the
process ID out of it. However, it helps sketch out some of the boiler
plate such as the base class, derived class, shared code, and static
factory function. It also introduces a unittest so that I can
incrementally ensure this stuff works.

However, I've not even compiled this code for Windows yet. I'll try to
fix any Windows fallout from the bots, and if I can't fix it I'll revert
and get someone on Windows to help out. There isn't a lot more that is
mandatory, so soon I'll switch to just stubbing out the Windows side and
get Michael Spencer to help with implementation as he can test it
directly.

llvm-svn: 171289
2012-12-31 11:17:50 +00:00
Chandler Carruth
c8247d2d0c Start sketching out a roadmap for better subprocess management in the
LLVM libraries. Also, clean up the doxygen and formatting of the
existing interfaces.

With this change I'm calling the existing interface "legacy" because I'd
like to replace it with something much better. My end goal is to expose
a common set of interfaces for inspecting various properties of
a process, and implementations to expose those both for the current
process and for child processes. This will also expose more rich
interfaces for spawning and controling a subprocess, notably to use
system calls like wait3 and wait4 where available and gather detailed
resource usage stats about the subprocess.

My plan (discussed with Michael Spencer on IRC) is to base this loosely
around the proposed Boost.Process interface, but to implement
a relatively small subset of that functionality based around the needs
of LLVM, Clang, the Clang driver, etc.

llvm-svn: 171285
2012-12-31 09:29:16 +00:00
Bill Wendling
eaa222d341 Remove the getAttributesAtIndex and getNumAttrs methods in favor of using the getAttrSomewhere predicate. This prevents the uses of 'Attribute' as a collection of attributes.
llvm-svn: 171271
2012-12-31 00:49:59 +00:00
Bill Wendling
648c3ccd7b Use the predicate methods off of AttributeSet instead of Attribute.
llvm-svn: 171257
2012-12-30 13:50:49 +00:00
Bill Wendling
f205606322 Remove the Function::getRetAttributes method in favor of using the AttributeSet accessor method.
llvm-svn: 171256
2012-12-30 13:01:51 +00:00
Bill Wendling
35bce31a2e Remove Function::getParamAttributes and use the AttributeSet accessor methods instead.
llvm-svn: 171255
2012-12-30 12:45:13 +00:00
Bill Wendling
e0920e4122 Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

This is in preparation for removing the use of the 'Attribute' class as a
collection of attributes. That will shift to the AttributeSet class instead.

llvm-svn: 171253
2012-12-30 10:32:01 +00:00
Bill Wendling
3b04474127 s/hasAttribute/contains/g to be more consistent with other method names.
llvm-svn: 171252
2012-12-30 09:17:46 +00:00
Bill Wendling
44e1f00275 s/Raw/getBitMask/g to be more in line with current naming conventions. This method won't be sticking around.
llvm-svn: 171244
2012-12-30 01:05:42 +00:00
Chandler Carruth
93a470549b Teach instsimplify to use the constant folder where appropriate for
constant folding calls. Add the initial tests for this which show that
now instsimplify can simplify blindingly obvious code patterns expressed
with both intrinsics and library calls.

llvm-svn: 171194
2012-12-28 14:23:29 +00:00
Chandler Carruth
b113216136 Add entry points to instsimplify for simplifying calls. The entry points
are nice and decomposed so that we can simplify synthesized calls as
easily as actually call instructions. The internal utility still has the
same behavior, it just now operates on a more generic interface so that
I can extend the set of call simplifications that instsimplify knows
about.

llvm-svn: 171189
2012-12-28 11:30:55 +00:00
Alexey Samsonov
3a437b2e64 Add proper support for -fsanitize-blacklist= flag for TSan and MSan. LLVM part.
llvm-svn: 171183
2012-12-28 09:30:44 +00:00
Chandler Carruth
e20bfe3a35 Add support to BasicBlocks for iterating backwards over the
instructions. This just exposes the already present reverse iterators of
the instruction ilist.

llvm-svn: 171159
2012-12-27 12:00:56 +00:00
Chandler Carruth
3f86485d73 Provide a common half-open interval map info implementation, and just
re-use that for SlotIndexes. This way other users who want half-open
semantics can share the implementation.

llvm-svn: 171158
2012-12-27 11:29:17 +00:00
Nadav Rotem
fcfd42040b DAGCombinerInformation: add a getter that exposes the dagcombine level.
llvm-svn: 171152
2012-12-27 08:44:35 +00:00
Alexey Samsonov
319ccd0fdb Fix new[]/delete mismatch in FullDependence spotted by AddressSanitizer
llvm-svn: 171150
2012-12-27 08:40:37 +00:00
Nadav Rotem
55c5987673 Refactor DAGCombinerInfo. Change the different booleans that indicate if we are before or after different runs of DAGCo, with the CombineLevel enum.
Also, added a new API for checking if we are running before or after the LegalizeVectorOps phase. 

llvm-svn: 171142
2012-12-27 06:47:41 +00:00
Nadav Rotem
798533821a whitespace
llvm-svn: 171129
2012-12-27 02:04:12 +00:00
Eric Christopher
c6fa1e95a2 Right now all of the relocations are 32-bit dwarf, and the relocation
information doesn't return an addend for Rel relocations. Go ahead
and use this information to fix relocation handling inside dwarfdump
for 32-bit ELF REL.

llvm-svn: 171126
2012-12-27 01:07:07 +00:00
Nadav Rotem
8ab52765bc white space
llvm-svn: 171090
2012-12-26 04:58:12 +00:00
Hal Finkel
62efc81644 Loosen scheduling restrictions on the PPC dcbt intrinsic
As with the prefetch intrinsic to which it maps, simply have dcbt
marked as reading from and writing to its arguments instead of having
unmodeled side effects. While this might cause unwanted code motion
(because aliasing checks don't really capture cache-line sharing),
it is more important that prefetches in unrolled loops don't block
the scheduler from rearranging the unrolled loop body.

llvm-svn: 171073
2012-12-25 18:51:18 +00:00
Bob Wilson
b0b344d1f6 Rename LLVMContext diagnostic handler types and functions.
These are now generally used for all diagnostics from the backend, not just
for inline assembly, so this drops the "InlineAsm" from the names.  No
functional change.  (I've left aliases for the old names but only for long
enough to let me switch over clang to use the new ones.)

llvm-svn: 171047
2012-12-25 00:07:12 +00:00
Bob Wilson
94a94e9500 Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>
When the backend is used from clang, it should produce proper diagnostics
instead of just printing messages to errs(). Other clients may also want to
register their own error handlers with the LLVMContext, and the same handler
should work for warnings in the same way as the existing emitError methods.

llvm-svn: 171041
2012-12-24 18:15:21 +00:00
Nadav Rotem
286f6b8ea1 CostModel: We have API for checking the costs of known shuffles. This patch adds
support for the insert-subvector and extract-subvector kinds.

llvm-svn: 171027
2012-12-24 10:04:03 +00:00
Elena Demikhovsky
33e7b6276c Added 6 more value types: v32i1, v64i1, v32i16, v32i8, v64i8, v8f64
llvm-svn: 171026
2012-12-24 10:03:57 +00:00
Nadav Rotem
f8f6a2ff97 Change the codegen Cost Model API for shuffeles. This patch removes the API for broadcast and adds a more general API that accepts an enum of known shuffles.
llvm-svn: 171022
2012-12-24 08:57:47 +00:00
NAKAMURA Takumi
ff3931121b llvm/MC/MCMachObjectWriter.h: ComputeSymbolTable(): Prune one description in the comment. [-Wdocumentation]
/// \param StringIndexMap [out] - Map from symbol names to offsets in the string table.

llvm-svn: 171010
2012-12-24 01:24:04 +00:00
Nadav Rotem
fb56b5fe2e CostModel: Change the default target-independent implementation for finding
the cost of arithmetic functions. We now assume that the cost of arithmetic
operations that are marked as Legal or Promote is low, but ops that are
marked as custom are higher.

llvm-svn: 171002
2012-12-23 17:31:23 +00:00
Nadav Rotem
e237376e62 Loop Vectorizer: Update the cost model of scatter/gather operations and make
them more expensive.

llvm-svn: 170995
2012-12-23 07:23:55 +00:00
Craig Topper
ab2b0315f2 Add a comma to fix the build.
llvm-svn: 170982
2012-12-22 08:22:01 +00:00
Craig Topper
faf5d76df0 Use a negative value to represent INVALID_SIMPLE_VALUE_TYPE instead of 256. Its much cheaper for the isSimple() checks to look for values less than 0 rather than a value greater than 255. This shaves ~8k off the size of the llc binary on x86-64.
llvm-svn: 170981
2012-12-22 08:16:17 +00:00
Craig Topper
7d908d812c Add vAny and Metadata to the switch in getSizeInBits for consistency since every other enum was listed.
llvm-svn: 170977
2012-12-22 03:08:37 +00:00
Bill Wendling
a16e5519db Change 'AttrVal' to 'AttrKind' to better reflect that it's a kind of attribute instead of the value of the attribute.
llvm-svn: 170972
2012-12-22 00:37:52 +00:00
Richard Smith
396fedeb01 Fix some undefined behavior when parsing YAML input: don't try to compare an
uninitialized value against a default value. Found by -fsanitize=enum.

llvm-svn: 170970
2012-12-22 00:31:54 +00:00
Jakob Stoklund Olesen
15218a60cd Add a missing assertion, the null register has no register units.
llvm-svn: 170916
2012-12-21 18:38:09 +00:00
Evgeniy Stepanov
ea2d72253e [msan] Remove unreachable blocks before instrumenting a function.
llvm-svn: 170883
2012-12-21 11:18:49 +00:00