oota-llvm.git
15 years agoFix PR3423: Link llvm on ARM EABI machines. Patch by Robert Schuster.
Evan Cheng [Sun, 1 Feb 2009 06:42:27 +0000 (06:42 +0000)]
Fix PR3423: Link llvm on ARM EABI machines. Patch by Robert Schuster.

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

15 years agoDebugLoc propagation.
Dale Johannesen [Sat, 31 Jan 2009 22:04:51 +0000 (22:04 +0000)]
DebugLoc propagation.

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

15 years agoReinstate this optimization to fold icmp of xor when possible. Don't try to
Nick Lewycky [Sat, 31 Jan 2009 21:30:05 +0000 (21:30 +0000)]
Reinstate this optimization to fold icmp of xor when possible. Don't try to
turn icmp eq a+x, b+x into icmp eq a, b if a+x or b+x has other uses. This
may have been increasing register pressure leading to the bzip2 slowdown.

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

15 years agoDebugLoc propagation. Done with file.
Dale Johannesen [Sat, 31 Jan 2009 21:04:24 +0000 (21:04 +0000)]
DebugLoc propagation.  Done with file.

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

15 years agoDebugLoc propagation. Done with file.
Dale Johannesen [Sat, 31 Jan 2009 20:01:02 +0000 (20:01 +0000)]
DebugLoc propagation.  Done with file.

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

15 years agoFix PR3452 (an infinite loop bootstrapping) by disabling the recent
Chris Lattner [Sat, 31 Jan 2009 19:05:27 +0000 (19:05 +0000)]
Fix PR3452 (an infinite loop bootstrapping) by disabling the recent
improvements to the EvaluateInDifferentType code.  This code works
by just inserted a bunch of new code and then seeing if it is
useful.  Instcombine is not allowed to do this: it can only insert
new code if it is useful, and only when it is converging to a more
canonical fixed point.  Now that we iterate when DCE makes progress,
this causes an infinite loop when the code ends up not being used.

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

15 years agoFix PR3401: when using large integers, the type
Duncan Sands [Sat, 31 Jan 2009 15:50:11 +0000 (15:50 +0000)]
Fix PR3401: when using large integers, the type
returned by getShiftAmountTy may be too small
to hold shift values (it is an i8 on x86-32).
Before and during type legalization, use a large
but legal type for shift amounts: getPointerTy;
afterwards use getShiftAmountTy, fixing up any
shift amounts with a big type during operation
legalization.  Thanks to Dan for writing the
original patch (which I shamelessly pillaged).

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

15 years agonow that all the pieces are in place, teach instcombine's
Chris Lattner [Sat, 31 Jan 2009 08:40:03 +0000 (08:40 +0000)]
now that all the pieces are in place, teach instcombine's
simplifydemandedbits to simplify instructions with *multiple
uses* in contexts where it can get away with it.  This allows
it to simplify the code in multi-use-or.ll into a single 'add
double'.

This change is particularly interesting because it will cover
up for some common codegen bugs with large integers created due
to the recent SROA patch.  When working on fixing those bugs,
this should be disabled.

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

15 years agosimplify/clarify control flow and improve comments, no functionality change.
Chris Lattner [Sat, 31 Jan 2009 08:24:16 +0000 (08:24 +0000)]
simplify/clarify control flow and improve comments, no functionality change.

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

15 years agomake some fairly meaty internal changes to how SimplifyDemandedBits works.
Chris Lattner [Sat, 31 Jan 2009 08:15:18 +0000 (08:15 +0000)]
make some fairly meaty internal changes to how SimplifyDemandedBits works.
Now, if it detects that "V" is the same as some other value,
SimplifyDemandedBits returns the new value instead of RAUW'ing it immediately.
This has two benefits:
1) simpler code in the recursive SimplifyDemandedBits routine.
2) it allows future fun stuff in instcombine where an operation has multiple
   uses and can be simplified in one context, but not all.

#2 isn't implemented yet, this patch should have no functionality change.

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

15 years agoadd accessors
Chris Lattner [Sat, 31 Jan 2009 07:34:19 +0000 (07:34 +0000)]
add accessors

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

15 years agominor cleanups
Chris Lattner [Sat, 31 Jan 2009 07:26:06 +0000 (07:26 +0000)]
minor cleanups

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

