oota-llvm.git
12 years agoAdd an asserting ValueHandle to the block simplification code which will
Chandler Carruth [Sun, 25 Mar 2012 03:29:25 +0000 (03:29 +0000)]
Add an asserting ValueHandle to the block simplification code which will
fire if anything ever invalidates the assumption of a terminator
instruction being unchanged throughout the routine.

I've convinced myself that the current definition of simplification
precludes such a transformation, so I think getting some asserts
coverage that we don't violate this agreement is sufficient to make this
code safe for the foreseeable future.

Comments to the contrary or other suggestions are of course welcome. =]
The bots are now happy with this code though, so it appears the bug here
has indeed been fixed.

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

12 years agoUse the isReachableFromEntry method.
Rafael Espindola [Sat, 24 Mar 2012 23:29:27 +0000 (23:29 +0000)]
Use the isReachableFromEntry method.

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

12 years agoDon't form a WeakVH around the sentinel node in the instructions BB
Chandler Carruth [Sat, 24 Mar 2012 23:03:27 +0000 (23:03 +0000)]
Don't form a WeakVH around the sentinel node in the instructions BB
list. This is a bad idea. ;] I'm hopeful this is the bug that's showing
up with the MSVC bots, but we'll see.

It is definitely unnecessary. InstSimplify won't do anything to
a terminator instruction, we don't need to even include it in the
iteration range. We can also skip the now dead terminator check,
although I've made it an assert to help document that this is an
important invariant.

I'm still a bit queasy about this because there is an implicit
assumption that the terminator instruction cannot be RAUW'ed by the
simplification code. While that appears to be true at the moment, I see
no guarantee that would ensure it remains true in the future. I'm
looking at the cleanest way to solve that...

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

12 years agoAvoid using dominatedBySlowTreeWalk.
Rafael Espindola [Sat, 24 Mar 2012 22:52:25 +0000 (22:52 +0000)]
Avoid using dominatedBySlowTreeWalk.

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

12 years agoTry to harden the recursive simplification still further. This is again
Chandler Carruth [Sat, 24 Mar 2012 22:34:26 +0000 (22:34 +0000)]
Try to harden the recursive simplification still further. This is again
spotted by inspection, and I've crafted no test case that triggers it on
my machine, but some of the windows builders are hitting what looks like
memory corruption, so *something* is amiss here.

This patch takes a more generalized approach to eliminating
double-visits. Imagine code such as:

  %x = ...
  %y = add %x, 1
  %z = add %x, %y

You can imagine that if we simplify %x, we would add %y and %z to the
list. If the use-chain order happens to cause us to add them in reverse
order, we could pull %y off first, and simplify it, adding %z to the
list. We now have %z on the list twice, and will reference it after it
is deleted.

Currently, all my test cases happen to not trigger this, likely due to
the use-chain ordering, but there seems no guarantee that such
a situation could not occur, so we should handle it correctly.

Again, if anyone knows how to craft a testcase that actually triggers
this, please let me know.

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

12 years agoDon't add the instruction about to be RAUW'ed and erased to the
Chandler Carruth [Sat, 24 Mar 2012 22:34:23 +0000 (22:34 +0000)]
Don't add the instruction about to be RAUW'ed and erased to the
worklist. This can happen in theory when an instruction uses itself,
such as a PHI node. This was spotted by inspection, and unfortunately
I've not been able to come up with a test case that would trigger it. If
anyone has ideas, let me know...

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

12 years agoFix null to integer conversion warnings.
Jean-Daniel Dupas [Sat, 24 Mar 2012 22:17:50 +0000 (22:17 +0000)]
Fix null to integer conversion warnings.

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

12 years agoFileCheck-ize this test. Note the FIXME I've introduced here: we've
Chandler Carruth [Sat, 24 Mar 2012 21:24:19 +0000 (21:24 +0000)]
FileCheck-ize this test. Note the FIXME I've introduced here: we've
regressed seriously here, we are no longer removing allocas during
inline cleanup. This appears to be because of lifetime markers "using"
them. =/ I'll look into this shortly.

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

12 years agoRefactor the interface to recursively simplifying instructions to be tad
Chandler Carruth [Sat, 24 Mar 2012 21:11:24 +0000 (21:11 +0000)]
Refactor the interface to recursively simplifying instructions to be tad
bit simpler by handling a common case explicitly.

