oota-llvm.git
11 years agoDAGCombiner: Use correct value type for checking legality of BR_CC v3
Tom Stellard [Fri, 8 Mar 2013 15:36:57 +0000 (15:36 +0000)]
DAGCombiner: Use correct value type for checking legality of BR_CC v3

LegalizeDAG.cpp uses the value of the comparison operands when checking
the legality of BR_CC, so DAGCombiner should do the same.

v2:
  - Expand more BR_CC value types for NVPTX

v3:
  - Expand correct BR_CC value types for Hexagon, Mips, and XCore.

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

11 years agoR600: Change addresspace in fold-kcache.ll
Vincent Lejeune [Fri, 8 Mar 2013 15:34:07 +0000 (15:34 +0000)]
R600: Change addresspace in fold-kcache.ll

AddressSpace definition has changed in a previous commit, reflect it
to avoid false failure.

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

11 years agoAArch64: specify full triple in test as only Linux works for now.
Tim Northover [Fri, 8 Mar 2013 15:27:30 +0000 (15:27 +0000)]
AArch64: specify full triple in test as only Linux works for now.

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

11 years agoR600/SI: adjust test to recent changes
Christian Konig [Fri, 8 Mar 2013 14:44:00 +0000 (14:44 +0000)]
R600/SI: adjust test to recent changes

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

11 years agoHexagon: Add patterns for zero extended loads from i1->i64.
Jyotsna Verma [Fri, 8 Mar 2013 14:15:15 +0000 (14:15 +0000)]
Hexagon: Add patterns for zero extended loads from i1->i64.

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

11 years agoAArch64: expand sincos operations, we don't support them.
Tim Northover [Fri, 8 Mar 2013 13:55:07 +0000 (13:55 +0000)]
AArch64: expand sincos operations, we don't support them.

Patch based on Mans Rullgard's.

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

11 years agoR600/SI: Use source scheduler
Michel Danzer [Fri, 8 Mar 2013 10:58:01 +0000 (10:58 +0000)]
R600/SI: Use source scheduler

This is certainly not the last word on scheduling for this target, but
right now this allows a few apps to run / finish with radeonsi, most
notably UT2004 / Lightsmark. They fail to compile some shaders with the
default scheduler because it ends up trying to spill registers, which
we don't support yet (and which is probably a bad idea in general for
performance if it can be avoided).

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

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

11 years agoAdd -verify-misched option.
Andrew Trick [Fri, 8 Mar 2013 05:40:34 +0000 (05:40 +0000)]
Add -verify-misched option.

This verifies live intervals both before and after scheduling. It's
useful for anyone hacking on live interval update.

Note that we don't yet pass verification all the time. We don't yet
handle updating nonallocatable live intervals perfectly.

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

11 years agoAnother test fix for r176671.
David Blaikie [Fri, 8 Mar 2013 02:27:40 +0000 (02:27 +0000)]
Another test fix for r176671.

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

11 years agoCouple of test fixes for r176671.
David Blaikie [Fri, 8 Mar 2013 02:26:16 +0000 (02:26 +0000)]
Couple of test fixes for r176671.

Not sure why these aren't failing on my linux machine, but this should cover
it.

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

11 years agoRevert r176154 in favor of a better approach.
Bill Wendling [Fri, 8 Mar 2013 02:21:08 +0000 (02:21 +0000)]
Revert r176154 in favor of a better approach.

Code generation makes some basic assumptions about the IR it's been given. In
particular, if there is only one 'invoke' in the function, then that invoke
won't be going away. However, with the advent of the `llvm.donothing' intrinsic,
those invokes may go away. If all of them go away, the landing pad no longer has
any users. This confuses the back-end, which asserts.

This happens with SjLj exceptions, because that's the model that modifies the IR
based on there being invokes, etc. in the function.

