oota-llvm.git
13 years agoPerhaps a bit too much vertical whitespace.
Eric Christopher [Mon, 24 Jan 2011 22:19:14 +0000 (22:19 +0000)]
Perhaps a bit too much vertical whitespace.

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

13 years ago[AVX] Add type checking support for vector/subvector type constraints.
David Greene [Mon, 24 Jan 2011 20:53:18 +0000 (20:53 +0000)]
[AVX] Add type checking support for vector/subvector type constraints.
This will be used to check patterns referencing a forthcoming
INSERT_SUBVECTOR SDNode.  INSERT_SUBVECTOR in turn is very useful for
matching to VINSERTF128 instructions and complements the already
existing EXTRACT_SUBVECTOR SDNode.

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

13 years agoSpeculatively revert r124138.
Devang Patel [Mon, 24 Jan 2011 20:04:37 +0000 (20:04 +0000)]
Speculatively revert r124138.

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

13 years agoJörg Sonnenberger noticed that we were missing this test.
Rafael Espindola [Mon, 24 Jan 2011 19:40:38 +0000 (19:40 +0000)]
Jörg Sonnenberger noticed that we were missing this test.

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

13 years agoResolve DanglingDbgValue of PHI nodes where the use follows dbg.value intrinisic.
Devang Patel [Mon, 24 Jan 2011 19:24:37 +0000 (19:24 +0000)]
Resolve DanglingDbgValue of PHI nodes where the use follows dbg.value intrinisic.

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

13 years agoTemporarily workaround JM/lencod miscompile (SIGSEGV).
Andrew Trick [Mon, 24 Jan 2011 19:08:15 +0000 (19:08 +0000)]
Temporarily workaround JM/lencod miscompile (SIGSEGV).
rdar://problem/8893967

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

13 years agoGive GetUnderlyingObject a TargetData, to keep it in sync
Dan Gohman [Mon, 24 Jan 2011 18:53:32 +0000 (18:53 +0000)]
Give GetUnderlyingObject a TargetData, to keep it in sync
with BasicAA's DecomposeGEPExpression, which recently began
using a TargetData. This fixes PR8968, though the testcase
is awkward to reduce.

Also, update several off GetUnderlyingObject's users
which happen to have a TargetData handy to pass it in.

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

13 years agofix PR8928 by clearing a stale map, patch by Jakub Staszak!
Chris Lattner [Mon, 24 Jan 2011 18:36:51 +0000 (18:36 +0000)]
fix PR8928 by clearing a stale map, patch by Jakub Staszak!

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

13 years agoTestcase for dragonegg commit 124128.
Duncan Sands [Mon, 24 Jan 2011 18:04:33 +0000 (18:04 +0000)]
Testcase for dragonegg commit 124128.

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

13 years agoHandle strings in section names the same way as gas:
Rafael Espindola [Mon, 24 Jan 2011 18:02:54 +0000 (18:02 +0000)]
Handle strings in section names the same way as gas:
* If the name is a single string, we remove the quotes
* If the name starts without a quote, we include any quotes in the name

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

13 years agoAdd a comment.
Dan Gohman [Mon, 24 Jan 2011 17:54:18 +0000 (17:54 +0000)]
Add a comment.

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

13 years agoAdd another rdar number.
Dan Gohman [Mon, 24 Jan 2011 17:54:01 +0000 (17:54 +0000)]
Add another rdar number.

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

13 years agoSupport/CommandLine: Fix LookupNearestOption to also search extra option names.
Daniel Dunbar [Mon, 24 Jan 2011 17:27:17 +0000 (17:27 +0000)]
Support/CommandLine: Fix LookupNearestOption to also search extra option names.

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

13 years agofix a missing shuffle pattern, PR9009. Patch by Artiom Myaskouvskey!
Chris Lattner [Mon, 24 Jan 2011 03:42:46 +0000 (03:42 +0000)]
fix a missing shuffle pattern, PR9009.  Patch by Artiom Myaskouvskey!

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

