oota-llvm.git
16 years agoUnbreak non-PPC builds
Anton Korobeynikov [Tue, 17 Jun 2008 17:38:31 +0000 (17:38 +0000)]
Unbreak non-PPC builds

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

16 years agoProvide generic hooks for icache invalidation. Add PPC implementation.
Anton Korobeynikov [Tue, 17 Jun 2008 17:30:05 +0000 (17:30 +0000)]
Provide generic hooks for icache invalidation. Add PPC implementation.
Patch by Gary Benson!

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

16 years agorevert recent patch which is causing widespread breakage.
Chris Lattner [Tue, 17 Jun 2008 17:06:43 +0000 (17:06 +0000)]
revert recent patch which is causing widespread breakage.

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

16 years agoDon't forget to initialize SymbolSearchingDisabled.
Evan Cheng [Tue, 17 Jun 2008 16:49:02 +0000 (16:49 +0000)]
Don't forget to initialize SymbolSearchingDisabled.

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

16 years agoFix typo that changed the logic to something wrong.
Duncan Sands [Tue, 17 Jun 2008 15:55:30 +0000 (15:55 +0000)]
Fix typo that changed the logic to something wrong.
Spotted by Nick Lewycky.

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

16 years agoSplit type expansion into ExpandInteger and ExpandFloat
Duncan Sands [Tue, 17 Jun 2008 14:27:01 +0000 (14:27 +0000)]
Split type expansion into ExpandInteger and ExpandFloat
rather than bundling them together.  Rename FloatToInt
to PromoteFloat (better, if not perfect).  Reorganize
files by types rather than by operations.

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

16 years agoForgot to commit the ValueTracking header file along with r52396.
Matthijs Kooijman [Tue, 17 Jun 2008 13:54:33 +0000 (13:54 +0000)]
Forgot to commit the ValueTracking header file along with r52396.

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

16 years agoLearn IPConstProp to propagate arguments that are directly returned. Strictly
Matthijs Kooijman [Tue, 17 Jun 2008 12:20:24 +0000 (12:20 +0000)]
Learn IPConstProp to propagate arguments that are directly returned. Strictly
speaking these are not constant values. However, when a function always returns
one of its arguments, then from the point of view of each caller the return
value is constant (or at least a known value) and can be replaced.

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

16 years agoLearn IPConstProp to look at individual return values and propagate them
Matthijs Kooijman [Tue, 17 Jun 2008 12:02:52 +0000 (12:02 +0000)]
Learn IPConstProp to look at individual return values and propagate them
individually.

Also learn IPConstProp how returning first class aggregates work, in addition
to old style multiple return instructions.

Modify the return-constants testscase to confirm this behaviour.

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

16 years ago80 column fixes.
Matthijs Kooijman [Tue, 17 Jun 2008 08:26:32 +0000 (08:26 +0000)]
80 column fixes.

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

16 years agoUse a SmallVector instead of an array, since auto_ptr doesn't handle arrays
Matthijs Kooijman [Tue, 17 Jun 2008 08:24:37 +0000 (08:24 +0000)]
Use a SmallVector instead of an array, since auto_ptr doesn't handle arrays
properly.

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

16 years agoadd a new -enable-value-prop flag for llcbeta, that enables propagation
Chris Lattner [Tue, 17 Jun 2008 06:09:18 +0000 (06:09 +0000)]
add a new -enable-value-prop flag for llcbeta, that enables propagation
of value info (sign/zero ext info) from one MBB to another.  This doesn't
handle much right now because of two limitations:

1) only handles zext/sext, not random bit propagation (no assert exists
   for this)
2) doesn't handle phis.

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

16 years agoFix spelling.
Duncan Sands [Tue, 17 Jun 2008 03:24:13 +0000 (03:24 +0000)]
Fix spelling.

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

16 years agoRather than avoiding to wrap ISD::DECLARE GV operand in X86ISD::Wrapper, simply handl...
Evan Cheng [Tue, 17 Jun 2008 02:01:22 +0000 (02:01 +0000)]
Rather than avoiding to wrap ISD::DECLARE GV operand in X86ISD::Wrapper, simply handle it at dagisel time with x86 specific isel code.

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

16 years agoAdd a missing ~ (dtor became ctor) which caused crashes on a bunch of stuff.
Chris Lattner [Mon, 16 Jun 2008 23:06:51 +0000 (23:06 +0000)]
Add a missing ~ (dtor became ctor) which caused crashes on a bunch of stuff.

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