15 years agomake sure to set Changed=true when instcombine hacks on the code,
Chris Lattner [Sat, 31 Jan 2009 07:04:22 +0000 (07:04 +0000)]
make sure to set Changed=true when instcombine hacks on the code,
not doing so prevents it from properly iterating and prevents it
from deleting the entire body of dce-iterate.ll

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

15 years agoUsed "-enable-unsafe-fp-math" to allow this transformation - (a * b -c) = c - a *b.
Mon P Wang [Sat, 31 Jan 2009 06:50:54 +0000 (06:50 +0000)]
Used "-enable-unsafe-fp-math" to allow this transformation - (a * b -c) = c - a *b.

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

15 years agoIf unsafe FP optimization is not set, don't allow -(A-B) => B-A because
Mon P Wang [Sat, 31 Jan 2009 06:07:45 +0000 (06:07 +0000)]
If unsafe FP optimization is not set, don't allow -(A-B) => B-A because
when A==B, -0.0 != +0.0.

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

15 years agoDon't use DebugLoc::getUnknownLoc(). Default to something hopefully sensible.
Bill Wendling [Sat, 31 Jan 2009 03:12:48 +0000 (03:12 +0000)]
Don't use DebugLoc::getUnknownLoc(). Default to something hopefully sensible.

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

15 years agoSimplify and generalize the SROA "convert to scalar" transformation to
Chris Lattner [Sat, 31 Jan 2009 02:28:54 +0000 (02:28 +0000)]
Simplify and generalize the SROA "convert to scalar" transformation to
be able to handle *ANY* alloca that is poked by loads and stores of
bitcasts and GEPs with constant offsets.  Before the code had a number
of annoying limitations and caused it to miss cases such as storing into
holes in structs and complex casts (as in bitfield-sroa) where we had
unions of bitfields etc.  This also handles a number of important cases
that are exposed due to the ABI lowering stuff we do to pass stuff by
value.

One case that is pretty great is that we compile
2006-11-07-InvalidArrayPromote.ll into:

define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind {
%tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %v1)
%tmp105 = bitcast <4 x i32> %tmp10 to i128
%tmp1056 = zext i128 %tmp105 to i256
%tmp.upgrd.43 = lshr i256 %tmp1056, 96
%tmp.upgrd.44 = trunc i256 %tmp.upgrd.43 to i32
ret i32 %tmp.upgrd.44
}

which turns into:

_func:
subl $28, %esp
cvttps2dq %xmm1, %xmm0
movaps %xmm0, (%esp)
movl 12(%esp), %eax
addl $28, %esp
ret

Which is pretty good code all things considering :).

One effect of this is that SROA will start generating arbitrary bitwidth
integers that are a multiple of 8 bits.  In the case above, we got a
256 bit integer, but the codegen guys assure me that it can handle the
simple and/or/shift/zext stuff that we're doing on these operations.

This addresses rdar://6532315

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

15 years agoMove CurDebugLoc into SelectionDAGLowering.
Dale Johannesen [Sat, 31 Jan 2009 02:22:37 +0000 (02:22 +0000)]
Move CurDebugLoc into SelectionDAGLowering.

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

15 years agoback out my previous change, it exposes a latent bug. investigating
Gabor Greif [Sat, 31 Jan 2009 01:31:59 +0000 (01:31 +0000)]
back out my previous change, it exposes a latent bug. investigating

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

15 years agouse precise accessors
Gabor Greif [Sat, 31 Jan 2009 00:58:14 +0000 (00:58 +0000)]
use precise accessors

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

15 years agoPropagate debug info in LegalizeFloatTypes.
Dale Johannesen [Sat, 31 Jan 2009 00:43:08 +0000 (00:43 +0000)]
Propagate debug info in LegalizeFloatTypes.
Complete (modulo bugs).

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

15 years agoPropagate debug info. This file complete
Dale Johannesen [Sat, 31 Jan 2009 00:20:43 +0000 (00:20 +0000)]
Propagate debug info.  This file complete
(modulo bugs)

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

15 years agoPropagate debug info through MakeLibCall and a
Dale Johannesen [Sat, 31 Jan 2009 00:11:23 +0000 (00:11 +0000)]
Propagate debug info through MakeLibCall and a
couple of things that use it.

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