Remove any invokes of `llvm.donothing' during SjLj EH preparation. This will
give us a CFG that the back-end won't be confused about. If all of the invokes
in a function are removed, then the SjLj EH prepare pass won't insert the bogus
code the relies upon the invokes being there.
<rdar://problem/13228754&13316637>

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

11 years agoremove an ancient and quaint bit of commented out makefile goo from when
Chris Lattner [Fri, 8 Mar 2013 01:26:10 +0000 (01:26 +0000)]
remove an ancient and quaint bit of commented out makefile goo from when
GCC was the system compiler on the mac.

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

11 years agoUpgrade tests to the latest debug info format.
David Blaikie [Fri, 8 Mar 2013 00:23:31 +0000 (00:23 +0000)]
Upgrade tests to the latest debug info format.

Mostly this is just changing the named metadata (llvm.dbg.sp, llvm.dbg.gv,
llvm.dbg.<func>.lv, etc -> llvm.dbg.cu), adding a few fields to older records
(DIVariable: flags/inlined-at, DICompileUnit: sp/gv/types,
DISubprogram: local variables list)

The tests to update were discovered by a change I'm working on to remove debug
info version support - so any tests using old debug info versions I haven't
updated probably are bad tests or just not actually designed to test debug
info.

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

11 years agoAdd a getPassName() method.
Jakob Stoklund Olesen [Thu, 7 Mar 2013 23:55:51 +0000 (23:55 +0000)]
Add a getPassName() method.

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

11 years agoRename isEarlierInSameTrace to isUsefulDominator.
Jakob Stoklund Olesen [Thu, 7 Mar 2013 23:55:49 +0000 (23:55 +0000)]
Rename isEarlierInSameTrace to isUsefulDominator.

In very rare cases caused by irreducible control flow, the dominating
block can have the same trace head without actually being part of the
trace.

As long as such a dominator still has valid instruction depths, it is OK
to use it for computing instruction depths.

Rename the function to avoid lying, and add a check that instruction
depths are computed for the dominator.

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

11 years agoKeep coding stanard.
Jakub Staszak [Thu, 7 Mar 2013 22:20:06 +0000 (22:20 +0000)]
Keep coding stanard.

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

11 years agoDon't create IRBuilder if we can return from the method earlier.
Jakub Staszak [Thu, 7 Mar 2013 22:10:33 +0000 (22:10 +0000)]
Don't create IRBuilder if we can return from the method earlier.

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

11 years ago[fast-isel] Seriously, add support for the expect intrinsic.
Chad Rosier [Thu, 7 Mar 2013 21:38:33 +0000 (21:38 +0000)]
[fast-isel] Seriously, add support for the expect intrinsic.
rdar://13370942

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

11 years agoFix tautological compare. Not sure why this didn't trigger any test failures.
Benjamin Kramer [Thu, 7 Mar 2013 20:56:18 +0000 (20:56 +0000)]
Fix tautological compare. Not sure why this didn't trigger any test failures.

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

11 years agoReplace temporary vectors with arrays.
Benjamin Kramer [Thu, 7 Mar 2013 20:53:34 +0000 (20:53 +0000)]
Replace temporary vectors with arrays.

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

11 years ago[fast-isel] Add support for the expect intrinsic.
Chad Rosier [Thu, 7 Mar 2013 20:42:17 +0000 (20:42 +0000)]
[fast-isel] Add support for the expect intrinsic.
rdar://13370942

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

11 years agoArrayRefize some code. No functionality change.
Benjamin Kramer [Thu, 7 Mar 2013 20:33:29 +0000 (20:33 +0000)]
ArrayRefize some code. No functionality change.

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

11 years agoHexagon: Handle i8, i16 and i1 Var Args.
Jyotsna Verma [Thu, 7 Mar 2013 20:28:34 +0000 (20:28 +0000)]
Hexagon: Handle i8, i16 and i1 Var Args.

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

11 years agoSimplify code. No functionality change.
Jakub Staszak [Thu, 7 Mar 2013 20:22:39 +0000 (20:22 +0000)]
Simplify code. No functionality change.

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

11 years agoChange Index type from unsigned long to unsigned. This should fix PR14980.
Jakub Staszak [Thu, 7 Mar 2013 20:21:27 +0000 (20:21 +0000)]
Change Index type from unsigned long to unsigned. This should fix PR14980.

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

11 years agoRemove trailing spaces.
Jakub Staszak [Thu, 7 Mar 2013 20:04:17 +0000 (20:04 +0000)]
Remove trailing spaces.

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

11 years agoChange NULL to 0.
Jakub Staszak [Thu, 7 Mar 2013 20:01:47 +0000 (20:01 +0000)]
Change NULL to 0.

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

11 years agoArrayRef ca accept one element. Simplify code a little bit, also it matches now
Jakub Staszak [Thu, 7 Mar 2013 20:01:19 +0000 (20:01 +0000)]
ArrayRef ca accept one element. Simplify code a little bit, also it matches now
coding in the other places of the file.

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

11 years agopre-RA-sched debug-only fix
Andrew Trick [Thu, 7 Mar 2013 19:21:08 +0000 (19:21 +0000)]
pre-RA-sched debug-only fix

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

11 years agoHexagon: Add support to lower block address.
Jyotsna Verma [Thu, 7 Mar 2013 19:10:28 +0000 (19:10 +0000)]
Hexagon: Add support to lower block address.

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

11 years agopre-RA-sched assertion fix. This bug was exposed by r176037.
Andrew Trick [Thu, 7 Mar 2013 19:07:57 +0000 (19:07 +0000)]
pre-RA-sched assertion fix. This bug was exposed by r176037.

rdar:13370002 [pre-RA-sched] assertion: released too many times

I tracked this down to an earlier hack that is no longer applicable
and interfered with normal scheduler logic. With the changes in
r176037, it was causing an instruction to be scheduled multiple times.

I have an external test case that I tried hard to reduce and
failed. I can't even reproduce with llc.

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

11 years agoMove testcase, this is testing extraction not inserting.
Benjamin Kramer [Thu, 7 Mar 2013 18:51:02 +0000 (18:51 +0000)]
Move testcase, this is testing extraction not inserting.

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

11 years agoX86: Fold EXTRACT_SUBVECTORs of a BUILD_VECTOR into a smaller BUILD_VECTOR.
Benjamin Kramer [Thu, 7 Mar 2013 18:48:40 +0000 (18:48 +0000)]
X86: Fold EXTRACT_SUBVECTORs of a BUILD_VECTOR into a smaller BUILD_VECTOR.

That can usually be lowered efficiently and is common in sandybridge code.
It would be nice to do this in DAGCombiner but we can't insert arbitrary
BUILD_VECTORs this late.

Fixes PR15462.

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

11 years agoFixed a crash when cloning a function into a function with
Pekka Jaaskelainen [Thu, 7 Mar 2013 16:46:43 +0000 (16:46 +0000)]
Fixed a crash when cloning a function into a function with
different size argument list and without attributes in the
arguments.

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

11 years agoR600/SI: rework input interpolation v2
Christian Konig [Thu, 7 Mar 2013 09:04:14 +0000 (09:04 +0000)]
R600/SI: rework input interpolation v2

v2: update CMakeLists.txt as well

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

11 years agoR600/SI: remove SI_vs_load_buffer_index
Christian Konig [Thu, 7 Mar 2013 09:04:04 +0000 (09:04 +0000)]
R600/SI: remove SI_vs_load_buffer_index

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

11 years agoR600/SI: remove SGPR address space v2
Christian Konig [Thu, 7 Mar 2013 09:03:59 +0000 (09:03 +0000)]
R600/SI: remove SGPR address space v2

v2: fix R600 regressions

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

11 years agoR600/SI: add proper formal parameter handling for SI
Christian Konig [Thu, 7 Mar 2013 09:03:52 +0000 (09:03 +0000)]
R600/SI: add proper formal parameter handling for SI

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

11 years agoR600/SI: remove shader type intrinsic
Christian Konig [Thu, 7 Mar 2013 09:03:46 +0000 (09:03 +0000)]
R600/SI: remove shader type intrinsic

Just encode the type as target specific attribute.

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

11 years agoR600/SI: switch types of SGPRs to v*i8
Christian Konig [Thu, 7 Mar 2013 09:03:38 +0000 (09:03 +0000)]
R600/SI: switch types of SGPRs to v*i8

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

11 years agoR600/SI: fix unused variable warning
Christian Konig [Thu, 7 Mar 2013 09:03:30 +0000 (09:03 +0000)]
R600/SI: fix unused variable warning

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

11 years agoSwitch from a version 4.2/4.4 switch to a four-byte version string to be put
Nick Lewycky [Thu, 7 Mar 2013 08:28:49 +0000 (08:28 +0000)]
Switch from a version 4.2/4.4 switch to a four-byte version string to be put
into the actual gcov file.

Instead of using the bottom 4 bytes as the function identifier, use a counter.
This makes the identifier numbers stable across multiple runs.

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

11 years agoNo need to go through int64 and APInt when generating a new constant.
Nadav Rotem [Thu, 7 Mar 2013 06:34:49 +0000 (06:34 +0000)]
No need to go through int64 and APInt when generating a new constant.

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

11 years agoSDAG: Handle scalarizing an extend of a <1 x iN> vector.
Jim Grosbach [Thu, 7 Mar 2013 05:47:54 +0000 (05:47 +0000)]
SDAG: Handle scalarizing an extend of a <1 x iN> vector.

Just scalarize the element and rebuild a vector of the result type
from that.

rdar://13281568

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

11 years agoRemove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and
Nick Lewycky [Thu, 7 Mar 2013 02:03:08 +0000 (02:03 +0000)]
Remove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and
is the one that should be used.

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

11 years agoDebug Info: store the files and directories for each compile unit.
Manman Ren [Thu, 7 Mar 2013 01:42:00 +0000 (01:42 +0000)]
Debug Info: store the files and directories for each compile unit.

We now emit a line table for each compile unit. To reduce the prologue size
of each line table, the files and directories used by each compile unit are
stored in std::map<unsigned, std::vector< > > instead of std::vector< >.

The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each
compile unit causes a huge increase of debug info. With this patch, each
prologue will only emit the files required by the compile unit.

rdar://problem/13342023

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

11 years agoArrayRef has a OneElt constructor. Beautify the code.
Nadav Rotem [Thu, 7 Mar 2013 01:38:04 +0000 (01:38 +0000)]
ArrayRef has a OneElt constructor. Beautify the code.

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

11 years agoSwitch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.
Nadav Rotem [Thu, 7 Mar 2013 01:30:40 +0000 (01:30 +0000)]
Switch from std::vector to ArrayRef. Speedup FoldBitCast by 5x.

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

11 years agoSimplifyCFG fix for volatile load/store.
Andrew Trick [Thu, 7 Mar 2013 01:03:35 +0000 (01:03 +0000)]
SimplifyCFG fix for volatile load/store.

Fixes rdar:13349374.

Volatile loads and stores need to be preserved even if the language
standard says they are undefined. "volatile" in this context means "get
out of the way compiler, let my platform handle it".

Additionally, this is the only way I know of with llvm to write to the
first page (when hardware allows) without dropping to assembly.

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

11 years agoFix two remaining issue after fixing PR15355 when CMOV is not available
Michael Liao [Thu, 7 Mar 2013 01:01:29 +0000 (01:01 +0000)]
Fix two remaining issue after fixing PR15355 when CMOV is not available

- Phi nodes should be replaced/updated after lowering CMOV into branch
  because 'mainMBB' updating operand in Phi node is changed.
- Add EFLAGS in livein before lowering the 2nd CMOV. It's necessary as
  we will reuse the EFLAGS generated before the 1st lowered CMOV, which
  won't clobber EFLAGS. However, we need explicitly specify that.
- '-attr=-cmov' test case are added.

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

11 years ago[mips] Custom-legalize BR_JT.
Akira Hatanaka [Wed, 6 Mar 2013 21:32:03 +0000 (21:32 +0000)]
[mips] Custom-legalize BR_JT.

In N64-static, GOT address is needed to compute the branch address.

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

11 years agoGeneralize my previous fix for -print-options.
Andrew Trick [Wed, 6 Mar 2013 19:04:56 +0000 (19:04 +0000)]
Generalize my previous fix for -print-options.

Always print options that differ from their implicit default. At least
for simple option types.

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

11 years agoRemove tailing whitespaces
Michael Liao [Wed, 6 Mar 2013 18:24:34 +0000 (18:24 +0000)]
Remove tailing whitespaces

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

11 years agoGive -loop-vectorize an explicit default.
Andrew Trick [Wed, 6 Mar 2013 18:22:22 +0000 (18:22 +0000)]
Give -loop-vectorize an explicit default.

This way, clang -mllvm -print-options shows that the driver is overriding it.

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

11 years agoMemory Dependence Analysis (not mem-dep test) take advantage of "invariant.load"...
Shuxin Yang [Wed, 6 Mar 2013 17:48:48 +0000 (17:48 +0000)]
Memory Dependence Analysis (not mem-dep test) take advantage of "invariant.load" metadata.

The "invariant.load" metadata indicates the memory unit being accessed is immutable.
A load annotated with this metadata can be moved across any store.

As I am not sure if it is legal to move such loads across barrier/fence, this
change dose not allow such transformation.

rdar://11311484

Thank Arnold for code review.

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

11 years agoInstCombine: Don't shrink allocas when combining with a bitcast.
Jim Grosbach [Wed, 6 Mar 2013 05:44:53 +0000 (05:44 +0000)]
InstCombine: Don't shrink allocas when combining with a bitcast.

When considering folding a bitcast of an alloca into the alloca itself,
make sure we don't shrink the amount of memory being allocated, or
things rapidly go sideways.

rdar://13324424

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

11 years ago[mips] Add a line which checks function name. Rename file.
Akira Hatanaka [Wed, 6 Mar 2013 01:58:03 +0000 (01:58 +0000)]
[mips] Add a line which checks function name. Rename file.

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

11 years agoFix PR15355
Michael Liao [Wed, 6 Mar 2013 00:17:04 +0000 (00:17 +0000)]
Fix PR15355

- Clear 'mayStore' flag when loading from the atomic variable before the
  spin loop
- Clear kill flag from one use to multiple use in registers forming the
  address to that atomic variable
- don't use a physical register as live-in register in BB (neither entry
  nor landing pad.) by copying it into virtual register

(patch by Cameron Zwarich)

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

11 years agoUse dyn_cast instead of isa && cast. No functionality change.
Jakub Staszak [Wed, 6 Mar 2013 00:16:16 +0000 (00:16 +0000)]
Use dyn_cast instead of isa && cast. No functionality change.

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

11 years agoRemove duplicated forward declaration.
Jakub Staszak [Wed, 6 Mar 2013 00:04:32 +0000 (00:04 +0000)]
Remove duplicated forward declaration.

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

11 years ago[mips] Remove android calling convention.
Akira Hatanaka [Tue, 5 Mar 2013 23:22:30 +0000 (23:22 +0000)]
[mips] Remove android calling convention.

This calling convention was added just to handle functions which return vector
of floats. The fix committed in r165585 solves the problem.

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

11 years ago[mips] Fix MipsCC::analyzeReturn so that, in soft-float mode, fp128 gets
Akira Hatanaka [Tue, 5 Mar 2013 22:54:59 +0000 (22:54 +0000)]
[mips] Fix MipsCC::analyzeReturn so that, in soft-float mode, fp128 gets
returned in registers $2 and $4.

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

11 years ago[mips] Fix MipsTargetLowering::LowerCallResult and LowerReturn to correctly
Akira Hatanaka [Tue, 5 Mar 2013 22:41:55 +0000 (22:41 +0000)]
[mips] Fix MipsTargetLowering::LowerCallResult and LowerReturn to correctly
handle fp128 returns.

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

11 years ago[mips] Fix MipsTargetLowering::LowerCall to pass fp128 arguments in floating
Akira Hatanaka [Tue, 5 Mar 2013 22:20:28 +0000 (22:20 +0000)]
[mips] Fix MipsTargetLowering::LowerCall to pass fp128 arguments in floating
point registers.

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

11 years ago[mips] Correct handling of fp128 (long double) formals and read long double
Akira Hatanaka [Tue, 5 Mar 2013 22:13:04 +0000 (22:13 +0000)]
[mips] Correct handling of fp128 (long double) formals and read long double
parameters from floating point registers if target is mips64 hard float.

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

11 years agoFix a few typos in comments.
Jakub Staszak [Tue, 5 Mar 2013 22:05:16 +0000 (22:05 +0000)]
Fix a few typos in comments.

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

11 years agoAdd some constantness.
Jakub Staszak [Tue, 5 Mar 2013 22:01:15 +0000 (22:01 +0000)]
Add some constantness.

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

11 years agostd::distance() == 0 means that iterators are equal. No functionality change.
Jakub Staszak [Tue, 5 Mar 2013 21:53:57 +0000 (21:53 +0000)]
std::distance() == 0 means that iterators are equal. No functionality change.

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

11 years agoAdd more functions to the TLI.
Meador Inge [Tue, 5 Mar 2013 21:47:40 +0000 (21:47 +0000)]
Add more functions to the TLI.

This patch adds many more functions to the target library information.
All of the functions being added were discovered while doing the migration
of the simplify-libcalls attribute annotation functionality to the
functionattrs pass.  As a part of that work the attribute annotation logic
will query TLI to determine if a function should be annotated or not.

Signed-off-by: Meador Inge <meadori@codesourcery.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176514 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoreverting patch 176508.
Jyotsna Verma [Tue, 5 Mar 2013 20:29:23 +0000 (20:29 +0000)]
reverting patch 176508.

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

11 years agoHexagon: Add support for lowering block address.
Jyotsna Verma [Tue, 5 Mar 2013 19:37:46 +0000 (19:37 +0000)]
Hexagon: Add support for lowering block address.

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

11 years agoR600: Do not predicate vector op
Vincent Lejeune [Tue, 5 Mar 2013 19:12:06 +0000 (19:12 +0000)]
R600: Do not predicate vector op

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

11 years agoHexagon: Expand addc, adde, subc and sube.
Jyotsna Verma [Tue, 5 Mar 2013 19:04:47 +0000 (19:04 +0000)]
Hexagon: Expand addc, adde, subc and sube.

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

11 years agoUse the right number of slashes in comment string
Arnold Schwaighofer [Tue, 5 Mar 2013 19:04:12 +0000 (19:04 +0000)]
Use the right number of slashes in comment string

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

11 years agoFixes a test by replacing .align by .p2align and setting triples explicitly.
Eli Bendersky [Tue, 5 Mar 2013 18:56:14 +0000 (18:56 +0000)]
Fixes a test by replacing .align by .p2align and setting triples explicitly.

Patch by David Sehr

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

11 years agoUpdate cmake build.
Benjamin Kramer [Tue, 5 Mar 2013 18:54:05 +0000 (18:54 +0000)]
Update cmake build.

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

11 years agoHexagon: Use MO operand flags to mark constant extended instructions.
Jyotsna Verma [Tue, 5 Mar 2013 18:51:42 +0000 (18:51 +0000)]
Hexagon: Use MO operand flags to mark constant extended instructions.

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

11 years agoHexagon: Add encoding bits to the TFR64 instructions.
Jyotsna Verma [Tue, 5 Mar 2013 18:42:28 +0000 (18:42 +0000)]
Hexagon: Add encoding bits to the TFR64 instructions.
Set imMoveImm, isAsCheapAsAMove flags for TFRI instructions.

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

11 years agoR600: initial scheduler code
Vincent Lejeune [Tue, 5 Mar 2013 18:41:32 +0000 (18:41 +0000)]
R600: initial scheduler code

This is a skeleton for a pre-RA MachineInstr scheduler strategy. Currently
it only tries to expose more parallelism for ALU instructions (this also
makes the distribution of GPR channels more uniform and increases the
chances of ALU instructions to be packed together in a single VLIW group).
Also it tries to reduce clause switching by grouping instruction of the
same kind (ALU/FETCH/CF) together.

Vincent Lejeune:
 - Support for VLIW4 Slot assignement
 - Recomputation of ScheduleDAG to get more parallelism opportunities

Tom Stellard:
 - Fix assertion failure when trying to determine an instruction's slot
   based on its destination register's class
 - Fix some compiler warnings

Vincent Lejeune: [v2]
 - Remove recomputation of ScheduleDAG (will be provided in a later patch)
 - Improve estimation of an ALU clause size so that heuristic does not emit cf
 instructions at the wrong position.
 - Make schedule heuristic smarter using SUnit Depth
 - Take constant read limitations into account

Vincent Lejeune: [v3]
 - Fix some uninitialized values in ConstPair
 - Add asserts to ensure an ALU slot is always populated

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

11 years agoClarify comment for function getObjectSize
Arnold Schwaighofer [Tue, 5 Mar 2013 16:53:24 +0000 (16:53 +0000)]
Clarify comment for function getObjectSize

Clarify that we mean the object starting at the pointer to the end of the
underlying object and not the size of the whole allocated object.

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

11 years agoAdd a test that .align directives on capable processors use long NOPs.
David Sehr [Tue, 5 Mar 2013 16:46:54 +0000 (16:46 +0000)]
Add a test that .align directives on capable processors use long NOPs.

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

11 years agoR600: Remove LowerConstCopyPass and lower CONST_COPY right after ISel.
Vincent Lejeune [Tue, 5 Mar 2013 15:04:55 +0000 (15:04 +0000)]
R600: Remove LowerConstCopyPass and lower CONST_COPY right after ISel.

Maintaining CONST_COPY Instructions until Pre Emit may prevent some ifcvt case
and taking them in account for scheduling is difficult for no real benefit.

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

11 years agoR600: Turn BUILD_VECTOR into Reg_Sequence
Vincent Lejeune [Tue, 5 Mar 2013 15:04:49 +0000 (15:04 +0000)]
R600: Turn BUILD_VECTOR into Reg_Sequence

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

11 years agoR600: CONST_ADDRESS node is not marked as mayLoad anymore
Vincent Lejeune [Tue, 5 Mar 2013 15:04:42 +0000 (15:04 +0000)]
R600: CONST_ADDRESS node is not marked as mayLoad anymore

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
mayLoad complexify scheduling and does not bring any usefull info
as the location is not writeable at all.

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

11 years agoR600: Use MUL_IEEE for trig/fdiv intrinsic
Vincent Lejeune [Tue, 5 Mar 2013 15:04:37 +0000 (15:04 +0000)]
R600: Use MUL_IEEE for trig/fdiv intrinsic

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

11 years agoR600: Add support for indirect addressing of non default const buffer
Vincent Lejeune [Tue, 5 Mar 2013 15:04:29 +0000 (15:04 +0000)]
R600: Add support for indirect addressing of non default const buffer

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

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

11 years agoPrint a warning message if compiler-rt can't be built because of old CMake version...
Alexey Samsonov [Tue, 5 Mar 2013 14:43:07 +0000 (14:43 +0000)]
Print a warning message if compiler-rt can't be built because of old CMake version to make this requirement more visible to users

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

11 years agollvm/test/CodeGen/Mips/mips64-f128.ll: Add explicit -mtriple=mips64el-unknown-unknown...
NAKAMURA Takumi [Tue, 5 Mar 2013 02:18:59 +0000 (02:18 +0000)]
llvm/test/CodeGen/Mips/mips64-f128.ll: Add explicit -mtriple=mips64el-unknown-unknown to appease win32.

FIXME: Is it expected for win32 to affect mips targets?

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

11 years agollvm/test/CodeGen/Thumb/iabs.ll: Add explicit -mtriple=thumb-unknown-unknown to appea...
NAKAMURA Takumi [Tue, 5 Mar 2013 02:18:52 +0000 (02:18 +0000)]
llvm/test/CodeGen/Thumb/iabs.ll: Add explicit -mtriple=thumb-unknown-unknown to appease win32 hosts.

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

11 years agoRemove unused #includes.
Bill Wendling [Tue, 5 Mar 2013 01:00:45 +0000 (01:00 +0000)]
Remove unused #includes.

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

11 years agoThe current X86 NOP padding uses one long NOP followed by the remainder in
David Sehr [Tue, 5 Mar 2013 00:02:23 +0000 (00:02 +0000)]
The current X86 NOP padding uses one long NOP followed by the remainder in
one-byte NOPs.  If the processor actually executes those NOPs, as it sometimes
does with aligned bundling, this can have a performance impact.  From my
micro-benchmarks run on my one machine, a 15-byte NOP followed by twelve
one-byte NOPs is about 20% worse than a 15 followed by a 12.  This patch
changes NOP emission to emit as many 15-byte (the maximum) as possible followed
by at most one shorter NOP.

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

11 years agoCheck isDiscardableIfUnused, rather than hasLocalLinkage, when bumping
Lang Hames [Mon, 4 Mar 2013 22:40:44 +0000 (22:40 +0000)]
Check isDiscardableIfUnused, rather than hasLocalLinkage, when bumping
GlobalValue linkage up to ExternalLinkage in the ExtractGV pass. This
prevents linkonce and linkonce_odr symbols from being DCE'd.

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

11 years ago[mips] Print move instructions.
Akira Hatanaka [Mon, 4 Mar 2013 22:25:01 +0000 (22:25 +0000)]
[mips] Print move instructions.

"move $4, $5" is printed instead of "or $4, $5, $zero".

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

11 years agoMips specific inline assembler constraint 'R'
Jack Carter [Mon, 4 Mar 2013 21:33:15 +0000 (21:33 +0000)]
Mips specific inline assembler constraint 'R'

'R' An address that can be sued in a non-macro load or store.
This patch includes a positive test case.

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

11 years agoReapply r176381, writing the CHECKs in a more forgiving manner to account for
Eli Bendersky [Mon, 4 Mar 2013 18:20:31 +0000 (18:20 +0000)]
Reapply r176381, writing the CHECKs in a more forgiving manner to account for
running llvm-objdump on Darwin.

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

11 years agoBypass Slow Divides
Preston Gurd [Mon, 4 Mar 2013 18:13:57 +0000 (18:13 +0000)]
Bypass Slow Divides

* Only apply divide bypass optimization when not optimizing for size.
* Fixed bug caused by constant for 0 value of type Int32,
  used dividend type to generate the constant instead.
* For atom x86-64 apply the divide bypass to use 16-bit divides instead of
  64-bit divides when operand values are small enough.
* Added lit tests for 64-bit divide bypass.

Patch by Tyler Nowicki!

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

11 years agoR600: Clean up datalayout strings so they better match hardware capabilities
Tom Stellard [Mon, 4 Mar 2013 17:40:28 +0000 (17:40 +0000)]
R600: Clean up datalayout strings so they better match hardware capabilities

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

11 years agoMips ISD typo
Jia Liu [Mon, 4 Mar 2013 01:06:54 +0000 (01:06 +0000)]
Mips ISD typo

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

11 years agoARM: Creating a vector from a lane of another.
Jim Grosbach [Sat, 2 Mar 2013 20:16:24 +0000 (20:16 +0000)]
ARM: Creating a vector from a lane of another.

The VDUP instruction source register doesn't allow a non-constant lane
index, so make sure we don't construct a ARM::VDUPLANE node asking it to
do so.

rdar://13328063
http://llvm.org/bugs/show_bug.cgi?id=13963

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

11 years agoClean up code format a bit.
Jim Grosbach [Sat, 2 Mar 2013 20:16:19 +0000 (20:16 +0000)]
Clean up code format a bit.

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