oota-llvm.git
11 years agoCheck type for legality before forming a select from loads.
Pete Cooper [Tue, 12 Feb 2013 03:14:50 +0000 (03:14 +0000)]
Check type for legality before forming a select from loads.

Sorry for the lack of a test case.  I tried writing one for i386 as i know selects are illegal on this target, but they are actually considered legal by isel and expanded later.

I can't see any targets to trigger this, but checking for the legality of a node before forming it is general goodness.

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

11 years agoARM cost model: Add vector reverse shuffle costs
Arnold Schwaighofer [Tue, 12 Feb 2013 02:40:39 +0000 (02:40 +0000)]
ARM cost model: Add vector reverse shuffle costs

A reverse shuffle is lowered to a vrev and possibly a vext instruction (quad
word).

radar://13171406

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

11 years agoCost model: Add check for reverse shuffles to CostModel analysis
Arnold Schwaighofer [Tue, 12 Feb 2013 02:40:37 +0000 (02:40 +0000)]
Cost model: Add check for reverse shuffles to CostModel analysis

Check for reverse shuffles in the CostModel analysis pass and query
TargetTransform info accordingly. This allows us we can write test cases for
reverse shuffles.

radar://13171406

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

11 years agoARM NEON: Handle v16i8 and v8i16 reverse shuffles
Arnold Schwaighofer [Tue, 12 Feb 2013 01:58:32 +0000 (01:58 +0000)]
ARM NEON: Handle v16i8 and v8i16 reverse shuffles

Lower reverse shuffles to a vrev64 and a vext instruction instead of the default
legalization of storing and loading to the stack. This is important because we
generate reverse shuffles in the loop vectorizer when we reverse store to an
array.

  uint8_t Arr[N];
  for (i = 0; i < N; ++i)
    Arr[N - i - 1] = ...

radar://13171760

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

11 years agoUpdate error message due to previous commit, r174926.
Chad Rosier [Tue, 12 Feb 2013 01:12:24 +0000 (01:12 +0000)]
Update error message due to previous commit, r174926.

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

11 years ago[ms-inline asm] Add support for lexing hexidecimal integers with a [hH] suffix.
Chad Rosier [Tue, 12 Feb 2013 01:00:01 +0000 (01:00 +0000)]
[ms-inline asm] Add support for lexing hexidecimal integers with a [hH] suffix.
Part of rdar://12470373

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

11 years agoDIBuilder: make the return type of createBasicType more specific
David Blaikie [Tue, 12 Feb 2013 00:40:41 +0000 (00:40 +0000)]
DIBuilder: make the return type of createBasicType more specific

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

11 years agoAdded 0x0D to 2-byte opcode extension table for prefetch* variants
Kay Tiong Khoo [Tue, 12 Feb 2013 00:19:12 +0000 (00:19 +0000)]
Added 0x0D to 2-byte opcode extension table for prefetch* variants
Fixed decode of existing 3dNow prefetchw instruction
Intel is scheduled to add a compatible prefetchw (same encoding) to future CPUs

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

11 years agoBBVectorize: Don't over-search when building the dependency map
Hal Finkel [Mon, 11 Feb 2013 23:02:17 +0000 (23:02 +0000)]
BBVectorize: Don't over-search when building the dependency map

When building the pairable-instruction dependency map, don't search
past the last pairable instruction. For large blocks that have been
divided into multiple instruction groups, searching past the last
instruction in each group is very wasteful. This gives a 32% speedup
on the csa.ll test case from PR15222 (when using 50 instructions
in each group).

No functionality change intended.

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

11 years agoBBVectorize: Omit unnecessary entries in PairableInstUsers
Hal Finkel [Mon, 11 Feb 2013 23:02:09 +0000 (23:02 +0000)]
BBVectorize: Omit unnecessary entries in PairableInstUsers

This map is queried only for instructions in pairs of pairable
instructions; so make sure that only pairs of pairable
instructions are added to the map. This gives a 3.5% speedup
on the csa.ll test case from PR15222.

No functionality change intended.

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

11 years ago[Support][Compiler] Add LLVM_HAS_VARIADIC_TEMPLATES.
Michael J. Spencer [Mon, 11 Feb 2013 22:51:07 +0000 (22:51 +0000)]
[Support][Compiler] Add LLVM_HAS_VARIADIC_TEMPLATES.

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

11 years ago[mips] Expand pseudo instructions before they are emitted in
Akira Hatanaka [Mon, 11 Feb 2013 22:35:40 +0000 (22:35 +0000)]
[mips] Expand pseudo instructions before they are emitted in
MipsCodeEmitter.cpp.

JALR and NOP are expanded by function emitPseudoExpansionLowering, which is not
called when the old JIT is used.

This fixes the following tests which have been failing on
llvm-mips-linux builder:

LLVM :: ExecutionEngine__2003-01-04-LoopTest.ll
LLVM :: ExecutionEngine__2003-05-06-LivenessClobber.ll
LLVM :: ExecutionEngine__2003-06-04-bzip2-bug.ll
LLVM :: ExecutionEngine__2005-12-02-TailCallBug.ll
LLVM :: ExecutionEngine__2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
LLVM :: ExecutionEngine__hello2.ll
LLVM :: ExecutionEngine__stubs.ll
LLVM :: ExecutionEngine__test-branch.ll
LLVM :: ExecutionEngine__test-call.ll
LLVM :: ExecutionEngine__test-common-symbols.ll
LLVM :: ExecutionEngine__test-loadstore.ll
LLVM :: ExecutionEngine__test-loop.ll

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

11 years agoRename AttributeSets to AttributeGroups so that it's more meaningful.
Bill Wendling [Mon, 11 Feb 2013 22:33:26 +0000 (22:33 +0000)]
Rename AttributeSets to AttributeGroups so that it's more meaningful.

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

11 years agoUse a std::map so that we record the group ID.
Bill Wendling [Mon, 11 Feb 2013 22:32:29 +0000 (22:32 +0000)]
Use a std::map so that we record the group ID.

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

11 years agoRename to something more sensible. No functionality change.
Bill Wendling [Mon, 11 Feb 2013 22:31:34 +0000 (22:31 +0000)]
Rename to something more sensible. No functionality change.

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

11 years ago[mips] Fix indentation.
Akira Hatanaka [Mon, 11 Feb 2013 22:03:52 +0000 (22:03 +0000)]
[mips] Fix indentation.

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

11 years agoOptimization: bitcast (<1 x ...> insertelement ..., X, ...) to ... ==> bitcast X...
Michael Ilseman [Mon, 11 Feb 2013 21:41:44 +0000 (21:41 +0000)]
Optimization: bitcast (<1 x ...> insertelement ..., X, ...) to ... ==> bitcast X to ...

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

11 years agoExtend Hexagon hardware loop generation to handle various additional cases:
Krzysztof Parzyszek [Mon, 11 Feb 2013 21:37:55 +0000 (21:37 +0000)]
Extend Hexagon hardware loop generation to handle various additional cases:
- variety of compare instructions,
- loops with no preheader,
- arbitrary lower and upper bounds.

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

11 years agoRemove trailing whitespace
Michael Ilseman [Mon, 11 Feb 2013 21:36:49 +0000 (21:36 +0000)]
Remove trailing whitespace

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

11 years agoImplement HexagonInstrInfo::analyzeCompare.
Krzysztof Parzyszek [Mon, 11 Feb 2013 20:04:29 +0000 (20:04 +0000)]
Implement HexagonInstrInfo::analyzeCompare.

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

11 years ago*fixed disassembly of some i386 system insts with intel syntax
Kay Tiong Khoo [Mon, 11 Feb 2013 19:46:36 +0000 (19:46 +0000)]
*fixed disassembly of some i386 system insts with intel syntax
*added file for test cases for i386 intel syntax

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

11 years ago[NVPTX] Remove NoCapture from address space conversion intrinsics. NoCapture is not...
Justin Holewinski [Mon, 11 Feb 2013 18:56:35 +0000 (18:56 +0000)]
[NVPTX] Remove NoCapture from address space conversion intrinsics. NoCapture is not valid in this case, and was causing incorrect optimizations.

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

11 years agoBBVectorize: Eliminate one more restricted linear search
Hal Finkel [Mon, 11 Feb 2013 17:19:34 +0000 (17:19 +0000)]
BBVectorize: Eliminate one more restricted linear search

This eliminates one more linear search over a range of
std::multimap entries. This gives a 22% speedup on the
csa.ll test case from PR15222.

No functionality change intended.

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

11 years agoAArch64: generate dwarfdump test rather than include .o in subversion
Tim Northover [Mon, 11 Feb 2013 16:28:12 +0000 (16:28 +0000)]
AArch64: generate dwarfdump test rather than include .o in subversion

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

11 years agoR600/SI: Use V_ADD_F32 instead of V_MOV_B32 for clamp/neg/abs modifiers.
Michel Danzer [Mon, 11 Feb 2013 15:58:21 +0000 (15:58 +0000)]
R600/SI: Use V_ADD_F32 instead of V_MOV_B32 for clamp/neg/abs modifiers.

The modifiers don't seem to have any effect with V_MOV_B32, supposedly it's
meant to just move bits untouched.

Fixes 46 piglit tests with radeonsi, though unfortunately 11 of those had
just regressed because they started using the clamp modifier.

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174890 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[asan] added a flag -mllvm asan-short-64bit-mapping-offset=1 (0 by default)
Kostya Serebryany [Mon, 11 Feb 2013 14:36:01 +0000 (14:36 +0000)]
[asan] added a flag -mllvm asan-short-64bit-mapping-offset=1 (0 by default)
This flag makes asan use a small (<2G) offset for 64-bit asan shadow mapping.
On x86_64 this saves us a register, thus achieving ~2/3 of the
zero-base-offset's benefits in both performance and code size.