Also, refactor the implementation to use a worklist based walk of the
recursive users, rather than trying to use value handles to detect and
recover from RAUWs during the recursive descent. This fixes a very
subtle bug in the previous implementation where degenerate control flow
structures could cause mutually recursive instructions (PHI nodes) to
collapse in just such a way that From became equal to To after some
amount of recursion. At that point, we hit the inf-loop that the assert
at the top attempted to guard against. This problem is defined away when
not using value handles in this manner. There are lots of comments
claiming that the WeakVH will protect against just this sort of error,
but they're not accurate about the actual implementation of WeakVHs,
which do still track RAUWs.

I don't have any test case for the bug this fixes because it requires
running the recursive simplification on unreachable phi nodes. I've no
way to either run this or easily write an input that triggers it. It was
found when using instruction simplification inside the inliner when
running over the nightly test-suite.

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

12 years agoRemove always true variable.
Rafael Espindola [Sat, 24 Mar 2012 20:02:25 +0000 (20:02 +0000)]
Remove always true variable.

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

12 years agoAdd a small release not about the range metadata.
Rafael Espindola [Sat, 24 Mar 2012 19:02:32 +0000 (19:02 +0000)]
Add a small release not about the range metadata.

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

12 years agoFix small-integer VAARG on SVR4 ABI PPC64.
Hal Finkel [Sat, 24 Mar 2012 03:53:55 +0000 (03:53 +0000)]
Fix small-integer VAARG on SVR4 ABI PPC64.

The PPC64 SVR4 ABI requires integer stack arguments, and thus the var. args., that
are smaller than 64 bits be zero extended to 64 bits.

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

12 years agoAdd the ability to promote legal integer VAARGs. This is required for the PPC64 SVR4...
Hal Finkel [Sat, 24 Mar 2012 03:53:52 +0000 (03:53 +0000)]
Add the ability to promote legal integer VAARGs. This is required for the PPC64 SVR4 ABI.

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

12 years agoFix the MSVC build.
Francois Pichet [Sat, 24 Mar 2012 01:36:37 +0000 (01:36 +0000)]
Fix the MSVC build.

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

12 years agoPTX: Fix predicate logic bug
Justin Holewinski [Sat, 24 Mar 2012 01:23:20 +0000 (01:23 +0000)]
PTX: Fix predicate logic bug

Code such as:

%vreg100 = setcc %vreg10, -1, SETNE
brcond %vreg10, %tgt

was being incorrectly morphed into

%vreg100 = and %vreg10, 1
brcond %vreg10, %tgt

where the 'and' instruction could be eliminated since
such logic is on 1-bit types in the PTX back-end, leaving
us with just:

brcond %vreg10, %tgt

which essentially gives us inverted branch conditions.

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

12 years agoMore IndVarSimplify cleanup.
Andrew Trick [Sat, 24 Mar 2012 00:51:17 +0000 (00:51 +0000)]
More IndVarSimplify cleanup.

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

12 years agoFirst part of PR12251. Add documentation and verifier support for the range
Rafael Espindola [Sat, 24 Mar 2012 00:14:51 +0000 (00:14 +0000)]
First part of PR12251. Add documentation and verifier support for the range
metadata.

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

12 years agoadd EP_OptimizerLast extension point
Kostya Serebryany [Fri, 23 Mar 2012 23:22:59 +0000 (23:22 +0000)]
add EP_OptimizerLast extension point

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

12 years agoIt's possible for two types, which are isomorphic, to be added to the
Bill Wendling [Fri, 23 Mar 2012 23:17:38 +0000 (23:17 +0000)]
It's possible for two types, which are isomorphic, to be added to the
destination module, but one of them isn't used in the destination module. If
another module comes along and the uses the unused type, there could be type
conflicts when the modules are finally linked together. (This happened when
building LLVM.)

The test that was reduced is:

Module A:

%Z = type { %A }
%A = type { %B.1, [7 x x86_fp80] }
%B.1 = type { %C }
%C = type { i8* }

declare void @func_x(%C*, i64, i64)
declare void @func_z(%Z* nocapture)

Module B:

%B = type { %C.1 }
%C.1 = type { i8* }
%A.2 = type { %B.3, [5 x x86_fp80] }
%B.3 = type { %C.1 }

