oota-llvm.git
11 years agoDIBuilder: support structs with vtable pointers in the same way as classes
David Blaikie [Mon, 25 Feb 2013 01:07:18 +0000 (01:07 +0000)]
DIBuilder: support structs with vtable pointers in the same way as classes

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

11 years ago Make psuedo FEXT_T8I816_ins into a custom emitter.
Reed Kotler [Sun, 24 Feb 2013 23:17:51 +0000 (23:17 +0000)]
 Make psuedo FEXT_T8I816_ins into a custom emitter.

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

11 years agoFix PR14364.
Bill Schmidt [Sun, 24 Feb 2013 17:34:50 +0000 (17:34 +0000)]
Fix PR14364.

This removes a const_cast hack from PPCRegisterInfo::hasReservedSpillSlot().
The proper place to save the frame index for the CR spill slot is in the
PPCFunctionInfo object, not the PPCRegisterInfo object.

No new test cases, as this just reimplements existing function.  Existing
tests such as test/CodeGen/PowerPC/crsave.ll are sufficient.

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

11 years agoCVP: If we have a PHI with an incoming select, try to skip the select.
Benjamin Kramer [Sun, 24 Feb 2013 15:34:43 +0000 (15:34 +0000)]
CVP: If we have a PHI with an incoming select, try to skip the select.

This is a common pattern with dyn_cast and similar constructs, when the
PHI no longer depends on the select it can often be turned into a simpler
construct or even get hoisted out of the loop.

PR15340.

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

11 years agoFix invalid IR in test, missing incoming value for PHI node.
Benjamin Kramer [Sun, 24 Feb 2013 15:34:29 +0000 (15:34 +0000)]
Fix invalid IR in test, missing incoming value for PHI node.

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

11 years agoTypo
Francois Pichet [Sun, 24 Feb 2013 12:34:13 +0000 (12:34 +0000)]
Typo

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

11 years agoRevert r169638 because it broke Mesa llvmpipe tests.
Nadav Rotem [Sun, 24 Feb 2013 07:09:35 +0000 (07:09 +0000)]
Revert r169638 because it broke Mesa llvmpipe  tests.

Fix PR15239.

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

11 years agoMake psuedo FEXT_T8I816_ins a custom inserter. It should be expanded
Reed Kotler [Sun, 24 Feb 2013 06:16:39 +0000 (06:16 +0000)]
Make psuedo FEXT_T8I816_ins a custom inserter. It should be expanded
as early as possible; which means during instruction selection.

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

11 years agoAdd a use of an otherwise unused variable to remove a warning in non-Asserts
Cameron Zwarich [Sun, 24 Feb 2013 01:26:05 +0000 (01:26 +0000)]
Add a use of an otherwise unused variable to remove a warning in non-Asserts
builds.

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

11 years agoTwoAddressInstructionPass::tryInstructionTransform() only potentially returns
Cameron Zwarich [Sun, 24 Feb 2013 00:27:29 +0000 (00:27 +0000)]
TwoAddressInstructionPass::tryInstructionTransform() only potentially returns
true when shouldOnlyCommute is false, so we can remove code that checks
otherwise.

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

11 years agoTwoAddrInstructionPass::tryInstructionTransform() has a case where it calls
Cameron Zwarich [Sun, 24 Feb 2013 00:27:26 +0000 (00:27 +0000)]
TwoAddrInstructionPass::tryInstructionTransform() has a case where it calls
itself recursively with a new instruction that has not been finalized, in order
to determine whether to keep the instruction. On 'make check' and test-suite the
only cases where the recursive invocation made any transformations were simple
instruction commutations, so I am restricting the recursive invocation to do
only this.

The other cases wouldn't work correctly when updating LiveIntervals, since the
new instructions don't have slot indices and LiveIntervals hasn't yet been
updated. If the other transformations were actually triggering in any test case
it would be possible to support it with a lot of effort, but since they don't
it's not worth it.

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

11 years agoAdd new base instruction def for cmpi, cmp, slt and sltu so that def/uses
Reed Kotler [Sat, 23 Feb 2013 23:37:03 +0000 (23:37 +0000)]
Add new base instruction def for cmpi, cmp, slt and sltu so that def/uses
proper. Fixed this already a few days ago for slti.

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