13 years agomerge all the "crash tests" into crash.ll
Chris Lattner [Mon, 24 Jan 2011 03:37:34 +0000 (03:37 +0000)]
merge all the "crash tests" into crash.ll

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

13 years agofix PR9017, a bug where we'd assert when promoting in unreachable
Chris Lattner [Mon, 24 Jan 2011 03:29:07 +0000 (03:29 +0000)]
fix PR9017, a bug where we'd assert when promoting in unreachable
code.

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

13 years agofix PR9015, a crash linking recursive metadata.
Chris Lattner [Mon, 24 Jan 2011 03:18:24 +0000 (03:18 +0000)]
fix PR9015, a crash linking recursive metadata.

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

13 years agothis isn't a memset, we do convert dest[i] to one though :)
Chris Lattner [Mon, 24 Jan 2011 02:32:00 +0000 (02:32 +0000)]
this isn't a memset, we do convert dest[i] to one though :)

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

13 years agowith recent work, we now optimize this into:
Chris Lattner [Mon, 24 Jan 2011 01:12:18 +0000 (01:12 +0000)]
with recent work, we now optimize this into:

define i32 @foo(i32 %x) nounwind readnone ssp {
entry:
  %tobool = icmp eq i32 %x, 0
  %tmp5 = select i1 %tobool, i32 2, i32 1
  ret i32 %tmp5
}

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

13 years agoenhance SRoA to promote allocas that are used by PHI nodes. This often
Chris Lattner [Mon, 24 Jan 2011 01:07:11 +0000 (01:07 +0000)]
enhance SRoA to promote allocas that are used by PHI nodes.  This often
occurs because instcombine sinks loads and inserts phis.  This kicks in
on such apps as 175.vpr, eon, 403.gcc, xalancbmk and a bunch of times in
spec2006 in some app that uses std::deque.

This resolves the last of rdar://7339113.

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

13 years agoEnhance SRoA to promote allocas that are used by selects in some
Chris Lattner [Sun, 23 Jan 2011 22:04:55 +0000 (22:04 +0000)]
Enhance SRoA to promote allocas that are used by selects in some
common cases.  This triggers a surprising number of times in SPEC2K6
because min/max idioms end up doing this.  For example, code from the
STL ends up looking like this to SRoA:

  %202 = load i64* %__old_size, align 8, !tbaa !3
  %203 = load i64* %__old_size, align 8, !tbaa !3
  %204 = load i64* %__n, align 8, !tbaa !3
  %205 = icmp ult i64 %203, %204
  %storemerge.i = select i1 %205, i64* %__n, i64* %__old_size
  %206 = load i64* %storemerge.i, align 8, !tbaa !3

We can now promote both the __n and the __old_size allocas.

This addresses another chunk of rdar://7339113, poor codegen on
stringswitch.

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

13 years agoteach Value::isDereferenceablePointer that byval arguments are always
Chris Lattner [Sun, 23 Jan 2011 21:15:29 +0000 (21:15 +0000)]
teach Value::isDereferenceablePointer that byval arguments are always
dereferencable, noticed by inspection.

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

13 years agoAdd a memset loop that LoopIdiomRecognize doesn't recognize.
Anders Carlsson [Sun, 23 Jan 2011 20:31:00 +0000 (20:31 +0000)]
Add a memset loop that LoopIdiomRecognize doesn't recognize.

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

13 years agoSimplify some code with no functionality change. Make the test a lot more
Nick Lewycky [Sun, 23 Jan 2011 20:06:05 +0000 (20:06 +0000)]
Simplify some code with no functionality change. Make the test a lot more
robust against smarter optimizations, using the power of FileCheck.

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

13 years agoInitialize MCNoExecStack.
Rafael Espindola [Sun, 23 Jan 2011 18:50:12 +0000 (18:50 +0000)]
Initialize MCNoExecStack.

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

13 years agoAdd support for the --noexecstack option.
Rafael Espindola [Sun, 23 Jan 2011 17:55:27 +0000 (17:55 +0000)]
Add support for the --noexecstack option.

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