define void @func_z() {
  %x = alloca %A.2, align 16
  %y = getelementptr inbounds %A.2* %x, i64 0, i32 0, i32 0
  call void @func_x(%C.1* %y, i64 37, i64 927) nounwind
  ret void
}

declare void @func_x(%C.1*, i64, i64)
declare void @func_y(%B* nocapture)

(Unfortunately, this test doesn't fail under llvm-link, only during an LTO
linking.) The '%C' and '%C.1' clash. The destination module gets the '%C'
declaration. When merging Module B, it looks at the '%C.1' subtype of the '%B'
structure. It adds that in, because that's cool. And when '%B.3' is processed,
it uses the '%C.1'. But the '%B' has used '%C' and we prefer to use '%C'. So the
'@func_x' type is changed to 'void (%C*, i64, i64)', but the type of '%x' in
'@func_z' remains '%A.2'. The GEP resolves to a '%C.1', which conflicts with the
'@func_x' signature.

We can resolve this situation by making sure that the type is used in the
destination before saying that it should be used in the module being merged in.

With this fix, LLVM and Clang both compile under LTO.
<rdar://problem/10913281>

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

12 years agoARM tidy up ARMConstantIsland.cpp.
Jim Grosbach [Fri, 23 Mar 2012 23:07:03 +0000 (23:07 +0000)]
ARM tidy up ARMConstantIsland.cpp.

No functional change, just tidy up the code and nomenclature a bit.

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

12 years agoPretty-printing comments for literal floating point in .s files.
Jim Grosbach [Fri, 23 Mar 2012 23:06:47 +0000 (23:06 +0000)]
Pretty-printing comments for literal floating point in .s files.

Dump the hex representation to the comment stream as well as the float
value.

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

12 years agoAdd a hook in MCELFObjectTargetWriter to allow targets to sort relocation
Akira Hatanaka [Fri, 23 Mar 2012 23:06:45 +0000 (23:06 +0000)]
Add a hook in MCELFObjectTargetWriter to allow targets to sort relocation
entries in the relocation table before they are written out to the file.

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

12 years agoDon't convert objc_retainAutoreleasedReturnValue to objc_retain if it
Dan Gohman [Fri, 23 Mar 2012 18:09:00 +0000 (18:09 +0000)]
Don't convert objc_retainAutoreleasedReturnValue to objc_retain if it
is retaining the return value of an invoke that it immediately follows.

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

12 years agoIt's not possible to insert code immediately after an invoke in the
Dan Gohman [Fri, 23 Mar 2012 17:47:54 +0000 (17:47 +0000)]
It's not possible to insert code immediately after an invoke in the
same basic block, and it's not safe to insert code in the successor
blocks if the edges are critical edges. Splitting those edges is
possible, but undesirable, especially on the unwind side. Instead,
make the bottom-up code motion to consider invokes to be part of
their successor blocks, rather than part of their parent blocks, so
that it doesn't push code past them and onto the edges. This fixes
PR12307.

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

12 years agoMake it feasible for clients using EngineBuilder to capture the TargetMachine that...
Owen Anderson [Fri, 23 Mar 2012 17:40:56 +0000 (17:40 +0000)]
Make it feasible for clients using EngineBuilder to capture the TargetMachine that is created as part of selecting the appropriate target.
This is necessary if the client wants to be able to mutate TargetOptions (for example, fast FP math mode) after the initial creation of the ExecutionEngine.

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

12 years agoAdd support for register masks to PBQP.
Lang Hames [Fri, 23 Mar 2012 17:33:42 +0000 (17:33 +0000)]
Add support for register masks to PBQP.

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

12 years agoInclude cctype for std::isprint.
Benjamin Kramer [Fri, 23 Mar 2012 11:49:32 +0000 (11:49 +0000)]
Include cctype for std::isprint.

This should unbreak the msvc build.

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

12 years agoInclude cstdio in a few place that depended on getting it transitively through String...
Benjamin Kramer [Fri, 23 Mar 2012 11:35:30 +0000 (11:35 +0000)]
Include cstdio in a few place that depended on getting it transitively through StringExtras.h

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

12 years agoMove ftostr into its last user (cppbackend) and simplify it a bit.
Benjamin Kramer [Fri, 23 Mar 2012 11:26:29 +0000 (11:26 +0000)]
Move ftostr into its last user (cppbackend) and simplify it a bit.

New code should use raw_ostream.

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