15 years agoMore DebugLoc propagation.
Bill Wendling [Fri, 30 Jan 2009 23:59:18 +0000 (23:59 +0000)]
More DebugLoc propagation.

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

15 years agoMore DebugLoc propagation.
Bill Wendling [Fri, 30 Jan 2009 23:36:47 +0000 (23:36 +0000)]
More DebugLoc propagation.

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

15 years agoMore DebugLoc propagation in LOAD etc. methods.
Bill Wendling [Fri, 30 Jan 2009 23:27:35 +0000 (23:27 +0000)]
More DebugLoc propagation in LOAD etc. methods.

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

15 years agoFix build on case-sensitive filesystems (i.e. everybody else)
Dale Johannesen [Fri, 30 Jan 2009 23:20:42 +0000 (23:20 +0000)]
Fix build on case-sensitive filesystems (i.e. everybody else)

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

15 years agoMore DebugLoc propagation in floating-point methods.
Bill Wendling [Fri, 30 Jan 2009 23:15:49 +0000 (23:15 +0000)]
More DebugLoc propagation in floating-point methods.

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

15 years agoMake LowerCallTo and LowerArguments take a DebugLoc
Dale Johannesen [Fri, 30 Jan 2009 23:10:59 +0000 (23:10 +0000)]
Make LowerCallTo and LowerArguments take a DebugLoc
argument.  Adjust all callers and overloaded versions.

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

15 years agoStandardize comments about folding xforms.
Bill Wendling [Fri, 30 Jan 2009 23:10:18 +0000 (23:10 +0000)]
Standardize comments about folding xforms.

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

15 years agoGet rid of the non-DebugLoc-ified getNOT() method.
Bill Wendling [Fri, 30 Jan 2009 23:03:19 +0000 (23:03 +0000)]
Get rid of the non-DebugLoc-ified getNOT() method.

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

15 years agoPropagate debug loc info for some FP arithmetic methods.
Bill Wendling [Fri, 30 Jan 2009 22:57:07 +0000 (22:57 +0000)]
Propagate debug loc info for some FP arithmetic methods.

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

15 years agoPropagate debug loc info for some FP arithmetic methods.
Bill Wendling [Fri, 30 Jan 2009 22:53:48 +0000 (22:53 +0000)]
Propagate debug loc info for some FP arithmetic methods.

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

15 years agoPropagate debug loc info for BIT_CONVERT.
Bill Wendling [Fri, 30 Jan 2009 22:44:24 +0000 (22:44 +0000)]
Propagate debug loc info for BIT_CONVERT.

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

15 years agoPropagate debug loc info for more *_EXTEND methods.
Bill Wendling [Fri, 30 Jan 2009 22:33:24 +0000 (22:33 +0000)]
Propagate debug loc info for more *_EXTEND methods.

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

15 years agoPropagate debug loc info for ANY_EXTEND.
Bill Wendling [Fri, 30 Jan 2009 22:27:33 +0000 (22:27 +0000)]
Propagate debug loc info for ANY_EXTEND.

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

15 years agoPropagate debug loc info for some of the *_EXTEND functions.
Bill Wendling [Fri, 30 Jan 2009 22:23:15 +0000 (22:23 +0000)]
Propagate debug loc info for some of the *_EXTEND functions.

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

15 years agoDebugLoc form of getNOT().
Bill Wendling [Fri, 30 Jan 2009 22:11:22 +0000 (22:11 +0000)]
DebugLoc form of getNOT().

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

15 years ago- Propagate debug loc info for SELECT.
Bill Wendling [Fri, 30 Jan 2009 22:02:18 +0000 (22:02 +0000)]
- Propagate debug loc info for SELECT.
- Added xform for (select X, 1, Y) and (select X, Y, 0), which was commented on,
  but missing.

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

15 years agoPropagate debug loc info for Shifts.
Bill Wendling [Fri, 30 Jan 2009 21:37:17 +0000 (21:37 +0000)]
Propagate debug loc info for Shifts.

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

15 years agoPropagate debug loc info for XOR and MatchRotate.
Bill Wendling [Fri, 30 Jan 2009 21:14:50 +0000 (21:14 +0000)]
Propagate debug loc info for XOR and MatchRotate.

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