13 years agoNull initialize a few variables flagged by
Ted Kremenek [Sun, 23 Jan 2011 17:05:06 +0000 (17:05 +0000)]
Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

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

13 years agoAdd support for lowercase variants.
Rafael Espindola [Sun, 23 Jan 2011 16:11:25 +0000 (16:11 +0000)]
Add support for lowercase variants.

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

13 years agoEnhance SRoA to be more aggressive about scalarization of aggregate allocas
Chris Lattner [Sun, 23 Jan 2011 08:27:54 +0000 (08:27 +0000)]
Enhance SRoA to be more aggressive about scalarization of aggregate allocas
that have PHI or select uses of their element pointers.  This can often happen
when instcombine sinks two loads into a successor, inserting a phi or select.

With this patch, we can scalarize the alloca, but the pinned elements are not
yet promoted.  This is still a win for large aggregates where only one element
is used.  This fixes rdar://8904039 and part of rdar://7339113 (poor codegen
on stringswitch).

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

13 years agoConvert two std::vectors to SmallVectors for a 3.4% speedup running -scalarrepl
Cameron Zwarich [Sun, 23 Jan 2011 08:03:04 +0000 (08:03 +0000)]
Convert two std::vectors to SmallVectors for a 3.4% speedup running -scalarrepl
on test-suite + SPEC2000 & SPEC2006.

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

13 years agohave AllocaInfo store the alloca being inspected, simplifying callers.
Chris Lattner [Sun, 23 Jan 2011 07:29:29 +0000 (07:29 +0000)]
have AllocaInfo store the alloca being inspected, simplifying callers.
No functionality change.

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

13 years agoRearrange some code a bit. Change MarkUnsafe to
Chris Lattner [Sun, 23 Jan 2011 07:05:44 +0000 (07:05 +0000)]
Rearrange some code a bit.  Change MarkUnsafe to
handle the "Transformation preventing inst" printing,
so that -scalarrepl -debug will always print the rejected
instruction.  No functionality change.

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

13 years agoConvert a std::vector to a SmallVector for another 5.4% speedup on domtree.
Cameron Zwarich [Sun, 23 Jan 2011 06:54:22 +0000 (06:54 +0000)]
Convert a std::vector to a SmallVector for another 5.4% speedup on domtree.

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

13 years agoremove an old hack that avoided creating MMX datatypes. The
Chris Lattner [Sun, 23 Jan 2011 06:40:33 +0000 (06:40 +0000)]
remove an old hack that avoided creating MMX datatypes.  The
X86 backend has been fixed.

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

13 years agoUse value ranges to fold ext(trunc) in SCEV when possible.
Nick Lewycky [Sun, 23 Jan 2011 06:20:19 +0000 (06:20 +0000)]
Use value ranges to fold ext(trunc) in SCEV when possible.

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

13 years agoIn the simpler version of the link-eval data structure that we use in dominator
Cameron Zwarich [Sun, 23 Jan 2011 06:16:06 +0000 (06:16 +0000)]
In the simpler version of the link-eval data structure that we use in dominator
computation, the Ancestor field is always set to the Parent, so we can remove
the explicit link entirely and merge the Parent and Ancestor fields. Instead of
checking for whether an ancestor exists for a node or not, we simply check
whether the node has already been processed. This is simpler if Compress is
inlined into Eval, so I did that as well.

This is about a 3% speedup running -domtree on test-suite + SPEC2000 & SPEC2006,
but it also opens up some opportunities for further improvement.

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

13 years agoDelay the creation of eh_frame so that the user can change the defaults.
Rafael Espindola [Sun, 23 Jan 2011 05:43:40 +0000 (05:43 +0000)]
Delay the creation of eh_frame so that the user can change the defaults.
Add support for SHT_X86_64_UNWIND.

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

13 years agoRemove useless struct fields.
Cameron Zwarich [Sun, 23 Jan 2011 05:11:18 +0000 (05:11 +0000)]
Remove useless struct fields.

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

