oota-llvm.git
11 years agoChange the codegen Cost Model API for shuffeles. This patch removes the API for broad...
Nadav Rotem [Mon, 24 Dec 2012 08:57:47 +0000 (08:57 +0000)]
Change the codegen Cost Model API for shuffeles. This patch removes the API for broadcast and adds a more general API that accepts an enum of known shuffles.

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

11 years agoFix typo in comments
Alexey Samsonov [Mon, 24 Dec 2012 08:52:53 +0000 (08:52 +0000)]
Fix typo in comments

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

11 years agoUpdate the docs of the cost model.
Nadav Rotem [Mon, 24 Dec 2012 05:51:12 +0000 (05:51 +0000)]
Update the docs of the cost model.

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

11 years agollvm/MC/MCMachObjectWriter.h: ComputeSymbolTable(): Prune one description in the...
NAKAMURA Takumi [Mon, 24 Dec 2012 01:24:04 +0000 (01:24 +0000)]
llvm/MC/MCMachObjectWriter.h: ComputeSymbolTable(): Prune one description in the comment. [-Wdocumentation]

/// \param StringIndexMap [out] - Map from symbol names to offsets in the string table.

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

11 years agoLoopVectorizer: Fix an endless loop in the code that looks for reductions.
Nadav Rotem [Mon, 24 Dec 2012 01:22:06 +0000 (01:22 +0000)]
LoopVectorizer: Fix an endless loop in the code that looks for reductions.
The bug was in the code that detects PHIs in if-then-else block sequence.

PR14701.

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

11 years agoDocumentation: fix typos reported in PR13866
Dmitri Gribenko [Sun, 23 Dec 2012 18:46:11 +0000 (18:46 +0000)]
Documentation: fix typos reported in PR13866

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

11 years agoCostModel: Change the default target-independent implementation for finding
Nadav Rotem [Sun, 23 Dec 2012 17:31:23 +0000 (17:31 +0000)]
CostModel: Change the default target-independent implementation for finding
the cost of arithmetic functions. We now assume that the cost of arithmetic
operations that are marked as Legal or Promote is low, but ops that are
marked as custom are higher.

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

11 years agoLoopVectorize: Fix accidentaly inverted condition.
Benjamin Kramer [Sun, 23 Dec 2012 13:21:41 +0000 (13:21 +0000)]
LoopVectorize: Fix accidentaly inverted condition.

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

11 years agoLoopVectorize: For scalars and void types there is no need to compute vector insert...
Benjamin Kramer [Sun, 23 Dec 2012 13:19:18 +0000 (13:19 +0000)]
LoopVectorize: For scalars and void types there is no need to compute vector insert/extract costs.

Fixes an assert during the build of oggenc in the test suite.

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

11 years agoWe are not ready to estimate the cost of integer expansions based on the number of...
Nadav Rotem [Sun, 23 Dec 2012 09:11:07 +0000 (09:11 +0000)]
We are not ready to estimate the cost of integer expansions based on the number of parts. This test is too noisy.

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

11 years agodocs: Add link to external LLVM backend tutorial.
Sean Silva [Sun, 23 Dec 2012 07:34:51 +0000 (07:34 +0000)]
docs: Add link to external LLVM backend tutorial.

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

11 years agowhitespace
Nadav Rotem [Sun, 23 Dec 2012 07:33:44 +0000 (07:33 +0000)]
whitespace

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

11 years agoRename a function.
Nadav Rotem [Sun, 23 Dec 2012 07:30:09 +0000 (07:30 +0000)]
Rename a function.

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

11 years agoLoop Vectorizer: Update the cost model of scatter/gather operations and make
Nadav Rotem [Sun, 23 Dec 2012 07:23:55 +0000 (07:23 +0000)]
Loop Vectorizer: Update the cost model of scatter/gather operations and make
them more expensive.

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

11 years agoRemove trailing whitespace.
Craig Topper [Sat, 22 Dec 2012 19:15:35 +0000 (19:15 +0000)]
Remove trailing whitespace.

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

11 years agoRemove trailing whitespace
Craig Topper [Sat, 22 Dec 2012 18:09:02 +0000 (18:09 +0000)]
Remove trailing whitespace

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