16 years agoDo not issue identity copies.
Evan Cheng [Mon, 16 Jun 2008 22:52:53 +0000 (22:52 +0000)]
Do not issue identity copies.

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

16 years agoRefine the change in r52258 for avoiding use-before-def conditions
Dan Gohman [Mon, 16 Jun 2008 22:34:15 +0000 (22:34 +0000)]
Refine the change in r52258 for avoiding use-before-def conditions
when changing the stride of a comparison so that it's slightly
more precise, by having it scan the instruction list to determine
if there is a use of the condition after the point where the
condition will be inserted.

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

16 years agoswitch TypeHasCycleThroughItself from using an std::set to using a SmallPtrSet,
Chris Lattner [Mon, 16 Jun 2008 21:20:58 +0000 (21:20 +0000)]
switch TypeHasCycleThroughItself from using an std::set to using a SmallPtrSet,
this speeds up the linking testcase in PR1860 by 44% (.379 -> 0.263)

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

16 years agostop making PATypeHolder's so crazily.
Chris Lattner [Mon, 16 Jun 2008 21:17:12 +0000 (21:17 +0000)]
stop making PATypeHolder's so crazily.

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

16 years agoHorizontal-add instructions are not commutative.
Evan Cheng [Mon, 16 Jun 2008 21:16:24 +0000 (21:16 +0000)]
Horizontal-add instructions are not commutative.

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

16 years agoSwitch over to SetVector to ensure same order of iterations do not vary across runs.
Evan Cheng [Mon, 16 Jun 2008 21:08:17 +0000 (21:08 +0000)]
Switch over to SetVector to ensure same order of iterations do not vary across runs.

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

16 years agoMove some documentation from the header file into ProgrammersManual. About to improve.
Gabor Greif [Mon, 16 Jun 2008 21:06:12 +0000 (21:06 +0000)]
Move some documentation from the header file into ProgrammersManual. About to improve.

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

16 years agouse a real associative container for type association instead of using
Chris Lattner [Mon, 16 Jun 2008 21:00:18 +0000 (21:00 +0000)]
use a real associative container for type association instead of using
a vector with a linear search.  This speeds up the linking testcase
in PR1860 from 0.965s to 0.385s on my system.

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

16 years ago- Add "Commutative" property to intrinsics. This allows tblgen to generate the commut...
Evan Cheng [Mon, 16 Jun 2008 20:29:38 +0000 (20:29 +0000)]
- Add "Commutative" property to intrinsics. This allows tblgen to generate the commuted variants for dagisel matching code.
- Mark lots of X86 intrinsics as "Commutative" to allow load folding.

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

16 years agompsadbw is commutable.
Evan Cheng [Mon, 16 Jun 2008 20:25:59 +0000 (20:25 +0000)]
mpsadbw is commutable.

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

16 years agobail out sooner if we have two concrete but different types.
Chris Lattner [Mon, 16 Jun 2008 20:03:01 +0000 (20:03 +0000)]
bail out sooner if we have two concrete but different types.

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

16 years agosimplify some code.
Chris Lattner [Mon, 16 Jun 2008 19:55:40 +0000 (19:55 +0000)]
simplify some code.

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

16 years agoApply a patch from Nathan Keynes, which speeds up llvm-link on
Chris Lattner [Mon, 16 Jun 2008 19:48:08 +0000 (19:48 +0000)]
Apply a patch from Nathan Keynes, which speeds up llvm-link on
the testcases in PR1860 from taking more than 1 hour (when I killed it)
to taking 1s.

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

16 years agoRemove special case handling of empty MBBs now that we assign indices to them.
Owen Anderson [Mon, 16 Jun 2008 19:32:40 +0000 (19:32 +0000)]
Remove special case handling of empty MBBs now that we assign indices to them.

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

16 years agohandle vectors. Any integers that got here would necessarily be different already.
Chris Lattner [Mon, 16 Jun 2008 18:27:53 +0000 (18:27 +0000)]
handle vectors.  Any integers that got here would necessarily be different already.

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

16 years agoSimplify ResolveTypes by pulling the null case out into the one
Chris Lattner [Mon, 16 Jun 2008 18:19:05 +0000 (18:19 +0000)]
Simplify ResolveTypes by pulling the null case out into the one
client that cares and simplifying its control flow.

