oota-llvm.git
11 years agoRevert "Rename LLVMContext diagnostic handler types and functions."
Bob Wilson [Mon, 11 Feb 2013 05:37:07 +0000 (05:37 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174860 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBBVectorize: Remove the linear searches from pair connection searching
Hal Finkel [Mon, 11 Feb 2013 05:29:51 +0000 (05:29 +0000)]
BBVectorize: Remove the linear searches from pair connection searching

This removes the last of the linear searches over ranges of std::multimap
iterators, giving a 7% speedup on the doduc.bc input from PR15222.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174859 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBBVectorize: Avoid linear searches within the load-move set
Hal Finkel [Mon, 11 Feb 2013 05:29:49 +0000 (05:29 +0000)]
BBVectorize: Avoid linear searches within the load-move set

This is another cleanup aimed at eliminating linear searches
in ranges of std::multimap.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174858 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBBVectorize: isa/cast cleanup in getInstructionTypes
Hal Finkel [Mon, 11 Feb 2013 05:29:48 +0000 (05:29 +0000)]
BBVectorize: isa/cast cleanup in getInstructionTypes

Profiling suggests that getInstructionTypes is performance-sensitive,
this cleans up some double-casting in that function in favor of
using dyn_cast.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174857 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBBVectorize: Make the bookkeeping to support full cycle checking less expensive
Hal Finkel [Mon, 11 Feb 2013 05:29:41 +0000 (05:29 +0000)]
BBVectorize: Make the bookkeeping to support full cycle checking less expensive

By itself, this does not have much of an effect, but only because in the default
configuration the full cycle checks are used only for small problem sizes.
This is part of a general cleanup of uses of iteration over std::multimap
ranges only for the purpose of checking membership.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174856 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCurrently, codegen may spent some time in SDISel passes even if an entire
Evan Cheng [Mon, 11 Feb 2013 01:27:15 +0000 (01:27 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174855 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unnecessary code.
Evan Cheng [Mon, 11 Feb 2013 01:18:26 +0000 (01:18 +0000)]
Remove unnecessary code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174854 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix unnecessary removal of const through cast machinery
David Blaikie [Mon, 11 Feb 2013 01:16:51 +0000 (01:16 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174853 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSpelling correction
Joel Jones [Sun, 10 Feb 2013 23:56:30 +0000 (23:56 +0000)]
Spelling correction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174852 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix the unused but nearly correct method SlotIndexes::insertMBBInMaps() and add
Cameron Zwarich [Sun, 10 Feb 2013 23:29:54 +0000 (23:29 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174851 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAbstract the liveness checking in PHIElimination::SplitPHIEdges() to support
Cameron Zwarich [Sun, 10 Feb 2013 23:29:49 +0000 (23:29 +0000)]
Abstract the liveness checking in PHIElimination::SplitPHIEdges() to support
both LiveVariables and LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174850 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support in the bitcode reader to read the attribute groups.
Bill Wendling [Sun, 10 Feb 2013 23:24:25 +0000 (23:24 +0000)]
Add support in the bitcode reader to read the attribute groups.

This reads the attribute groups. It currently doesn't do anything with them.

NOTE: In the commit to the bitcode writer, the format *may* change in the near
future. Which means that this code would also change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174849 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThe 'Raw' method cannot handle 'string' attributes. Don't even try.
Bill Wendling [Sun, 10 Feb 2013 23:18:05 +0000 (23:18 +0000)]
The 'Raw' method cannot handle 'string' attributes. Don't even try.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174848 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate with attribute group IDs.
Bill Wendling [Sun, 10 Feb 2013 23:17:10 +0000 (23:17 +0000)]
Update with attribute group IDs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174847 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEat the alignment keyword if we're in an attribute group.
Bill Wendling [Sun, 10 Feb 2013 23:15:51 +0000 (23:15 +0000)]
Eat the alignment keyword if we're in an attribute group.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174846 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd code for emitting the attribute groups.
Bill Wendling [Sun, 10 Feb 2013 23:09:32 +0000 (23:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174845 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for attribute groups in the value enumerator.
Bill Wendling [Sun, 10 Feb 2013 23:06:02 +0000 (23:06 +0000)]
Add support for attribute groups in the value enumerator.

Attribute groups are essentially all AttributeSets which are used by the
program. Enumerate them here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174844 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTest Commit - Remove some trailing whitespace in R600Instructions.td
Vincent Lejeune [Sun, 10 Feb 2013 17:57:33 +0000 (17:57 +0000)]
Test Commit - Remove some trailing whitespace in R600Instructions.td

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174839 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHandle string attributes in the AttrBuilder.
Bill Wendling [Sun, 10 Feb 2013 10:13:23 +0000 (10:13 +0000)]
Handle string attributes in the AttrBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174834 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse a 'continue' here to stop from double lexing.
Bill Wendling [Sun, 10 Feb 2013 10:12:50 +0000 (10:12 +0000)]
Use a 'continue' here to stop from double lexing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174833 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd 'empty' query methods to the builder and use them in the verifier.
Bill Wendling [Sun, 10 Feb 2013 10:12:06 +0000 (10:12 +0000)]
Add 'empty' query methods to the builder and use them in the verifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174832 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for updating LiveIntervals to PHIElimination. If LiveIntervals are
Cameron Zwarich [Sun, 10 Feb 2013 06:42:36 +0000 (06:42 +0000)]
Add support for updating LiveIntervals to PHIElimination. If LiveIntervals are
present, it currently verifies them with the MachineVerifier, and this passed
all of the test cases in 'make check' (when accounting for existing verifier
errors). There were some assertion failures in the two-address pass, but they
also happened on code without phis and look like they are caused by different
kill flags from LiveIntervals.

The only part that doesn't work is the critical edge splitting heuristic,
because there isn't currently an efficient way to update LiveIntervals after
splitting an edge. I'll probably start by implementing the slow fallback and
test that it works before tackling the fast path for single-block ranges. The
existing code that updates LiveVariables is fairly slow as it is.

There isn't a command-line option for enabling this; instead, just edit
PHIElimination.cpp to require LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174831 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a typo.
Cameron Zwarich [Sun, 10 Feb 2013 06:42:34 +0000 (06:42 +0000)]
Fix a typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174830 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove ancient references to 'atomic' phis in PHIElimination that don't really
Cameron Zwarich [Sun, 10 Feb 2013 06:42:32 +0000 (06:42 +0000)]
Remove ancient references to 'atomic' phis in PHIElimination that don't really
make sense anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174829 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake LiveVariables an instance variable of PHIElimination.
Cameron Zwarich [Sun, 10 Feb 2013 06:42:30 +0000 (06:42 +0000)]
Make LiveVariables an instance variable of PHIElimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174828 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agook, ok, stop fighting type punning warnings by just using a union.
Chris Lattner [Sun, 10 Feb 2013 06:36:29 +0000 (06:36 +0000)]
ok, ok, stop fighting type punning warnings by just using a union.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174827 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agohopefully "really" fix a type punning warning by defining the buffer as
Chris Lattner [Sun, 10 Feb 2013 06:07:16 +0000 (06:07 +0000)]
hopefully "really" fix a type punning warning by defining the buffer as
type char, which can't have TBAA tags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174826 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoattempt to defeat a gcc warning that is breaking a -Werror buildbot.
Chris Lattner [Sun, 10 Feb 2013 05:45:34 +0000 (05:45 +0000)]
attempt to defeat a gcc warning that is breaking a -Werror buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174825 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd accessor for the LLVMContext.
Bill Wendling [Sun, 10 Feb 2013 05:00:40 +0000 (05:00 +0000)]
Add accessor for the LLVMContext.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174824 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unneeded "TargetMachine.h" #includes.
Jakub Staszak [Sat, 9 Feb 2013 20:54:05 +0000 (20:54 +0000)]
Remove unneeded "TargetMachine.h" #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174817 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTEMPORARY SYNTAX CHANGE!
Bill Wendling [Sat, 9 Feb 2013 15:48:49 +0000 (15:48 +0000)]
TEMPORARY SYNTAX CHANGE!

The original syntax for the attribute groups was ambiguous. For example:

    declare void @foo() #1
    #0 = attributes { noinline }

The '#0' would be parsed as an attribute reference for '@foo' and not as a
top-level entity. In order to continue forward while waiting for a decision on
what the correct syntax is, I'm changing it to this instead:

     declare void @foo() #1
     attributes #0 = { noinline }

Repeat: This is TEMPORARY until we decide what the correct syntax should be.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174813 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a DenseMapInfo class for the AttributeSet.
Bill Wendling [Sat, 9 Feb 2013 15:42:51 +0000 (15:42 +0000)]
Add a DenseMapInfo class for the AttributeSet.

We are going to place the AttributeSet into a DenseMap during assembly writing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174812 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[NVPTX] Make address space errors more explicit (llvm_unreachable -> report_fatal_error)
Justin Holewinski [Sat, 9 Feb 2013 13:34:15 +0000 (13:34 +0000)]
[NVPTX] Make address space errors more explicit (llvm_unreachable -> report_fatal_error)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174808 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify code.
Jakub Staszak [Sat, 9 Feb 2013 13:29:31 +0000 (13:29 +0000)]
Simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174807 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unneeded #includes.
Jakub Staszak [Sat, 9 Feb 2013 13:29:10 +0000 (13:29 +0000)]
Remove unneeded #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174806 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis is the correct version of r174802.
Chris Lattner [Sat, 9 Feb 2013 07:37:59 +0000 (07:37 +0000)]
This is the correct version of r174802.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174804 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a nasty off-by one error that only manifests with 64-bit word size (which is
Chris Lattner [Sat, 9 Feb 2013 07:37:26 +0000 (07:37 +0000)]
Fix a nasty off-by one error that only manifests with 64-bit word size (which is
not enabled yet).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174803 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix the underlying problem that was causing read(0) to be called: sometimes the
Chris Lattner [Sat, 9 Feb 2013 07:07:29 +0000 (07:07 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174801 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agorecommit r173072 (preparing bitstream reader to read a machine word at a time,
Chris Lattner [Sat, 9 Feb 2013 06:52:14 +0000 (06:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174800 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove trailing spaces.
Jakub Staszak [Sat, 9 Feb 2013 01:19:12 +0000 (01:19 +0000)]
Remove trailing spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174791 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unneeded #includes.
Jakub Staszak [Sat, 9 Feb 2013 01:15:18 +0000 (01:15 +0000)]
Remove unneeded #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174790 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLSR IVChain improvement.
Andrew Trick [Sat, 9 Feb 2013 01:11:01 +0000 (01:11 +0000)]
LSR IVChain improvement.

Handle chains in which the same offset is used for both loads and
stores to the same array.

Fixes rdar://11410078.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174789 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove #includes from the commonly used LoopInfo.h.
Jakub Staszak [Sat, 9 Feb 2013 01:04:28 +0000 (01:04 +0000)]
Remove #includes from the commonly used LoopInfo.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174786 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDwarf: do not use line_table_start in at_stmt_list since we do not always emit
Manman Ren [Sat, 9 Feb 2013 00:41:44 +0000 (00:41 +0000)]
Dwarf: do not use line_table_start in at_stmt_list since we do not always emit
line table entries in assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174785 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove the old liveness algorithm.
Jakob Stoklund Olesen [Sat, 9 Feb 2013 00:04:07 +0000 (00:04 +0000)]
Remove the old liveness algorithm.

This is part of the plan to delete LiveVariables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174783 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable *BasicBlockPass::createPrinterPass()
Sergei Larin [Fri, 8 Feb 2013 23:37:41 +0000 (23:37 +0000)]
Enable *BasicBlockPass::createPrinterPass()

Enables raw_ostream I/O for BasicBlockPass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174776 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTurn on -new-live-intervals by default.
Jakob Stoklund Olesen [Fri, 8 Feb 2013 23:18:37 +0000 (23:18 +0000)]
Turn on -new-live-intervals by default.

This uses a liveness algorithm that does not depend on data from the
LiveVariables analysis, it is the first step towards removing
LiveVariables completely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174774 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCMake: Use check_symbol_exists instead of check_cxx_symbol_exists.
Jordan Rose [Fri, 8 Feb 2013 23:17:31 +0000 (23:17 +0000)]
CMake: Use check_symbol_exists instead of check_cxx_symbol_exists.

check_cxx_symbol_exists requires CMake 2.8.6, so even though I
recommended it to Owen it's probably better to stay away for now.
This check is not technically correct because we're checking <math.h>
but then using <cmath> in the actual code, but if we run into problems we
can do the same sort of dance as isinf() and isnan() where we check /both/
headers and then write a wrapper header around them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174773 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoconfigure: when performing a compiler feature test for a -Wno-foo flag, attempt
Richard Smith [Fri, 8 Feb 2013 22:55:10 +0000 (22:55 +0000)]
configure: when performing a compiler feature test for a -Wno-foo flag, attempt
to use -Wfoo instead of -Wno-foo. This works around a bug in some versions of
gcc, where it will silently accept an unknown -Wno-foo option, but will
generate an error for a compile which uses -Wno-foo if that compile also
triggers any warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174770 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReleaseNotes: Add section for R600 backend
Tom Stellard [Fri, 8 Feb 2013 22:24:41 +0000 (22:24 +0000)]
ReleaseNotes: Add section for R600 backend

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174764 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Dump the function name when TargetLowering::LowerCall() fails
Tom Stellard [Fri, 8 Feb 2013 22:24:40 +0000 (22:24 +0000)]
R600: Dump the function name when TargetLowering::LowerCall() fails

Also output a more useful error message.

NOTE: This is a candidate for the Mesa stable branch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174763 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: rework flow creation in the structurizer v2
Tom Stellard [Fri, 8 Feb 2013 22:24:38 +0000 (22:24 +0000)]
R600: rework flow creation in the structurizer v2

This fixes a couple of bugs and incorrect assumptions,
in total four more piglit tests now pass.

v2: fix small bug in the dominator updating

Patch by: Christian König

Signed-off-by: Christian König <christian.koenig@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174762 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: fix loop analyses in the structurizer
Tom Stellard [Fri, 8 Feb 2013 22:24:37 +0000 (22:24 +0000)]
R600: fix loop analyses in the structurizer

Patch by: Christian König

Intersecting loop handling was wrong.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174761 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: fix PHI value adding in the structurizer
Tom Stellard [Fri, 8 Feb 2013 22:24:35 +0000 (22:24 +0000)]
R600: fix PHI value adding in the structurizer

Otherwise we sometimes produce invalid code.

Patch by: Christian König

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174760 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMinor cleanup.
Dan Gohman [Fri, 8 Feb 2013 22:01:47 +0000 (22:01 +0000)]
Minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174756 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[docs] Tweaks for clarity, readability, and correctness.
Sean Silva [Fri, 8 Feb 2013 21:51:26 +0000 (21:51 +0000)]
[docs] Tweaks for clarity, readability, and correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174749 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>"
Bob Wilson [Fri, 8 Feb 2013 21:48:29 +0000 (21:48 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174748 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd the 16 bit version of addiu. To the assembler, the 16 and 32 bit are the
Reed Kotler [Fri, 8 Feb 2013 21:42:56 +0000 (21:42 +0000)]
Add the 16 bit version of addiu. To the assembler, the 16 and 32 bit are the
same so we put in the comment field an indicator when we think we are
emitting the 16 bit version. For the direct object emitter, the difference is
important as well as for other passes which need an accurate count of
program size. There will be other similar putbacks to this for various
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174747 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDAGCombiner: Constant folding around pre-increment loads/stores
Hal Finkel [Fri, 8 Feb 2013 21:35:47 +0000 (21:35 +0000)]
DAGCombiner: Constant folding around pre-increment loads/stores

Previously, even when a pre-increment load or store was generated,
we often needed to keep a copy of the original base register for use
with other offsets. If all of these offsets are constants (including
the offset which was combined into the addressing mode), then this is
clearly unnecessary. This change adjusts these other offsets to use the
new incremented address.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174746 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBBVectorize: Use TTI->getAddressComputationCost
Hal Finkel [Fri, 8 Feb 2013 21:13:39 +0000 (21:13 +0000)]
BBVectorize: Use TTI->getAddressComputationCost

This is a follow-up to the cost-model change in r174713 which splits
the cost of a memory operation between the address computation and the
actual memory access. In r174713, this cost is always added to the
memory operation cost, and so BBVectorize will do the same.

Currently, this new cost function is used only by ARM, and I don't
have any ARM test cases for BBVectorize. Assistance in generating some
good ARM test cases for BBVectorize would be greatly appreciated!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174743 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMore modifications to PowerPC doc links
Bill Schmidt [Fri, 8 Feb 2013 21:08:22 +0000 (21:08 +0000)]
More modifications to PowerPC doc links

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174742 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert 172027 and 174336. Remove diagnostics about over-aligned stack objects.
Bob Wilson [Fri, 8 Feb 2013 20:35:15 +0000 (20:35 +0000)]
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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174741 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate PowerPC links in CompilerWriterInfo.rst
Hal Finkel [Fri, 8 Feb 2013 20:24:46 +0000 (20:24 +0000)]
Update PowerPC links in CompilerWriterInfo.rst

This updates the current references to links that work for me.
In the future, we should update the list of references itself to provide
information on newer architecture variants.

Thanks to Sean Silva for pointing out that the current links were broken!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174739 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRefine fix to bug 15041.
Bill Schmidt [Fri, 8 Feb 2013 18:19:17 +0000 (18:19 +0000)]
Refine fix to bug 15041.

Thanks to help from Nadav and Hal, I have a more reasonable (and even
correct!) approach.  This specifically penalizes the insertelement
and extractelement operations for the performance hit that will occur
on PowerPC processors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174725 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SimplifyLibCalls] Library call simplification doen't work if the call site
Chad Rosier [Fri, 8 Feb 2013 18:00:14 +0000 (18:00 +0000)]
[SimplifyLibCalls] Library call simplification doen't work if the call site
isn't using the default calling convention.  However, if the transformation is
from a call to inline IR, then the calling convention doesn't matter.
rdar://13157990

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174724 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTypos.
Jakob Stoklund Olesen [Fri, 8 Feb 2013 17:43:32 +0000 (17:43 +0000)]
Typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174723 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThe patch to fix some issues in r174543 fixed the lines failing the test, but missed...
David Tweed [Fri, 8 Feb 2013 16:35:10 +0000 (16:35 +0000)]
The patch to fix some issues in r174543 fixed the lines failing the test, but missed a couple
of lines which weren't being explicitly looked at and were printing incorrect results. These
values clearly must lie within 32 bits, so the casts are definitely safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174717 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM cost model: Address computation in vector mem ops not free
Arnold Schwaighofer [Fri, 8 Feb 2013 14:50:48 +0000 (14:50 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174713 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate tests for DWARF parser: store sources next to pre-built object files and provi...
Alexey Samsonov [Fri, 8 Feb 2013 14:34:33 +0000 (14:34 +0000)]
Update tests for DWARF parser: store sources next to pre-built object files and provide build instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174711 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTest Commit
Michael Kuperstein [Fri, 8 Feb 2013 12:58:29 +0000 (12:58 +0000)]
Test Commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174709 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoParse the attribute group reference on a function.
Bill Wendling [Fri, 8 Feb 2013 06:32:06 +0000 (06:32 +0000)]
Parse the attribute group reference on a function.

Attribute references are of this form:

  define void @foo() #0 #1 #2 { ... }

Parse them for function attributes. If there's more than one reference, then
they are merged together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174697 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen Mips16 frames grow large, the immediate field may exceed the maximum
Reed Kotler [Fri, 8 Feb 2013 03:57:41 +0000 (03:57 +0000)]
When Mips16 frames grow large, the immediate field may exceed the maximum
allowed size for the instruction. This code uses RegScavenger to fix this.
We sometimes need 2 registers for Mips16 so we must handle things
differently than how register scavenger is normally used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174696 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Have InstCombine call SipmlifyCall when handling calls. Test case included."
Andrew Trick [Fri, 8 Feb 2013 01:55:39 +0000 (01:55 +0000)]
Revert "Have InstCombine call SipmlifyCall when handling calls. Test case included."

This reverts commit 3854a5d90fee52af1065edbed34521fff6cdc18d.

This causes a clang unit test to hang: vtable-available-externally.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174692 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[readobj] Fix memory leak.
Michael J. Spencer [Fri, 8 Feb 2013 01:05:48 +0000 (01:05 +0000)]
[readobj] Fix memory leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174687 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse ParseFnAttributeValuePairs instead of ParseOptionalFuncAttrs
Bill Wendling [Fri, 8 Feb 2013 00:52:31 +0000 (00:52 +0000)]
Use ParseFnAttributeValuePairs instead of ParseOptionalFuncAttrs

The functionality of ParseOptionalFuncAttrs was there in
ParseFnAttributeValuePairs. So just use that instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174686 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Object][ELF] Add a way to get the dynamic symbol table section.
Michael J. Spencer [Thu, 7 Feb 2013 23:37:58 +0000 (23:37 +0000)]
[Object][ELF] Add a way to get the dynamic symbol table section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174682 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Object][ELF] Add {begin,end}_elf_dynamic_symbols to non-virtually iterate over dynam...
Michael J. Spencer [Thu, 7 Feb 2013 23:37:46 +0000 (23:37 +0000)]
[Object][ELF] Add {begin,end}_elf_dynamic_symbols to non-virtually iterate over dynamic symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174681 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHave InstCombine call SipmlifyCall when handling calls. Test case included.
Michael Ilseman [Thu, 7 Feb 2013 23:01:35 +0000 (23:01 +0000)]
Have InstCombine call SipmlifyCall when handling calls. Test case included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174675 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agofix 80-col violation and fix the docs.
Nadav Rotem [Thu, 7 Feb 2013 22:34:07 +0000 (22:34 +0000)]
fix 80-col violation and fix the docs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174671 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[lit] Add a display function for lit.Test.TestResult.
Daniel Dunbar [Thu, 7 Feb 2013 21:34:34 +0000 (21:34 +0000)]
[lit] Add a display function for lit.Test.TestResult.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174667 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Make Filler a class and reduce indentation.
Akira Hatanaka [Thu, 7 Feb 2013 21:32:32 +0000 (21:32 +0000)]
[mips] Make Filler a class and reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174666 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFormatting.
Eric Christopher [Thu, 7 Feb 2013 21:19:56 +0000 (21:19 +0000)]
Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174664 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago"Clean up" line section symbol emission by emitting the section
Eric Christopher [Thu, 7 Feb 2013 21:19:50 +0000 (21:19 +0000)]
"Clean up" line section symbol emission by emitting the section
syms before constructing the compile units so we're not emitting
section references to sections not there already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174663 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[patch] bug 15055 Add Unistd.h to OProfileWrapper.cpp
Will Schmidt [Thu, 7 Feb 2013 20:43:33 +0000 (20:43 +0000)]
[patch] bug 15055 Add Unistd.h to OProfileWrapper.cpp

Add #include <unistd.h> to OProfileWrapper.cpp.   This provides the declarations for 'read' and 'close' that are otherwise missing, and result in 'error: <foo> was not declared in this scope'.

This matches the issue as reported in bug 15055 "Can no longer compile LLVM with --with-oprofile"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174661 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConstrain PowerPC autovectorization to fix bug 15041.
Bill Schmidt [Thu, 7 Feb 2013 20:33:57 +0000 (20:33 +0000)]
Constrain PowerPC autovectorization to fix bug 15041.

Certain vector operations don't vectorize well with the current
PowerPC implementation.  Element insert/extract performs poorly
without VSX support because Altivec requires going through memory.
SREM, UREM, and VSELECT all produce bad scalar code.

There's a lot of work to do for the cost model before
autovectorization will be tuned well, and this is not an attempt to
address the larger problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174660 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Add definition of JALR instruction which has two register operands. Change the
Akira Hatanaka [Thu, 7 Feb 2013 19:48:00 +0000 (19:48 +0000)]
[mips] Add definition of JALR instruction which has two register operands. Change the
original JALR instruction with one register operand to be a pseudo-instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174657 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: cleanup VGPR encoding
Tom Stellard [Thu, 7 Feb 2013 19:39:45 +0000 (19:39 +0000)]
R600/SI: cleanup VGPR encoding

Remove all the unused code.

Patch by: Christian König

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174656 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Handle VGPR64 destination in copyPhysReg().
Tom Stellard [Thu, 7 Feb 2013 19:39:43 +0000 (19:39 +0000)]
R600/SI: Handle VGPR64 destination in copyPhysReg().

Allows nexuiz to run with radeonsi.

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174655 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add pattern for mul.
Tom Stellard [Thu, 7 Feb 2013 19:39:42 +0000 (19:39 +0000)]
R600/SI: Add pattern for mul.

20 more little piglits with radeonsi.

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174654 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: simplify and fix SMRD encoding
Tom Stellard [Thu, 7 Feb 2013 19:39:40 +0000 (19:39 +0000)]
R600/SI: simplify and fix SMRD encoding

The _SGPR variants where wrong.

Patch by: Christian König

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174653 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: add proper 64bit immediate support v2
Tom Stellard [Thu, 7 Feb 2013 19:39:38 +0000 (19:39 +0000)]
R600/SI: add proper 64bit immediate support v2

v2: rebased on current upstream

Patch by: Christian König

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174652 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Add an explicit default processor
Tom Stellard [Thu, 7 Feb 2013 19:39:34 +0000 (19:39 +0000)]
R600: Add an explicit default processor

This is for the case when no processor is passed to the backend.  This
prevents the

'' is not a recognized processor for this target (ignoring processor)

warning from being generated by clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174651 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIdentify and simplify idempotent intrinsics. Test case included.
Michael Ilseman [Thu, 7 Feb 2013 19:26:05 +0000 (19:26 +0000)]
Identify and simplify idempotent intrinsics. Test case included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174650 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoop Vectorizer: Refactor Memory Cost Computation
Arnold Schwaighofer [Thu, 7 Feb 2013 19:05:21 +0000 (19:05 +0000)]
Loop Vectorizer: Refactor Memory Cost Computation

We don't want too many classes in a pass and the classes obscure the details. I
was going a little overboard with object modeling here. Replace classes by
generic code that handles both loads and stores.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174646 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoADT: Correct APInt::getActiveWords for zero values
Meador Inge [Thu, 7 Feb 2013 18:36:50 +0000 (18:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174641 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Object][ELF] Fix crash on no dynamic section.
Michael J. Spencer [Thu, 7 Feb 2013 18:26:45 +0000 (18:26 +0000)]
[Object][ELF] Fix crash on no dynamic section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174639 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Use proper instructions for array/shadow samplers.
Tom Stellard [Thu, 7 Feb 2013 17:02:14 +0000 (17:02 +0000)]
R600/SI: Use proper instructions for array/shadow samplers.

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174634 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Make sample intrinsic address parameter type overloaded.
Tom Stellard [Thu, 7 Feb 2013 17:02:13 +0000 (17:02 +0000)]
R600/SI: Make sample intrinsic address parameter type overloaded.

Handle vectors of 1 to 16 integers.

Change the intrinsic names to prevent the wrong one from being selected at
runtime due to the overloading.

Patch By: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174633 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add basic support for more integer vector types.
Tom Stellard [Thu, 7 Feb 2013 17:02:09 +0000 (17:02 +0000)]
R600/SI: Add basic support for more integer vector types.

v1i32, v2i32, v8i32 and v16i32.

Only add VGPR register classes for integer vector types, to avoid attempts
copying from VGPR to SGPR registers, which is not possible.

Patch By: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174632 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM cost model: Add costs for vector selects
Arnold Schwaighofer [Thu, 7 Feb 2013 16:10:15 +0000 (16:10 +0000)]
ARM cost model: Add costs for vector selects

Vector selects are cheap on NEON. They get lowered to a vbsl instruction.

radar://13158753

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174631 91177308-0d34-0410-b5e6-96231b3b80d8