15 years agoPropagate debug loc info for OR. Also clean up some comments.
Bill Wendling [Fri, 30 Jan 2009 20:59:34 +0000 (20:59 +0000)]
Propagate debug loc info for OR. Also clean up some comments.

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

15 years agoPerform obvious constant arithmetic folding.
Bill Wendling [Fri, 30 Jan 2009 20:50:00 +0000 (20:50 +0000)]
Perform obvious constant arithmetic folding.

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

15 years agoPropagate debug loc info for AND. Also clean up some comments.
Bill Wendling [Fri, 30 Jan 2009 20:43:18 +0000 (20:43 +0000)]
Propagate debug loc info for AND. Also clean up some comments.

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

15 years agoPropagate debug loc info in SimplifyBinOpWithSameOpcodeHands.
Bill Wendling [Fri, 30 Jan 2009 19:25:47 +0000 (19:25 +0000)]
Propagate debug loc info in SimplifyBinOpWithSameOpcodeHands.

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

15 years agouse precise getters
Gabor Greif [Fri, 30 Jan 2009 18:27:21 +0000 (18:27 +0000)]
use precise getters

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

15 years agouse precise getters
Gabor Greif [Fri, 30 Jan 2009 18:21:13 +0000 (18:21 +0000)]
use precise getters

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

15 years ago Each input file is encoded as a separate compile unit in LLVM debugging
Devang Patel [Fri, 30 Jan 2009 18:20:31 +0000 (18:20 +0000)]
 Each input file is encoded as a separate compile unit in LLVM debugging
information output. However, many target specific tool chains prefer to encode
only one compile unit in an object file. In this situation, the LLVM code
generator will include  debugging information entities in the compile unit
that is marked as main compile unit. The code generator accepts maximum one main
compile unit per module. If a module does not contain any main compile unit
then the code generator will emit multiple compile units in the output object
file.

[Part 1]

Update DebugInfo APIs to accept optional boolean value while creating DICompileUnit  to mark the unit as "main" unit. By defaults all units are considered  non-main.  Update SourceLevelDebugging.html to document "main" compile unit.

Update DebugInfo APIs to not accept and encode separate source file/directory entries while creating various llvm.dbg.* entities. There was a recent, yet to be documented, change to include this additional information so no documentation changes are required here.

Update DwarfDebug to handle "main" compile unit. If "main" compile unit is seen then all DIEs are inserted into "main" compile unit. All other compile units are used to find source location for llvm.dbg.* values. If there is not any "main" compile unit then create unique compile unit DIEs for each llvm.dbg.compile_unit.

[Part 2]

Create separate llvm.dbg.compile_unit for each input file. Mark compile unit create for main_input_filename as "main" compile unit. Use appropriate compile unit, based on source location information collected from the tree node, while creating llvm.dbg.* values using DebugInfo APIs.

---

This is Part 1.

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

15 years agoAs Duncan suggested, add braces for the one-line "else branch".
Zhou Sheng [Fri, 30 Jan 2009 09:44:49 +0000 (09:44 +0000)]
As Duncan suggested, add braces for the one-line "else branch".
Thanks, Duncan.

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

15 years agoThis is to fix the bug in IntrinsicLowering.cpp,
Zhou Sheng [Fri, 30 Jan 2009 09:02:50 +0000 (09:02 +0000)]
This is to fix the bug in IntrinsicLowering.cpp,
the LowerPartSet(). It didn't handle the situation correctly when
the low, high argument values are in reverse order (low > high)
with 'Val' type i32 (a corner case).

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

15 years agoFixed the comment. No functionality change.
Sanjiv Gupta [Fri, 30 Jan 2009 09:01:44 +0000 (09:01 +0000)]
Fixed the comment. No functionality change.

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

15 years agoThis is case is to uncover the bug in IntrinsicLowering.cpp,
Zhou Sheng [Fri, 30 Jan 2009 08:59:51 +0000 (08:59 +0000)]
This is case is to uncover the bug in IntrinsicLowering.cpp,
the LowerPartSet(). It didn't handle the situation correctly when
the low, high argument values are in reverse order (low > high)
with 'Val' type is i32 (a corner case).

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