13 years agoRemove friend declaration for removed function.
Cameron Zwarich [Sun, 23 Jan 2011 04:54:34 +0000 (04:54 +0000)]
Remove friend declaration for removed function.

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

13 years agoRemove more duplicated code.
Rafael Espindola [Sun, 23 Jan 2011 04:43:11 +0000 (04:43 +0000)]
Remove more duplicated code.

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

13 years agoConvert a std::vector to a SmallVector.
Cameron Zwarich [Sun, 23 Jan 2011 04:30:59 +0000 (04:30 +0000)]
Convert a std::vector to a SmallVector.

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

13 years agoRemove duplicated code.
Rafael Espindola [Sun, 23 Jan 2011 04:28:49 +0000 (04:28 +0000)]
Remove duplicated code.

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

13 years agoSimplify some code now that we've removed the more optimal (but slower) version
Cameron Zwarich [Sun, 23 Jan 2011 04:13:53 +0000 (04:13 +0000)]
Simplify some code now that we've removed the more optimal (but slower) version
of the link-eval data structure from dominator computation.

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

13 years agoHave SCEV turn sext(x) into zext(x) when x is s>= 0. This applies many times in
Nick Lewycky [Sat, 22 Jan 2011 22:06:21 +0000 (22:06 +0000)]
Have SCEV turn sext(x) into zext(x) when x is s>= 0. This applies many times in
"make check" alone.

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

13 years agoAdd a FIXME explaining the move to a single indirect call bonus per function
Eric Christopher [Sat, 22 Jan 2011 21:56:53 +0000 (21:56 +0000)]
Add a FIXME explaining the move to a single indirect call bonus per function
that we can change from indirect to direct.

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

13 years agoOnly apply the devirtualization bonus once instead of per-call site in the
Eric Christopher [Sat, 22 Jan 2011 21:17:33 +0000 (21:17 +0000)]
Only apply the devirtualization bonus once instead of per-call site in the
target function.

Fixes part of rdar://8546196

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

13 years agoPass sret arguments through the stack instead of through registers in Sparc backend...
Venkatraman Govindaraju [Sat, 22 Jan 2011 13:05:16 +0000 (13:05 +0000)]
Pass sret arguments through the stack instead of through registers in Sparc backend. It makes the code generated more compliant with the sparc32 ABI.

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

13 years agoRemove dead ivar.
Benjamin Kramer [Sat, 22 Jan 2011 12:13:28 +0000 (12:13 +0000)]
Remove dead ivar.

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

13 years agoAdded ICC, FCC as uses of movcc instruction to generate correct code when -mattr...
Venkatraman Govindaraju [Sat, 22 Jan 2011 11:36:24 +0000 (11:36 +0000)]
Added ICC, FCC as uses of movcc instruction to generate correct code when -mattr=v9 is used.

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

13 years agoARM uses '.' in their tokens. Give it a name instead of a numeric value.
Bill Wendling [Sat, 22 Jan 2011 09:44:32 +0000 (09:44 +0000)]
ARM uses '.' in their tokens. Give it a name instead of a numeric value.

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

13 years agoadd DW_TAG for rvalue refs.
Chris Lattner [Sat, 22 Jan 2011 01:47:25 +0000 (01:47 +0000)]
add DW_TAG for rvalue refs.

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

13 years agoActually check memcpy lengths, instead of just commenting about
Dan Gohman [Fri, 21 Jan 2011 22:07:57 +0000 (22:07 +0000)]
Actually check memcpy lengths, instead of just commenting about
how they should be checked.

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

13 years agoSparc backend:
Venkatraman Govindaraju [Fri, 21 Jan 2011 22:00:00 +0000 (22:00 +0000)]
Sparc backend:
 Rename FLUSH to FLUSHW.
 Output "ta 3" instead of a "flushw" instruction if v8 instruction set is used.

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

13 years agoJust because we have determined that an (fcmp | fcmp) is true for A < B,
Owen Anderson [Fri, 21 Jan 2011 19:39:42 +0000 (19:39 +0000)]
Just because we have determined that an (fcmp | fcmp) is true for A < B,
A == B, and A > B, does not mean we can fold it to true.  We still need to
check for A ? B (A unordered B).

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