12 years agoAdd soname to LLVM shared library on Linux. Probably the same stuff is necessary...
Anton Korobeynikov [Fri, 23 Mar 2012 10:00:42 +0000 (10:00 +0000)]
Add soname to LLVM shared library on Linux. Probably the same stuff is necessary for *BSD.
Patch from Mageia!

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

12 years agoWhen propagating equalities, eg replacing A with B in every basic block
Duncan Sands [Fri, 23 Mar 2012 08:45:52 +0000 (08:45 +0000)]
When propagating equalities, eg replacing A with B in every basic block
dominated by Root, check that B is available throughout the scope.  This
is obviously true (famous last words?) given the current logic, but the
check may be helpful if more complicated reasoning is added one day.

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

12 years agoIndentation.
Duncan Sands [Fri, 23 Mar 2012 08:29:04 +0000 (08:29 +0000)]
Indentation.

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

12 years agoIgnore the last message.
Bill Wendling [Fri, 23 Mar 2012 07:22:49 +0000 (07:22 +0000)]
Ignore the last message.

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

12 years agoRevert patch. It broke the build.
Bill Wendling [Fri, 23 Mar 2012 07:21:18 +0000 (07:21 +0000)]
Revert patch. It broke the build.

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

12 years agoDematerialize the source functions after we're done with them. This saves a bit
Bill Wendling [Fri, 23 Mar 2012 07:18:22 +0000 (07:18 +0000)]
Dematerialize the source functions after we're done with them. This saves a bit
of memory during LTO.

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

12 years agoRemove the C backend.
Eric Christopher [Fri, 23 Mar 2012 05:50:46 +0000 (05:50 +0000)]
Remove the C backend.

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

12 years agoFix up cmake build.
Eric Christopher [Fri, 23 Mar 2012 03:55:14 +0000 (03:55 +0000)]
Fix up cmake build.

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

12 years agoTake out the debug info probe stuff. It's making some changes to
Eric Christopher [Fri, 23 Mar 2012 03:54:05 +0000 (03:54 +0000)]
Take out the debug info probe stuff. It's making some changes to
the PassManager annoying and should be reimplemented as a decorator
on top of existing passes (as should the timing data).

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

12 years agoExplicitly close optionally closed <li> tags.
Nick Lewycky [Fri, 23 Mar 2012 00:56:26 +0000 (00:56 +0000)]
Explicitly close optionally closed <li> tags.

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

12 years agoRemove -enable-lsr-retry in time for 3.1.
Andrew Trick [Thu, 22 Mar 2012 22:42:51 +0000 (22:42 +0000)]
Remove -enable-lsr-retry in time for 3.1.

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

12 years agoRemove -enable-lsr-nested in time for 3.1.
Andrew Trick [Thu, 22 Mar 2012 22:42:45 +0000 (22:42 +0000)]
Remove -enable-lsr-nested in time for 3.1.

Tests cases have been removed but attached to open PR12330.

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

12 years agoSome whitespace and comment cleanup.
Bill Wendling [Thu, 22 Mar 2012 20:47:54 +0000 (20:47 +0000)]
Some whitespace and comment cleanup.

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

12 years agoRemove unneeded #ifdefs.
Bill Wendling [Thu, 22 Mar 2012 20:30:41 +0000 (20:30 +0000)]
Remove unneeded #ifdefs.

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

12 years agoAdd a 'dump' method to the type map. Doxygenify some of the comments and add a
Bill Wendling [Thu, 22 Mar 2012 20:28:27 +0000 (20:28 +0000)]
Add a 'dump' method to the type map. Doxygenify some of the comments and add a
few comments where none existed before. Also change a function's name to match
the current coding standard.
No functionality change.

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

12 years agoSource order scheduler should not preschedule nodes with multiple uses. rdar://11096639
Evan Cheng [Thu, 22 Mar 2012 19:31:17 +0000 (19:31 +0000)]
Source order scheduler should not preschedule nodes with multiple uses. rdar://11096639

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

12 years agoAssign node orders to target intrinsics which do not produce results. rdar://11096639
Evan Cheng [Thu, 22 Mar 2012 19:29:09 +0000 (19:29 +0000)]
Assign node orders to target intrinsics which do not produce results. rdar://11096639

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

12 years agoRefactor the code for visiting instructions out into helper functions.
Dan Gohman [Thu, 22 Mar 2012 18:24:56 +0000 (18:24 +0000)]
Refactor the code for visiting instructions out into helper functions.

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