11 years agoTargetInstrInfo::commuteInstruction() doesn't actually return a new instruction
Cameron Zwarich [Sat, 23 Feb 2013 23:13:28 +0000 (23:13 +0000)]
TargetInstrInfo::commuteInstruction() doesn't actually return a new instruction
unless it was requested to with an optional parameter that defaults to false, so
we don't need to handle that case in TwoAddressInstructionPass.

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

11 years agoAdd global structure vectorization to docs
Renato Golin [Sat, 23 Feb 2013 13:25:41 +0000 (13:25 +0000)]
Add global structure vectorization to docs

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

11 years agoSome more tests for the global structure vectorizer
Renato Golin [Sat, 23 Feb 2013 12:48:30 +0000 (12:48 +0000)]
Some more tests for the global structure vectorizer

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

11 years agoX86: Disable cmov-memory patterns on subtargets without cmov.
Benjamin Kramer [Sat, 23 Feb 2013 10:40:58 +0000 (10:40 +0000)]
X86: Disable cmov-memory patterns on subtargets without cmov.

Fixes PR15115.

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

11 years agoMake some fixes for LiveInterval repair with debug info. Debug value
Cameron Zwarich [Sat, 23 Feb 2013 10:25:25 +0000 (10:25 +0000)]
Make some fixes for LiveInterval repair with debug info. Debug value
MachineInstrs don't have a slot index.

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

11 years agoFix a bug with the LiveIntervals updating in the two-address pass found by
Cameron Zwarich [Sat, 23 Feb 2013 04:49:22 +0000 (04:49 +0000)]
Fix a bug with the LiveIntervals updating in the two-address pass found by
running ASCI_Purple/SMG2000 in the test-suite.

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

11 years agoMake TwoAddressInstructionPass::sink3AddrInstruction() LiveIntervals-aware.
Cameron Zwarich [Sat, 23 Feb 2013 04:49:20 +0000 (04:49 +0000)]
Make TwoAddressInstructionPass::sink3AddrInstruction() LiveIntervals-aware.

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

11 years agoMake rescheduleMIBelowKill() and rescheduleKillAboveMI() LiveIntervals-aware in
Cameron Zwarich [Sat, 23 Feb 2013 04:49:13 +0000 (04:49 +0000)]
Make rescheduleMIBelowKill() and rescheduleKillAboveMI() LiveIntervals-aware in
TwoAddressInstructionPass. The code in rescheduleMIBelowKill() is a bit tricky,
since multiple instructions need to be moved down, one-at-a-time, in reverse
order.

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

11 years agoExpand pseudos/macros for Selt. This is the last of the complex
Reed Kotler [Sat, 23 Feb 2013 03:09:56 +0000 (03:09 +0000)]
Expand pseudos/macros for Selt. This is the last of the complex
macros.The rest is some small misc. stuff.

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

11 years agoARM: Convenience aliases for 'srs*' instructions.
Jim Grosbach [Sat, 23 Feb 2013 00:52:09 +0000 (00:52 +0000)]
ARM: Convenience aliases for 'srs*' instructions.

Handle an implied 'sp' operand.

rdar://11466783

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

11 years agoFixed a careless mistake.
Michael Gottesman [Sat, 23 Feb 2013 00:31:32 +0000 (00:31 +0000)]
Fixed a careless mistake.

rdar://13273675.

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

11 years agoUse getSplitDebugFilename when constructing the skeleton cu and
Eric Christopher [Fri, 22 Feb 2013 23:50:08 +0000 (23:50 +0000)]
Use getSplitDebugFilename when constructing the skeleton cu and
update testcase accordingly to give the correct name to the cu.

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

11 years agoAdd a field to the compile unit of where we plan on splitting out
Eric Christopher [Fri, 22 Feb 2013 23:50:04 +0000 (23:50 +0000)]
Add a field to the compile unit of where we plan on splitting out
the debug info for -gsplit-dwarf so we can encode that location
in the skeleton cu.

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