15 years agoAdd opposite_of and inverse_opt to support -fno- style options. This
Mike Stump [Fri, 30 Jan 2009 08:19:46 +0000 (08:19 +0000)]
Add opposite_of and inverse_opt to support -fno- style options.  This
is necessary for eventual gcc commmand line compatibility.

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

15 years agoUse sublw for comparison with literals instead of subwf.
Sanjiv Gupta [Fri, 30 Jan 2009 07:55:25 +0000 (07:55 +0000)]
Use sublw for comparison with literals instead of subwf.

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

15 years agoWhen PerformBuildVectorCombine, avoid creating a X86ISD::VZEXT_LOAD of
Mon P Wang [Fri, 30 Jan 2009 07:07:40 +0000 (07:07 +0000)]
When PerformBuildVectorCombine, avoid creating a X86ISD::VZEXT_LOAD of
an illegal type.

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

15 years agoEnable emitting of constant values in non-default address space as well. The APIs...
Sanjiv Gupta [Fri, 30 Jan 2009 04:25:10 +0000 (04:25 +0000)]
Enable emitting of constant values in non-default address space as well. The APIs emitting constants now take an additional parameter signifying the address space in which to emit. The APIs like getData8BitsDirective() etc are made virtual enabling targets to be able to define appropirate directivers for various sizes and address spaces.

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

15 years agoPropagate debug loc info in SimplifyNodeWithTwoResults.
Bill Wendling [Fri, 30 Jan 2009 03:08:40 +0000 (03:08 +0000)]
Propagate debug loc info in SimplifyNodeWithTwoResults.

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

15 years agoPropagate debug loc info for MULHS.
Bill Wendling [Fri, 30 Jan 2009 03:00:18 +0000 (03:00 +0000)]
Propagate debug loc info for MULHS.

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

15 years agoPropagate debug loc info for SREM and UREM.
Bill Wendling [Fri, 30 Jan 2009 02:57:00 +0000 (02:57 +0000)]
Propagate debug loc info for SREM and UREM.

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

15 years agoPropagate debug loc info for UDIV.
Bill Wendling [Fri, 30 Jan 2009 02:55:25 +0000 (02:55 +0000)]
Propagate debug loc info for UDIV.

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

15 years agoPropagate debug loc info for SDIV.
Bill Wendling [Fri, 30 Jan 2009 02:52:17 +0000 (02:52 +0000)]
Propagate debug loc info for SDIV.

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

15 years agoForgot to propagate debug loc info here.
Bill Wendling [Fri, 30 Jan 2009 02:49:26 +0000 (02:49 +0000)]
Forgot to propagate debug loc info here.

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

15 years agoFix a post-RA scheduling dependency bug.
Dan Gohman [Fri, 30 Jan 2009 02:49:14 +0000 (02:49 +0000)]
Fix a post-RA scheduling dependency bug.

If a MachineInstr doesn't have a memoperand but has an opcode that
is known to load or store, assume its memory reference may alias
*anything*, including stack slots which the compiler completely
controls.

To partially compensate for this, teach the ScheduleDAG building
code to do basic getUnderlyingValue analysis. This greatly
reduces the number of instructions that require restrictive
dependencies. This code will need to be revisited when we start
doing real alias analysis, but it should suffice for now.

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

15 years agoPropagate debug loc info for MUL.
Bill Wendling [Fri, 30 Jan 2009 02:45:56 +0000 (02:45 +0000)]
Propagate debug loc info for MUL.

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

15 years agoPropagate debug loc info in SUB.
Bill Wendling [Fri, 30 Jan 2009 02:42:10 +0000 (02:42 +0000)]
Propagate debug loc info in SUB.

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

15 years agoPropagate debug loc info in ADDC and ADDE.
Bill Wendling [Fri, 30 Jan 2009 02:38:00 +0000 (02:38 +0000)]
Propagate debug loc info in ADDC and ADDE.

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

15 years agoPropagate debug loc info in DAG combine's "ADD".
Bill Wendling [Fri, 30 Jan 2009 02:31:17 +0000 (02:31 +0000)]
Propagate debug loc info in DAG combine's "ADD".

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