11 years agoRemove a special case that doesn't seem necessary any longer.
Jakob Stoklund Olesen [Sat, 22 Dec 2012 17:33:22 +0000 (17:33 +0000)]
Remove a special case that doesn't seem necessary any longer.

Back when this exception was added, it was skipping a lot more code, but
now it just looks like a premature optimization.

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

11 years agoUse getNumOperands() instead of Operands.size().
Jakob Stoklund Olesen [Sat, 22 Dec 2012 17:13:06 +0000 (17:13 +0000)]
Use getNumOperands() instead of Operands.size().

The representation of the Operands array is going to change soon so it
can be allocated from a BumpPtrAllocator.

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

11 years agoX86: Turn mul of <4 x i32> into pmuludq when no SSE4.1 is available.
Benjamin Kramer [Sat, 22 Dec 2012 16:07:56 +0000 (16:07 +0000)]
X86: Turn mul of <4 x i32> into pmuludq when no SSE4.1 is available.

pmuludq is slow, but it turns out that all the unpacking and packing of the
scalarized mul is even slower. 10% speedup on loop-vectorized paq8p.

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

11 years agoX86: Emit vector sext as shuffle + sra if vpmovsx is not available.
Benjamin Kramer [Sat, 22 Dec 2012 11:34:28 +0000 (11:34 +0000)]
X86: Emit vector sext as shuffle + sra if vpmovsx is not available.

Also loosen the SSSE3 dependency a bit, expanded pshufb + psra is still better
than scalarized loads. Fixes PR14590.

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

11 years agoAdd a comma to fix the build.
Craig Topper [Sat, 22 Dec 2012 08:22:01 +0000 (08:22 +0000)]
Add a comma to fix the build.

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

11 years agoUse a negative value to represent INVALID_SIMPLE_VALUE_TYPE instead of 256. Its much...
Craig Topper [Sat, 22 Dec 2012 08:16:17 +0000 (08:16 +0000)]
Use a negative value to represent INVALID_SIMPLE_VALUE_TYPE instead of 256. Its much cheaper for the isSimple() checks to look for values less than 0 rather than a value greater than 255. This shaves ~8k off the size of the llc binary on x86-64.

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

11 years agoAdd vAny and Metadata to the switch in getSizeInBits for consistency since every...
Craig Topper [Sat, 22 Dec 2012 03:08:37 +0000 (03:08 +0000)]
Add vAny and Metadata to the switch in getSizeInBits for consistency since every other enum was listed.

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

11 years ago[utils] Tweak utils/clang-parse-diagnostics-file to ignore autoconf diagnostics.
Daniel Dunbar [Sat, 22 Dec 2012 00:47:06 +0000 (00:47 +0000)]
[utils] Tweak utils/clang-parse-diagnostics-file to ignore autoconf diagnostics.
 - Also, don't print headers if we aren't going to print any diagnostics.

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

11 years agoChange 'AttrVal' to 'AttrKind' to better reflect that it's a kind of attribute instea...
Bill Wendling [Sat, 22 Dec 2012 00:37:52 +0000 (00:37 +0000)]
Change 'AttrVal' to 'AttrKind' to better reflect that it's a kind of attribute instead of the value of the attribute.

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

11 years agoFix some undefined behavior when parsing YAML input: don't try to compare an
Richard Smith [Sat, 22 Dec 2012 00:31:54 +0000 (00:31 +0000)]
Fix some undefined behavior when parsing YAML input: don't try to compare an
uninitialized value against a default value. Found by -fsanitize=enum.

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

11 years agoDon't call back() on an empty SmallVector. Found by -fsanitize=enum!
Richard Smith [Sat, 22 Dec 2012 00:15:13 +0000 (00:15 +0000)]
Don't call back() on an empty SmallVector. Found by -fsanitize=enum!

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

11 years agoIn some cases, due to scheduling constraints we copy the EFLAGS.
Nadav Rotem [Fri, 21 Dec 2012 23:48:49 +0000 (23:48 +0000)]
In some cases, due to scheduling constraints we copy the EFLAGS.
The only way to read the eflags is using push and pop. If we don't
adjust the stack then we run over the first frame index. This is
not something that we want to do, so we have to make sure that
our machine function does not copy the flags. If it does then
we have to emit the prolog that adjusts the stack.

