oota-llvm.git
16 years agoRemove this test until the corresponding patch is reapplied because it's causing...
Owen Anderson [Wed, 18 Jun 2008 22:37:31 +0000 (22:37 +0000)]
Remove this test until the corresponding patch is reapplied because it's causing make check to crash for some people.

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

16 years agoAdd support for extractvalue and insertvalue instructions in GVN.
Owen Anderson [Wed, 18 Jun 2008 21:59:00 +0000 (21:59 +0000)]
Add support for extractvalue and insertvalue instructions in GVN.

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

16 years agoAdd local PRE to GVN. This only operates in cases where it would not increase code...
Owen Anderson [Wed, 18 Jun 2008 21:41:49 +0000 (21:41 +0000)]
Add local PRE to GVN.  This only operates in cases where it would not increase code size, namely when the instantiated expression
would only need to be created in one predecessor.

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

16 years agoRefactor the way to get a string containing the features of the target.
Bill Wendling [Wed, 18 Jun 2008 21:39:02 +0000 (21:39 +0000)]
Refactor the way to get a string containing the features of the target.

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

16 years agoFix the source line debug information for the Windows platform.
Argyrios Kyrtzidis [Wed, 18 Jun 2008 19:27:37 +0000 (19:27 +0000)]
Fix the source line debug information for the Windows platform.

According to DWARF-2 specification, the line information is provided through an offset in the .debug_line section.
Replace the label reference that is used with a section offset.

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

16 years agoFix a missing comma spotted by Bram Geron.
Dan Gohman [Wed, 18 Jun 2008 18:42:13 +0000 (18:42 +0000)]
Fix a missing comma spotted by Bram Geron.

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

16 years agoFix the regressions on sext-misc.ll my patch yesterday caused.
Chris Lattner [Wed, 18 Jun 2008 18:11:55 +0000 (18:11 +0000)]
Fix the regressions on sext-misc.ll my patch yesterday caused.

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

16 years agoRevert r52459, which was causing an infinite loop or massive slowdown on MultiSource...
Owen Anderson [Wed, 18 Jun 2008 17:32:16 +0000 (17:32 +0000)]
Revert r52459, which was causing an infinite loop or massive slowdown on MultiSource/Applications/SPASS, and possibly others as well.
Please reapply once this is fixed.

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

16 years agoMove SCEVExpander::visitAddExpr out-of-line.
Dan Gohman [Wed, 18 Jun 2008 16:37:11 +0000 (16:37 +0000)]
Move SCEVExpander::visitAddExpr out-of-line.

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

16 years agoMove LSR's private isZero function to a public SCEV member
Dan Gohman [Wed, 18 Jun 2008 16:23:07 +0000 (16:23 +0000)]
Move LSR's private isZero function to a public SCEV member
function, and make use of it in several places.

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

16 years agofix validator warning
Gabor Greif [Wed, 18 Jun 2008 14:05:31 +0000 (14:05 +0000)]
fix validator warning

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

16 years agoprettify, no semantic changes
Gabor Greif [Wed, 18 Jun 2008 13:44:57 +0000 (13:44 +0000)]
prettify, no semantic changes

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

16 years agoRewrite the DeadArgumentElimination pass, to use a more explicit tracking of
Matthijs Kooijman [Wed, 18 Jun 2008 11:12:53 +0000 (11:12 +0000)]
Rewrite the DeadArgumentElimination pass, to use a more explicit tracking of
dependencies between return values and/or arguments. Also make the handling of
arguments and return values the same.

The pass now looks properly inside returned structs, but only at the first
level (ie, not inside nested structs).

Also add a testcase for testing various variations of (multiple) dead rerturn
values.

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

16 years agoReapply r52397 (make IPConstProp promote returned arguments), but fixed this
Matthijs Kooijman [Wed, 18 Jun 2008 08:30:37 +0000 (08:30 +0000)]
Reapply r52397 (make IPConstProp promote returned arguments), but fixed this
time. Sorry for the trouble!

This time, also add a testcase, which I should have done in the first place...

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

16 years agoXOR32rr, etc. are not AsCheapAsMove, but MOV32ri, etc. are.
Evan Cheng [Wed, 18 Jun 2008 08:13:07 +0000 (08:13 +0000)]
XOR32rr, etc. are not AsCheapAsMove, but MOV32ri, etc. are.

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

16 years agoReapply r52396, it was unrelated to the breakage (that was caused by r52397, my
Matthijs Kooijman [Wed, 18 Jun 2008 08:09:27 +0000 (08:09 +0000)]
Reapply r52396, it was unrelated to the breakage (that was caused by r52397, my
commit after this).

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

16 years agoComplete support for two-address pass rematerialization. Now *almost* always a win.
Evan Cheng [Wed, 18 Jun 2008 07:49:14 +0000 (07:49 +0000)]
Complete support for two-address pass rematerialization. Now *almost* always a win.

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

16 years agoAdd MachineRegisterInfo::use_empty.
Evan Cheng [Wed, 18 Jun 2008 07:47:55 +0000 (07:47 +0000)]
Add MachineRegisterInfo::use_empty.

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

16 years agoCosmetic.
Evan Cheng [Wed, 18 Jun 2008 07:47:28 +0000 (07:47 +0000)]
Cosmetic.

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

16 years agoIf compiling for PPC on an i386 box, the LTO wouldn't get the altivec (and
Bill Wendling [Wed, 18 Jun 2008 06:35:30 +0000 (06:35 +0000)]
If compiling for PPC on an i386 box, the LTO wouldn't get the altivec (and
other) feature information. The workaround is inelegant and could be cleaned up
if this information were available some other way (say, in the IR).

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

