Commit Graph

17612 Commits

Author SHA1 Message Date
Bill Wendling 89ade92879 Rename to something more sensible. No functionality change.
llvm-svn: 174909
2013-02-11 22:31:34 +00:00
Justin Holewinski 4f12f53353 [NVPTX] Remove NoCapture from address space conversion intrinsics. NoCapture is not valid in this case, and was causing incorrect optimizations.
llvm-svn: 174896
2013-02-11 18:56:35 +00:00
Tim Northover acaa788be6 AArch64: Add basic relocation processing for llvm-dwarfdump.
This allows llvm-dwarfdump to handle the relocations needed, at least
for LLVM-produced code.

llvm-svn: 174874
2013-02-11 11:16:02 +00:00
Cameron Zwarich 02e742fbe6 Fix some problems with the updating of SlotIndexes after adding a new MBB. In
particular, holes were being left between two blocks after splitting an edge.

llvm-svn: 174868
2013-02-11 09:24:42 +00:00
Bill Wendling 829b478980 Add support for printing out the attribute groups.
This emits the attribute groups that are used by the functions. (It currently
doesn't print out return type or parameter attributes within attribute groups.)

Note: The functions still retrieve their attributes from the "old" bitcode
format (using the deprecated 'Raw()' method). This means that string attributes
within an attribute group will not show up during a disassembly. This will be
addressed in a future commit.

llvm-svn: 174867
2013-02-11 08:43:33 +00:00
Kostya Serebryany d688bab563 [tsan/msan] adding thread_safety and uninitialized_checks attributes
llvm-svn: 174864
2013-02-11 08:13:54 +00:00
Bob Wilson a594fab454 Revert "Rename LLVMContext diagnostic handler types and functions."
This reverts my commit 171047. Now that I've removed my misguided attempt to
support backend warnings, these diagnostics are only about inline assembly.
It would take quite a bit more work to generalize them properly, so I'm
just reverting this.

llvm-svn: 174860
2013-02-11 05:37:07 +00:00
Evan Cheng 615620c9e8 Currently, codegen may spent some time in SDISel passes even if an entire
function is successfully handled by fast-isel. That's because function
arguments are *always* handled by SDISel. Introduce FastLowerArguments to
allow each target to provide hook to handle formal argument lowering.

As a proof-of-concept, add ARMFastIsel::FastLowerArguments to handle
functions with 4 or fewer scalar integer (i8, i16, or i32) arguments. It
completely eliminates the need for SDISel for trivial functions.

rdar://13163905

llvm-svn: 174855
2013-02-11 01:27:15 +00:00
David Blaikie b78e9e59ca Fix unnecessary removal of const through cast machinery
I have some uncommitted changes to the cast code that catch this sort of thing
at compile-time but I still need to do some other cleanup before I can enable
it.

llvm-svn: 174853
2013-02-11 01:16:51 +00:00
Cameron Zwarich 21beaf6789 Fix the unused but nearly correct method SlotIndexes::insertMBBInMaps() and add
support for updating SlotIndexes to MachineBasicBlock::SplitCriticalEdge(). This
calls renumberIndexes() every time; it should be improved to only renumber
locally.

llvm-svn: 174851
2013-02-10 23:29:54 +00:00
Bill Wendling dc095559fa Add code for emitting the attribute groups.
This is some initial code for emitting the attribute groups into the bitcode.

NOTE: This format *may* change! Do not rely upon the attribute groups' bitcode
not changing.

llvm-svn: 174845
2013-02-10 23:09:32 +00:00
Bill Wendling ff84294567 Add 'empty' query methods to the builder and use them in the verifier.
llvm-svn: 174832
2013-02-10 10:12:06 +00:00
Chris Lattner 6b24f7429a ok, ok, stop fighting type punning warnings by just using a union.
llvm-svn: 174827
2013-02-10 06:36:29 +00:00
Chris Lattner 4080fcc478 hopefully "really" fix a type punning warning by defining the buffer as
type char, which can't have TBAA tags.

llvm-svn: 174826
2013-02-10 06:07:16 +00:00
Chris Lattner e3d3e6ab8c attempt to defeat a gcc warning that is breaking a -Werror buildbot.
llvm-svn: 174825
2013-02-10 05:45:34 +00:00
Bill Wendling 5d020a3a31 Add accessor for the LLVMContext.
llvm-svn: 174824
2013-02-10 05:00:40 +00:00
Jakub Staszak 853136229b Remove unneeded "TargetMachine.h" #includes.
llvm-svn: 174817
2013-02-09 20:54:05 +00:00
Bill Wendling 33ab8a2187 Add a DenseMapInfo class for the AttributeSet.
We are going to place the AttributeSet into a DenseMap during assembly writing.

llvm-svn: 174812
2013-02-09 15:42:51 +00:00
Jakub Staszak bef117fed5 Simplify code.
llvm-svn: 174807
2013-02-09 13:29:31 +00:00
Jakub Staszak ba3189bc0a Remove unneeded #includes.
llvm-svn: 174806
2013-02-09 13:29:10 +00:00
Chris Lattner 55d911d833 This is the correct version of r174802.
llvm-svn: 174804
2013-02-09 07:37:59 +00:00
Chris Lattner 1a43b350c4 Fix a nasty off-by one error that only manifests with 64-bit word size (which is
not enabled yet).

llvm-svn: 174803
2013-02-09 07:37:26 +00:00
Chris Lattner 6c29cb3b7a Fix the underlying problem that was causing read(0) to be called: sometimes the
bitcode writer would generate abbrev records saying that the abbrev should be
filled with fixed zero-bit bitfields (this happens in the .bc writer when 
the number of types used in a module is exactly one, since log2(1) == 0).

In this case, just handle it as a literal zero.  We can't "just fix" the writer
without breaking compatibility with existing bc files, so have the abbrev reader
do the substitution.

Strengthen the assert in read to reject reads of zero bits so we catch such 
crimes in the future, and remove the special case designed to handle this.

llvm-svn: 174801
2013-02-09 07:07:29 +00:00
Chris Lattner 1420fda82f recommit r173072 (preparing bitstream reader to read a machine word at a time,
instead of always 32-bits at a time) with two changes:

1. Make Read(0) always return zero without affecting the state of our cursor.
2. Hack word_t to always be 32 bits, as staging.

These two caveats will change shortly.

llvm-svn: 174800
2013-02-09 06:52:14 +00:00
Jakub Staszak 65225c3aa1 Remove trailing spaces.
llvm-svn: 174791
2013-02-09 01:19:12 +00:00
Jakub Staszak 79a396fbef Remove unneeded #includes.
llvm-svn: 174790
2013-02-09 01:15:18 +00:00
Jakub Staszak f23980aba5 Remove #includes from the commonly used LoopInfo.h.
llvm-svn: 174786
2013-02-09 01:04:28 +00:00
Jakob Stoklund Olesen fac770b865 Remove the old liveness algorithm.
This is part of the plan to delete LiveVariables.

llvm-svn: 174783
2013-02-09 00:04:07 +00:00
Sergei Larin cd1201b98c Enable *BasicBlockPass::createPrinterPass()
Enables raw_ostream I/O for BasicBlockPass.

llvm-svn: 174776
2013-02-08 23:37:41 +00:00
Bob Wilson bfb44ef9cb Revert "Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>"
This reverts r171041. This was a nice idea that didn't work out well.
Clang warnings need to be associated with warning groups so that they can
be selectively disabled, promoted to errors, etc. This simplistic patch didn't
allow for that. Enhancing it to provide some way for the backend to specify
a front-end warning type seems like overkill for the few uses of this, at
least for now.

llvm-svn: 174748
2013-02-08 21:48:29 +00:00
Bob Wilson 67bbf3aa0c Revert 172027 and 174336. Remove diagnostics about over-aligned stack objects.
Aside from the question of whether we report a warning or an error when we
can't satisfy a requested stack object alignment, the current implementation
of this is not good.  We're not providing any source location in the diagnostics
and the current warning is not connected to any warning group so you can't
control it.  We could improve the source location somewhat, but we can do a
much better job if this check is implemented in the front-end, so let's do that
instead.  <rdar://problem/13127907>

llvm-svn: 174741
2013-02-08 20:35:15 +00:00
Arnold Schwaighofer 594fa2dc2b ARM cost model: Address computation in vector mem ops not free
Adds a function to target transform info to query for the cost of address
computation. The cost model analysis pass now also queries this interface.
The code in LoopVectorize adds the cost of address computation as part of the
memory instruction cost calculation. Only there, we know whether the instruction
will be scalarized or not.
Increase the penality for inserting in to D registers on swift. This becomes
necessary because we now always assume that address computation has a cost and
three is a closer value to the architecture.

radar://13097204

llvm-svn: 174713
2013-02-08 14:50:48 +00:00
Michael J. Spencer cff2b27bf4 [Object][ELF] Add a way to get the dynamic symbol table section.
llvm-svn: 174682
2013-02-07 23:37:58 +00:00
Michael J. Spencer 38243d8997 [Object][ELF] Add {begin,end}_elf_dynamic_symbols to non-virtually iterate over dynamic symbols.
llvm-svn: 174681
2013-02-07 23:37:46 +00:00
Meador Inge 32dc724920 ADT: Correct APInt::getActiveWords for zero values
PR15138 was opened because of a segfault in the Bitcode writer.
The actual issue ended up being a bug in APInt where calls to
APInt::getActiveWords returns a bogus value when the APInt value
is 0.  This patch fixes the problem by ensuring that getActiveWords
returns 1 for 0 valued APInts.

llvm-svn: 174641
2013-02-07 18:36:50 +00:00
Michael J. Spencer 3a967eac1e [Object][ELF] Fix crash on no dynamic section.
llvm-svn: 174639
2013-02-07 18:26:45 +00:00
Michael J. Spencer 8ea63242a4 80-col
llvm-svn: 174572
2013-02-07 01:43:18 +00:00
Michael J. Spencer 65c6a184a9 [Object][ELF] Do the actual devirtualization.
llvm-svn: 174568
2013-02-07 01:24:22 +00:00
Michael J. Spencer 1ef75e55b9 [Object][ELF] Devirtualize and simplify dynamic table iteration.
llvm-svn: 174566
2013-02-07 01:17:23 +00:00
Owen Anderson 389f7dc7a2 Fix CMake detection of various cmath functions, and XFAIL the test on platforms that are known to be missing them.
llvm-svn: 174564
2013-02-07 00:54:05 +00:00
Owen Anderson 132ae8b955 Conditionalize constant folding of math intrinsics on the availability of an implementation on the host. This is a little bit unfortunate, but until someone decides to implement a full libm for APFloat, we don't have a better way to get this functionality.
llvm-svn: 174561
2013-02-07 00:21:34 +00:00
Michael J. Spencer 18131ae08d [Support][ErrorOr] Add support for convertable types.
Thanks to Andrew, David, and Aaron for helping fix this.

llvm-svn: 174552
2013-02-06 22:28:53 +00:00
Bill Wendling 8911b86400 Improve comment.
llvm-svn: 174536
2013-02-06 20:05:44 +00:00
Jim Grosbach 86c652a6b2 Allow targets to add custom asm operand matching logic.
For example, ARM has several instructions with a literal '#0' immediate in the syntax
that's not represented as an actual operand. The asm matcher is expected a token
operand, but the parser will have created an immediate operand. This is currently
handled by dedicated per-instruction C++ munging of the ParsedAsmOperand list, but
will be better handled by this hook.

llvm-svn: 174487
2013-02-06 06:00:06 +00:00
Bill Wendling 4b00144e1b Add a 'StringRef' version of hasAttribute.
Fix the 'operator==' and 'hasAttributes' queries to take into account
target-dependent attributes.

llvm-svn: 174481
2013-02-06 01:33:42 +00:00
Bill Wendling e261492fd4 Add methods to merge an AttrBuilder into another builder.
This is useful when parsing an object that references multiple attribute groups.

N.B. If both builders have alignments specified, then they should match!

llvm-svn: 174480
2013-02-06 01:16:00 +00:00
Bill Wendling ae89a0fbc2 Add the target-dependent (string) attributes from the AttrBuilder to the AttributeSet.
llvm-svn: 174467
2013-02-05 23:48:36 +00:00
Eli Bendersky fd08bc195b Initial support for DWARF CFI parsing and dumping in LLVM
llvm-svn: 174463
2013-02-05 23:30:58 +00:00
Eli Bendersky 12547bc76c Be consistent about the field name - AddressSize, not PointerSize. Add
a setter and fix some comments.

llvm-svn: 174462
2013-02-05 23:26:02 +00:00
Andrew Trick 780ebadc1a Revert "[Support][ErrorOr] Add support for convertable types."
This reverts commit a33e1fafac7fedb1b080ef07ddf9ad6ddff3a830.

This unit test crashes on Darwon. It needs to be temporarily reverted
to unblock the test infrastructure.

llvm-svn: 174458
2013-02-05 22:50:20 +00:00
Bill Wendling 3f12ac2138 Convert to storing the attribute's internals as enums, integers, and strings.
The stuff we're handing are all enums (Attribute::AttrKind), integers and
strings. Don't convert them to Constants, which is an unnecessary step here. The
rest of the changes are mostly mechanical.

llvm-svn: 174456
2013-02-05 22:37:24 +00:00
Manman Ren 4e042a6be6 Dwarf: support for LTO where a single object file can have multiple line tables
We generate one line table for each compilation unit in the object file.
Reviewed by Eric and Kevin.

rdar://problem/13067005

llvm-svn: 174445
2013-02-05 21:52:47 +00:00
Jakob Stoklund Olesen 4acf7dd866 Remove liveout lists from MachineRegisterInfo.
All targets are now adding return value registers as implicit uses on
return instructions, and there is no longer a need for the live out
lists.

llvm-svn: 174417
2013-02-05 18:21:56 +00:00
Derek Schuff 90aa1d8abe [MC] Bundle alignment: Invalidate relaxed fragments
Currently, when a fragment is relaxed, its size is modified, but its
offset is not (it gets laid out as a side effect of checking whether
it needs relaxation), then all subsequent fragments are invalidated
because their offsets need to change. When bundling is enabled,
relaxed fragments need to get laid out again, because the increase in
size may push it over a bundle boundary. So instead of only
invalidating subsequent fragments, also invalidate the fragment that
gets relaxed, which causes it to get laid out again.

This patch also fixes some trailing whitespace and fixes the
bundling-related debug output of MCFragments.

llvm-svn: 174401
2013-02-05 17:55:27 +00:00
Eli Bendersky 20e3dcc80b Format comments & clean whitespace
llvm-svn: 174396
2013-02-05 17:10:07 +00:00
Eli Bendersky b81c922947 Fix comment formatting
llvm-svn: 174388
2013-02-05 16:40:22 +00:00
Meador Inge 2c6cf8e2c7 Support: ensure proper state in ErrorOr copy ctors before calling 'get'
Some paths through the copy constructors for 'ErrorOr' were calling
'get' when 'HasError' and 'IsValid' were not properly initialized.
Depending on what happened to be in memory for those member variables
the asserts in 'get' might incorrectly fire.  Fixed by ensuring that
the member variables in question are always initialized before calling
'get'.

llvm-svn: 174381
2013-02-05 15:41:27 +00:00
Jack Carter 428a06cc75 This patch that sets the Mips ELF header flag for
MicroMips architectures. 

Contributer: Zoran Jovanovic
 
llvm-svn: 174360
2013-02-05 09:30:03 +00:00
Michael J. Spencer 31876b4efd [Support][ErrorOr] Add support for convertable types.
llvm-svn: 174357
2013-02-05 08:22:27 +00:00
Bill Wendling b9c5b1a5c4 Add target-dependent versions of addAttribute/removeAttribute to AttrBuilder.
llvm-svn: 174356
2013-02-05 08:09:32 +00:00
Michael Gottesman 159630598a Changed in comment cxx -> C++. Thanks Richard Smith!.
llvm-svn: 174355
2013-02-05 08:01:22 +00:00
Jack Carter 10be6aef15 This patch changes a static_cast to dyn_cast
for MipsELFStreamer objects.

Contributer: Jack Carter
 
llvm-svn: 174354
2013-02-05 07:47:41 +00:00
Michael Gottesman e2376cdf71 Add code to GlobalVariable.h so that global variables marked as
externally_initialized return false for hasDefiniteInitializer and
hasUniqueInitializer.

rdar://12580965.

llvm-svn: 174345
2013-02-05 06:53:26 +00:00
Bill Wendling 56aecccee0 Initial cleanups of the param-attribute code in the bitcode reader/writer.
Rename the PARAMATTR_CODE_ENTRY to PARAMATTR_CODE_ENTRY_OLD. It will be replaced
by another encoding. Keep around the current LLVM attribute encoder/decoder
code, but move it to the bitcode directories so that no one's tempted to use
them.

llvm-svn: 174335
2013-02-04 23:32:23 +00:00
Benjamin Kramer 548ffa274a SelectionDAG: Teach FoldConstantArithmetic how to deal with vectors.
This required disabling a PowerPC optimization that did the following:
input:
x = BUILD_VECTOR <i32 16, i32 16, i32 16, i32 16>
lowered to:
tmp = BUILD_VECTOR <i32 8, i32 8, i32 8, i32 8>
x = ADD tmp, tmp

The add now gets folded immediately and we're back at the BUILD_VECTOR we
started from. I don't see a way to fix this currently so I left it disabled
for now.

Fix some trivially foldable X86 tests too.

llvm-svn: 174325
2013-02-04 15:19:18 +00:00
Evgeniy Stepanov 1f5a71492d More MSan/ASan annotations.
This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains
fixes for 2 issues:

- X86JIT reads return address from stack, which MSan does not know is
  initialized.
- bugpoint tests run binaries with RLIMIT_AS. This does not work with certain
  Sanitizers.

We are no longer including config.h in Compiler.h with this change.

llvm-svn: 174306
2013-02-04 07:03:24 +00:00
Michael Gottesman 4c4ffd7783 Added instance variable/initializers/getter/setters for new keyword externally initialized to GlobalVariable. No *TRUE* functionality change.
I am going to add in the actual test cases with the actual functionality
changes in a later patch because I want to include some test cases.

To be clear when I say no *TRUE* functionality change I mean that this
patch (like it says in the title) only contains getters/setters and sets
up a default initial value of the instance variable to false so that
this patch does not affect any other uses of Global Variable.h.

llvm-svn: 174295
2013-02-03 21:54:38 +00:00
Michael J. Spencer 9718f45d39 [Object][Archive] Improve performance.
Improve performance of iterating over children and accessing the member file
buffer by caching the file size and moving code out to the header.

This also makes getBuffer return a StringRef instead of a MemoryBuffer. Both
fixing a memory leak and removing a malloc.

This takes getBuffer from ~10% of the time in lld to unmeasurable.

llvm-svn: 174272
2013-02-03 10:48:50 +00:00
Michael J. Spencer 39678d836c [Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.
llvm-svn: 174271
2013-02-03 10:48:31 +00:00
Bill Wendling 9122618307 Remove AttrBuilder::Raw().
llvm-svn: 174251
2013-02-02 00:52:44 +00:00
Manman Ren e498b25bc5 Correct indentation for dumping LexicalScope.
llvm-svn: 174237
2013-02-02 00:02:03 +00:00
Bill Wendling 7a33f779b9 Change the AttributeImpl to hold a single Constant* for the values.
This Constant could be an aggregate to represent multiple values.

llvm-svn: 174228
2013-02-01 22:32:30 +00:00
Bill Wendling 3f9fcd48a4 Remove one of the odious 'Raw' methods.
llvm-svn: 174130
2013-02-01 00:48:14 +00:00
Bill Wendling a91748602a Add iterators to the AttributeSet class so that we can access the Attributes in a nice way.
llvm-svn: 174120
2013-01-31 23:53:05 +00:00
Chandler Carruth a983b4de7a Fix a think-o in the condition here. =[ I would commit the test that
caught this, but I want that in a separate commit in case there is
a need to revert the actual functional bit as part of reverting other
patches. This way, the commits relating to just getting the RTTI bits in
place are separate from the functional changes that start using them.

llvm-svn: 174117
2013-01-31 23:43:12 +00:00
Bill Wendling 23804daad9 s/AttrBuilder::addAttributes/AttrBuilder::addAttribute/g because that's more descriptive of what it actually is.
llvm-svn: 174116
2013-01-31 23:38:01 +00:00
Chandler Carruth de093ef8d6 Give the MCStreamer class hierarchy LLVM RTTI facilities for use with
isa<> and dyn_cast<>. In several places, code is already hacking around
the absence of this, and there seem to be several interfaces that might
be lifted and/or devirtualized using this.

This change was based on a discussion with Jim Grosbach about how best
to handle testing for specific MCStreamer subclasses. He said that this
was the correct end state, and everything else was too hacky so
I decided to just make it so.

No functionality should be changed here, this is just threading the kind
through all the constructors and setting up the classof overloads.

llvm-svn: 174113
2013-01-31 23:29:57 +00:00
Bill Wendling 1c7cc8ae90 Remove the AttrBuilder form of the Attribute::get creators.
The AttrBuilder is for building a collection of attributes. The Attribute object
holds only one attribute. So it's not really useful for the Attribute object to
have a creator which takes an AttrBuilder.

This has two fallouts:

1. The AttrBuilder no longer holds its internal attributes in a bit-mask form.
2. The attributes are now ordered alphabetically (hence why the tests have changed).

llvm-svn: 174110
2013-01-31 23:16:25 +00:00
Dan Gohman 8aa3dafb7b Document another instsimplify assumption.
llvm-svn: 174100
2013-01-31 22:13:00 +00:00
Chad Rosier df782d2225 [PEI] Pass the frame index operand number to the eliminateFrameIndex function.
Each target implementation was needlessly recomputing the index.
Part of rdar://13076458

llvm-svn: 174083
2013-01-31 20:02:54 +00:00
Tim Northover e0e3aefdd3 Add AArch64 as an experimental target.
This patch adds support for AArch64 (ARM's 64-bit architecture) to
LLVM in the "experimental" category. Currently, it won't be built
unless requested explicitly.

This initial commit should have support for:
    + Assembly of all scalar (i.e. non-NEON, non-Crypto) instructions
      (except the late addition CRC instructions).
    + CodeGen features required for C++03 and C99.
    + Compilation for the "small" memory model: code+static data <
      4GB.
    + Absolute and position-independent code.
    + GNU-style (i.e. "__thread") TLS.
    + Debugging information.

The principal omission, currently, is performance tuning.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

llvm-svn: 174054
2013-01-31 12:12:40 +00:00
Evgeniy Stepanov 130fdcd225 Annotate BumpPtrAllocator for MemorySanitizer.
This change adds MemorySanitizer annotations to BumpPtrAllocator to
improve report quality.

llvm-svn: 174051
2013-01-31 09:58:59 +00:00
Bill Wendling d471863c1e Remove the Attribute::hasAttributes() function.
That function doesn't make sense anymore because there's only one attribute per
Attribute object now.

llvm-svn: 174044
2013-01-31 06:22:35 +00:00
NAKAMURA Takumi b0944392aa Revert r174026, "Remove Attribute::hasAttributes() and make Attribute::hasAttribute() private."
It broke many hosts to crash.

llvm-svn: 174035
2013-01-31 03:47:28 +00:00
Dan Gohman 1b0f79de0a Move isKnownNonNull out of AliasAnalysis.h and into ValueTracking.cpp since
it isn't really an AliasAnalysis concept, and ValueTracking has similar things
that it could plausibly share code with some day.

llvm-svn: 174027
2013-01-31 02:40:59 +00:00
Bill Wendling 3b4a02bf84 Remove Attribute::hasAttributes() and make Attribute::hasAttribute() private.
The Attribute::hasAttributes() is kind of meaningless since an Attribute can
have only one attribute. And we would rather people use the 'operator=='
instead of Attribute::hasAttribute().

llvm-svn: 174026
2013-01-31 02:18:19 +00:00
Dan Gohman 20a2ae9df5 Change GetPointerBaseWithConstantOffset's DataLayout argument from a
reference to a pointer, so that it can handle the case where DataLayout
is not available and behave conservatively.

llvm-svn: 174024
2013-01-31 02:00:45 +00:00
Bill Wendling 37f7e18705 Make the AttrBuilder creation method of Attribute private so that people won't use it.
llvm-svn: 174023
2013-01-31 01:51:27 +00:00
Bill Wendling 82aa8d4926 Revert for now:
--- Reverse-merging r174010 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Verifier.cpp
U    lib/IR/Attributes.cpp

llvm-svn: 174012
2013-01-31 01:04:51 +00:00
Bill Wendling b8b16b567c Remove the AttrBuilder version of the Attribute::get function.
The AttrBuilder is there to build up multiple attributes. The Attribute class
represents only one attribute at a time. So remove this unnecessary builder
creator method.

llvm-svn: 174010
2013-01-31 00:53:21 +00:00
Bill Wendling fe0021a2f9 Make sure that the Attribute object represents one attribute only.
Several places were still treating the Attribute object as respresenting
multiple attributes. Those places now use the AttributeSet to represent
multiple attributes.

llvm-svn: 174003
2013-01-31 00:29:54 +00:00
Bill Wendling 785afdf3a4 Remove addRetAttributes and addFnAttributes, which aren't useful abstractions.
llvm-svn: 173992
2013-01-30 23:40:31 +00:00
Bill Wendling d219675c2a Convert typeIncompatible to return an AttributeSet.
There are still places which treat the Attribute object as a collection of
attributes. I'm systematically removing them.

llvm-svn: 173990
2013-01-30 23:07:40 +00:00
Michael Gottesman 3980b8c4cc Doxygenified some comments in IRBuilder.h.
llvm-svn: 173986
2013-01-30 22:56:31 +00:00
Michael Gottesman 9656405684 Removed CreateFPExtOrFPTrunc for now until I have the time to get in my vector convert patch.
What I thought was going to be a quick thing has extended out a little bit in
time *sigh*. So after some thought in order to not cruft up the tree I am
removing this for now since it is the right thing to do.

llvm-svn: 173985
2013-01-30 22:53:21 +00:00
Michael Gottesman 58d19a661d Encapsulate testing that we have an iOS Triple in Triple.h in the method isiOS
so we follow the convention that all other platforms follow by having an is*
test method.

llvm-svn: 173983
2013-01-30 22:38:19 +00:00
Bill Wendling 866fc41060 Use the number of 'slots' in the AttributeSetImpl being 0 to indicate that the AttributeSet is empty.
llvm-svn: 173962
2013-01-30 19:39:21 +00:00
Eli Bendersky faf5e3e6b0 Clean up whitespace and indentation a bit
llvm-svn: 173960
2013-01-30 19:24:23 +00:00
Dmitri Gribenko 3c5210b2b8 LLDB uses ConvertUTF16toUTF8, remove #ifdef
llvm-svn: 173936
2013-01-30 15:10:12 +00:00
Dmitri Gribenko b311f4e84a Move UTF conversion routines from clang/lib/Basic to llvm/lib/Support
This is required to use them in TableGen.

llvm-svn: 173923
2013-01-30 12:05:05 +00:00
Jack Carter 718da0b53b This patch implements runtime ARM specific
setting of ELF header e_flags.

Contributer: Jack Carter
 
llvm-svn: 173885
2013-01-30 02:24:33 +00:00
Jack Carter 1bd90ff6cc This patch reworks how llvm targets set
and update ELF header e_flags.

Currently gathering information such as symbol, 
section and data is done by collecting it in an 
MCAssembler object. From MCAssembler and MCAsmLayout 
objects ELFObjectWriter::WriteObject() forms and 
streams out the ELF object file.

This patch just adds a few members to the MCAssember 
class to store and access the e_flag settings. It 
allows for runtime additions to the e_flag by 
assembler directives. The standalone assembler can 
get to MCAssembler from getParser().getStreamer().getAssembler().

This patch is the generic infrastructure and will be
followed by patches for ARM and Mips for their target 
specific use.

Contributer: Jack Carter
 
llvm-svn: 173882
2013-01-30 02:09:52 +00:00
NAKAMURA Takumi 58da26b7df [autoconf]: Fix description in HAVE_CRASHREPORTER_INFO.
http://llvm-reviews.chandlerc.com/D332

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
llvm-svn: 173879
2013-01-30 01:38:03 +00:00
Bill Wendling 03eefb3a38 Add a couple of accessor methods to get the kind and values of an attribute.
llvm-svn: 173828
2013-01-29 20:45:34 +00:00
Bill Wendling f2955aa3f2 Convert getAttributes() to return an AttributeSetNode.
The AttributeSetNode contains all of the attributes. This removes one (hopefully
last) use of the Attribute class as a container of multiple attributes.

llvm-svn: 173761
2013-01-29 03:20:31 +00:00
Evan Cheng 0e88c7d897 Teach SDISel to combine fsin / fcos into a fsincos node if the following
conditions are met:
1. They share the same operand and are in the same BB.
2. Both outputs are used.
3. The target has a native instruction that maps to ISD::FSINCOS node or
   the target provides a sincos library call.

Implemented the generic optimization in sdisel and enabled it for
Mac OSX. Also added an additional optimization for x86_64 Mac OSX by
using an alternative entry point __sincos_stret which returns the two
results in xmm0 / xmm1.

rdar://13087969
PR13204

llvm-svn: 173755
2013-01-29 02:32:37 +00:00
Bill Wendling 60011b8e27 Use an AttrBuilder to generate the correct AttributeSet.
We no longer accept an encoded integer as representing all of the
attributes. Convert this via the AttrBuilder class into an AttributeSet with the
correct representation (an AttributeSetImpl that holds a list of Attribute
objects).

llvm-svn: 173750
2013-01-29 01:43:29 +00:00
Bill Wendling 7707c5a985 S'more small non-functional changes in comments and #includes.
llvm-svn: 173738
2013-01-29 00:48:16 +00:00
Bill Wendling d509a6653a Reorder some functions and add comments. No functionality change.
llvm-svn: 173733
2013-01-29 00:34:06 +00:00
Bill Wendling eeebb13fb2 Try to appease some broken compilers by using 'unsigned' instead of 'uint64_t'.
llvm-svn: 173725
2013-01-28 22:33:39 +00:00
Bill Wendling ec454546ec Remove the AttributeWithIndex class.
The AttributeWithIndex class exposed the interior structure of the AttributeSet
class. That was gross. Remove it and all of the code that relied upon it.

llvm-svn: 173722
2013-01-28 21:55:20 +00:00
Dan Gohman 00830962c6 Add a comment mentioning that InstructionSimplify routines do,
in fact, resolve undef uses.

llvm-svn: 173721
2013-01-28 21:45:32 +00:00
Bill Wendling 892711b0db Mid-air collision. reapply r173656.
llvm-svn: 173661
2013-01-28 05:51:40 +00:00
Bill Wendling 8e31efdbbf Rewrite the removeAttr() method.
This now uses the AttributeSet object instead of the Attribute /
AttributeWithIndex objects. It's fairly simple now. It goes through all of the
subsets before the one we're modifying, adds them to the new set. It then adds
the modified subset (with the requested attributes removed). And then adds the
rest of the subsets.

llvm-svn: 173660
2013-01-28 05:44:14 +00:00
Bill Wendling 1aa9d9e260 Rewrite the addAttr() method.
This now uses the AttributeSet object instead of the Attribute /
AttributeWithIndex objects. It's fairly simple now. It goes through all of the
subsets before the one we're modifying, adds them to the new set. It then adds
the modified subset. And then adds the rest of the subsets.

llvm-svn: 173659
2013-01-28 05:23:28 +00:00
NAKAMURA Takumi 55ec92004f Revert r173646, "Use proper type for the index."
Unfortunately, msvc miscompiles it. Investigating.

llvm-svn: 173656
2013-01-28 04:29:01 +00:00
Michael Gottesman 79d8d81226 Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer.
llvm-svn: 173647
2013-01-28 01:35:51 +00:00
Bill Wendling 63ab99829a Use proper type for the index.
llvm-svn: 173646
2013-01-28 01:30:29 +00:00
Bill Wendling 3217eb652b Use proper return type for attribute index.
llvm-svn: 173639
2013-01-27 23:50:44 +00:00
Bill Wendling 1f786a7371 Push the calculation of the 'Raw' attribute mask down into the implementation. It in turn uses the correct list for calculating the 'Raw' value.
llvm-svn: 173637
2013-01-27 23:41:29 +00:00
Bill Wendling 71ead26439 Don't erase these methods. They're used during testing.
llvm-svn: 173636
2013-01-27 22:46:17 +00:00
Bill Wendling 4bbe9db48f Add special 'get' methods to create an Attribute with an alignment. Also do some random cleanup. No functionality change.
llvm-svn: 173635
2013-01-27 22:43:04 +00:00
Bill Wendling 56b0b2a8e4 s/AttrList/pImpl/g in AttributeSet. No functionality change.
llvm-svn: 173628
2013-01-27 21:23:46 +00:00
Bill Wendling f5c1f555cb Fix miscompile. Add back the use of the ArrayRef version of the ::get method.
llvm-svn: 173613
2013-01-27 10:28:39 +00:00
Bill Wendling a05f97c6e5 Rearrange some deckchairs. Moving the class before it's use.
llvm-svn: 173612
2013-01-27 10:00:13 +00:00
Bill Wendling 993604c747 Remove dead methods.
llvm-svn: 173611
2013-01-27 09:55:44 +00:00
Bill Wendling 53e191b2bc Hide the method that creates an AttributeSet with AttributeWithIndexes.
This method will go away once AttributeWithIndex goes away. In the meantime,
hide it from general use.

llvm-svn: 173607
2013-01-27 03:35:32 +00:00
David Blaikie 9f4b70dde0 PR14566: Debug Info: Removing top level lexical blocks
This adds support for LLVM to accept metadata that doesn't include a top level
lexical block in a function. Specifically LLVM couldn't handle this when there
were file changes relating to these blocks. I've updated a few test cases to
ensure other functionality (such as inlining) isn't affected by this change, but
haven't pervasively updated all the test cases.

llvm-svn: 173592
2013-01-26 21:55:23 +00:00
David Blaikie 18a7776b93 IRBuilder: Remove redundant check around SetInstDebugLocation call.
llvm-svn: 173591
2013-01-26 21:55:19 +00:00
NAKAMURA Takumi a44b1c2486 Object/RelocVisitor: Add minimal support, R_MIPS_32, for mips.
It fixes llvm-dwarfdump for mips and mipsel.

llvm-svn: 173567
2013-01-26 08:27:36 +00:00
NAKAMURA Takumi 3ba23555de Object/RelocVisitor: Add minimal support, R_PPC64_ADDR32, for ppc64.
It fixes llvm-dwarfdump for ppc64-elf.

llvm-svn: 173566
2013-01-26 08:27:29 +00:00
NAKAMURA Takumi a5b09ff6b9 RelocVisitor::visit(): Set hasError in the default path.
llvm-svn: 173565
2013-01-26 08:27:23 +00:00
Andrew Kaylor 9a8ff813f3 Add DIContext::getLineInfoForAddressRange() function and test. This function allows a caller to obtain a table of line information for a function using the function's address and size.
llvm-svn: 173537
2013-01-26 00:28:05 +00:00
Bill Wendling 201d7b2545 Convert BuildLibCalls.cpp to using the AttributeSet methods instead of AttributeWithIndex.
llvm-svn: 173536
2013-01-26 00:03:11 +00:00
Bill Wendling 0170cc7523 Remove dead method.
llvm-svn: 173524
2013-01-25 23:14:36 +00:00
Bill Wendling 57625a4966 Remove some introspection functions.
The 'getSlot' function and its ilk allow introspection into the AttributeSet
class. However, that class should be opaque. Allow access through accessor
methods instead.

llvm-svn: 173522
2013-01-25 23:09:36 +00:00
Andrew Kaylor d55d7019fc Add support for applying in-memory relocations to the .debug_line section and, in the case of ELF files, using symbol addresses when available for relocations to the .debug_info section. Also extending the llvm-rtdyld tool to add the ability to dump line number information for testing purposes.
llvm-svn: 173517
2013-01-25 22:50:58 +00:00
Reid Kleckner 1bda56ce55 Add parens to suppress an MSVC 2012 << precedence warning
It doesn't seem to like instantiating the isUInt<unsigned N> template
with 6+3, and then doing <<N.

llvm-svn: 173507
2013-01-25 22:12:45 +00:00
Nick Lewycky 476a6dab9f Add an insert() method to MapVector. Adds the first MapVector unit test.
llvm-svn: 173505
2013-01-25 22:11:02 +00:00
Bill Wendling 25e65a61cc Add an accessor method to get the slot's index. This will limit the use of AttributeWithIndex.
llvm-svn: 173495
2013-01-25 21:30:53 +00:00
David Blaikie 3ea696d73f This is no trule.
llvm-svn: 173487
2013-01-25 20:47:58 +00:00
Eli Bendersky 7a94daa170 Add command-line flags for DWARF dumping.
Flags for dumping specific DWARF sections added in lib/DebugInfo and
llvm-dwarfdump.

llvm-svn: 173480
2013-01-25 20:26:43 +00:00
Hal Finkel c7d4dc13a4 Add an addition operator to TableGen
This adds an !add(a, b) operator to tablegen; this will be used
to cleanup the PPC register definitions.

llvm-svn: 173445
2013-01-25 14:49:08 +00:00
Andrew Trick ea9fd951a0 MachineScheduler support for viewGraph.
llvm-svn: 173432
2013-01-25 07:45:29 +00:00
Andrew Trick b36388a1cb ScheduleDAG: colorize the DOT graph and improve formatting.
llvm-svn: 173431
2013-01-25 07:45:25 +00:00
Andrew Trick 646eeb6675 ScheduleDAG: Added isBoundaryNode to conveniently detect a common corner case.
This fixes DAG subtree analysis at the boundary.

llvm-svn: 173427
2013-01-25 06:52:30 +00:00
Andrew Trick ffc8097c60 SchedDFS: Complete support for nested subtrees.
Maintain separate per-node and per-tree book-keeping.
Track all instructions above a DAG node including nested subtrees.
Seperately track instructions within a subtree.
Record subtree parents.

llvm-svn: 173426
2013-01-25 06:52:27 +00:00
Andrew Trick e2c3f5c982 MIsched: Improve the interface to SchedDFS analysis (subtrees).
Allow the strategy to select SchedDFS. Allow the results of SchedDFS
to affect initialization of the scheduler state.

llvm-svn: 173425
2013-01-25 06:33:57 +00:00
Andrew Trick f443f11589 ArrayRef reverse iterators.
llvm-svn: 173424
2013-01-25 06:33:52 +00:00
Andrew Trick 030119bc3e whitespace
llvm-svn: 173423
2013-01-25 06:33:50 +00:00