13 years agoLast round of fixes for movw + movt global address codegen.
Evan Cheng [Fri, 21 Jan 2011 18:55:51 +0000 (18:55 +0000)]
Last round of fixes for movw + movt global address codegen.
1. Fixed ARM pc adjustment.
2. Fixed dynamic-no-pic codegen
3. CSE of pc-relative load of global addresses.

It's now enabled by default for Darwin.

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

13 years agoClang was not parsing target triples involving EABI and was generating wrong IR ...
Renato Golin [Fri, 21 Jan 2011 18:25:47 +0000 (18:25 +0000)]
Clang was not parsing target triples involving EABI and was generating wrong IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure.

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

13 years agoHandles libffi on the CMake build.
Oscar Fuentes [Fri, 21 Jan 2011 15:42:54 +0000 (15:42 +0000)]
Handles libffi on the CMake build.

Patch by arrowdodger!

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

13 years agoFix the encoding of QADD/SUB, QDADD/SUB. While qadd16, qadd8 use "rd, rn, rm",
Bruno Cardoso Lopes [Fri, 21 Jan 2011 14:07:40 +0000 (14:07 +0000)]
Fix the encoding of QADD/SUB, QDADD/SUB. While qadd16, qadd8 use  "rd, rn, rm",
qadd and qdadd uses "rd, rm, rn", the same applies to the 'sub' variants. This
is described in ARM manuals and matches the encoding used by the gnu assembler.

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

13 years agoImplement support for byval arguments in Sparc backend.
Venkatraman Govindaraju [Fri, 21 Jan 2011 14:00:01 +0000 (14:00 +0000)]
Implement support for byval arguments in Sparc backend.

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

13 years agoSCCP doesn't actually preserve the CFG. It will delete and insert terminator
Nick Lewycky [Fri, 21 Jan 2011 08:38:09 +0000 (08:38 +0000)]
SCCP doesn't actually preserve the CFG. It will delete and insert terminator
instructions.

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

13 years agoRevert "Object: Renable the tests now that none of the build bots complain about...
Michael J. Spencer [Fri, 21 Jan 2011 06:27:04 +0000 (06:27 +0000)]
Revert "Object: Renable the tests now that none of the build bots complain about aliasing."

This reverts commit 281f3901b7b0869929caf8946c1ad1228bc38922.

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

13 years agoEnable support for precise scheduling of the instruction selection
Andrew Trick [Fri, 21 Jan 2011 06:19:05 +0000 (06:19 +0000)]
Enable support for precise scheduling of the instruction selection
DAG. Disable using "-disable-sched-cycles".

For ARM, this enables a framework for modeling the cpu pipeline and
counting stalls. It also activates several heuristics to drive
scheduling based on the model. Scheduling is inherently imprecise at
this stage, and until spilling is improved it may defeat attempts to
schedule. However, this framework provides greater control over
tuning codegen.

Although the flag is not target-specific, it should have very little
affect on the default scheduler used by x86. The only two changes that
affect x86 are:
- scheduling a high-latency operation bumps the current cycle so independent
  operations can have their latency covered. i.e. two independent 4
  cycle operations can produce results in 4 cycles, not 8 cycles.
- Two operations with equal register pressure impact and no
  latency-based stalls on their uses will be prioritized by depth before height
  (height is irrelevant if no stalls occur in the schedule below this point).

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

13 years agoConvert -enable-sched-cycles and -enable-sched-hazard to -disable
Andrew Trick [Fri, 21 Jan 2011 05:51:33 +0000 (05:51 +0000)]
Convert -enable-sched-cycles and -enable-sched-hazard to -disable
flags. They are still not enable in this revision.

Added TargetInstrInfo::isZeroCost() to fix a fundamental problem with
the scheduler's model of operand latency in the selection DAG.

Generalized unit tests to work with sched-cycles.

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