11 years agoAdd a TODO and explain when we can get rid of the isMain field.
Eric Christopher [Fri, 22 Feb 2013 23:50:01 +0000 (23:50 +0000)]
Add a TODO and explain when we can get rid of the isMain field.

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

11 years agoFormatting.
Eric Christopher [Fri, 22 Feb 2013 23:49:58 +0000 (23:49 +0000)]
Formatting.

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

11 years agoSelectionDAG compile time improvement.
Nadav Rotem [Fri, 22 Feb 2013 23:33:30 +0000 (23:33 +0000)]
SelectionDAG compile time improvement.

One of the phases of SelectionDAG is LegalizeVectors. We don't need to sort the DAG and copy nodes around if there are no vector ops.

Speeds up the compilation time of SelectionDAG on a big scalar workload by ~8%.

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

11 years ago[mips] Emit call16 operator instead of got_disp. The former allows lazy binding.
Akira Hatanaka [Fri, 22 Feb 2013 21:10:03 +0000 (21:10 +0000)]
[mips] Emit call16 operator instead of got_disp. The former allows lazy binding.

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

11 years agoFix test by matching movaps instead of AVX-only vmovaps
Peter Collingbourne [Fri, 22 Feb 2013 19:53:30 +0000 (19:53 +0000)]
Fix test by matching movaps instead of AVX-only vmovaps

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

11 years agox86_64: designate most general purpose and SSE registers as callee save under coldcc
Peter Collingbourne [Fri, 22 Feb 2013 19:19:44 +0000 (19:19 +0000)]
x86_64: designate most general purpose and SSE registers as callee save under coldcc

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

11 years agoRevert "Test commit"
Peter Collingbourne [Fri, 22 Feb 2013 19:19:41 +0000 (19:19 +0000)]
Revert "Test commit"

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

11 years agoTest commit
Peter Collingbourne [Fri, 22 Feb 2013 19:18:15 +0000 (19:18 +0000)]
Test commit

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

11 years agoAn Optional<T> is pod-like if the inner type is.
Benjamin Kramer [Fri, 22 Feb 2013 18:58:26 +0000 (18:58 +0000)]
An Optional<T> is pod-like if the inner type is.

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

11 years agoRemove unused CHECK lines copied from another test
Pete Cooper [Fri, 22 Feb 2013 18:16:21 +0000 (18:16 +0000)]
Remove unused CHECK lines copied from another test

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

11 years agoMore tests to global struct vectorizer
Renato Golin [Fri, 22 Feb 2013 16:18:31 +0000 (16:18 +0000)]
More tests to global struct vectorizer

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

11 years agoMade it more explicit that the self-referential llvm.loop identifier metadata
Pekka Jaaskelainen [Fri, 22 Feb 2013 12:03:07 +0000 (12:03 +0000)]
Made it more explicit that the self-referential llvm.loop identifier metadata
should be unique for each loop.

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

11 years agoR600/SI: Add pattern for sign extension of i1 to i32.
Michel Danzer [Fri, 22 Feb 2013 11:22:58 +0000 (11:22 +0000)]
R600/SI: Add pattern for sign extension of i1 to i32.

16 more little piglits with radeonsi.

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@175887 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add pattern for logical or of i1 values.
Michel Danzer [Fri, 22 Feb 2013 11:22:54 +0000 (11:22 +0000)]
R600/SI: Add pattern for logical or of i1 values.

24 more little piglits with radeonsi.

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@175886 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add pattern for fceil.
Michel Danzer [Fri, 22 Feb 2013 11:22:49 +0000 (11:22 +0000)]
R600/SI: Add pattern for fceil.

9 more little piglits with radeonsi.

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@175885 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake ARMAsmPrinter generate the correct alignment specifier syntax in instructions.
Kristof Beyls [Fri, 22 Feb 2013 10:01:33 +0000 (10:01 +0000)]
Make ARMAsmPrinter generate the correct alignment specifier syntax in instructions.

The Printer will now print instructions with the correct alignment specifier syntax, like
    vld1.8  {d16}, [r0:64]

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

11 years agoUse references to attribute groups on the call/invoke instructions.
Bill Wendling [Fri, 22 Feb 2013 09:09:42 +0000 (09:09 +0000)]
Use references to attribute groups on the call/invoke instructions.