Remove the DestST argument to ResolveTypes and RecursiveResolveTypes*
which are dead now.

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

16 years agoIterating over SmallPtrSet is not deterministic.
Evan Cheng [Mon, 16 Jun 2008 18:17:09 +0000 (18:17 +0000)]
Iterating over SmallPtrSet is not deterministic.

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

16 years agosimplify RecursiveResolveTypes and ResolveTypes by pulling the naming out of
Chris Lattner [Mon, 16 Jun 2008 18:11:40 +0000 (18:11 +0000)]
simplify RecursiveResolveTypes and ResolveTypes by pulling the naming out of
ResolveTypes into the one place that needs it.

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

16 years agoAdd a new flag that disables symbol lookup with dlsym when set. This allows
Chris Lattner [Mon, 16 Jun 2008 17:44:14 +0000 (17:44 +0000)]
Add a new flag that disables symbol lookup with dlsym when set.  This allows
a JIT client to completely control symbol lookup with the LazyFunctionCreator
interface.

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

16 years agoAdd support for icache invalidation on non-darwin ppc systems.
Chris Lattner [Mon, 16 Jun 2008 17:04:06 +0000 (17:04 +0000)]
Add support for icache invalidation on non-darwin ppc systems.
Patch by Gary Benson!

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

16 years agoRe-enable empty block indexing by default, since it doesn't seem to have any
Owen Anderson [Mon, 16 Jun 2008 16:58:24 +0000 (16:58 +0000)]
Re-enable empty block indexing by default, since it doesn't seem to have any
impact on code quality or compile time.

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

16 years agoMake BuildSubAggregate use FindInsertedElement again to prevent it from
Matthijs Kooijman [Mon, 16 Jun 2008 14:13:46 +0000 (14:13 +0000)]
Make BuildSubAggregate use FindInsertedElement again to prevent it from
inserting extractvalues. In particular, this prevents the insertion of
extractvalues that can't be folded away later. Also add an example of when this
stuff is needed.

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

16 years agoMake the InsertBefore argument to FindInsertedValue optional, so you can find an...
Matthijs Kooijman [Mon, 16 Jun 2008 13:28:31 +0000 (13:28 +0000)]
Make the InsertBefore argument to FindInsertedValue optional, so you can find an inserted value without modifying the code.

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

16 years agoPass around Instruction* instead of Instruction& in FindInsertedValue and friends.
Matthijs Kooijman [Mon, 16 Jun 2008 13:13:08 +0000 (13:13 +0000)]
Pass around Instruction* instead of Instruction& in FindInsertedValue and friends.

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

16 years agoMake testcase check for extractvalue instead of extractelement.
Matthijs Kooijman [Mon, 16 Jun 2008 13:03:44 +0000 (13:03 +0000)]
Make testcase check for extractvalue instead of extractelement.

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

16 years ago80 column fixes.
Matthijs Kooijman [Mon, 16 Jun 2008 12:57:37 +0000 (12:57 +0000)]
80 column fixes.

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

16 years agoMove FindScalarValue from InstructionCombining.cpp to ValueTracking.cpp. While
Matthijs Kooijman [Mon, 16 Jun 2008 12:48:21 +0000 (12:48 +0000)]
Move FindScalarValue from InstructionCombining.cpp to ValueTracking.cpp. While
I'm at it, rename it to FindInsertedValue.

The only functional change is that newly created instructions are no longer
added to instcombine's worklist, but that is not really necessary anyway (and
I'll commit some improvements next that will completely remove the need).

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

16 years agoStore the result of multiple identical run lines in a temporary file.
Matthijs Kooijman [Mon, 16 Jun 2008 12:21:25 +0000 (12:21 +0000)]
Store the result of multiple identical run lines in a temporary file.

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

16 years agoAdd comment.
Matthijs Kooijman [Mon, 16 Jun 2008 12:20:05 +0000 (12:20 +0000)]
Add comment.

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

16 years agoMinor comment fix.
Argyrios Kyrtzidis [Mon, 16 Jun 2008 10:14:09 +0000 (10:14 +0000)]
Minor comment fix.

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

16 years agoFix PR numbers, I accidentally switched two digits.
Matthijs Kooijman [Mon, 16 Jun 2008 09:38:23 +0000 (09:38 +0000)]
Fix PR numbers, I accidentally switched two digits.

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