15 years ago- Propagate debug loc info in combineSelectAndUse().
Bill Wendling [Fri, 30 Jan 2009 02:23:43 +0000 (02:23 +0000)]
- Propagate debug loc info in combineSelectAndUse().
- Modify ReassociateOps so that the resulting SDValue is what the comment claims
  it is.

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

15 years agoAdd some comments.
Mikhail Glushenkov [Fri, 30 Jan 2009 02:12:57 +0000 (02:12 +0000)]
Add some comments.

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

15 years agoFix a bug in getMaxValue/getMinValue to pass the right signedness the
Chris Lattner [Fri, 30 Jan 2009 01:58:19 +0000 (01:58 +0000)]
Fix a bug in getMaxValue/getMinValue to pass the right signedness the
the constructed APSInt, patch suggested by Ben Laurie!

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

15 years agoEnable target tripple.
Devang Patel [Fri, 30 Jan 2009 01:40:58 +0000 (01:40 +0000)]
Enable target tripple.

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

15 years agoLinux and other target's encoding for DW_AT_declaration may not match.
Devang Patel [Fri, 30 Jan 2009 01:37:30 +0000 (01:37 +0000)]
Linux and other target's  encoding for DW_AT_declaration may not match.

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

15 years agoPropagate debug info when building SelectionDAG.
Dale Johannesen [Fri, 30 Jan 2009 01:34:22 +0000 (01:34 +0000)]
Propagate debug info when building SelectionDAG.

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

15 years agoRemove dead code, again.
Devang Patel [Fri, 30 Jan 2009 01:27:49 +0000 (01:27 +0000)]
Remove dead code, again.

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

15 years agoRemove dead code.
Devang Patel [Fri, 30 Jan 2009 01:25:47 +0000 (01:25 +0000)]
Remove dead code.

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

15 years agoAdd DW_AT_declaration for class methods.
Devang Patel [Fri, 30 Jan 2009 01:21:46 +0000 (01:21 +0000)]
Add DW_AT_declaration for class methods.

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

15 years agoPropagate debug location info for the token factor.
Bill Wendling [Fri, 30 Jan 2009 01:13:16 +0000 (01:13 +0000)]
Propagate debug location info for the token factor.

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

15 years agoAdd dump() routines to help debug debug info :)
Devang Patel [Fri, 30 Jan 2009 01:03:10 +0000 (01:03 +0000)]
Add dump() routines to help debug debug info :)

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

15 years agoAdd DebugLoc propagation to some of the methods in DAG combiner.
Bill Wendling [Fri, 30 Jan 2009 00:45:56 +0000 (00:45 +0000)]
Add DebugLoc propagation to some of the methods in DAG combiner.

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

15 years agoExplain why this is here.
Bill Wendling [Thu, 29 Jan 2009 23:19:43 +0000 (23:19 +0000)]
Explain why this is here.

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

15 years agoXFAIL this test. It only worked before because of a bug in the spill point selection...
Owen Anderson [Thu, 29 Jan 2009 22:27:56 +0000 (22:27 +0000)]
XFAIL this test.  It only worked before because of a bug in the spill point selection code.  Not deleting because
it should be possible to enhance the selection code to handle this in the future.

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

15 years agoCorrect the algorithms for choosing spill and restore points so that we don't try...
Owen Anderson [Thu, 29 Jan 2009 22:13:06 +0000 (22:13 +0000)]
Correct the algorithms for choosing spill and restore points so that we don't try to insert loads/stores between call frame setup and the actual call.

This fixes the last known failure for the pre-alloc-splitter.

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

15 years agoExplicitly add PseudoSourceValue information when lowering
Dan Gohman [Thu, 29 Jan 2009 21:02:43 +0000 (21:02 +0000)]
Explicitly add PseudoSourceValue information when lowering
BUILD_VECTOR and conversions to stack operations.

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

15 years agoMake a few things const, fix some comments, and simplify
Dan Gohman [Thu, 29 Jan 2009 19:49:27 +0000 (19:49 +0000)]
Make a few things const, fix some comments, and simplify
some assertions.

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

15 years agoFix windows build, patch by Marius Wachtler!
Chris Lattner [Thu, 29 Jan 2009 18:53:28 +0000 (18:53 +0000)]
Fix windows build, patch by Marius Wachtler!

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