Listing all of the attributes for the callee of a call/invoke instruction is way
too much and makes the IR unreadable. Use references to attributes instead.

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

11 years agoFix a nomenclature mistake. Slt->Slti in the functions. The "i" refers
Reed Kotler [Fri, 22 Feb 2013 05:59:39 +0000 (05:59 +0000)]
Fix a nomenclature mistake. Slt->Slti in the functions. The "i" refers
to the immediate operand of sli or cmp function.

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

11 years agoExpand mips16 SelT form pseudso/macros.
Reed Kotler [Fri, 22 Feb 2013 05:10:51 +0000 (05:10 +0000)]
Expand mips16 SelT form pseudso/macros.

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

11 years agoFix isa<> check which could never be true.
Pete Cooper [Fri, 22 Feb 2013 01:50:38 +0000 (01:50 +0000)]
Fix isa<> check which could never be true.

It was incorrectly checking a Function* being an IntrinsicInst* which
isn't possible.  It should always have been checking the CallInst* instead.

Added test case for x86 which ensures we only get one constant load.
It was 2 before this change.

rdar://problem/13267920

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

11 years agoRemove code copied from GenRegisterInfo.inc.
Andrew Trick [Fri, 22 Feb 2013 01:15:08 +0000 (01:15 +0000)]
Remove code copied from GenRegisterInfo.inc.

There's no apparent reason this code was copied from generated source
into a .cpp. It sets a bad example for those working on other targets
and trying to understand the register info API.

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

11 years agoCode cleanup: pass Offset by pointer to parseInstruction to more explicitly
Eli Bendersky [Fri, 22 Feb 2013 00:50:48 +0000 (00:50 +0000)]
Code cleanup: pass Offset by pointer to parseInstruction to more explicitly
convey that it's a INOUT argument.
Also, if parsing of entry instructions fails, don't push the entry.

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

11 years agoRemove warning about default covering no cases.
Bill Wendling [Fri, 22 Feb 2013 00:50:09 +0000 (00:50 +0000)]
Remove warning about default covering no cases.

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

11 years agoAdd a bitmask for NoBuiltin. This should *not* be used.
Bill Wendling [Fri, 22 Feb 2013 00:40:12 +0000 (00:40 +0000)]
Add a bitmask for NoBuiltin. This should *not* be used.

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

11 years agoImplement the NoBuiltin attribute.
Bill Wendling [Fri, 22 Feb 2013 00:12:35 +0000 (00:12 +0000)]
Implement the NoBuiltin attribute.

The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should
not treat the callee function as a built-in function. I.e., it shouldn't try to
replace that function with different code.

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

11 years agoStop relying on physical register kill flags in isKilled() in the two-address
Cameron Zwarich [Thu, 21 Feb 2013 22:58:42 +0000 (22:58 +0000)]
Stop relying on physical register kill flags in isKilled() in the two-address
pass. One of the callers of isKilled() can cope with overapproximation of kills
and the other can't, so I added a flag to indicate this.

In theory this could pessimize code slightly, but in practice most physical
register uses are kills, and most important kills of physical registers are the
only uses of that register prior to register allocation, so we can recognize
them as kills even without kill flags.

This is relevant because LiveIntervals gets rid of all kill flags.

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

11 years agoPreviously, parsing capability of the .debug_frame section was added
Eli Bendersky [Thu, 21 Feb 2013 22:53:19 +0000 (22:53 +0000)]
Previously, parsing capability of the .debug_frame section was added
to lib/DebugInfo, with dumping in llvm-dwarfdump. This patch adds
initial ability to parse and dump CFA instructions contained in
entries.

To keep it manageable, the patch omits some more advanced capabilities
(accounted in TODOs):

* Parsing of instructions with BLOCK arguments (expression lists)
* Dumping of actual instruction arguments (currently only names are
dumped). This is quite tricky since the dumper has to effectively
"interpret" the instructions.

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

11 years agoLimit cast machinery to preserve const and not accept temporaries
David Blaikie [Thu, 21 Feb 2013 22:48:34 +0000 (22:48 +0000)]
Limit cast machinery to preserve const and not accept temporaries