16 years agoAllow these transforms for types like i256 while
Duncan Sands [Mon, 16 Jun 2008 08:14:38 +0000 (08:14 +0000)]
Allow these transforms for types like i256 while
still excluding types like i1 (not byte sized)
and i120 (loading an i120 requires loading an i64,
an i32, an i16 and an i8, which is expensive).

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

16 years agoFix read after free found by valgrind.
Evan Cheng [Mon, 16 Jun 2008 07:34:17 +0000 (07:34 +0000)]
Fix read after free found by valgrind.

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

16 years agoAdd option to commuteInstruction() which forces it to create a new (commuted) instruc...
Evan Cheng [Mon, 16 Jun 2008 07:33:11 +0000 (07:33 +0000)]
Add option to commuteInstruction() which forces it to create a new (commuted) instruction.

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

16 years agoMake indexing empty basic blocks an option for the moment.
Owen Anderson [Mon, 16 Jun 2008 07:10:49 +0000 (07:10 +0000)]
Make indexing empty basic blocks an option for the moment.

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

16 years agoadd a const version of stripPointerCasts
Chris Lattner [Mon, 16 Jun 2008 06:43:06 +0000 (06:43 +0000)]
add a const version of stripPointerCasts

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

16 years agosimplify some code by using a helper function. This really really
Chris Lattner [Mon, 16 Jun 2008 06:38:26 +0000 (06:38 +0000)]
simplify some code by using a helper function.  This really really
wants a 'nocapture' predicate.

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

16 years agomove a bunch of predicates up into their own section
Chris Lattner [Mon, 16 Jun 2008 06:30:22 +0000 (06:30 +0000)]
move a bunch of predicates up into their own section
in this file, no other changes.

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

16 years agoOther parts of this code treat noalias arguments as objects for
Chris Lattner [Mon, 16 Jun 2008 06:28:01 +0000 (06:28 +0000)]
Other parts of this code treat noalias arguments as objects for
the purposes of escape analysis.

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

16 years agoIf we are checking to see if the result of a call aliases a
Chris Lattner [Mon, 16 Jun 2008 06:19:11 +0000 (06:19 +0000)]
If we are checking to see if the result of a call aliases a
pointer derived from a local allocation, if the local allocation
never escapes, the pointers can't alias.  This implements PR2436

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

16 years agoAssign indices to empty basic blocks. This will be necessary for StrongPHIEliminatio...
Owen Anderson [Mon, 16 Jun 2008 06:18:41 +0000 (06:18 +0000)]
Assign indices to empty basic blocks.  This will be necessary for StrongPHIElimination in the near future.

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

16 years agoRefactor basicaa's main alias function somethin' fierce.
Chris Lattner [Mon, 16 Jun 2008 06:10:11 +0000 (06:10 +0000)]
Refactor basicaa's main alias function somethin' fierce.
This fixes several minor bugs (such as returning noalias
for comparisons between external weak functions an null) but
is mostly a cleanup.

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

16 years agothis is unneeded now.
Chris Lattner [Mon, 16 Jun 2008 04:25:39 +0000 (04:25 +0000)]
this is unneeded now.

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

16 years agoSwitch from generating the int128 typedefs based on targetdata to generating
Chris Lattner [Mon, 16 Jun 2008 04:25:29 +0000 (04:25 +0000)]
Switch from generating the int128 typedefs based on targetdata to generating
them based on the end-compiler's capabilities.  This fixes PR2453

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

16 years agoresolve PR2453 by adding a run line.
Chris Lattner [Mon, 16 Jun 2008 04:22:39 +0000 (04:22 +0000)]
resolve PR2453 by adding a run line.

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

16 years agoFix the crash on SimplifyLibCalls/2005-05-20-sprintf-crash.ll
Chris Lattner [Mon, 16 Jun 2008 04:10:21 +0000 (04:10 +0000)]
Fix the crash on SimplifyLibCalls/2005-05-20-sprintf-crash.ll

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

16 years agofix pr2460
Chris Lattner [Mon, 16 Jun 2008 04:02:40 +0000 (04:02 +0000)]
fix pr2460

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

16 years agoThe transforms in visitEXTRACT_VECTOR_ELT are
Duncan Sands [Sun, 15 Jun 2008 20:12:31 +0000 (20:12 +0000)]
The transforms in visitEXTRACT_VECTOR_ELT are
not valid if the load is volatile.  Hopefully
all wrong DAG combiner transforms of volatile
loads and stores have now been caught.

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