15 years agoLocal register allocator shouldn't assume only the entry and landing pad basic blocks...
Evan Cheng [Thu, 29 Jan 2009 18:37:30 +0000 (18:37 +0000)]
Local register allocator shouldn't assume only the entry and landing pad basic blocks have live-ins.

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

15 years agoFix two typos that Duncan spotted in a comment.
Dan Gohman [Thu, 29 Jan 2009 16:18:12 +0000 (16:18 +0000)]
Fix two typos that Duncan spotted in a comment.

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

15 years agoIn the case of an extractelement on an insertelement value,
Dan Gohman [Thu, 29 Jan 2009 16:10:46 +0000 (16:10 +0000)]
In the case of an extractelement on an insertelement value,
the element indices may be equal if either one is not a
constant.

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

15 years agoAdd a always_inline test case.
Evan Cheng [Thu, 29 Jan 2009 09:31:54 +0000 (09:31 +0000)]
Add a always_inline test case.

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

15 years agoRevert r63273. This was already implemented by Dale. There's no need for my
Bill Wendling [Thu, 29 Jan 2009 09:01:55 +0000 (09:01 +0000)]
Revert r63273. This was already implemented by Dale. There's no need for my
change.

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

15 years agoAdd a test case for Chris lvalue alignment fixes.
Evan Cheng [Thu, 29 Jan 2009 08:59:46 +0000 (08:59 +0000)]
Add a test case for Chris lvalue alignment fixes.

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

15 years agoFix an issue where restores could be inserted after a terminator instruction,
Owen Anderson [Thu, 29 Jan 2009 08:22:06 +0000 (08:22 +0000)]
Fix an issue where restores could be inserted after a terminator instruction,
and an iterator invalidation issue.

FreeBench/pifft no longer miscompiles with these fixes!

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

15 years agoComments are good. :-)
Owen Anderson [Thu, 29 Jan 2009 05:41:02 +0000 (05:41 +0000)]
Comments are good. :-)

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

15 years agoAdd support for aggressive load-use-store folding. This takes care of the
Owen Anderson [Thu, 29 Jan 2009 05:28:55 +0000 (05:28 +0000)]
Add support for aggressive load-use-store folding.  This takes care of the
vast majority of code size regressions introduced by pre-alloc-splitting.

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

15 years ago- Add DebugLoc to getTargetNode().
Bill Wendling [Thu, 29 Jan 2009 05:27:31 +0000 (05:27 +0000)]
- Add DebugLoc to getTargetNode().
- Modify TableGen to add the DebugLoc when calling getTargetNode.

(The light-weight wrappers are only temporary. The non-DebugLoc version will be
removed once the whole debug info stuff is finished with.)

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

15 years agoFix PR3424, a static constructor ordering issue. Patch by Robert Schuster!
Chris Lattner [Thu, 29 Jan 2009 04:43:42 +0000 (04:43 +0000)]
Fix PR3424, a static constructor ordering issue.  Patch by Robert Schuster!

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

15 years agoExit with nice warnings when register allocator run out of registers.
Evan Cheng [Thu, 29 Jan 2009 02:20:59 +0000 (02:20 +0000)]
Exit with nice warnings when register allocator run out of registers.

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

15 years agoMake x86's BT instruction matching more thorough, and add some
Dan Gohman [Thu, 29 Jan 2009 01:59:02 +0000 (01:59 +0000)]
Make x86's BT instruction matching more thorough, and add some
dagcombines that help it match in several more cases. Add
several more cases to test/CodeGen/X86/bt.ll. This doesn't
yet include matching for BT with an immediate operand, it
just covers more register+register cases.

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

15 years agoMove the code that starts printing the Select_* functions
Dan Gohman [Thu, 29 Jan 2009 01:37:18 +0000 (01:37 +0000)]
Move the code that starts printing the Select_* functions
after the code that sorts the patterns. This doesn't
affect the output, but it makes the code a little easier
to follow.

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

15 years agoA slight compile time optimization. If the caller knows there isn't a free register...
Evan Cheng [Thu, 29 Jan 2009 01:13:00 +0000 (01:13 +0000)]
A slight compile time optimization. If the caller knows there isn't a free register getReg() should not call getFreeReg().

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