After cleaning up the following type hierarchies:
  * TypeLoc: r175462
  * SVal: r175594
  * CFGElement: r175462
  * ProgramPoint: r175812
that all invoked undefined behavior by causing a derived copy construction of a
base object through an invalid cast (thus supporting code that relied on
casting temporaries that were direct base objects) Clang/LLVM is now clean of
casts of temporaries. So here's some fun SFINAE machinery (courtesy of Eli
Friedman, with some porting back from C++11 to LLVM's traits by me) to cause
compile-time failures if llvm::cast & friends are ever passed an rvalue.

This should avoid a repeat of anything even remotely like PR14321/r168124.

Thanks to Jordan Rose for the help with the various Static Analyzer related
hierarchies that needed cleaning up, Eli for the SFINAE, Richard Smith, John
McCall, Ted Kremenek, and Anna Zaks for their input/reviews/patience along the
way.

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

11 years agoAllow GlobalValues to vectorize with AliasAnalysis
Renato Golin [Thu, 21 Feb 2013 22:39:03 +0000 (22:39 +0000)]
Allow GlobalValues to vectorize with AliasAnalysis

Storing the load/store instructions with the values
and inspect them using Alias Analysis to make sure
they don't alias, since the GEP pointer operand doesn't
take the offset into account.

Trying hard to not add any extra cost to loads and stores
that don't overlap on global values, AA is *only* calculated
if all of the previous attempts failed.

Using biggest vector register size as the stride for the
vectorization access, as we're being conservative and
the cost model (which calculates the real vectorization
factor) is only run after the legalization phase.

We might re-think this relationship in the future, but
for now, I'd rather be safe than sorry.

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

11 years agoRe-apply r175688, with the changes suggested by Jakob in PR15320.
Lang Hames [Thu, 21 Feb 2013 22:16:43 +0000 (22:16 +0000)]
Re-apply r175688, with the changes suggested by Jakob in PR15320.

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

11 years agoRemove dead code and whitespace.
Chad Rosier [Thu, 21 Feb 2013 21:40:51 +0000 (21:40 +0000)]
Remove dead code and whitespace.

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

11 years agoClear the whole table including the tombstones, since the tombstone count will
Pedro Artigas [Thu, 21 Feb 2013 21:32:00 +0000 (21:32 +0000)]
Clear the whole table including the tombstones, since the tombstone count will
be set to zero that is what it was intended. Should improve performance of
the data structure when clear is invoked frequently (both compile time and
memory usage).

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

11 years agoMove the eliminateCallFramePseudoInstr method from TargetRegisterInfo
Eli Bendersky [Thu, 21 Feb 2013 20:05:00 +0000 (20:05 +0000)]
Move the eliminateCallFramePseudoInstr method from TargetRegisterInfo
to TargetFrameLowering, where it belongs. Incidentally, this allows us
to delete some duplicated (and slightly different!) code in TRI.

There are potentially other layering problems that can be cleaned up
as a result, or in a similar manner.

The refactoring was OK'd by Anton Korobeynikov on llvmdev.

Note: this touches the target interfaces, so out-of-tree targets may
be affected.

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

11 years agoDon't assert on empty attributes.
Bill Wendling [Thu, 21 Feb 2013 19:46:51 +0000 (19:46 +0000)]
Don't assert on empty attributes.

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

11 years agoHexagon: Expand cttz, ctlz, and ctpop for now.
Anshuman Dasgupta [Thu, 21 Feb 2013 19:39:40 +0000 (19:39 +0000)]
Hexagon: Expand cttz, ctlz, and ctpop for now.

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

11 years agoMake RAFast::UsedInInstr indexed by register units.
Jakob Stoklund Olesen [Thu, 21 Feb 2013 19:35:21 +0000 (19:35 +0000)]
Make RAFast::UsedInInstr indexed by register units.

This fixes some problems with too conservative checking where we were
marking all aliases of a register as used, and then also checking all
aliases when allocating a register.

<rdar://problem/13249625>

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

11 years agoRadar numbers don't belong in source code.
Evan Cheng [Thu, 21 Feb 2013 18:37:54 +0000 (18:37 +0000)]
Radar numbers don't belong in source code.

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