16 years agoLegalizeTypes support for INSERT_VECTOR_ELT with
Duncan Sands [Sun, 15 Jun 2008 20:00:14 +0000 (20:00 +0000)]
LegalizeTypes support for INSERT_VECTOR_ELT with
a non-constant index.

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

16 years agoFix PR2434. When scanning for exising binary operator to reuse don't
Wojciech Matyjewicz [Sun, 15 Jun 2008 19:07:39 +0000 (19:07 +0000)]
Fix PR2434. When scanning for exising binary operator to reuse don't
take into account the instrucion pointed by InsertPt. Thanks to it,
returning the new value of InsertPt to the InsertBinop() caller can be
avoided. The bug was, actually, in visitAddRecExpr() method which wasn't
correctly handling changes of InsertPt. There shouldn't be any
performance regression, as -gvn pass (run after -indvars) removes any
redundant binops.

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

16 years agoAdd a missing semicolon.
Wojciech Matyjewicz [Sun, 15 Jun 2008 18:02:47 +0000 (18:02 +0000)]
Add a missing semicolon.

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

16 years agoAdd an "exe" suffix only if the output file has no suffix at all.
Argyrios Kyrtzidis [Sun, 15 Jun 2008 15:20:16 +0000 (15:20 +0000)]
Add an "exe" suffix only if the output file has no suffix at all.

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

16 years agoFix the sys::Path::getSuffix() implementation.
Argyrios Kyrtzidis [Sun, 15 Jun 2008 15:15:19 +0000 (15:15 +0000)]
Fix the sys::Path::getSuffix() implementation.

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

16 years agoMake sure all produced executable files have "exe" suffix on Windows.
Argyrios Kyrtzidis [Sun, 15 Jun 2008 13:48:12 +0000 (13:48 +0000)]
Make sure all produced executable files have "exe" suffix on Windows.
With this more general way, -native and -native-cbe options are handled too.

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

16 years agoMake sure that the current executable filename has "exe" suffix on Windows.
Argyrios Kyrtzidis [Sun, 15 Jun 2008 12:07:01 +0000 (12:07 +0000)]
Make sure that the current executable filename has "exe" suffix on Windows.

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

16 years agoAppend "exe" suffix to executable files.
Argyrios Kyrtzidis [Sun, 15 Jun 2008 12:01:16 +0000 (12:01 +0000)]
Append "exe" suffix to executable files.

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

16 years agoFix the environment block that is passed to the CreateProcess function.
Argyrios Kyrtzidis [Sun, 15 Jun 2008 03:54:39 +0000 (03:54 +0000)]
Fix the environment block that is passed to the CreateProcess function.
This bug made llvm-ld unable to function with "-native" option, since the process that was used to call 'gcc' was crashing.

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

16 years agoRemove a redundant AfterLegalize check. Turn
Duncan Sands [Sat, 14 Jun 2008 17:48:34 +0000 (17:48 +0000)]
Remove a redundant AfterLegalize check.  Turn
on some code when !AfterLegalize - but since
this whole code section is turned off by an
"if (0)" it's not really turning anything on.

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

16 years agoChange 'while' loop to 'do' loop.
Wojciech Matyjewicz [Sat, 14 Jun 2008 16:48:22 +0000 (16:48 +0000)]
Change 'while' loop to 'do' loop.

Add a safety measure. It isn't safe to assume in ScalarEvolutionExpander that
all loops are in canonical form (but it should be safe for loops that have
AddRecs).
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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

16 years agoadd missing atomic intrinsic from gcc
Andrew Lenharth [Sat, 14 Jun 2008 05:48:15 +0000 (05:48 +0000)]
add missing atomic intrinsic from gcc

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

16 years agoFix a case where tailcallelim wouldn't set the changed bit when it made a change.
Chris Lattner [Sat, 14 Jun 2008 00:49:48 +0000 (00:49 +0000)]
Fix a case where tailcallelim wouldn't set the changed bit when it made a change.

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

16 years agoTeach the spiller to commute instructions in order to fold a reload. This hits 410...
Evan Cheng [Fri, 13 Jun 2008 23:58:02 +0000 (23:58 +0000)]
Teach the spiller to commute instructions in order to fold a reload. This hits 410 times on 444.namd and 122 times on 252.eon.

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

16 years agoRemove unnecessary target lines.
Eli Friedman [Fri, 13 Jun 2008 22:12:16 +0000 (22:12 +0000)]
Remove unnecessary target lines.

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