Thanks Jakub Jelinek for the idea.

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

11 years agoAArch64: fix build on some MSVC versions
Tim Northover [Mon, 11 Feb 2013 14:25:52 +0000 (14:25 +0000)]
AArch64: fix build on some MSVC versions

This does two things:

It removes a call to abs() which may have "long long" parameter on Windows,
which is not necessarily available in C++03.

It also corrects the signedness of Amount, which was relying on
implementation-defined conversions previously.

Code was already tested (albeit in an implemnetation defined way) so no extra
tests.

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

11 years agoRestore the resurrected doc link previously deleted
Bill Schmidt [Mon, 11 Feb 2013 14:14:32 +0000 (14:14 +0000)]
Restore the resurrected doc link previously deleted

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

11 years agoRemove a dead PowerPC doc link
Bill Schmidt [Mon, 11 Feb 2013 13:16:30 +0000 (13:16 +0000)]
Remove a dead PowerPC doc link

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

11 years agoAArch64: Simplify logic in deciding whether bfi is valid
Tim Northover [Mon, 11 Feb 2013 12:32:18 +0000 (12:32 +0000)]
AArch64: Simplify logic in deciding whether bfi is valid

Previous code had a confusing comment which was mostly an implementation
detail. This condition corresponds to "lsb up to register width" and "width not
ridiculous".

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

11 years agoAArch64: Add basic relocation processing for llvm-dwarfdump.
Tim Northover [Mon, 11 Feb 2013 11:16:02 +0000 (11:16 +0000)]
AArch64: Add basic relocation processing for llvm-dwarfdump.

This allows llvm-dwarfdump to handle the relocations needed, at least
for LLVM-produced code.

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

11 years agoAArch64: Undo change to how test was run
Tim Northover [Mon, 11 Feb 2013 10:51:41 +0000 (10:51 +0000)]
AArch64: Undo change to how test was run

This broke on Windows, presumably due to interleaving of output streams.

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

11 years agoMake use of DiagnosticType to provide better AArch64 diagnostics.
Tim Northover [Mon, 11 Feb 2013 09:29:37 +0000 (09:29 +0000)]
Make use of DiagnosticType to provide better AArch64 diagnostics.

This gives a DiagnosticType to all AsmOperands in sight. This replaces all
"invalid operand" diagnostics with something more specific. The messages given
should still be sufficiently vague that they're not usually actively misleading
when LLVM guesses your instruction incorrectly.

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

11 years agoAdd support for updating LiveIntervals to MachineBasicBlock::SplitCriticalEdge().
Cameron Zwarich [Mon, 11 Feb 2013 09:24:47 +0000 (09:24 +0000)]
Add support for updating LiveIntervals to MachineBasicBlock::SplitCriticalEdge().
This is currently a bit hairier than it needs to be, since depending on where the
split block resides the end ListEntry of the split block may be the end ListEntry
of the original block or a new entry. Some changes to the SlotIndexes updating
should make it possible to eliminate the two cases here.

This also isn't as optimized as it could be. In the future Liveinterval should
probably get a flag that indicates whether the LiveInterval is within a single
basic block. We could ignore all such intervals when splitting an edge.

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

11 years agoUpdate SlotIndexes after updateTerminator() possibly removes instructions. I am
Cameron Zwarich [Mon, 11 Feb 2013 09:24:45 +0000 (09:24 +0000)]
Update SlotIndexes after updateTerminator() possibly removes instructions. I am
really trying to avoid piping SlotIndexes through to RemoveBranch() and friends.

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

11 years agoFix some problems with the updating of SlotIndexes after adding a new MBB. In
Cameron Zwarich [Mon, 11 Feb 2013 09:24:42 +0000 (09:24 +0000)]
Fix some problems with the updating of SlotIndexes after adding a new MBB. In
particular, holes were being left between two blocks after splitting an edge.

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

11 years agoAdd support for printing out the attribute groups.
Bill Wendling [Mon, 11 Feb 2013 08:43:33 +0000 (08:43 +0000)]
Add support for printing out the attribute groups.

This emits the attribute groups that are used by the functions. (It currently
doesn't print out return type or parameter attributes within attribute groups.)

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

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

11 years agoFileCheck-ize the tests.
Bill Wendling [Mon, 11 Feb 2013 08:34:57 +0000 (08:34 +0000)]
FileCheck-ize the tests.

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

11 years ago[tsan/msan] adding thread_safety and uninitialized_checks attributes
Kostya Serebryany [Mon, 11 Feb 2013 08:13:54 +0000 (08:13 +0000)]
[tsan/msan] adding thread_safety and uninitialized_checks attributes

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

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