11 years agoTrivial cleanup
Bill Schmidt [Thu, 21 Feb 2013 17:26:05 +0000 (17:26 +0000)]
Trivial cleanup

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

11 years agoadd missing space which prevented the llvm.loop code-block from appearing in the
Paul Redmond [Thu, 21 Feb 2013 17:20:45 +0000 (17:20 +0000)]
add missing space which prevented the llvm.loop code-block from appearing in the
generated html.

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

11 years agoLarge code model support for PowerPC.
Bill Schmidt [Thu, 21 Feb 2013 17:12:27 +0000 (17:12 +0000)]
Large code model support for PowerPC.

Large code model is identical to medium code model except that the
addis/addi sequence for "local" accesses is never used.  All accesses
use the addis/ld sequence.

The coding changes are straightforward; most of the patch is taken up
with creating variants of the medium model tests for large model.

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

11 years agoRevert r175688 - It broke a test case (see PR15320).
Lang Hames [Thu, 21 Feb 2013 17:01:59 +0000 (17:01 +0000)]
Revert r175688 - It broke a test case (see PR15320).

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

11 years agogetX86SubSuperRegister has a special mode with High=true for i64 which
Eli Bendersky [Thu, 21 Feb 2013 16:40:18 +0000 (16:40 +0000)]
getX86SubSuperRegister has a special mode with High=true for i64 which
exists solely to enable it to call itself for i8 with some registers.
The proposed patch simplifies the function somewhat to make the High
bit only meaningful for the i8 mode, which makes sense. No functional
difference (getX86SubSuperRegister is not getting called from anywhere
outside with i64 and High=true).

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

11 years agoDAGCombiner: Make the post-legalize vector op optimization more aggressive.
Benjamin Kramer [Thu, 21 Feb 2013 15:24:35 +0000 (15:24 +0000)]
DAGCombiner: Make the post-legalize vector op optimization more aggressive.

A legal BUILD_VECTOR goes in and gets constant folded into another legal
BUILD_VECTOR so we don't lose any legality here. The problematic PPC
optimization that made this check necessary was fixed recently.

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

11 years agoR600/SI: inline V_ADD|SUB_F32 patterns
Christian Konig [Thu, 21 Feb 2013 15:17:41 +0000 (15:17 +0000)]
R600/SI: inline V_ADD|SUB_F32 patterns

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

11 years agoR600/SI: replace IMPLICIT_DEF with SIOperand.ZERO
Christian Konig [Thu, 21 Feb 2013 15:17:36 +0000 (15:17 +0000)]
R600/SI: replace IMPLICIT_DEF with SIOperand.ZERO

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

11 years agoR600/SI: replace SI_V_CNDLT with a pattern
Christian Konig [Thu, 21 Feb 2013 15:17:32 +0000 (15:17 +0000)]
R600/SI: replace SI_V_CNDLT with a pattern

It actually fixes quite a bunch of piglit tests.

This is a candidate for the mesa-stable branch.

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

11 years agoR600/SI: use patterns for clamp, fabs, fneg
Christian Konig [Thu, 21 Feb 2013 15:17:27 +0000 (15:17 +0000)]
R600/SI: use patterns for clamp, fabs, fneg

Instead of using custom inserters, it's simpler and
should make DAG folding easier.

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

11 years agoR600/SI: add all the other missing asm operands v2
Christian Konig [Thu, 21 Feb 2013 15:17:22 +0000 (15:17 +0000)]
R600/SI: add all the other missing asm operands v2

v2: put implicit parameters in []

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

11 years agoR600/SI: add the missing M*BUF|IMG asm operands
Christian Konig [Thu, 21 Feb 2013 15:17:17 +0000 (15:17 +0000)]
R600/SI: add the missing M*BUF|IMG asm operands

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

11 years agoR600/SI: add the missing S_* asm operands
Christian Konig [Thu, 21 Feb 2013 15:17:13 +0000 (15:17 +0000)]
R600/SI: add the missing S_* asm operands

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