16 years agoimplement some simple bswap optimizations, rdar://5992453
Chris Lattner [Wed, 18 Jun 2008 04:33:20 +0000 (04:33 +0000)]
implement some simple bswap optimizations, rdar://5992453

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

16 years agotemporarily revert this testcase since its patch was reverted.
Chris Lattner [Wed, 18 Jun 2008 04:03:23 +0000 (04:03 +0000)]
temporarily revert this testcase since its patch was reverted.

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

16 years agomake truncate/sext elimination capable of changing phi's. This
Chris Lattner [Wed, 18 Jun 2008 04:00:49 +0000 (04:00 +0000)]
make truncate/sext elimination capable of changing phi's.  This
implements rdar://6013816 and the testcase in Transforms/InstCombine/sext-misc.ll.

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

16 years agoUnbreak DECLARE isel in pic mode.
Evan Cheng [Wed, 18 Jun 2008 02:48:27 +0000 (02:48 +0000)]
Unbreak DECLARE isel in pic mode.

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

16 years agoPreserve dominance frontier while trivially unswitching loop.
Devang Patel [Wed, 18 Jun 2008 02:16:38 +0000 (02:16 +0000)]
Preserve dominance frontier while trivially unswitching loop.

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

16 years agoCheck empty dominance frontier.
Devang Patel [Wed, 18 Jun 2008 02:12:09 +0000 (02:12 +0000)]
Check empty dominance frontier.

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

16 years agoAuto-upgrade code for multiple-value return statements. This code
Dan Gohman [Tue, 17 Jun 2008 23:38:43 +0000 (23:38 +0000)]
Auto-upgrade code for multiple-value return statements. This code
isn't actually called yet.

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

16 years agoIn InsertValueInst's copy ctor, actually copy the operands.
Dan Gohman [Tue, 17 Jun 2008 23:25:49 +0000 (23:25 +0000)]
In InsertValueInst's copy ctor, actually copy the operands.

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

16 years agoWe don't want to find dependencies within the same block in this case. It leads...
Owen Anderson [Tue, 17 Jun 2008 22:27:06 +0000 (22:27 +0000)]
We don't want to find dependencies within the same block in this case.  It leads to incorrect results because
we're detecting something at or after the call we're querying on.

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

16 years agoImplement the ExtractValueInst::getIndexedType that accepts one
Dan Gohman [Tue, 17 Jun 2008 21:07:55 +0000 (21:07 +0000)]
Implement the ExtractValueInst::getIndexedType that accepts one
index value.

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

16 years agoLive-through live interval is [mbb start, mbb end+1].
Evan Cheng [Tue, 17 Jun 2008 20:13:36 +0000 (20:13 +0000)]
Live-through live interval is [mbb start, mbb end+1].

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

16 years agoWhen extending a liveinterval by commuting, don't throw away the live ranges that...
Evan Cheng [Tue, 17 Jun 2008 20:11:16 +0000 (20:11 +0000)]
When extending a liveinterval by commuting, don't throw away the live ranges that are not affected.

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

16 years agoConsistently set "Buckets[NumBuckets] = reinterpret_cast<void*>(-1)" throughout Foldi...
Ted Kremenek [Tue, 17 Jun 2008 19:12:43 +0000 (19:12 +0000)]
Consistently set "Buckets[NumBuckets] = reinterpret_cast<void*>(-1)" throughout FoldingSet.cpp.

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

16 years agoAdd an insertBefore method for attaching previously unattached instructions,
Owen Anderson [Tue, 17 Jun 2008 18:29:27 +0000 (18:29 +0000)]
Add an insertBefore method for attaching previously unattached instructions,
such as those created by clone(), to a basic block.

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

16 years agoFix use of placement new to actually use an address.
Owen Anderson [Tue, 17 Jun 2008 18:07:43 +0000 (18:07 +0000)]
Fix use of placement new to actually use an address.

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

16 years agoIt's not safe to remove SUBREG_TO_REG that looks like identity copies, e.g. movl...
Evan Cheng [Tue, 17 Jun 2008 17:59:16 +0000 (17:59 +0000)]
It's not safe to remove SUBREG_TO_REG that looks like identity copies, e.g. movl %eax, %eax on x86-64 actually does a zero-extend.

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

16 years agoAdd one more 'magic' define :)
Anton Korobeynikov [Tue, 17 Jun 2008 17:57:43 +0000 (17:57 +0000)]
Add one more 'magic' define :)

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

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