rdar://12896831

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

11 years ago[mips] Refactor subword-swap, EXT/INS, load-effective-address and read-hardware
Akira Hatanaka [Fri, 21 Dec 2012 23:21:32 +0000 (23:21 +0000)]
[mips] Refactor subword-swap, EXT/INS, load-effective-address and read-hardware
instructions.

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

11 years ago[mips] Refactor SYNC and multiply/divide instructions.
Akira Hatanaka [Fri, 21 Dec 2012 23:17:36 +0000 (23:17 +0000)]
[mips] Refactor SYNC and multiply/divide instructions.

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

11 years ago[mips] Refactor BAL instructions.
Akira Hatanaka [Fri, 21 Dec 2012 23:15:59 +0000 (23:15 +0000)]
[mips] Refactor BAL instructions.

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

11 years ago[mips] Fix encoding of BAL instruction. Also, fix assembler test case which
Akira Hatanaka [Fri, 21 Dec 2012 23:13:59 +0000 (23:13 +0000)]
[mips] Fix encoding of BAL instruction. Also, fix assembler test case which
was not catching the error.

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

11 years ago[mips] Refactor jump, jump register, jump-and-link and nop instructions.
Akira Hatanaka [Fri, 21 Dec 2012 23:03:50 +0000 (23:03 +0000)]
[mips] Refactor jump, jump register, jump-and-link and nop instructions.

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

11 years ago[mips] Refactor load/store left/right and load-link and store-conditional
Akira Hatanaka [Fri, 21 Dec 2012 23:01:24 +0000 (23:01 +0000)]
[mips] Refactor load/store left/right and load-link and store-conditional
instructions.

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

11 years ago[mips] Refactor load/store instructions.
Akira Hatanaka [Fri, 21 Dec 2012 22:58:55 +0000 (22:58 +0000)]
[mips] Refactor load/store instructions.

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

11 years ago[mips] Remove unnecessary isPseudo parameter.
Akira Hatanaka [Fri, 21 Dec 2012 22:57:26 +0000 (22:57 +0000)]
[mips] Remove unnecessary isPseudo parameter.

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

11 years ago[mips] Refactor LUI instruction.
Akira Hatanaka [Fri, 21 Dec 2012 22:46:07 +0000 (22:46 +0000)]
[mips] Refactor LUI instruction.

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

11 years ago[mips] Refactor count leading zero or one instructions.
Akira Hatanaka [Fri, 21 Dec 2012 22:43:58 +0000 (22:43 +0000)]
[mips] Refactor count leading zero or one instructions.

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

11 years ago[mips] Refactor sign-extension-in-register instructions.
Akira Hatanaka [Fri, 21 Dec 2012 22:41:52 +0000 (22:41 +0000)]
[mips] Refactor sign-extension-in-register instructions.

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

11 years ago[mips] Refactor instructions which copy from and to HI/LO registers.
Akira Hatanaka [Fri, 21 Dec 2012 22:39:17 +0000 (22:39 +0000)]
[mips] Refactor instructions which copy from and to HI/LO registers.

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

11 years ago[mips] Refactor logical NOR instructions.
Akira Hatanaka [Fri, 21 Dec 2012 22:35:47 +0000 (22:35 +0000)]
[mips] Refactor logical NOR instructions.

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

11 years ago[mips] Move instruction definitions in MipsInstrInfo.td.
Akira Hatanaka [Fri, 21 Dec 2012 22:33:43 +0000 (22:33 +0000)]
[mips] Move instruction definitions in MipsInstrInfo.td.

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

11 years agoR600: Coding style - remove empty spaces from the beginning of functions
Tom Stellard [Fri, 21 Dec 2012 20:12:02 +0000 (20:12 +0000)]
R600: Coding style - remove empty spaces from the beginning of functions

No functionality change.

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

11 years agoR600: Fix MAX_UINT definition
Tom Stellard [Fri, 21 Dec 2012 20:12:01 +0000 (20:12 +0000)]
R600: Fix MAX_UINT definition