12 years agoCleanup IVUsers::addUsersIfInteresting.
Andrew Trick [Thu, 22 Mar 2012 17:47:33 +0000 (17:47 +0000)]
Cleanup IVUsers::addUsersIfInteresting.

Keep the public interface clean, even though LLVM proper does not
currently use it.

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

12 years agoRemove unused simplifyIVUsers
Andrew Trick [Thu, 22 Mar 2012 17:47:30 +0000 (17:47 +0000)]
Remove unused simplifyIVUsers

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

12 years agoRemove -enable-iv-rewrite, which has been unsupported since 3.0.
Andrew Trick [Thu, 22 Mar 2012 17:10:11 +0000 (17:10 +0000)]
Remove -enable-iv-rewrite, which has been unsupported since 3.0.

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

12 years agoConvert -indvars tests that rely on SCEV expansion to -loop-reduce tests.
Andrew Trick [Thu, 22 Mar 2012 17:10:07 +0000 (17:10 +0000)]
Convert -indvars tests that rely on SCEV expansion to -loop-reduce tests.

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

12 years agoRemove tests: indvars trivially preserves GEPs now.
Andrew Trick [Thu, 22 Mar 2012 17:09:46 +0000 (17:09 +0000)]
Remove tests: indvars trivially preserves GEPs now.

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

12 years agoRemove test: trivial canonical IV test which is covered by other SCEV tests.
Andrew Trick [Thu, 22 Mar 2012 17:09:34 +0000 (17:09 +0000)]
Remove test: trivial canonical IV test which is covered by other SCEV tests.

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

12 years agoTest scalar evolution directly instead of testing the result of
Andrew Trick [Thu, 22 Mar 2012 17:09:31 +0000 (17:09 +0000)]
Test scalar evolution directly instead of testing the result of
canonical indvars.

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

12 years agoRemove redundant -enable-iv-rewrite=false flags from test cases.
Andrew Trick [Thu, 22 Mar 2012 17:09:04 +0000 (17:09 +0000)]
Remove redundant -enable-iv-rewrite=false flags from test cases.

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

12 years agoAdded soft fail checks for the disassembler when decoding some corner cases of the...
Silviu Baranga [Thu, 22 Mar 2012 14:14:49 +0000 (14:14 +0000)]
Added soft fail checks for the disassembler when decoding some corner cases of the STRD, STRH, LDRD, LDRH, LDRSH and LDRSB instructions on ARM.

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

12 years agoAdded soft fail cases for the disassembler when decoding LDRSBT, LDRHT or LDRSHT...
Silviu Baranga [Thu, 22 Mar 2012 13:24:43 +0000 (13:24 +0000)]
Added soft fail cases for the disassembler when decoding LDRSBT, LDRHT or LDRSHT instruction on ARM

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

12 years agoAdded soft fail cases for the disassembler when decoding MUL instructions on ARM.
Silviu Baranga [Thu, 22 Mar 2012 13:14:39 +0000 (13:14 +0000)]
Added soft fail cases for the disassembler when decoding MUL instructions on ARM.

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

12 years ago[python] Add negative MemoryBuffer testcase
Anders Waldenborg [Thu, 22 Mar 2012 11:23:52 +0000 (11:23 +0000)]
[python] Add negative MemoryBuffer testcase

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

12 years agoRemove some unnecessary forward declarations.
Craig Topper [Thu, 22 Mar 2012 06:52:14 +0000 (06:52 +0000)]
Remove some unnecessary forward declarations.

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

12 years agoRevert a series of commits to MCJIT to get the build working in CMake
Chandler Carruth [Thu, 22 Mar 2012 05:44:06 +0000 (05:44 +0000)]
Revert a series of commits to MCJIT to get the build working in CMake
(and hopefully on Windows). The bots have been down most of the day
because of this, and it's not clear to me what all will be required to
fix it.

The commits started with r153205, then r153207, r153208, and r153221.
The first commit seems to be the real culprit, but I couldn't revert
a smaller number of patches.

When resubmitting, r153207 and r153208 should be folded into r153205,
they were simple build fixes.

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

12 years agoPPC::DBG_VALUE must use Reg+Imm frame-index elimination even for large offsets. Fixes...
Hal Finkel [Thu, 22 Mar 2012 05:28:19 +0000 (05:28 +0000)]
PPC::DBG_VALUE must use Reg+Imm frame-index elimination even for large offsets. Fixes PR12203.

