Commit Graph

88234 Commits

Author SHA1 Message Date
Michael Gottesman
38bc25a52e [ObjCARC Debug Message] - Added debug message when we add a nounwind keyword to a function which can not throw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171676 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 23:39:13 +00:00
Michael Gottesman
817d4e942b [ObjCARC Debug Message] - Added debug message when we add a tail keyword to a function which can never be passed stack args.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171675 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 23:39:09 +00:00
Michael Gottesman
795612702e [ObjCARC Debug Messages] - Added missing newline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171674 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 22:56:54 +00:00
Michael Gottesman
20d9fff206 Added debug statement to ObjCARC when we replace objc_autorelease(x) with objc_release(x) when x is otherwise unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171673 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 22:56:50 +00:00
Michael Gottesman
e549492c36 Added 2x Debug statements to ObjCARC that log when we handle the two undefined pointer-to-weak-pointer is NULL cases by replacing the given call inst with an undefined value.
The reason that there are two cases is that the first case handles the unary cases and the second the binary cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171672 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 21:54:30 +00:00
Dmitri Gribenko
be0ffd1e5a Documentation: add clang 3.0 + libstdc++ 4.7.x as a known bad combination that
is actually used by a few Linux distributions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171671 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 21:23:27 +00:00
Michael Gottesman
4680abec92 Added debug message in ObjCARC when we remove a no-op cast which has only special semantic meaning in the frontend and thus in the optimizer can be deleted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 21:07:15 +00:00
Michael Gottesman
48239c753a Added debug message to ObjCARC when we transform an objc_autoreleaseReturnValue => objc_autorelease due to its operand not being used as a return value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171669 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 21:07:11 +00:00
Craig Topper
f564a9389d Fix suffix handling for parsing and printing of cvtsi2ss, cvtsi2sd, cvtss2si, cvttss2si, cvtsd2si, and cvttsd2si to match gas behavior.
cvtsi2* should parse with an 'l' or 'q' suffix or no suffix at all. No suffix should be treated the same as 'l' suffix. Printing should always print a suffix. Previously we didn't parse or print an 'l' suffix.
cvtt*2si/cvt*2si should parse with an 'l' or 'q' suffix or not suffix at all. No suffix should use the destination register size to choose encoding. Printing should not print a suffix.