Patch by: Vadim Girlin

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

11 years agoR600: Add SHADOWCUBE to TEX_SHADOW pattern
Tom Stellard [Fri, 21 Dec 2012 20:11:59 +0000 (20:11 +0000)]
R600: Add SHADOWCUBE to TEX_SHADOW pattern

Patch by: Vadim Girlin

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

11 years agoCleanup compiler warnings on discarding type qualifiers in casts. Switch to C++ style...
Benjamin Kramer [Fri, 21 Dec 2012 19:09:53 +0000 (19:09 +0000)]
Cleanup compiler warnings on discarding type qualifiers in casts. Switch to C++ style casts.

Patch by Saleem Abdulrasool!

Differential Revision: http://llvm-reviews.chandlerc.com/D204

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

11 years agoAdd a missing assertion, the null register has no register units.
Jakob Stoklund Olesen [Fri, 21 Dec 2012 18:38:09 +0000 (18:38 +0000)]
Add a missing assertion, the null register has no register units.

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

11 years agotry to unbreak ppc buildbots.
Benjamin Kramer [Fri, 21 Dec 2012 18:11:45 +0000 (18:11 +0000)]
try to unbreak ppc buildbots.

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

11 years agoTeach sort_includes.py to drop duplicated includes.
Benjamin Kramer [Fri, 21 Dec 2012 18:00:08 +0000 (18:00 +0000)]
Teach sort_includes.py to drop duplicated includes.

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

11 years agoX86: Match pmin/pmax as a target specific dag combine. This occurs during vectorization.
Benjamin Kramer [Fri, 21 Dec 2012 17:46:58 +0000 (17:46 +0000)]
X86: Match pmin/pmax as a target specific dag combine. This occurs during vectorization.

Part of PR14667.

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

11 years agoRemove duplicate includes.
Roman Divacky [Fri, 21 Dec 2012 17:06:44 +0000 (17:06 +0000)]
Remove duplicate includes.

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

11 years agoR600: Expand vec4 INT <-> FP conversions
Tom Stellard [Fri, 21 Dec 2012 16:33:24 +0000 (16:33 +0000)]
R600: Expand vec4 INT <-> FP conversions

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

11 years agoX86: Match the SSE/AVX min/max vector ops using a custom node instead of intrinsics
Benjamin Kramer [Fri, 21 Dec 2012 14:04:55 +0000 (14:04 +0000)]
X86: Match the SSE/AVX min/max vector ops using a custom node instead of intrinsics

This is very mechanical, no functionality change. Preparation for PR14667.

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

11 years agoTest that a landingpad gets the name provided when it was created (see commit
Duncan Sands [Fri, 21 Dec 2012 12:03:03 +0000 (12:03 +0000)]
Test that a landingpad gets the name provided when it was created (see commit
170318).

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

11 years ago[msan] Remove unreachable blocks before instrumenting a function.
Evgeniy Stepanov [Fri, 21 Dec 2012 11:18:49 +0000 (11:18 +0000)]
[msan] Remove unreachable blocks before instrumenting a function.

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

11 years agoAdd a missing "virtual" keyword.
Nadav Rotem [Fri, 21 Dec 2012 05:02:12 +0000 (05:02 +0000)]
Add a missing "virtual" keyword.

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

11 years agoEnable if-conversion.
Nadav Rotem [Fri, 21 Dec 2012 04:47:54 +0000 (04:47 +0000)]
Enable if-conversion.

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

11 years agoAdd ARM cortex-r5 subtarget.
Quentin Colombet [Fri, 21 Dec 2012 04:35:05 +0000 (04:35 +0000)]
Add ARM cortex-r5 subtarget.

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

11 years agoDon't skip __DWARF,
Rafael Espindola [Fri, 21 Dec 2012 04:08:03 +0000 (04:08 +0000)]
Don't skip __DWARF,

Now that we don't merge section and segment names, we don't need to skip the
segment name to get to the section name.

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

11 years agoAdd a function to get the segment name of a section.
Rafael Espindola [Fri, 21 Dec 2012 03:47:03 +0000 (03:47 +0000)]
Add a function to get the segment name of a section.

On MachO, sections also have segment names. When a tool looking at a .o file
prints a segment name, this is what they mean. In reality, a .o has only one
anonymous, segment.

This patch adds a MachO only function to fetch that segment name. I named it
getSectionFinalSegmentName since the main use for the name seems to be inform
the linker with segment this section should go to.

The patch also changes MachOObjectFile::getSectionName to return just the
section name instead of computing SegmentName,SectionName.

The main difference from the previous patch is that it doesn't use
InMemoryStruct. It is extremely dangerous: if the endians match it returns
a pointer to the file buffer, if not, it returns a pointer to an internal buffer
that is overwritten in the next API call.

We should change all of this code to use
support::detail::packed_endian_specific_integral like ELF, but since these
functions only handle strings, they work with big and little endian machines
as is.

I have tested this by installing ubuntu 12.10 ppc on qemu, that is why it took
so long :-)

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