13 years agofix PR9013, an infinite loop in instcombine.
Chris Lattner [Fri, 21 Jan 2011 05:29:50 +0000 (05:29 +0000)]
fix PR9013, an infinite loop in instcombine.

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

13 years agoupdate obsolete comment.
Chris Lattner [Fri, 21 Jan 2011 05:08:26 +0000 (05:08 +0000)]
update obsolete comment.

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

13 years agoObject: Renable the tests now that none of the build bots complain about aliasing.
Michael J. Spencer [Fri, 21 Jan 2011 05:07:13 +0000 (05:07 +0000)]
Object: Renable the tests now that none of the build bots complain about aliasing.

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

13 years agoDon't try to pull vector bitcasts that change the number of elements through
Nick Lewycky [Fri, 21 Jan 2011 02:30:43 +0000 (02:30 +0000)]
Don't try to pull vector bitcasts that change the number of elements through
a select. A vector select is pairwise on each element so we'd need a new
condition with the right number of elements to select on. Fixes PR8994.

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

13 years agoObject: Fix type punned pointer issues by making DataRefImpl a union and using intptr_t.
Michael J. Spencer [Fri, 21 Jan 2011 02:27:02 +0000 (02:27 +0000)]
Object: Fix type punned pointer issues by making DataRefImpl a union and using intptr_t.

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

13 years agotblgen: Add support for non-inheritable attributes
Peter Collingbourne [Fri, 21 Jan 2011 02:08:26 +0000 (02:08 +0000)]
tblgen: Add support for non-inheritable attributes

This patch makes the necessary changes to TableGen to support
non-inheritable attributes.

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

13 years agoAdd a constant folding of casts from zero to zero. Fixes PR9011!
Nick Lewycky [Fri, 21 Jan 2011 01:12:09 +0000 (01:12 +0000)]
Add a constant folding of casts from zero to zero. Fixes PR9011!

While here, I'd like to complain about how vector is not an aggregate type
according to llvm::Type::isAggregateType(), but they're listed under aggregate
types in the LangRef and zero vectors are stored as ConstantAggregateZero.

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

13 years agoDon't be overly aggressive with CSE of "ldr constantpool". If it's a pc-relative
Evan Cheng [Thu, 20 Jan 2011 23:55:07 +0000 (23:55 +0000)]
Don't be overly aggressive with CSE of "ldr constantpool". If it's a pc-relative
value, the "add pc" must be CSE'ed at the same time. We could follow the same
approach as T2 by adding pseudo instructions that combine the ldr + "add pc".
But the better approach is to use movw + movt (which I will enable soon), so
I'll leave this as a TODO.

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

13 years agoImplement requiredTransitive
Tobias Grosser [Thu, 20 Jan 2011 21:03:22 +0000 (21:03 +0000)]
Implement requiredTransitive

The PassManager did not implement the transitivity of requiredTransitive. This
was unnoticed since 2006.

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

13 years agoRegionPassPrinter should contain the name of the pass printed
Tobias Grosser [Thu, 20 Jan 2011 21:03:20 +0000 (21:03 +0000)]
RegionPassPrinter should contain the name of the pass printed

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

13 years agoAdd testcases for clz encoding
Bruno Cardoso Lopes [Thu, 20 Jan 2011 19:27:16 +0000 (19:27 +0000)]
Add testcases for clz encoding

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

13 years agoFix the encoding and parsing of clrex instruction
Bruno Cardoso Lopes [Thu, 20 Jan 2011 19:18:32 +0000 (19:18 +0000)]
Fix the encoding and parsing of clrex instruction

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

13 years agoMove InstAlias check of argument types to a separate loop.
Bob Wilson [Thu, 20 Jan 2011 18:38:10 +0000 (18:38 +0000)]
Move InstAlias check of argument types to a separate loop.

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

13 years agoTidy comment.
Bob Wilson [Thu, 20 Jan 2011 18:38:07 +0000 (18:38 +0000)]
Tidy comment.

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