I don't have a small test case yet, but I'll try to construct one.

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

12 years agoadd load/store volatility control to the C API, patch by Yiannis Tsiouris!
Chris Lattner [Thu, 22 Mar 2012 03:54:15 +0000 (03:54 +0000)]
add load/store volatility control to the C API, patch by Yiannis Tsiouris!

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

12 years agodon't use "signed", just something I noticed in patches flying by.
Chris Lattner [Thu, 22 Mar 2012 03:46:58 +0000 (03:46 +0000)]
don't use "signed", just something I noticed in patches flying by.

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

12 years agoIn erroneous inline assembly we could mistakenly try to access the
Eric Christopher [Thu, 22 Mar 2012 01:33:51 +0000 (01:33 +0000)]
In erroneous inline assembly we could mistakenly try to access the
metadata operand as an actual operand, leading to an assert. Error
out in this case.

rdar://11007633

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

12 years ago[fast-isel] Fold "urem x, pow2" -> "and x, pow2-1". This should fix the 271%
Chad Rosier [Thu, 22 Mar 2012 00:21:17 +0000 (00:21 +0000)]
[fast-isel] Fold "urem x, pow2" -> "and x, pow2-1".  This should fix the 271%
execution-time regression for nsieve-bits on the ARMv7 -O0 -g nightly tester.
This may also improve compile-time on architectures that would otherwise
generate a libcall for urem (e.g., ARM) or fall back to the DAG selector.
rdar://10810716

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

12 years ago[PathV2]: Fix bug in create_directories which caused infinite recursion on
Michael J. Spencer [Wed, 21 Mar 2012 23:09:14 +0000 (23:09 +0000)]
[PathV2]: Fix bug in create_directories which caused infinite recursion on
som inputs.

Bug found and fix proposed by Kal Conley!

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

12 years agoAdd a release note for r145714.
Nick Lewycky [Wed, 21 Mar 2012 22:58:28 +0000 (22:58 +0000)]
Add a release note for r145714.

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

12 years agomisched: tag a few XFAILs that I plan to fix
Andrew Trick [Wed, 21 Mar 2012 22:31:31 +0000 (22:31 +0000)]
misched: tag a few XFAILs that I plan to fix

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

12 years agoRe-factored RuntimeDyld.
Danil Malyshev [Wed, 21 Mar 2012 21:06:29 +0000 (21:06 +0000)]
Re-factored RuntimeDyld.
Added ExecutionEngine/MCJIT tests.

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

12 years agoFix ARM disassembly of VST1 and VST2 instructions with writeback. And add test
Kevin Enderby [Wed, 21 Mar 2012 20:54:32 +0000 (20:54 +0000)]
Fix ARM disassembly of VST1 and VST2 instructions with writeback.  And add test
case for all opcodes handed by DecodeVSTInstruction() in ARMDisassembler.cpp .

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

12 years agoFix windows compilation warning. Patch by Micah.
Jan Sjödin [Wed, 21 Mar 2012 20:00:30 +0000 (20:00 +0000)]
Fix windows compilation warning. Patch by Micah.

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

12 years agoAdd a ${pathsep} variable to lit that expands to : (or ; on win32).
Nico Weber [Wed, 21 Mar 2012 19:56:42 +0000 (19:56 +0000)]
Add a ${pathsep} variable to lit that expands to : (or ; on win32).

This is in braces so that it doesn't conflict with the existing %p.
It uses braces instead of parens because parens would have to be
regex-escaped.

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