11 years agoAdd targets to skip running the GC passes.
Evan Cheng [Fri, 21 Dec 2012 02:57:04 +0000 (02:57 +0000)]
Add targets to skip running the GC passes.

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

11 years agoEvery pass deserves a name, even codegenprep.
Evan Cheng [Fri, 21 Dec 2012 01:48:14 +0000 (01:48 +0000)]
Every pass deserves a name, even codegenprep.

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

11 years agoImprove the X86 cost model for loads and stores.
Nadav Rotem [Fri, 21 Dec 2012 01:33:59 +0000 (01:33 +0000)]
Improve the X86 cost model for loads and stores.

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

11 years agoBB-Vectorizer: Check the cost of the store pointer type
Nadav Rotem [Fri, 21 Dec 2012 01:24:36 +0000 (01:24 +0000)]
BB-Vectorizer: Check the cost of the store pointer type
and not the return type, which is void. A number of test
cases fail after adding the assertion in TTImpl.

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

11 years agoAdd test case for r170674
Reed Kotler [Fri, 21 Dec 2012 00:55:10 +0000 (00:55 +0000)]
Add test case for r170674

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

11 years agoCall llvm_unreachable instead of assert.
Reed Kotler [Fri, 21 Dec 2012 00:44:59 +0000 (00:44 +0000)]
Call llvm_unreachable instead of assert.

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

11 years agodocs: More robust image scaling fix.
Sean Silva [Fri, 21 Dec 2012 00:28:42 +0000 (00:28 +0000)]
docs: More robust image scaling fix.

Hopefully these benchmarks will be updated in the future, so avoid
hardcoding image dimensions.

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

11 years agodocs: Prevent image scaling.
Sean Silva [Fri, 21 Dec 2012 00:20:25 +0000 (00:20 +0000)]
docs: Prevent image scaling.

Tell the image to be its natural size.

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

11 years agoFix a bug in the code that checks if we can vectorize loops while using dynamic
Nadav Rotem [Fri, 21 Dec 2012 00:07:35 +0000 (00:07 +0000)]
Fix a bug in the code that checks if we can vectorize loops while using dynamic
memory bound checks.  Before the fix we were able to vectorize this loop from
the Livermore Loops benchmark:

for ( k=1 ; k<n ; k++ )
  x[k] = x[k-1] + y[k];

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

11 years agoMove these files over to the debug info directory.
Eric Christopher [Fri, 21 Dec 2012 00:03:42 +0000 (00:03 +0000)]
Move these files over to the debug info directory.

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

11 years agodocs: Try out nosidebar.
Sean Silva [Thu, 20 Dec 2012 23:35:22 +0000 (23:35 +0000)]
docs: Try out nosidebar.

Please squawk if you find this appalling or otherwise don't like it.

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

11 years agodocs: Cleanup trailing whitespace.
Sean Silva [Thu, 20 Dec 2012 22:59:36 +0000 (22:59 +0000)]
docs: Cleanup trailing whitespace.

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

11 years agoRequire the two-argument MI::addOperand(MF, MO) for dangling instructions.
Jakob Stoklund Olesen [Thu, 20 Dec 2012 22:54:05 +0000 (22:54 +0000)]
Require the two-argument MI::addOperand(MF, MO) for dangling instructions.