Original 'l' suffix issue with cvtsi2* pointed out by Michael Kuperstein.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171668 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 20:39:29 +00:00
Evan Cheng
700843ec2c Fix for PR14739. It's not safe to fold a load into a call across a store. Thanks to Nick Lewycky for the initial patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171665 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 19:00:15 +00:00
Andrew Trick
c6b4936a59 Fix a crash in LSR replaceCongruentIVs.
Indirect branch in the preheader crashes replaceCongruentIVs.
Fixes rdar://12910141.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171653 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 05:59:39 +00:00
Michael J. Spencer
46418797cd [objdump] Use correct format specifiers and fix C++03 variadic warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171651 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 05:23:59 +00:00
Michael J. Spencer
95abfbe8e9 [Object][ELF] Fix incorrect size of members for the 64 version of Elf_Phdr_Impl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171650 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 03:57:11 +00:00
Michael J. Spencer
b2c064c695 [objdump] Add --private-headers, -p.
This currently prints the ELF program headers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171649 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 03:56:49 +00:00
Michael J. Spencer
3e5d8ade39 [Object][ELF] Add program header iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171648 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 03:56:27 +00:00
Michael J. Spencer
fe23da7949 [Object][ELF] Refactor ELFRelocationIterator into ELFEntityIterator. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171647 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 03:56:14 +00:00
Renato Golin
e36291a1ef Add reference to dcommit on GettingStarted
Signed-off-by: Renato Golin <renato.golin@linaro.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171642 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 00:14:27 +00:00
David Blaikie
e302b6cb69 Include access modifiers in subprogram metadata IR comment.
Based on code review feedback in r171604 from Chandler Carruth &
Eric Christopher.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171636 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 21:39:33 +00:00
Dmitri Gribenko
8b2bcf4f75 GettingStarted: improve formatting and document that configure checks for
'clang' to use it as the compiler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171630 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 18:10:06 +00:00
Michael Gottesman
36e4bc406c Added debug message to ObjCARC when we transform objc_retainAutorelasedReturnValue => objc_retain since the operand to said function is not a return value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171629 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 17:55:42 +00:00
Michael Gottesman
87a0f02953 Added debug message for ObjCARC when we zap an objc_autoreleaseReturnValue/objc_retainAutoreleasedValue pair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171628 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 17:55:35 +00:00
Chris Lattner
261304248f switch from pointer equality comparison to MDNode::getMostGenericTBAA
when merging two TBAA tags, pointed out by Nuno.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171627 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 16:44:07 +00:00
Chandler Carruth
e4b4edd72a 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 12:32:17 +00:00
Benjamin Kramer
f06eb26165 Attribute: Make hashes match when looking up AttributeImpls.
This isn't optimal either but fixes a massive compile time regression from the
attribute uniquing work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171624 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 12:08:00 +00:00
Chandler Carruth
b24ce3ec45 Fix another place where we build the TTI pass to the new interface.
Sorry for the noise here, 'make check' doesn't build this code. =/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171623 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 11:54:35 +00:00
Chandler Carruth
7bdf6b00e0 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171621 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 11:43:11 +00:00
Chandler Carruth
be73c7b903 Switch the loop vectorizer from VTTI to just use TTI directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171620 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 10:16:02 +00:00
Chandler Carruth
194bd71b06 Switch the cost model analysis over to just the TTI interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171619 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 10:09:33 +00:00
Chandler Carruth
abc227d9b3 Switch the BB vectorizer from the VTTI interface to the simple TTI
interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171618 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 10:05:28 +00:00
Chandler Carruth
b8f6cb7c49 Switch SimplifyCFG over to the TargetTransformInfo interface rather than
the ScalarTargetTransformInfo interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171617 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 10:05:26 +00:00
Chandler Carruth
9980b8a0bd Switch LoopIdiomRecognize to directly use the TargetTransformInfo
interface rather than the ScalarTargetTransformInterface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171616 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 10:00:09 +00:00
Chandler Carruth
9eac3912d3 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171615 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 09:56:20 +00:00
Chandler Carruth
6f78fbbc63 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171614 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 08:47:26 +00:00
Chandler Carruth
ba7a4e69e8 While the struct being defined in the AddressingMode.h header was
unused, there were transitive includes needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171613 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 08:19:20 +00:00
Chandler Carruth
acd2c2139d Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171612 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 08:12:59 +00:00
NAKAMURA Takumi
3a4779a921 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171611 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 07:55:47 +00:00
David Blaikie
00ece1b846 Emit DW_TAG_formal_parameter for unnamed parameters.
This change essentially reverts r87069 which came without a test case. It
causes no regressions in the GDB 7.5 test suite & fixes 25 xfails (commit
to the test suite to follow). If anyone can present a test case that
demonstrates why this check is necessary I'd be happy to account for it in one
way or another.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 07:43:02 +00:00
Craig Topper
835e7bc48e Recommit r171461 which was incorrectly reverted. Mark DIV/IDIV instructions hasSideEffects=1 because they can trap when dividing by 0. This is needed to keep early if conversion from moving them across basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171608 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 07:39:25 +00:00
Nadav Rotem
5d1f5c1737 Revert revision 171524. Original message:
URL: http://llvm.org/viewvc/llvm-project?rev=171524&view=rev
Log:
The current Intel Atom microarchitecture has a feature whereby when a function
returns early then it is slightly faster to execute a sequence of NOP
instructions to wait until the return address is ready,
as opposed to simply stalling on the ret instruction
until the return address is ready.

When compiling for X86 Atom only, this patch will run a pass, called
"X86PadShortFunction" which will add NOP instructions where less than four
cycles elapse between function entry and return.

It includes tests.

Patch by Andy Zhang.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171603 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:42:48 +00:00
NAKAMURA Takumi
255cd6f317 Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171601 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:16:53 +00:00
NAKAMURA Takumi
5d295b41a3 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171600 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:14:23 +00:00
Jakob Stoklund Olesen
84be3d5a73 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().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171599 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:05:51 +00:00
Jakob Stoklund Olesen
f1d015f342 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171598 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:00:09 +00:00
Jakob Stoklund Olesen
bced5cd924 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171597 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 04:38:12 +00:00
Chandler Carruth
64e407be0d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171595 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 03:36:17 +00:00
Chandler Carruth
b1a429fd1c 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171590 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 02:09:22 +00:00
Chandler Carruth
61e7ff907a Rename the unittest from ArrayRecylerTest.cpp to ArrayRecyclerTest.cpp.
Fixes the CMake build. It took me cutting and pasting this before
I managed to see the missing character. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171589 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 02:08:43 +00:00
Akira Hatanaka
3f0ef85f44 [mips] Fix data layout string. Add 64 to the list of native integer widths
and add stack alignment information.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 02:00:56 +00:00
Bill Wendling
1bbd644301 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171586 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 01:36:54 +00:00
Nadav Rotem
024328ea49 Fix a typo. Remove the duplicated test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171584 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 01:17:46 +00:00