11 years agoR600/SI: rework VOP3 classes
Christian Konig [Thu, 21 Feb 2013 15:17:09 +0000 (15:17 +0000)]
R600/SI: rework VOP3 classes

Order the classes and add asm operands.

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

11 years agoR600/SI: simplify VOPC_* pattern v2
Christian Konig [Thu, 21 Feb 2013 15:17:04 +0000 (15:17 +0000)]
R600/SI: simplify VOPC_* pattern v2

Fixing asm operation names.

v2: fix name of the e64 encoding, also add asm operands

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

11 years agoR600/SI: rework VOP2_* pattern v2
Christian Konig [Thu, 21 Feb 2013 15:16:58 +0000 (15:16 +0000)]
R600/SI: rework VOP2_* pattern v2

Fixing asm operation names.

v2: use ZERO constant, also add asm operands

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

11 years agoR600/SI: rework VOP1_* patterns v2
Christian Konig [Thu, 21 Feb 2013 15:16:53 +0000 (15:16 +0000)]
R600/SI: rework VOP1_* patterns v2

Fixing asm operation names.

v2: use ZERO constant, also add asm operands

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

11 years agoR600/SI: add constant for inline zero operand
Christian Konig [Thu, 21 Feb 2013 15:16:49 +0000 (15:16 +0000)]
R600/SI: add constant for inline zero operand

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

11 years agoR600/SI: cleanup SIInstrInfo.td and SIInstrFormat.td
Christian Konig [Thu, 21 Feb 2013 15:16:44 +0000 (15:16 +0000)]
R600/SI: cleanup SIInstrInfo.td and SIInstrFormat.td

Those two files got mixed up.

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

11 years agoR600: Fix for Unigine when MachineSched is enabled
Tom Stellard [Thu, 21 Feb 2013 15:06:59 +0000 (15:06 +0000)]
R600: Fix for Unigine when MachineSched is enabled

Fixes for-loop.cl piglit test

Patch By: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
NOTE: This is a candidate for the Mesa stable branch.

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

11 years agoCode review cleanup for r175697
Bill Schmidt [Thu, 21 Feb 2013 14:35:42 +0000 (14:35 +0000)]
Code review cleanup for r175697

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

11 years agoR600/SI: Make sure M0 is loaded for V_INTERP_MOV_F32
Michel Danzer [Thu, 21 Feb 2013 08:57:10 +0000 (08:57 +0000)]
R600/SI: Make sure M0 is loaded for V_INTERP_MOV_F32

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@175733 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't rely on the isDead() MachineOperand flag when updating LiveIntervals.
Cameron Zwarich [Thu, 21 Feb 2013 08:51:58 +0000 (08:51 +0000)]
Don't rely on the isDead() MachineOperand flag when updating LiveIntervals.

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

11 years agoUse getInterval() instead of getOrCreateInterval().
Cameron Zwarich [Thu, 21 Feb 2013 08:51:55 +0000 (08:51 +0000)]
Use getInterval() instead of getOrCreateInterval().

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

11 years agoOnly include move-related Optional<T> tests when rvalue references are available.
David Blaikie [Thu, 21 Feb 2013 07:58:45 +0000 (07:58 +0000)]
Only include move-related Optional<T> tests when rvalue references are available.

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

11 years agoAdd move ctor/assignment to Optional<T>
David Blaikie [Thu, 21 Feb 2013 07:55:39 +0000 (07:55 +0000)]
Add move ctor/assignment to Optional<T>

Code review feedback for r175580 by Jordan Rose.

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

11 years agoMake another kill check LiveIntervals-aware.
Cameron Zwarich [Thu, 21 Feb 2013 07:02:30 +0000 (07:02 +0000)]
Make another kill check LiveIntervals-aware.

This brings the number of remaining failures in 'make check' without
LiveVariables down to 39, with 1 unexpectedly passing test.

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

11 years agoSplit part of isKilled() into a separate function for use elsewhere.
Cameron Zwarich [Thu, 21 Feb 2013 07:02:28 +0000 (07:02 +0000)]
Split part of isKilled() into a separate function for use elsewhere.

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

11 years agoCorrect spelling of 'enumerator'.
David Blaikie [Thu, 21 Feb 2013 06:08:22 +0000 (06:08 +0000)]
Correct spelling of 'enumerator'.