13 years agoFix broken check for InstAlias argument used with different types.
Bob Wilson [Thu, 20 Jan 2011 18:38:05 +0000 (18:38 +0000)]
Fix broken check for InstAlias argument used with different types.

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

13 years agoPrecompute InstAlias operand mapping to result instruction operand indices.
Bob Wilson [Thu, 20 Jan 2011 18:38:02 +0000 (18:38 +0000)]
Precompute InstAlias operand mapping to result instruction operand indices.

There should be no functional change from this, but I think it's simpler this
way.

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

13 years agoChange instruction names for consistency
Bruno Cardoso Lopes [Thu, 20 Jan 2011 18:36:07 +0000 (18:36 +0000)]
Change instruction names for consistency

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

13 years agoAdd cdp/cdp2 instructions for thumb/thumb2
Bruno Cardoso Lopes [Thu, 20 Jan 2011 18:32:09 +0000 (18:32 +0000)]
Add cdp/cdp2 instructions for thumb/thumb2

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

13 years agoDisable objdump-trivial-object.test. It is broken on powerpc-darwin9.
Devang Patel [Thu, 20 Jan 2011 18:08:44 +0000 (18:08 +0000)]
Disable objdump-trivial-object.test. It is broken on powerpc-darwin9.

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

13 years ago- Use a more appropriate name for Owen's ARM Parser isMCR hack since the same operand...
Bruno Cardoso Lopes [Thu, 20 Jan 2011 18:06:58 +0000 (18:06 +0000)]
- Use a more appropriate name for Owen's ARM Parser isMCR hack since the same operands can be present
 in cdp/cdp2 instructions. Also increase the hack with cdp/cdp2 instructions.
- Fix the encoding of cdp/cdp2 instructions for ARM (no thumb and thumb2 yet) and add testcases for t
hem.

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

13 years agoSplitKit requires that all defs are in place before calling useIntv().
Jakob Stoklund Olesen [Thu, 20 Jan 2011 17:45:23 +0000 (17:45 +0000)]
SplitKit requires that all defs are in place before calling useIntv().

The value mapping gets confused about which original values have multiple new
definitions so they may need phi insertions.

This could probably be simplified by letting enterIntvBefore() take a live range
to be added following the instruction. As long as the range stays inside the
same basic block, value mapping shouldn't be a problem.

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

13 years agoAdd LiveIntervalMap::dumpCache() to print out the cache used by the ssa update algorithm.
Jakob Stoklund Olesen [Thu, 20 Jan 2011 17:45:20 +0000 (17:45 +0000)]
Add LiveIntervalMap::dumpCache() to print out the cache used by the ssa update algorithm.

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

13 years agoAdd mcr*2 and mr*c2 support to thumb2 targets
Bruno Cardoso Lopes [Thu, 20 Jan 2011 16:58:48 +0000 (16:58 +0000)]
Add mcr*2 and mr*c2 support to thumb2 targets

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

13 years agoAdd mcr* and mr*c support to thumb targets
Bruno Cardoso Lopes [Thu, 20 Jan 2011 16:35:57 +0000 (16:35 +0000)]
Add mcr* and mr*c support to thumb targets

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

13 years agoDisable this test until I can figure out why it's broken. Not xfailed because it
Michael J. Spencer [Thu, 20 Jan 2011 16:24:07 +0000 (16:24 +0000)]
Disable this test until I can figure out why it's broken. Not xfailed because it
usese 100% CPU and times out, so it's annoying to run it.

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

13 years agoAllow sign-extending of i8 and i16 to i128 on SPU.
Kalle Raiskila [Thu, 20 Jan 2011 15:49:06 +0000 (15:49 +0000)]
Allow sign-extending of i8 and i16 to i128 on SPU.

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