16 years agoRemove unnecessary target lines.
Eli Friedman [Fri, 13 Jun 2008 22:10:32 +0000 (22:10 +0000)]
Remove unnecessary target lines.

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

16 years agoDon't skip over instructions other than loads that might read memory
Eli Friedman [Fri, 13 Jun 2008 22:02:12 +0000 (22:02 +0000)]
Don't skip over instructions other than loads that might read memory
when trying to sink stores.

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

16 years agoProtect ChangeCompareStride from situations in which it is possible
Dan Gohman [Fri, 13 Jun 2008 21:43:41 +0000 (21:43 +0000)]
Protect ChangeCompareStride from situations in which it is possible
for it to generate use-before-def IR, such as in this testcase.

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

16 years agoMake sure SimplifyStoreAtEndOfBlock doesn't mess with loops; the
Eli Friedman [Fri, 13 Jun 2008 21:17:49 +0000 (21:17 +0000)]
Make sure SimplifyStoreAtEndOfBlock doesn't mess with loops; the
structure checks are incorrect if the blocks aren't distinct.
Fixes PR2435.

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

16 years agoDisable some DAG combiner optimizations that may be
Duncan Sands [Fri, 13 Jun 2008 19:07:40 +0000 (19:07 +0000)]
Disable some DAG combiner optimizations that may be
wrong for volatile loads and stores.  In fact this
is almost all of them!  There are three types of
problems: (1) it is wrong to change the width of
a volatile memory access.  These may be used to
do memory mapped i/o, in which case a load can have
an effect even if the result is not used.  Consider
loading an i32 but only using the lower 8 bits.  It
is wrong to change this into a load of an i8, because
you are no longer tickling the other three bytes.  It
is also unwise to make a load/store wider.  For
example, changing an i16 load into an i32 load is
wrong no matter how aligned things are, since the
fact of loading an additional 2 bytes can have
i/o side-effects.  (2) it is wrong to change the
number of volatile load/stores: they may be counted
by the hardware.  (3) it is wrong to change a volatile
load/store that requires one memory access into one
that requires several.  For example on x86-32, you
can store a double in one processor operation, but to
store an i64 requires two (two i32 stores).  In a
multi-threaded program you may want to bitcast an i64
to a double and store as a double because that will
occur atomically, and be indivisible to other threads.
So it would be wrong to convert the store-of-double
into a store of an i64, because this will become two
i32 stores - no longer atomic.  My policy here is
to say that the number of processor operations for
an illegal operation is undefined.  So it is alright
to change a store of an i64 (requires at least two
stores; but could be validly lowered to memcpy for
example) into a store of double (one processor op).
In short, if the new store is legal and has the same
size then I say that the transform is ok.  It would
also be possible to say that transforms are always
ok if before they were illegal, whether after they
are illegal or not, but that's more awkward to do
and I doubt it buys us anything much.
However this exposed an interesting thing - on x86-32
a store of i64 is considered legal!  That is because
operations are marked legal by default, regardless of
whether the type is legal or not.  In some ways this
is clever: before type legalization this means that
operations on illegal types are considered legal;
after type legalization there are no illegal types
so now operations are only legal if they really are.
But I consider this to be too cunning for mere mortals.
Better to do things explicitly by testing AfterLegalize.
So I have changed things so that operations with illegal
types are considered illegal - indeed they can never
map to a machine operation.  However this means that
the DAG combiner is more conservative because before
it was "accidentally" performing transforms where the
type was illegal because the operation was nonetheless
marked legal.  So in a few such places I added a check
on AfterLegalize, which I suppose was actually just
forgotten before.  This causes the DAG combiner to do
slightly more than it used to, which resulted in the X86
backend blowing up because it got a slightly surprising
node it wasn't expecting, so I tweaked it.

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

16 years agoFix an error in the two-address example.
Dan Gohman [Fri, 13 Jun 2008 17:55:57 +0000 (17:55 +0000)]
Fix an error in the two-address example.

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

16 years agoUse recently added getTruncateOrZeroExtend method to make the code shorter.
Wojciech Matyjewicz [Fri, 13 Jun 2008 17:02:03 +0000 (17:02 +0000)]
Use recently added getTruncateOrZeroExtend method to make the code shorter.

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