12 years agogit-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153208 91177308-0d34-0410...
Danil Malyshev [Wed, 21 Mar 2012 19:13:08 +0000 (19:13 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153208 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMissed getPointerToNamedFunction() declaration.
Danil Malyshev [Wed, 21 Mar 2012 18:47:10 +0000 (18:47 +0000)]
Missed getPointerToNamedFunction() declaration.

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

12 years agoBased on this discussion: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of...
Danil Malyshev [Wed, 21 Mar 2012 18:26:47 +0000 (18:26 +0000)]
Based on this discussion: lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120305/138477.html
1. Declare a virtual function getPointerToNamedFunction() in JITMemoryManager
2. Move the implementation of getPointerToNamedFunction() form JIT/MCJIT to DefaultJITMemoryManager.

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

12 years agoChecking a build_vector for an all-ones value.
Jim Grosbach [Wed, 21 Mar 2012 17:48:04 +0000 (17:48 +0000)]
Checking a build_vector for an all-ones value.

Type legalization can zero-extend the elements of the build_vector node, so,
for example, we may have an <8 x i8> with i32 elements of value 255. That
should return 'true' for the vector being all ones.

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

12 years ago[asan] fix one more bug related to long double
Kostya Serebryany [Wed, 21 Mar 2012 15:28:50 +0000 (15:28 +0000)]
[asan] fix one more bug related to long double

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

12 years agoPut Is64BitMemOperand into !defined(NDEBUG) for now.
Joerg Sonnenberger [Wed, 21 Mar 2012 14:09:26 +0000 (14:09 +0000)]
Put Is64BitMemOperand into !defined(NDEBUG) for now.

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

12 years agoUse a signed value for this enum to avoid spuriuos warnings from gcc.
Benjamin Kramer [Wed, 21 Mar 2012 13:48:11 +0000 (13:48 +0000)]
Use a signed value for this enum to avoid spuriuos warnings from gcc.

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

12 years agoTeach instsimplify to gracefully degrade in the presence of instructions
Chandler Carruth [Wed, 21 Mar 2012 10:58:47 +0000 (10:58 +0000)]
Teach instsimplify to gracefully degrade in the presence of instructions
not attched to a basic block or function. There are conservatively
correct answers in these cases, and this makes the analysis more useful
in contexts where we have a partially formed bit of IR.

I don't have any way to test this directly... suggestions welcome here,
but I'm not seeing anything sadly. I only found this using a subsequent
patch to the inliner which runs instsimplify on partially inlined
instructions, and even then only on a quite large program. I never got
a reasonable testcase out of it, and anything I do get is likely to be
quite fragile due to requiring an interaction of two different passes,
and the only result being a segfault if it goes wrong.

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

12 years ago[python] Add some paths where to find test binary
Anders Waldenborg [Wed, 21 Mar 2012 08:34:58 +0000 (08:34 +0000)]
[python] Add some paths where to find test binary

Adds /usr/lib/debug early to list, as some systems (debian) have unstripped libs in there
Adds /lib/i386-linux-gnu for systems that does multiarch (debian)

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

12 years ago[python] Mark get_test_binary as not being a test
Anders Waldenborg [Wed, 21 Mar 2012 08:18:19 +0000 (08:18 +0000)]
[python] Mark get_test_binary as not being a test

get_test_binary is a helper method, not a test, make sure nosetests
doesn't pick it up as a test.

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

12 years agolit/TestRunner.py: [Win32] Rework WinWaitReleased() again! "win32file" from Python...
NAKAMURA Takumi [Wed, 21 Mar 2012 07:49:44 +0000 (07:49 +0000)]
lit/TestRunner.py: [Win32] Rework WinWaitReleased() again! "win32file" from Python Win32 Extensions.

We can simply confirm the handle released to open it with EXCLUSIVE. Attempting renaming was bad.

Disable win32file at ImportError. Thanks to Francois to let me know.

FIXME: Could we report warning or notification if win32file were not found?

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

12 years agoFinish organizing C API docs.
Gregory Szorc [Wed, 21 Mar 2012 07:28:27 +0000 (07:28 +0000)]
Finish organizing C API docs.

Remaining "uncategorized" functions have been organized into their
proper place in the hierarchy. Some functions were moved around so
groups are defined together.

No code changes were made.

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

12 years agoFix generation of the address size override prefix. Add assertions for
Joerg Sonnenberger [Wed, 21 Mar 2012 05:48:07 +0000 (05:48 +0000)]
Fix generation of the address size override prefix. Add assertions for
the invalid cases. At least 16bit operand in 64bit mode is currently not
rejected in the parser.

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

12 years agoI meant to disable this test, not XFAIL it
Andrew Trick [Wed, 21 Mar 2012 05:18:53 +0000 (05:18 +0000)]
I meant to disable this test, not XFAIL it

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

12 years agomisched: beginning to add unit tests
Andrew Trick [Wed, 21 Mar 2012 04:12:19 +0000 (04:12 +0000)]
misched: beginning to add unit tests

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

12 years agomisched: fix LiveInterval update for bottom-up scheduling
Andrew Trick [Wed, 21 Mar 2012 04:12:16 +0000 (04:12 +0000)]
misched: fix LiveInterval update for bottom-up scheduling

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

12 years agomisched: trace LiveIntervals after scheduling.
Andrew Trick [Wed, 21 Mar 2012 04:12:12 +0000 (04:12 +0000)]
misched: trace LiveIntervals after scheduling.

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

12 years agomisched: obvious iterator update fixes for bottom-up.
Andrew Trick [Wed, 21 Mar 2012 04:12:10 +0000 (04:12 +0000)]
misched: obvious iterator update fixes for bottom-up.

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

12 years agomisched: cleanup main loop
Andrew Trick [Wed, 21 Mar 2012 04:12:07 +0000 (04:12 +0000)]
misched: cleanup main loop

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

12 years agomisched: fix LI update for bottom-up.
Andrew Trick [Wed, 21 Mar 2012 04:12:01 +0000 (04:12 +0000)]
misched: fix LI update for bottom-up.

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

12 years agoOrganize LLVM C API docs into doxygen modules; add docs
Gregory Szorc [Wed, 21 Mar 2012 03:54:29 +0000 (03:54 +0000)]
Organize LLVM C API docs into doxygen modules; add docs

This gives a lot of love to the docs for the C API. Like Clang's
documentation, the C API is now organized into a Doxygen "module"
(LLVMC). Each C header file is a child of the main module. Some modules
(like Core) have a hierarchy of there own. The produced documentation is
thus better organized (before everything was in one monolithic list).

This patch also includes a lot of new documentation for APIs in Core.h.
It doesn't document them all, but is better than none. Function docs are
missing @param and @return annotation, but the documentation body now
commonly provides help details (like the expected llvm::Value sub-type
to expect).

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

12 years agoAdd typecast to silence -Wswitch warning introduced by r153153.
Craig Topper [Wed, 21 Mar 2012 02:28:53 +0000 (02:28 +0000)]
Add typecast to silence -Wswitch warning introduced by r153153.

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

12 years agoSpacing fixes and using 'unsigned' instead of 'int' to index to select shuffle elemen...
Craig Topper [Wed, 21 Mar 2012 02:14:01 +0000 (02:14 +0000)]
Spacing fixes and using 'unsigned' instead of 'int' to index to select shuffle elements for consistency with other shuffle code in X86 backend.

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

12 years agoIncremental big endian patch by Jack Carter.
Akira Hatanaka [Wed, 21 Mar 2012 00:52:01 +0000 (00:52 +0000)]
Incremental big endian patch by Jack Carter.

These changes allow us to compile big endian from the command line for 32 bit
Mips targets. This patch will result in code and data actually being produced
in the correct endianess.

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

12 years agoZap some dead code pointed out by Chandler.
Eric Christopher [Tue, 20 Mar 2012 23:28:58 +0000 (23:28 +0000)]
Zap some dead code pointed out by Chandler.

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

12 years agoMake sure ImmutableSet never inserts Tombstone/Entry into DenseMap.
Anna Zaks [Tue, 20 Mar 2012 22:56:27 +0000 (22:56 +0000)]
Make sure ImmutableSet never inserts Tombstone/Entry into DenseMap.

ImmutAVLTree uses random unsigned values as keys into a DenseMap,
which could possibly happen to be the same value as the Tombstone or
Entry keys in the DenseMap.

Test case is hard to come up with. We randomly get failures on the
internal static analyzer bot, which most likely hits this issue
(hard to be 100% sure without the full stack).

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

12 years agoRuntimeDyldMachO has the ability to keep track of
Sean Callanan [Tue, 20 Mar 2012 22:25:39 +0000 (22:25 +0000)]
RuntimeDyldMachO has the ability to keep track of
relocations (i.e., pieces of data whose addresses
are referred to elsewhere in the binary image) and
update the references when the section containing
the relocations moves.  The way this works is that
there is a map from section IDs to lists of
relocations.

Because the relocations are associated with the
section containing the data being referred to, they
are updated only when the target moves.  However,
many data references are relative and also depend
on the location of the referrer.

To solve this problem, I introduced a new data
structure, Referrer, which simply contains the
section being referred to and the index of the
relocation in that section.  These referrers are
associated with the source containing the
reference that needs to be updated, so now
regardless of which end of the relocation moves,
the relocation will now be updated correctly.

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