13 years agoAt -O123 the early-cse pass is run before instcombine has run. According to my
Duncan Sands [Thu, 20 Jan 2011 13:21:55 +0000 (13:21 +0000)]
At -O123 the early-cse pass is run before instcombine has run.  According to my
auto-simplier the transform most missed by early-cse is (zext X) != 0 -> X != 0.
This patch adds this transform and some related logic to InstructionSimplify
and removes some of the logic from instcombine (unfortunately not all because
there are several situations in which instcombine can improve things by making
new instructions, whereas instsimplify is not allowed to do this).  At -O2 this
often results in more than 15% more simplifications by early-cse, and results in
hundreds of lines of bitcode being eliminated from the testsuite.  I did see some
small negative effects in the testsuite, for example a few additional instructions
in three programs.  One program, 483.xalancbmk, got an additional 35 instructions,
which seems to be due to a function getting an additional instruction and then
being inlined all over the place.

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

13 years agoRefactor mcr* and mr*c instructions into classes with the same encoding. No functiona...
Bruno Cardoso Lopes [Thu, 20 Jan 2011 13:17:59 +0000 (13:17 +0000)]
Refactor mcr* and mr*c instructions into classes with the same encoding. No functionality change.

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

13 years agoMy editor's indent went crazy. Fix.
Eric Christopher [Thu, 20 Jan 2011 08:56:34 +0000 (08:56 +0000)]
My editor's indent went crazy. Fix.

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

13 years agoExpand invalid return values for umulo and smulo. Handle these similarly
Eric Christopher [Thu, 20 Jan 2011 08:54:28 +0000 (08:54 +0000)]
Expand invalid return values for umulo and smulo. Handle these similarly
to add/sub by doing the normal operation and then checking for overflow
afterwards. This generally relies on the DAG handling the later invalid
operations as well.

Fixes the 64-bit part of rdar://8622122 and rdar://8774702.

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

13 years agoCorrect itinerary entry for t2MOV_pic_ga_add_pc.
Evan Cheng [Thu, 20 Jan 2011 08:43:03 +0000 (08:43 +0000)]
Correct itinerary entry for t2MOV_pic_ga_add_pc.

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

13 years agoAdd test.
Evan Cheng [Thu, 20 Jan 2011 08:38:21 +0000 (08:38 +0000)]
Add test.

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

13 years agoSorry, several patches in one.
Evan Cheng [Thu, 20 Jan 2011 08:34:58 +0000 (08:34 +0000)]
Sorry, several patches in one.

TargetInstrInfo:
Change produceSameValue() to take MachineRegisterInfo as an optional argument.
When in SSA form, targets can use it to make more aggressive equality analysis.

Machine LICM:
1. Eliminate isLoadFromConstantMemory, use MI.isInvariantLoad instead.
2. Fix a bug which prevent CSE of instructions which are not re-materializable.
3. Use improved form of produceSameValue.

ARM:
1. Teach ARM produceSameValue to look pass some PIC labels.
2. Look for operands from different loads of different constant pool entries
   which have same values.
3. Re-implement PIC GA materialization using movw + movt. Combine the pair with
   a "add pc" or "ldr [pc]" to form pseudo instructions. This makes it possible
   to re-materialize the instruction, allow machine LICM to hoist the set of
   instructions out of the loop and make it possible to CSE them. It's a bit
   hacky, but it significantly improve code quality.
4. Some minor bug fixes as well.

With the fixes, using movw + movt to materialize GAs significantly outperform the
load from constantpool method. 186.crafty and 255.vortex improved > 20%, 254.gap
and 176.gcc ~10%.

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

13 years agollvm-objdump: Remove redundant includes.
Michael J. Spencer [Thu, 20 Jan 2011 07:22:13 +0000 (07:22 +0000)]
llvm-objdump: Remove redundant includes.

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

13 years agollvm-nm: Fix warning.
Michael J. Spencer [Thu, 20 Jan 2011 07:22:04 +0000 (07:22 +0000)]
llvm-nm: Fix warning.

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

13 years agoObject: Add some tests!
Michael J. Spencer [Thu, 20 Jan 2011 06:39:15 +0000 (06:39 +0000)]
Object: Add some tests!

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

13 years agoAdd llvm-objdump
Michael J. Spencer [Thu, 20 Jan 2011 06:39:06 +0000 (06:39 +0000)]
Add llvm-objdump

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