Post commit code review feedback to r175705 from Jordan Rose.

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

11 years agoMake Optional<T>'s operator bool 'explicit' in C++11
David Blaikie [Thu, 21 Feb 2013 06:05:57 +0000 (06:05 +0000)]
Make Optional<T>'s operator bool 'explicit' in C++11

Provides a general way to add 'explicit' for conversion operators (a no-op when
compiling as C++98).

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

11 years agoUpdate isKilledAt in TwoAddressInstructionPass.cpp to use LiveIntervals when
Cameron Zwarich [Thu, 21 Feb 2013 04:33:02 +0000 (04:33 +0000)]
Update isKilledAt in TwoAddressInstructionPass.cpp to use LiveIntervals when
available.

With this commit there are no longer any assertion or verifier failures when
running 'make check' without LiveVariables. There are still 56 failing tests
with codegen differences and 1 unexpectedly passing test.

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

11 years agoExpand the sel pseudo/macro. This generates basic blocks where previously
Reed Kotler [Thu, 21 Feb 2013 04:22:38 +0000 (04:22 +0000)]
Expand the sel pseudo/macro. This generates basic blocks where previously
there were inline br .+4 instructions. Soon everything can enjoy the
full instruction scheduling experience.

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

11 years agoADT/Optional.h: Appease msvc. It reapplies r175626.
NAKAMURA Takumi [Thu, 21 Feb 2013 02:32:25 +0000 (02:32 +0000)]
ADT/Optional.h: Appease msvc. It reapplies r175626.

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

11 years ago[objdump] Add PT_PHDR.
Michael J. Spencer [Thu, 21 Feb 2013 02:21:29 +0000 (02:21 +0000)]
[objdump] Add PT_PHDR.

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

11 years agoMips specific standalone assembler addressing mode %hi and %lo.
Jack Carter [Thu, 21 Feb 2013 02:09:31 +0000 (02:09 +0000)]
Mips specific standalone assembler addressing mode %hi and %lo.

The constructs %hi() and %lo() represent the high and low 16
bits of the address.
Because the 16 bit offset field of an LW instruction is
interpreted as signed, if bit 15 of the low part is 1 then the
low part will act as a negative and 1 needs to be added to the
high part.

Contributer: Vladimir Medic

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

11 years agoPPCDAGToDAGISel::PostprocessISelDAG()
Bill Schmidt [Thu, 21 Feb 2013 00:38:25 +0000 (00:38 +0000)]
PPCDAGToDAGISel::PostprocessISelDAG()

This patch implements the PPCDAGToDAGISel::PostprocessISelDAG virtual
method to perform post-selection peephole optimizations on the DAG
representation.

One optimization is implemented here:  folds to clean up complex
addressing expressions for thread-local storage and medium code
model.  It will also be useful for large code model sequences when
those are added later.  I originally thought about doing this on the
MI representation prior to register assignment, but it's difficult to
do effective global dead code elimination at that point.  DCE is
trivial on the DAG representation.

A typical example of a candidate code sequence in assembly:

   addis 3, 2, globalvar@toc@ha
   addi  3, 3, globalvar@toc@l
   lwz   5, 0(3)

When the final instruction is a load or store with an immediate offset
of zero, the offset from the add-immediate can replace the zero,
provided the relocation information is carried along:

   addis 3, 2, globalvar@toc@ha
   lwz   5, globalvar@toc@l(3)

Since the addi can in general have multiple uses, we need to only
delete the instruction when the last use is removed.

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

11 years agoProvide a "None" value for convenience when using Optional<T>()
David Blaikie [Thu, 21 Feb 2013 00:27:28 +0000 (00:27 +0000)]
Provide a "None" value for convenience when using Optional<T>()

This implementation of NoneType/None does have some holes but I haven't
found one that doesn't - open to improvement.

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

11 years agoRelocation enablement for PPC DAG postprocessing pass
Bill Schmidt [Thu, 21 Feb 2013 00:05:29 +0000 (00:05 +0000)]
Relocation enablement for PPC DAG postprocessing pass

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