16 years agoXFAIL some tests that became failing due to the extra error reporting recently. PR...
Matthijs Kooijman [Fri, 13 Jun 2008 16:52:35 +0000 (16:52 +0000)]
XFAIL some tests that became failing due to the extra error reporting recently. PR's are created for these.

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

16 years agoCrash less. The i64 restriction in BinomialCoefficient caused some problems
Nick Lewycky [Fri, 13 Jun 2008 04:38:55 +0000 (04:38 +0000)]
Crash less. The i64 restriction in BinomialCoefficient caused some problems
with code that was expecting different bit widths for different values.

Make getTruncateOrZeroExtend a method on ScalarEvolution, and use it.

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

16 years agofix a minor deviation from the original in my previous commit
Gabor Greif [Thu, 12 Jun 2008 21:51:29 +0000 (21:51 +0000)]
fix a minor deviation from the original in my previous commit

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

16 years agoop_iterator-ify some loops, low hanging fruit only, there is more
Gabor Greif [Thu, 12 Jun 2008 21:37:33 +0000 (21:37 +0000)]
op_iterator-ify some loops, low hanging fruit only, there is more

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

16 years agoFix some tests.
Evan Cheng [Thu, 12 Jun 2008 21:23:38 +0000 (21:23 +0000)]
Fix some tests.

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

16 years agoDo not speculatively execute an instruction by hoisting it to its predecessor BB...
Evan Cheng [Thu, 12 Jun 2008 21:15:59 +0000 (21:15 +0000)]
Do not speculatively execute an instruction by hoisting it to its predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block.

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

16 years agoRevert 52223.
Evan Cheng [Thu, 12 Jun 2008 20:55:39 +0000 (20:55 +0000)]
Revert 52223.

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

16 years agoSwitch GVN to use ScopedHashTable.
Owen Anderson [Thu, 12 Jun 2008 19:25:32 +0000 (19:25 +0000)]
Switch GVN to use ScopedHashTable.

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

16 years agoImprove description of -emit-llvm.
Dale Johannesen [Thu, 12 Jun 2008 17:04:09 +0000 (17:04 +0000)]
Improve description of -emit-llvm.

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

16 years agoDon't try to compile tests for the ev56 alpha subtarget, which hasn't been
Matthijs Kooijman [Thu, 12 Jun 2008 13:44:26 +0000 (13:44 +0000)]
Don't try to compile tests for the ev56 alpha subtarget, which hasn't been
supported since r33492.

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

16 years agoPass -silence-passes to bugpoint in testcases, this makes two out of three bugpoint...
Matthijs Kooijman [Thu, 12 Jun 2008 13:12:11 +0000 (13:12 +0000)]
Pass -silence-passes to bugpoint in testcases, this makes two out of three bugpoint testcases work again.

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

16 years agoLet bugpoint display generated messages on stderr only if no interpreter was
Matthijs Kooijman [Thu, 12 Jun 2008 13:09:43 +0000 (13:09 +0000)]
Let bugpoint display generated messages on stderr only if no interpreter was
found, this ensures that messages like "Found gcc" end up on stdout where they
belong.

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

16 years agoAdd -silence-passes option to bugpoint. This option suppresses output generated
Matthijs Kooijman [Thu, 12 Jun 2008 13:02:26 +0000 (13:02 +0000)]
Add -silence-passes option to bugpoint. This option suppresses output generated
when bugpoint is running passes in a child process.

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

16 years agoFix redirection of stderr in sys::Program::ExecuteAndWait. There was logic
Matthijs Kooijman [Thu, 12 Jun 2008 12:53:35 +0000 (12:53 +0000)]
Fix redirection of stderr in sys::Program::ExecuteAndWait. There was logic
error that caused it to redirect stderr to stdout too often.

This fix is applied identically to the win32 code as well, but that is
untested.
--Thi line, and those below, will be ignored--

M    System/Unix/Program.inc
M    System/Win32/Program.inc

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

16 years agoMake I/O redirection handling in sys::Program a bit more consistent. No
Matthijs Kooijman [Thu, 12 Jun 2008 10:47:18 +0000 (10:47 +0000)]
Make I/O redirection handling in sys::Program a bit more consistent. No
functional changes. Win32 code is untested, but should work fine.

In the unix variant, rename RedirectFD to RedirectIO and let that function
handle empty and null paths instead of doing that in the caller 3 times. This
is the same as win32 already does it.

In the win32 variant, use Path::isEmpty() instead of checking the resulting
c_str() manually. This is the same as unix already does it.

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