Instructions that are inserted in a basic block can still be decorated
with addOperand(MO).

Make the two-argument addOperand() function contain the actual
implementation. This function will now always have a valid MF reference
that it can use for memory allocation.

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

11 years agoAdd an MF argument to MI::copyImplicitOps().
Jakob Stoklund Olesen [Thu, 20 Dec 2012 22:54:02 +0000 (22:54 +0000)]
Add an MF argument to MI::copyImplicitOps().

This function is often used to decorate dangling instructions, so a
context reference is required to allocate memory for the operands.

Also add a corresponding MachineInstrBuilder method.

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

11 years agoUse two-arg addOperand(MF, MO) internally in MachineInstr when possible.
Jakob Stoklund Olesen [Thu, 20 Dec 2012 22:53:58 +0000 (22:53 +0000)]
Use two-arg addOperand(MF, MO) internally in MachineInstr when possible.

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

11 years agoMachineInstrBuilderize ARM.
Jakob Stoklund Olesen [Thu, 20 Dec 2012 22:53:55 +0000 (22:53 +0000)]
MachineInstrBuilderize ARM.

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

11 years agoMachineInstrBuilderize NVPTX.
Jakob Stoklund Olesen [Thu, 20 Dec 2012 22:53:53 +0000 (22:53 +0000)]
MachineInstrBuilderize NVPTX.

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

11 years agoFix an unitialized member variable that may have caused sporadic failures
Eli Bendersky [Thu, 20 Dec 2012 22:51:52 +0000 (22:51 +0000)]
Fix an unitialized member variable that may have caused sporadic failures
for code that wasn't even in bundling mode.

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

11 years agodocs: actually indent these consistently
Sean Silva [Thu, 20 Dec 2012 22:49:13 +0000 (22:49 +0000)]
docs: actually indent these consistently

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

11 years agodocs: Indent consistently in code examples.
Sean Silva [Thu, 20 Dec 2012 22:47:41 +0000 (22:47 +0000)]
docs: Indent consistently in code examples.

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

11 years agodocs: Improve navigation for Vectorizers.rst
Sean Silva [Thu, 20 Dec 2012 22:42:20 +0000 (22:42 +0000)]
docs: Improve navigation for Vectorizers.rst

Add links in the intro paragraph.
Add table of contents.

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

11 years agodocs: bring back link for reddit.
Sean Silva [Thu, 20 Dec 2012 22:24:37 +0000 (22:24 +0000)]
docs: bring back link for reddit.

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

11 years agoWhitespace and 80-column cleanup.
Eric Christopher [Thu, 20 Dec 2012 21:58:40 +0000 (21:58 +0000)]
Whitespace and 80-column cleanup.

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

11 years agoStart splitting out the debug string section handling by moving it
Eric Christopher [Thu, 20 Dec 2012 21:58:36 +0000 (21:58 +0000)]
Start splitting out the debug string section handling by moving it
into the DwarfUnits class.

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

11 years agodocs: Make document name congruent with title.
Sean Silva [Thu, 20 Dec 2012 21:50:41 +0000 (21:50 +0000)]
docs: Make document name congruent with title.

Hopefully nobody has linked to it yet...

OK'd by Nadav.

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

11 years agoSome random comment, naming, and format changes.
Bill Wendling [Thu, 20 Dec 2012 21:28:43 +0000 (21:28 +0000)]
Some random comment, naming, and format changes.

Rename the AttributeImpl* from Attrs to pImpl to be consistent with other code.
Add comments where none were before. Or doxygen-ify other comments.

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

11 years agoRemove two dead functions.
Jakob Stoklund Olesen [Thu, 20 Dec 2012 21:12:42 +0000 (21:12 +0000)]
Remove two dead functions.

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

11 years agoRevert "Adding support for llvm.arm.neon.vaddl[su].* and"
Bob Wilson [Thu, 20 Dec 2012 21:09:38 +0000 (21:09 +0000)]
Revert "Adding support for llvm.arm.neon.vaddl[su].* and"

This reverts r170694.  The operations can be represented in IR without
adding any new intrinsics.

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

11 years agoLoopVectorize: Fix a bug in the scalarization of instructions.
Nadav Rotem [Thu, 20 Dec 2012 20:24:40 +0000 (20:24 +0000)]
LoopVectorize: Fix a bug in the scalarization of instructions.
Before if-conversion we could check if a value is loop invariant
if it was declared inside the basic block. Now that loops have
multiple blocks this check is incorrect.

This fixes External/SPEC/CINT95/099_go/099_go

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

11 years agoOn some ARM cpus, flags setting movs with shifter operand, i.e. lsl, lsr, asr,
Evan Cheng [Thu, 20 Dec 2012 19:59:30 +0000 (19:59 +0000)]
On some ARM cpus, flags setting movs with shifter operand, i.e. lsl, lsr, asr,
are more expensive than the non-flag setting variant. Teach thumb2 size
reduction pass to avoid generating them unless we are optimizing for size.

rdar://12892707

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

11 years agoChange Lit error redirection to FileCheck to a more common syntax since it
Eli Bendersky [Thu, 20 Dec 2012 19:54:02 +0000 (19:54 +0000)]
Change Lit error redirection to FileCheck to a more common syntax since it
can potentially cause some bots to fail.

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

11 years agoAdd a largish auto-generated test for the aligned bundling feature, along with
Eli Bendersky [Thu, 20 Dec 2012 19:16:57 +0000 (19:16 +0000)]
Add a largish auto-generated test for the aligned bundling feature, along with
the script generating it. The test should never be modified manually. If anyone
needs to change it, please change the script and re-run it.

The script is placed into utils/testgen - I couldn't think of a better place,
and after some discussion on IRC this looked like a logical location.

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

11 years agoTests for the aligned bundling support added in r170718
Eli Bendersky [Thu, 20 Dec 2012 19:07:30 +0000 (19:07 +0000)]
Tests for the aligned bundling support added in r170718

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

11 years agoAligned bundling support. Following the discussion here:
Eli Bendersky [Thu, 20 Dec 2012 19:05:53 +0000 (19:05 +0000)]
Aligned bundling support. Following the discussion here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056754.html

The proposal and implementation are fully documented here:
https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/aligned-bundling-support-in-llvm

Tests will follow shortly.

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

11 years agoUse MachineInstrBuilder for PHI nodes in SelectionDAGISel.
Jakob Stoklund Olesen [Thu, 20 Dec 2012 18:46:29 +0000 (18:46 +0000)]
Use MachineInstrBuilder for PHI nodes in SelectionDAGISel.

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

11 years agoFix inadvertant delete of 'has'.
Jim Grosbach [Thu, 20 Dec 2012 18:09:48 +0000 (18:09 +0000)]
Fix inadvertant delete of 'has'.

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

11 years agoUse MachineInstrBuilder in InstrEmitter.
Jakob Stoklund Olesen [Thu, 20 Dec 2012 18:08:09 +0000 (18:08 +0000)]
Use MachineInstrBuilder in InstrEmitter.

This is supposed to be a mechanical change with no functional effects.

InstrEmitter can generate all types of MachineOperands which revealed
that MachineInstrBuilder was missing a few methods, added by this patch.

Besides providing a context pointer to MI::addOperand(),
MachineInstrBuilder seems like a better fit for this code.

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

11 years agoUse MachineInstrBuilder in a few CodeGen passes.
Jakob Stoklund Olesen [Thu, 20 Dec 2012 18:08:06 +0000 (18:08 +0000)]
Use MachineInstrBuilder in a few CodeGen passes.

This automatically passes a context pointer to MI->addOperand().

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

11 years agoSimplify the testcase a bit.
Rafael Espindola [Thu, 20 Dec 2012 17:47:27 +0000 (17:47 +0000)]
Simplify the testcase a bit.

I checked that it would still crash llc before the corresponding fix.

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

11 years agoLoop Vectorizer: turn-off if-conversion.
Nadav Rotem [Thu, 20 Dec 2012 17:42:53 +0000 (17:42 +0000)]
Loop Vectorizer: turn-off if-conversion.

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