Commit Graph

44560 Commits

Author SHA1 Message Date
Bill Wendling b0ad6f9a6c It fails on Linux. XFAIL that machine.
llvm-svn: 63582
2009-02-03 00:35:11 +00:00
Bill Wendling 423f3bc196 This is passing for us. Should it have been reenabled?
llvm-svn: 63580
2009-02-03 00:27:09 +00:00
Dan Gohman 7948ef5f87 Add explicit -march=x86 to these tests so that they don't
default to -march=x86-64 on 64-bit hosts.

llvm-svn: 63579
2009-02-03 00:20:22 +00:00
Dan Gohman 76a07f59d4 Use the SubclassData field to hold ExtType, isTrunc, and MemIndexedMode
information. This eliminates the need for the Flags field in MemSDNode,
so this makes LoadSDNode and StoreSDNode smaller. Also, it makes
FoldingSetNodeIDs for loads and stores two AddIntegers smaller.

llvm-svn: 63577
2009-02-03 00:08:45 +00:00
Dan Gohman 7403751e16 Change Feature64Bit to not imply FeatureSSE2. All x86-64 hardware has
SSE2, however it's possible to disable SSE2, and the subtarget support
code thinks that if 64-bit implies SSE2 and SSE2 is disabled then
64-bit should also be disabled. Instead, just mark all the 64-bit
subtargets as explicitly supporting SSE2.

Also, move the code that makes -march=x86-64 enable 64-bit support by
default to only apply when there is no explicit subtarget. If you
need to specify a subtarget and you want 64-bit code, you'll need to
select a subtarget that supports 64-bit code.

llvm-svn: 63575
2009-02-03 00:04:43 +00:00
Dale Johannesen 72ba6df1a9 Last DebugLoc propagation for this file.
llvm-svn: 63574
2009-02-02 23:46:53 +00:00
Dan Gohman f58f0cbfd5 Fix another test to not use -mcpu=yonah with 64-bit code.
llvm-svn: 63572
2009-02-02 23:43:59 +00:00
Dan Gohman e862b3dd96 Yonah does not support x86-64. Change the -mcpu value to one that does.
llvm-svn: 63561
2009-02-02 22:50:08 +00:00
Dale Johannesen b5dd922a92 More DebugLoc propagation. This should be everything
except LegalizeOp itself.

llvm-svn: 63560
2009-02-02 22:49:46 +00:00
Mike Stump b92f839f9c Improve -fno-opt style option processing to not require an extra
option to make the -fno- form on the option.  We also document the new
form in the CommandLine documentation.

llvm-svn: 63559
2009-02-02 22:48:49 +00:00
Owen Anderson 4eda2cbe5f MergeValueInto is too smart: it might choose to do the merge the opposite direction.
Live interval reconstruction needs to account for this, and scour its maps to
prevent dangling references.

llvm-svn: 63558
2009-02-02 22:42:01 +00:00
Dale Johannesen a02e45ca19 DebugLoc propagation. ExpandOp and PromoteOp,
among others.

llvm-svn: 63555
2009-02-02 22:12:50 +00:00
Torok Edwin e83866065b Only force SSE level if it is not correct.
Add an assert to check HasX86_64 status.

llvm-svn: 63552
2009-02-02 21:57:34 +00:00
Devang Patel dd5dbca59c Run dsymutil on darwin, when it is expected, before running gdb test.
llvm-svn: 63548
2009-02-02 21:09:36 +00:00
Dale Johannesen ae7992a333 Commit missing files.
llvm-svn: 63545
2009-02-02 20:47:48 +00:00
Chris Lattner 43cecd7c26 inline SROA::ConvertToScalar, no functionality change.
llvm-svn: 63544
2009-02-02 20:44:45 +00:00
Dale Johannesen ad00f6e010 More DebugLoc propagation.
llvm-svn: 63543
2009-02-02 20:41:04 +00:00
Torok Edwin 5dbd26ae0f remove #if 0 code on Bill's request.
llvm-svn: 63542
2009-02-02 20:23:02 +00:00
Duncan Sands dab7be8774 Remove trailing spaces.
llvm-svn: 63540
2009-02-02 19:46:41 +00:00
Steve Naroff 9ff3d9a1b4 Update hand-crafted VC++ build.
- Add PACKAGE_STRING definition to Windows config.h.

llvm-svn: 63539
2009-02-02 19:22:02 +00:00
Dale Johannesen 8525d83aac DebugLoc propagation for int<->fp conversions.
llvm-svn: 63537
2009-02-02 19:03:57 +00:00
Evan Cheng 03f862579c Refactor PerformPHIConstruction, no functionality changes.
llvm-svn: 63536
2009-02-02 18:33:18 +00:00
Chris Lattner c81fdd1773 xfail this for now, will fix shortly.
llvm-svn: 63533
2009-02-02 18:15:33 +00:00
Chris Lattner 64217e6a28 update test
llvm-svn: 63532
2009-02-02 18:12:58 +00:00
Dan Gohman 2171f5aeec Reposition the DebugLoc field to reduce padding space
on LP64 hosts.

llvm-svn: 63530
2009-02-02 18:04:24 +00:00
Chris Lattner 18eba4f211 Fix a bug which caused us to miscompile a couple of Ada
tests.  Thanks for the beautiful reduced testcase Duncan!

llvm-svn: 63529
2009-02-02 18:02:59 +00:00
Devang Patel 97ba824ad9 Do not add redundant arguments in a method definition DIE.
llvm-svn: 63527
2009-02-02 17:51:41 +00:00
Devang Patel e7a112111a Make this test case smaller.
llvm-svn: 63526
2009-02-02 17:50:43 +00:00
Sanjiv Gupta 8e56d1898b Duncan's patch. Further to 64382. Takes care of illegal types for shift amount.
llvm-svn: 63523
2009-02-02 17:19:39 +00:00
Sanjiv Gupta 50aeb12d80 Made the common case of default address space directive as non-virtual for performance reasons. Provide a single virtual interface for directives of all sizes in non-default address spaces.
llvm-svn: 63521
2009-02-02 16:53:06 +00:00
Duncan Sands 6f361ff345 Fix a comment (bytes -> bits), reformat a comment
and remove trailing whitespace.  No functionality
change.

llvm-svn: 63511
2009-02-02 10:06:20 +00:00
Duncan Sands 33d6e97e33 Fix an obvious thinko.
llvm-svn: 63510
2009-02-02 09:53:14 +00:00
Evan Cheng dc636c4080 ADD / SUB / SMUL / UMUL with overflow second result top bits must be zero.
llvm-svn: 63509
2009-02-02 09:15:04 +00:00
Duncan Sands 7e4cb0a1cf This passes on x86-32 linux at least.
llvm-svn: 63508
2009-02-02 09:10:57 +00:00
Duncan Sands dca376ff07 Make the XFAIL line actually match x86-32 targets.
llvm-svn: 63507
2009-02-02 09:07:13 +00:00
Evan Cheng 4988c597b3 Add comment.
llvm-svn: 63506
2009-02-02 08:19:07 +00:00
Evan Cheng 50e15bdf81 Teach LowerBRCOND to recognize (xor (setcc x), 1). The xor inverts the condition. It's normally transformed by the dag combiner, unless the condition is set by a arithmetic op with overflow.
llvm-svn: 63505
2009-02-02 08:07:36 +00:00
Chris Lattner b2b177393c reject things like: zext <4 x i32> %tmp to i256
llvm-svn: 63504
2009-02-02 07:40:17 +00:00
Chris Lattner 5e66858152 validation error fix.
llvm-svn: 63503
2009-02-02 07:33:15 +00:00
Chris Lattner cf7a584341 Document type upreferences (PR3380), patch by Stein Roger Skafløtten
with enhancements and corrections by me.

llvm-svn: 63502
2009-02-02 07:32:36 +00:00
Chris Lattner 1f386b8ec8 Fix PR3372
llvm-svn: 63501
2009-02-02 07:24:28 +00:00
Chris Lattner 1aafe4cece reduce indentation, (~XorCST->getValue()).isSignBit() -> isMaxSignedValue()
llvm-svn: 63500
2009-02-02 07:15:30 +00:00
Chris Lattner c4eb63d412 reduce testcase.
llvm-svn: 63499
2009-02-02 06:55:45 +00:00
Mon P Wang cc866c955c Preserve more SourceValue information.
llvm-svn: 63498
2009-02-02 06:37:55 +00:00
Torok Edwin c418287974 add 2 more testcases for -mattr=-sse (r63495).
--This line, and those below, will be ignaored--

A    test/CodeGen/X86/nosse-error1.ll
A    test/CodeGen/X86/nosse-error2.ll

llvm-svn: 63496
2009-02-01 18:24:20 +00:00
Torok Edwin a2d1f35e9a Implement -mno-sse: if SSE is disabled on x86-64, don't store XMM on stack for
var-args, and don't allow FP return values

llvm-svn: 63495
2009-02-01 18:15:56 +00:00
Duncan Sands 3ed768868d Fix PR3453 and probably a bunch of other potential
crashes or wrong code with codegen of large integers:
eliminate the legacy getIntegerVTBitMask and
getIntegerVTSignBit methods, which returned their
value as a uint64_t, so couldn't handle huge types.

llvm-svn: 63494
2009-02-01 18:06:53 +00:00
Bill Wendling a6c75ffd73 Forgot some more DebugLoc propagations.
llvm-svn: 63493
2009-02-01 11:19:36 +00:00
Owen Anderson 19616c08a0 Fix test failures causes by my previous commit.
llvm-svn: 63492
2009-02-01 08:41:54 +00:00
Owen Anderson 66838e9a27 Fix an issue in PHI construction that was exposed by GCC 4.2 producing a different set iteration order for the reg_iterator.
llvm-svn: 63490
2009-02-01 07:06:00 +00:00
Evan Cheng 676130f2e1 Fix PR3423: Link llvm on ARM EABI machines. Patch by Robert Schuster.
llvm-svn: 63489
2009-02-01 06:42:27 +00:00
Dale Johannesen dfbb6a1a9a DebugLoc propagation.
llvm-svn: 63488
2009-01-31 22:04:51 +00:00
Nick Lewycky f23908151a 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.

llvm-svn: 63487
2009-01-31 21:30:05 +00:00
Dale Johannesen 5f98ea28ca DebugLoc propagation. Done with file.
llvm-svn: 63486
2009-01-31 21:04:24 +00:00
Dale Johannesen 4d9fa9e71d DebugLoc propagation. Done with file.
llvm-svn: 63485
2009-01-31 20:01:02 +00:00
Chris Lattner 9e2b9f3234 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.

llvm-svn: 63483
2009-01-31 19:05:27 +00:00
Duncan Sands 41826036b1 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).

llvm-svn: 63482
2009-01-31 15:50:11 +00:00
Chris Lattner 76a63ed099 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.

llvm-svn: 63481
2009-01-31 08:40:03 +00:00
Chris Lattner 3e2cb66c56 simplify/clarify control flow and improve comments, no functionality change.
llvm-svn: 63480
2009-01-31 08:24:16 +00:00
Chris Lattner 83c6a141b8 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.

llvm-svn: 63479
2009-01-31 08:15:18 +00:00
Chris Lattner 19efe30264 add accessors
llvm-svn: 63478
2009-01-31 07:34:19 +00:00
Chris Lattner 585cfb2ce7 minor cleanups
llvm-svn: 63477
2009-01-31 07:26:06 +00:00
Chris Lattner 94cfb281c3 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

llvm-svn: 63476
2009-01-31 07:04:22 +00:00
Mon P Wang b6080cf943 Used "-enable-unsafe-fp-math" to allow this transformation - (a * b -c) = c - a *b.
llvm-svn: 63475
2009-01-31 06:50:54 +00:00
Mon P Wang cf9ba82324 If unsafe FP optimization is not set, don't allow -(A-B) => B-A because
when A==B, -0.0 != +0.0.

llvm-svn: 63474
2009-01-31 06:07:45 +00:00
Bill Wendling 3b585af0ec Don't use DebugLoc::getUnknownLoc(). Default to something hopefully sensible.
llvm-svn: 63473
2009-01-31 03:12:48 +00:00
Chris Lattner ec99c46d44 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

llvm-svn: 63469
2009-01-31 02:28:54 +00:00
Dale Johannesen db7c5f6a7b Move CurDebugLoc into SelectionDAGLowering.
llvm-svn: 63468
2009-01-31 02:22:37 +00:00
Gabor Greif dc588689bb back out my previous change, it exposes a latent bug. investigating
llvm-svn: 63463
2009-01-31 01:31:59 +00:00
Gabor Greif f88092ee06 use precise accessors
llvm-svn: 63459
2009-01-31 00:58:14 +00:00
Dale Johannesen dc0f124429 Propagate debug info in LegalizeFloatTypes.
Complete (modulo bugs).

llvm-svn: 63458
2009-01-31 00:43:08 +00:00
Dale Johannesen 42aa385e20 Propagate debug info. This file complete
(modulo bugs)

llvm-svn: 63457
2009-01-31 00:20:43 +00:00
Dale Johannesen c910889511 Propagate debug info through MakeLibCall and a
couple of things that use it.

llvm-svn: 63456
2009-01-31 00:11:23 +00:00
Bill Wendling 31b50991cb More DebugLoc propagation.
llvm-svn: 63454
2009-01-30 23:59:18 +00:00
Bill Wendling 27d9dd4b57 More DebugLoc propagation.
llvm-svn: 63452
2009-01-30 23:36:47 +00:00
Bill Wendling 306bfc2213 More DebugLoc propagation in LOAD etc. methods.
llvm-svn: 63451
2009-01-30 23:27:35 +00:00
Dale Johannesen 9d7c69d832 Fix build on case-sensitive filesystems (i.e. everybody else)
llvm-svn: 63448
2009-01-30 23:20:42 +00:00
Bill Wendling 0bd29743e3 More DebugLoc propagation in floating-point methods.
llvm-svn: 63446
2009-01-30 23:15:49 +00:00
Dale Johannesen 555a375bb6 Make LowerCallTo and LowerArguments take a DebugLoc
argument.  Adjust all callers and overloaded versions.

llvm-svn: 63444
2009-01-30 23:10:59 +00:00
Bill Wendling 6fbf5495f8 Standardize comments about folding xforms.
llvm-svn: 63443
2009-01-30 23:10:18 +00:00
Bill Wendling 8fb81f1b3d Get rid of the non-DebugLoc-ified getNOT() method.
llvm-svn: 63442
2009-01-30 23:03:19 +00:00
Bill Wendling 3dc5d2454e Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63441
2009-01-30 22:57:07 +00:00
Bill Wendling cb9be5d174 Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63440
2009-01-30 22:53:48 +00:00
Bill Wendling 4e0a61514b Propagate debug loc info for BIT_CONVERT.
llvm-svn: 63439
2009-01-30 22:44:24 +00:00
Bill Wendling 7bfa43b022 Propagate debug loc info for more *_EXTEND methods.
llvm-svn: 63437
2009-01-30 22:33:24 +00:00
Bill Wendling 9b3dc8d848 Propagate debug loc info for ANY_EXTEND.
llvm-svn: 63436
2009-01-30 22:27:33 +00:00
Bill Wendling c409318562 Propagate debug loc info for some of the *_EXTEND functions.
llvm-svn: 63434
2009-01-30 22:23:15 +00:00
Bill Wendling cab9a2eef5 DebugLoc form of getNOT().
llvm-svn: 63433
2009-01-30 22:11:22 +00:00
Bill Wendling b6b6f46fe4 - Propagate debug loc info for SELECT.
- Added xform for (select X, 1, Y) and (select X, Y, 0), which was commented on,
  but missing.

llvm-svn: 63428
2009-01-30 22:02:18 +00:00
Bill Wendling d51e3ff540 Propagate debug loc info for Shifts.
llvm-svn: 63424
2009-01-30 21:37:17 +00:00
Bill Wendling 35972a9460 Propagate debug loc info for XOR and MatchRotate.
llvm-svn: 63420
2009-01-30 21:14:50 +00:00
Bill Wendling f29b6e1318 Propagate debug loc info for OR. Also clean up some comments.
llvm-svn: 63419
2009-01-30 20:59:34 +00:00
Bill Wendling ff8acd684f Perform obvious constant arithmetic folding.
llvm-svn: 63417
2009-01-30 20:50:00 +00:00
Bill Wendling 8617191302 Propagate debug loc info for AND. Also clean up some comments.
llvm-svn: 63416
2009-01-30 20:43:18 +00:00
Bill Wendling 781db7a1ad Propagate debug loc info in SimplifyBinOpWithSameOpcodeHands.
llvm-svn: 63411
2009-01-30 19:25:47 +00:00
Gabor Greif 1933b00c12 use precise getters
llvm-svn: 63403
2009-01-30 18:27:21 +00:00
Gabor Greif 97f1720621 use precise getters
llvm-svn: 63402
2009-01-30 18:21:13 +00:00
Devang Patel c094970cd2 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.

llvm-svn: 63400
2009-01-30 18:20:31 +00:00
Zhou Sheng 4b23938fb9 As Duncan suggested, add braces for the one-line "else branch".
Thanks, Duncan.

llvm-svn: 63389
2009-01-30 09:44:49 +00:00
Zhou Sheng 25b6f8153e 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).

llvm-svn: 63388
2009-01-30 09:02:50 +00:00
Sanjiv Gupta c10d810303 Fixed the comment. No functionality change.
llvm-svn: 63387
2009-01-30 09:01:44 +00:00
Zhou Sheng 1e36fbb5ed 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).

llvm-svn: 63386
2009-01-30 08:59:51 +00:00
Mike Stump ecbe4a0860 Add opposite_of and inverse_opt to support -fno- style options. This
is necessary for eventual gcc commmand line compatibility.

llvm-svn: 63384
2009-01-30 08:19:46 +00:00
Sanjiv Gupta 082174cb78 Use sublw for comparison with literals instead of subwf.
llvm-svn: 63382
2009-01-30 07:55:25 +00:00
Mon P Wang cbb20a6ee1 When PerformBuildVectorCombine, avoid creating a X86ISD::VZEXT_LOAD of
an illegal type.

llvm-svn: 63380
2009-01-30 07:07:40 +00:00
Sanjiv Gupta 964a29f671 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.
llvm-svn: 63377
2009-01-30 04:25:10 +00:00
Bill Wendling 9b3407e5bb Propagate debug loc info in SimplifyNodeWithTwoResults.
llvm-svn: 63376
2009-01-30 03:08:40 +00:00
Bill Wendling faed065e5c Propagate debug loc info for MULHS.
llvm-svn: 63375
2009-01-30 03:00:18 +00:00
Bill Wendling d033af09fd Propagate debug loc info for SREM and UREM.
llvm-svn: 63374
2009-01-30 02:57:00 +00:00
Bill Wendling aff3e03765 Propagate debug loc info for UDIV.
llvm-svn: 63373
2009-01-30 02:55:25 +00:00
Bill Wendling 5b663e7b53 Propagate debug loc info for SDIV.
llvm-svn: 63372
2009-01-30 02:52:17 +00:00
Bill Wendling b48dcf67e5 Forgot to propagate debug loc info here.
llvm-svn: 63371
2009-01-30 02:49:26 +00:00
Dan Gohman 1ee0d41ef8 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.

llvm-svn: 63370
2009-01-30 02:49:14 +00:00
Bill Wendling 091f92f568 Propagate debug loc info for MUL.
llvm-svn: 63369
2009-01-30 02:45:56 +00:00
Bill Wendling 48ff08ef3e Propagate debug loc info in SUB.
llvm-svn: 63368
2009-01-30 02:42:10 +00:00
Bill Wendling 6127757920 Propagate debug loc info in ADDC and ADDE.
llvm-svn: 63367
2009-01-30 02:38:00 +00:00
Bill Wendling c442348dd7 Propagate debug loc info in DAG combine's "ADD".
llvm-svn: 63366
2009-01-30 02:31:17 +00:00
Bill Wendling cdd96133bd - Propagate debug loc info in combineSelectAndUse().
- Modify ReassociateOps so that the resulting SDValue is what the comment claims
  it is.

llvm-svn: 63365
2009-01-30 02:23:43 +00:00
Mikhail Glushenkov c7d6951c92 Add some comments.
llvm-svn: 63364
2009-01-30 02:12:57 +00:00
Chris Lattner caffe92d86 Fix a bug in getMaxValue/getMinValue to pass the right signedness the
the constructed APSInt, patch suggested by Ben Laurie!

llvm-svn: 63362
2009-01-30 01:58:19 +00:00
Devang Patel acbb381cc4 Enable target tripple.
llvm-svn: 63361
2009-01-30 01:40:58 +00:00
Devang Patel a103ee4f0d Linux and other target's encoding for DW_AT_declaration may not match.
llvm-svn: 63360
2009-01-30 01:37:30 +00:00
Dale Johannesen ed255b3d8e Propagate debug info when building SelectionDAG.
llvm-svn: 63359
2009-01-30 01:34:22 +00:00
Devang Patel 33a21670f4 Remove dead code, again.
llvm-svn: 63358
2009-01-30 01:27:49 +00:00
Devang Patel 776a4c5baa Remove dead code.
llvm-svn: 63357
2009-01-30 01:25:47 +00:00
Devang Patel 4ba91058d2 Add DW_AT_declaration for class methods.
llvm-svn: 63356
2009-01-30 01:21:46 +00:00
Bill Wendling 9c9a3b6665 Propagate debug location info for the token factor.
llvm-svn: 63355
2009-01-30 01:13:16 +00:00
Devang Patel 199740651c Add dump() routines to help debug debug info :)
llvm-svn: 63353
2009-01-30 01:03:10 +00:00
Bill Wendling f6d0aff0bd Add DebugLoc propagation to some of the methods in DAG combiner.
llvm-svn: 63350
2009-01-30 00:45:56 +00:00
Bill Wendling 33dddf3235 Explain why this is here.
llvm-svn: 63342
2009-01-29 23:19:43 +00:00
Owen Anderson ad89c410e6 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.

llvm-svn: 63340
2009-01-29 22:27:56 +00:00
Owen Anderson bf77d2eb9d 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.

llvm-svn: 63339
2009-01-29 22:13:06 +00:00
Dan Gohman 14d55f0a5c Explicitly add PseudoSourceValue information when lowering
BUILD_VECTOR and conversions to stack operations.

llvm-svn: 63333
2009-01-29 21:02:43 +00:00
Dan Gohman 60d6844aa8 Make a few things const, fix some comments, and simplify
some assertions.

llvm-svn: 63328
2009-01-29 19:49:27 +00:00
Chris Lattner dfb6735385 Fix windows build, patch by Marius Wachtler!
llvm-svn: 63325
2009-01-29 18:53:28 +00:00
Evan Cheng a160d4af82 Local register allocator shouldn't assume only the entry and landing pad basic blocks have live-ins.
llvm-svn: 63323
2009-01-29 18:37:30 +00:00
Dan Gohman 8b437ccbbe Fix two typos that Duncan spotted in a comment.
llvm-svn: 63312
2009-01-29 16:18:12 +00:00
Dan Gohman ef04ed5477 In the case of an extractelement on an insertelement value,
the element indices may be equal if either one is not a
constant.

llvm-svn: 63311
2009-01-29 16:10:46 +00:00
Evan Cheng a115859df0 Add a always_inline test case.
llvm-svn: 63304
2009-01-29 09:31:54 +00:00
Bill Wendling a434d930ff Revert r63273. This was already implemented by Dale. There's no need for my
change.

llvm-svn: 63301
2009-01-29 09:01:55 +00:00
Evan Cheng 45799abe61 Add a test case for Chris lvalue alignment fixes.
llvm-svn: 63300
2009-01-29 08:59:46 +00:00
Owen Anderson c0924a0632 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!

llvm-svn: 63293
2009-01-29 08:22:06 +00:00
Owen Anderson a590802ed6 Comments are good. :-)
llvm-svn: 63276
2009-01-29 05:41:02 +00:00
Owen Anderson b05ce78c51 Add support for aggressive load-use-store folding. This takes care of the
vast majority of code size regressions introduced by pre-alloc-splitting.

llvm-svn: 63274
2009-01-29 05:28:55 +00:00
Bill Wendling 50338007b9 - 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.)

llvm-svn: 63273
2009-01-29 05:27:31 +00:00
Chris Lattner c0474013cb Fix PR3424, a static constructor ordering issue. Patch by Robert Schuster!
llvm-svn: 63269
2009-01-29 04:43:42 +00:00
Evan Cheng 76a2736c74 Exit with nice warnings when register allocator run out of registers.
llvm-svn: 63267
2009-01-29 02:20:59 +00:00
Dan Gohman e58ab79f33 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.

llvm-svn: 63266
2009-01-29 01:59:02 +00:00
Dan Gohman 84f0165273 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.

llvm-svn: 63265
2009-01-29 01:37:18 +00:00
Evan Cheng 89ba594975 A slight compile time optimization. If the caller knows there isn't a free register getReg() should not call getFreeReg().
llvm-svn: 63263
2009-01-29 01:13:00 +00:00
Dale Johannesen 839acbb089 Add DebugLoc-sensitive versions of many node creation
functions.  Currently omitted:  memcpy, memmove, memset.

llvm-svn: 63259
2009-01-29 00:47:48 +00:00
Evan Cheng 55ca1d38ea Fix comment about removeRange.
llvm-svn: 63255
2009-01-29 00:06:09 +00:00
Mon P Wang 9150f735fa Fixed lowering of v816 shuffles.
llvm-svn: 63252
2009-01-28 23:11:14 +00:00
Bill Wendling 42b63bc175 Make test platform agnostic.
llvm-svn: 63247
2009-01-28 22:20:56 +00:00
Bill Wendling 1b6a3bce82 Add DebugLoc to the getNode() methods.
llvm-svn: 63245
2009-01-28 22:17:52 +00:00
Dan Gohman d21775ae0e Give this test an explicit target, to make it host-independent.
llvm-svn: 63244
2009-01-28 22:14:58 +00:00
Dan Gohman 511d5ece2b SDOperand has been renamed to SDValue. SDNode::Val is now
accessed via SDNode::getNode.

llvm-svn: 63240
2009-01-28 21:36:46 +00:00
Dan Gohman f52ac41566 Add more comments describing SDNode operator codes.
llvm-svn: 63239
2009-01-28 21:34:36 +00:00
Dale Johannesen 666bf20441 Add DebugLoc-aware constructors for SDNode derived
classes (those that reasonably have a DebugLoc
associated with them).

llvm-svn: 63236
2009-01-28 21:18:29 +00:00
Dan Gohman 7a1b4538a0 Add some comments on ISD::NodeType.
llvm-svn: 63234
2009-01-28 21:13:08 +00:00
Devang Patel d7ecb3b661 Do not forget to derived type while constructing an array type.
llvm-svn: 63233
2009-01-28 21:08:20 +00:00
Chris Lattner df17987c19 Fix some issues with volatility, move "CanConvertToScalar" check
after the others.

llvm-svn: 63227
2009-01-28 20:16:43 +00:00
Chris Lattner 1498e62117 strengthen this test.
llvm-svn: 63222
2009-01-28 19:29:30 +00:00
Mon P Wang a15ea78ea6 Fixed extract element when the result needs to be promoted and the input widened.
llvm-svn: 63217
2009-01-28 18:53:39 +00:00
Dan Gohman e7d7b0c2fd Delete unnecessary elses.
llvm-svn: 63214
2009-01-28 18:03:09 +00:00
Chris Lattner ff2d99d94b Enable PACKAGE_VERSION in cmake builds, this unbreaks the clang build with cmake.
Patch by Piotr Rak!

llvm-svn: 63213
2009-01-28 17:49:03 +00:00
Dan Gohman 4aa1846215 Make isOperationLegal do what its name suggests, and introduce a
new isOperationLegalOrCustom, which does what isOperationLegal
previously did.

Update a bunch of callers to use isOperationLegalOrCustom
instead of isOperationLegal. In some case it wasn't obvious
which behavior is desired; when in doubt I changed then to
isOperationLegalOrCustom as that preserves their previous
behavior.

This is for the second half of PR3376.

llvm-svn: 63212
2009-01-28 17:46:25 +00:00
Duncan Sands ba21b7d57a Formatting.
llvm-svn: 63199
2009-01-28 14:42:54 +00:00
Duncan Sands 5a913d61e3 Rename getAnalysisToUpdate to getAnalysisIfAvailable.
llvm-svn: 63198
2009-01-28 13:14:17 +00:00
Duncan Sands 08e53d041f Fix PR3415 (infinite loop in EscapeAnalysis) by
deleting the escape analysis pass.

llvm-svn: 63197
2009-01-28 11:33:59 +00:00
Evan Cheng f31f288863 The memory alignment requirement on some of the mov{h|l}p{d|s} patterns are 16-byte. That is overly strict. These instructions read / write f64 memory locations without alignment requirement.
llvm-svn: 63195
2009-01-28 08:35:02 +00:00
Mon P Wang d880efc005 Added sse test patterns for r62979 and r63193.
llvm-svn: 63194
2009-01-28 08:13:56 +00:00
Mon P Wang 5a685a52c1 Add shuffle splat pattern for x86 sse shifts.
llvm-svn: 63193
2009-01-28 08:12:05 +00:00
Mikhail Glushenkov 02b47b5e7a Typo.
llvm-svn: 63174
2009-01-28 03:47:58 +00:00
Mikhail Glushenkov 84172f7dca Update the generated docs.
llvm-svn: 63173
2009-01-28 03:47:38 +00:00
Mikhail Glushenkov 2115d09a10 Add three new option properties.
Adds new option properties 'multi_val', 'one_or_more' and 'zero_or_one'.

llvm-svn: 63172
2009-01-28 03:47:20 +00:00
Mikhail Glushenkov 57cf3964f3 Clarify comment.
llvm-svn: 63171
2009-01-28 03:46:22 +00:00
Dan Gohman b3bbde3e62 Use ValueType::bitsLT to simplify some code.
llvm-svn: 63170
2009-01-28 03:10:52 +00:00
Dan Gohman 172ad92b29 Use ZERO_EXTEND instead of ANY_EXTEND when promoting
shift amounts, to avoid implicitly assuming that
target architectures will ignore the high bits.

llvm-svn: 63169
2009-01-28 02:58:31 +00:00
Bill Wendling 3cf43ca571 Comment fixes.
llvm-svn: 63164
2009-01-28 01:19:52 +00:00
Evan Cheng e4510972a6 Suppress a compile time warning.
llvm-svn: 63161
2009-01-28 00:53:34 +00:00
Dale Johannesen b3e0931401 Embalm my ideas of how things should work. Not that
anyone will pay attention.

llvm-svn: 63155
2009-01-27 23:32:10 +00:00
Devang Patel 5adc3dbc96 Add type DIE into appropriate context DIE.
llvm-svn: 63154
2009-01-27 23:22:55 +00:00
Dale Johannesen 4e04ef3c55 Add a DebugLoc field and some simple accessors.
llvm-svn: 63152
2009-01-27 23:20:29 +00:00
Dale Johannesen 675869aef0 Reorder args, constify.
llvm-svn: 63151
2009-01-27 23:19:41 +00:00
Bill Wendling fd03bdd00c Add testcase for r63142.
llvm-svn: 63149
2009-01-27 23:00:53 +00:00
Anton Korobeynikov 70d4c08cfe Treat [1 x i8] zeroinitializer as a C string, placing such stuff into
mergeable string section. I don't see any bad impact of such decision
(rather then placing it into mergeable const section, as it was before),
but at least Darwin linker won't complain anymore.

The problem in LLVM is that we don't have special type for string constants
(like gcc does). Even more, we have two separate types: ConstatArray for non-null
strings and ConstantAggregateZero for null stuff.... It's a bit weird :)

llvm-svn: 63142
2009-01-27 22:29:24 +00:00
Dan Gohman b841dc2957 Use .empty() instead of comparing .size() with 0.
llvm-svn: 63139
2009-01-27 22:12:23 +00:00
Dale Johannesen aa064e6cd6 Update to latest spelling.
llvm-svn: 63138
2009-01-27 22:09:11 +00:00
Dale Johannesen f041127bda Add DebugLoc field and simple accessors.
llvm-svn: 63136
2009-01-27 21:41:04 +00:00
Evan Cheng 573e529127 Refine DebugLoc per review comments.
llvm-svn: 63132
2009-01-27 21:15:07 +00:00
Dan Gohman fb58faf29e Add an assertion to the form of SelectionDAG::getConstant that takes
a uint64_t to verify that the value is in range for the given type,
to help catch accidental overflow. Fix a few places that relied on
getConstant implicitly truncating the value.

llvm-svn: 63128
2009-01-27 20:39:34 +00:00
Dan Gohman 0ca1e7c6b6 Reformat the allocation-order arrays to a more conventional style.
llvm-svn: 63121
2009-01-27 19:25:38 +00:00
Dan Gohman 0bd9546039 Delete redundant return statements.
llvm-svn: 63120
2009-01-27 19:23:22 +00:00
Dan Gohman 13f18e853f Respect the DisableRedZone flag on PowerPC.
llvm-svn: 63119
2009-01-27 19:19:28 +00:00
Dan Gohman f77f0ce21a Simplify findNonImmUse; return the result using the return value
instead of via a by-reference argument. No functionality change.

llvm-svn: 63118
2009-01-27 19:04:30 +00:00
Torok Edwin ec39eb8519 APInt's countLeadingOnes() was broken for negative i128 values,
causing assertion failures in getSExtValue().
Fix it by making highWordBits actually contain what its name says,
and add some more unit-tests for APInt.
This fixes PR3419.

llvm-svn: 63107
2009-01-27 18:06:03 +00:00
Dan Gohman ed2ba0fb01 Make some comments doxygen-friendly.
llvm-svn: 63104
2009-01-27 17:28:23 +00:00
Owen Anderson 431053ed2c Make the pre-split-limit option more useful by using a per-function counter.
llvm-svn: 63091
2009-01-27 05:01:15 +00:00
Evan Cheng 1bc8af207e Implement multiple with overflow by 2 with an add instruction.
llvm-svn: 63090
2009-01-27 03:30:42 +00:00
Evan Cheng ce95cddd0f Forgot this test case.
llvm-svn: 63089
2009-01-27 02:59:39 +00:00
Dan Gohman 7740523a89 Eliminate unnecessary operands-list traversals.
llvm-svn: 63088
2009-01-27 02:37:43 +00:00
Dan Gohman 52e907a780 Add a FrontendC testcase for the x86-64 Red Zone feature,
to help verify that the feature may be disabled through
the -mno-red-zone option.

llvm-svn: 63079
2009-01-27 00:59:55 +00:00
Dan Gohman 75cee3a93c Enable the red zone on x86-64 by default.
llvm-svn: 63078
2009-01-27 00:58:47 +00:00
Devang Patel 45c899cd15 Assorted debug info fixes.
- DW_AT_bit_size is only suitable for bitfields.
- Encode source location info for derived types.
- Source location and type size info is not useful for subroutine_type (info is included in respective DISubprogram) and array_type.

llvm-svn: 63077
2009-01-27 00:45:04 +00:00
Dan Gohman 8738997c11 Add a regression test for x86-64 red zone usage.
llvm-svn: 63075
2009-01-27 00:40:27 +00:00
Dan Gohman 1cd2a2c9f8 Fix the Red Zone calculation for functions with frame pointers.
Don't use the Red Zone when dynamic stack realignment is needed.
This could be implemented, but most x86-64 ABIs don't require
dynamic stack realignment so it isn't urgent.

llvm-svn: 63074
2009-01-27 00:40:06 +00:00
Evan Cheng b8c79bdc31 No need to keep size of DebugLocations vector separately.
llvm-svn: 63070
2009-01-26 23:47:30 +00:00
Dale Johannesen 03490f0ce1 Testcase for 6522054.
llvm-svn: 63067
2009-01-26 23:22:19 +00:00
Scott Michel 49483188c3 CellSPU:
- Update DWARF debugging support.

llvm-svn: 63059
2009-01-26 22:33:37 +00:00
Scott Michel 3789a13c30 Make the Dwarf macro information section optional; CellSPU's assembler
doesn't support it. The default is set to 'true', so this should not
impact any other target backends.

llvm-svn: 63058
2009-01-26 22:32:51 +00:00
Dan Gohman b6d36e1d14 Implement Red Zone utilization on x86-64. This is currently
disabled by default; I'll enable it when I hook it up with
the llvm-gcc flag which controls it.

llvm-svn: 63056
2009-01-26 22:22:31 +00:00
Steve Naroff 8cf220398b More updates to VC proj...
llvm-svn: 63050
2009-01-26 22:03:42 +00:00
Owen Anderson e84c3f261e Reapply r63025 and r63026, with fixes for the failing testcases.
llvm-svn: 63049
2009-01-26 21:57:31 +00:00
Duncan Sands d77e476921 Fix PR3393, which amounts to a bug in the expensive
checking logic.  Rather than make the checking more
complicated, I've tweaked some logic to make things
conform to how the checking thought things ought to
be, since this results in a simpler "mental model".

llvm-svn: 63048
2009-01-26 21:54:18 +00:00
Ted Kremenek a26699211d Add method raw_fd_ostream::seek() for random access within a file.
llvm-svn: 63044
2009-01-26 21:42:04 +00:00
Dan Gohman ac272eaf13 At Nick Lewycky's request, rename this test with a more informative name.
llvm-svn: 63042
2009-01-26 21:36:31 +00:00
Bill Wendling e7fa3c37c6 Also revert r63206
llvm-svn: 63041
2009-01-26 21:30:17 +00:00
Bill Wendling a39c83d118 Temporarily revert r63025 until the testsuite failures can be fixed.
llvm-svn: 63040
2009-01-26 21:27:03 +00:00
Dan Gohman 0b46005b19 Fix the name of an argument.
llvm-svn: 63037
2009-01-26 20:27:11 +00:00
Anton Korobeynikov 4b4622454c During bittest switch lowering emit shift in the test block, which should (theoretically)
allow us to generate more efficient code. We don't do this now though :)

llvm-svn: 63027
2009-01-26 19:26:01 +00:00
Owen Anderson 5e235d3a7e Get rid of a bunch of dead code now that interval reconstruction is enabled.
llvm-svn: 63026
2009-01-26 19:18:06 +00:00
Owen Anderson feffdec244 Fix an issue where LiveIntervals was trying to be smart about removing kill
markers, and ended up foiling the interval reconstruction.

This allows us to turn on reconstruction in the pre alloc splitter, which
fixes a number of miscompilations.

llvm-svn: 63025
2009-01-26 19:12:06 +00:00
Evan Cheng 6c7e85142b Enhance logic in X86DAGToDAGISel::PreprocessForRMW which move load inside callseq_start to allow it to be folded into a call. It was not considering the cases where a token factor is between the load and the callseq_start.
llvm-svn: 63022
2009-01-26 18:43:34 +00:00
Evan Cheng 72287a599f Silence a bogus compiler warning.
llvm-svn: 63021
2009-01-26 18:33:51 +00:00
Steve Naroff 0113928f94 Update VS project files.
llvm-svn: 63017
2009-01-26 18:08:55 +00:00
Roman Levenstein 179dd918b9 Fix a bug in BitVector.h. All assignment operations (except the usual
assignment operator) were returning a copy of the bit vector, instead of a
reference! This old semantics probably did not meet the expectations.
With this patch, chained assignments happen to the right object.

llvm-svn: 63012
2009-01-26 11:07:20 +00:00
Evan Cheng 4e6871da09 Actually source file has already been uniquified into an id during isel. Eliminate the StringMap.
llvm-svn: 63009
2009-01-26 07:53:42 +00:00
Evan Cheng b5706c45fa Add data structure to define and track debug location during codegen.
llvm-svn: 63008
2009-01-26 07:41:49 +00:00
Evan Cheng fd0ab12327 Looks like comments were chopped off.
llvm-svn: 63007
2009-01-26 07:40:13 +00:00
Evan Cheng 3975bbec58 LLVM_SUPPORT_DEBUGINFO_H -> LLVM_ANALYSIS_DEBUGINFO_H since DebugInfo.h is under Analysis.
llvm-svn: 63005
2009-01-26 07:31:20 +00:00
Mon P Wang 3537a62704 Fixed optimization of combining two shuffles where the first shuffle inputs
has a different number of elements than the output.

llvm-svn: 62998
2009-01-26 04:39:00 +00:00
Dan Gohman 8e4ac9b71a Take the next steps in making SDUse more consistent with LLVM Use, and
tidy up SDUse and related code.
 - Replace the operator= member functions with a set method, like
   LLVM Use has, and variants setInitial and setNode, which take
   care up updating use lists, like LLVM Use's does. This simplifies
   code that calls these functions.
 - getSDValue() is renamed to get(), as in LLVM Use, though most
   places can either use the implicit conversion to SDValue or the
   convenience functions instead.
 - Fix some more node vs. value terminology issues.

Also, eliminate the one remaining use of SDOperandPtr, and
SDOperandPtr itself.

llvm-svn: 62995
2009-01-26 04:35:06 +00:00
Scott Michel 95b2a206ee Untabify code.
llvm-svn: 62991
2009-01-26 03:37:41 +00:00
Scott Michel 9e3e4a9219 CellSPU:
- Rename fcmp.ll test to fcmp32.ll, start adding new double tests to fcmp64.ll
- Fix select_bits.ll test
- Capitulate to the DAGCombiner and move i64 constant loads to instruction
  selection (SPUISelDAGtoDAG.cpp).

  <rant>DAGCombiner will insert all kinds of 64-bit optimizations after
  operation legalization occurs and now we have to do most of the work that
  instruction selection should be doing twice (once to determine if v2i64
  build_vector can be handled by SelectCode(), which then runs all of the
  predicates a second time to select the necessary instructions.) But,
  CellSPU is a good citizen.</rant>

llvm-svn: 62990
2009-01-26 03:31:40 +00:00
Nate Begeman 624801e87e Fix a typo
llvm-svn: 62989
2009-01-26 03:15:54 +00:00
Nate Begeman a2550a8e96 De-identifying per sabre review
llvm-svn: 62988
2009-01-26 03:15:31 +00:00
Nick Lewycky 5c8fc9d549 Build libLTO on any platform so long as PIC is enabled.
llvm-svn: 62987
2009-01-26 03:04:57 +00:00
Nate Begeman 7ea4e861ca Add some documentation for address-space-based access to the segment registers.
llvm-svn: 62986
2009-01-26 02:54:45 +00:00
Chris Lattner 9449991c4f Handle single-entry phi nodes gracefully in condprop.
llvm-svn: 62985
2009-01-26 02:18:20 +00:00
Chris Lattner 7b6647c178 Fix PR3408 by making a non-obvious assumption very obvious, and
handling the flaw inherent in that assumption.  :)

llvm-svn: 62984
2009-01-26 02:11:30 +00:00
Chris Lattner 57cb472b56 More cleanups and simplifications, no functionality change.
llvm-svn: 62983
2009-01-26 01:57:01 +00:00
Chris Lattner d67aaa6560 tidy asserts
llvm-svn: 62982
2009-01-26 01:38:24 +00:00
Nate Begeman 5eca265519 Map address space 256 to gs; similar mappings could be supported for the
other x86 segments.  address space 0 is stack/default, 1-255 are reserved for
client use.

llvm-svn: 62980
2009-01-26 01:24:32 +00:00
Nate Begeman 8a51d8c8f7 Support pattern matching various x86 sse shifts.
llvm-svn: 62979
2009-01-26 00:52:55 +00:00
Chris Lattner 80b283c1cd silence a warning when assertions are disabled.
llvm-svn: 62976
2009-01-25 23:08:00 +00:00
Torok Edwin 692ed0f67d should have removed the + when manually applying a patch!
llvm-svn: 62973
2009-01-25 20:29:34 +00:00
Torok Edwin 97be2f5840 revert this patch for now, because Codegen does still want to generate SSE code,
for example in the case of va-args. XFAIL associated tests.

llvm-svn: 62972
2009-01-25 20:21:24 +00:00
Torok Edwin 3cc1940003 testcase for llvm-gcc part of PR3402.
llvm-svn: 62969
2009-01-25 18:00:06 +00:00
Torok Edwin a23c73bbdc If user explicitly asks not to use SSE, don't force it. This fixes LLVM part of PR3402.
llvm-svn: 62967
2009-01-25 17:58:56 +00:00
Dan Gohman f1d38be265 Eliminate the loop that searches through each of the operands
of each use in the SelectionDAG ReplaceAllUses* functions. Thanks
to Chris for spotting this opportunity.

Also, factor out code from all 5 of the ReplaceAllUses* functions
into AddNonLeafNodeToCSEMaps, which is now renamed
AddModifiedNodeToCSEMaps to more accurately reflect its purpose.

llvm-svn: 62964
2009-01-25 16:29:12 +00:00
Dan Gohman 3a113ec468 Whitespace tidiments.
llvm-svn: 62963
2009-01-25 16:21:38 +00:00
Dan Gohman e7b0dde2ee Move the N->use_empty() assert from DeleteNode to
DeleteNodeNotInCSEMaps, since DeleteNode just calls
DeleteNodeNotInCSEMaps.

llvm-svn: 62962
2009-01-25 16:20:37 +00:00
Dan Gohman e3f2278de1 Reality-check the FAQ entry for "Can I use LLVM to convert C++ to C?"
llvm-svn: 62961
2009-01-25 16:04:50 +00:00
Nick Lewycky 21add8f983 Start generating arbitrary precision integer SCEVs. This removes the temporary
code that rounded up and capped the size.

llvm-svn: 62958
2009-01-25 08:16:27 +00:00
Nick Lewycky cb7a10ab63 Actually run the test in this directory.
llvm-svn: 62957
2009-01-25 08:05:07 +00:00
Nick Lewycky 5647c5d1a4 The function that does nothing but call malloc is noalias return.
llvm-svn: 62956
2009-01-25 07:59:57 +00:00
Evan Cheng 1c7c019229 Private linkage support for PPC / Darwin.
llvm-svn: 62955
2009-01-25 06:32:01 +00:00
Evan Cheng abda665f5f Teach 2addr pass to be do more commuting. If both uses of a two-address instruction are killed, but the first operand has a use before and after the def, commute if the second operand does not suffer from the same issue.
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1                                                                                                                                     
%reg1029<def> = MOV8rr %reg1028                                                                                                                                                      
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>                                                                                                                            
insert => %reg1030<def> = MOV8rr %reg1028                                                                                                                                            
%reg1030<def> = ADD8rr %reg1028<kill>, %reg1029<kill>, %EFLAGS<imp-def,dead>                                                                                                         

In this case, it might not be possible to coalesce the second MOV8rr                                                                                                                 
instruction if the first one is coalesced. So it would be profitable to                                                                                                              
commute it:                                                                                                                                                                          
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1                                                                                                                                     
%reg1029<def> = MOV8rr %reg1028                                                                                                                                                      
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>                                                                                                                            
insert => %reg1030<def> = MOV8rr %reg1029                                                                                                                                            
%reg1030<def> = ADD8rr %reg1029<kill>, %reg1028<kill>, %EFLAGS<imp-def,dead>

llvm-svn: 62954
2009-01-25 03:53:59 +00:00
Nate Begeman b09b0242ca Fix an indent and a typo.
llvm-svn: 62940
2009-01-24 22:12:48 +00:00
Dale Johannesen 2b3389a626 Revert previous change; even this mild and clearly
more accurate change loses more than it gains on
benchmarks.

llvm-svn: 62938
2009-01-24 21:49:34 +00:00
Torok Edwin 3cedd4dc64 add note about possible GEP improvement with fields of size 0.
llvm-svn: 62925
2009-01-24 19:30:25 +00:00
Dan Gohman 73fd5a5651 Add a PR comment to this test.
llvm-svn: 62921
2009-01-24 17:32:54 +00:00
Torok Edwin f4395ea97a testcase for PR3381.
Also it was an empty struct, not a void after all.

llvm-svn: 62920
2009-01-24 17:16:04 +00:00
Dan Gohman 142ccc0e15 Add more documentation mentioning the limitations due to PR2660.
llvm-svn: 62919
2009-01-24 15:58:40 +00:00
Torok Edwin 73ff92272f void* is represented as pointer to empty struct {}.
Thus we need to check whether the struct is empty before trying to index into
it. This fixes PR3381.

llvm-svn: 62918
2009-01-24 11:30:49 +00:00
Owen Anderson ee34b8f179 Some cleanups. No functional changes.
llvm-svn: 62917
2009-01-24 10:07:43 +00:00
Dale Johannesen 899ecdbbba Improve the inlining cost function a bit.
Little practical effect.

llvm-svn: 62908
2009-01-24 01:27:33 +00:00
Chris Lattner 72cd68fe64 Make InstCombineStoreToCast handle aggregates more aggressively,
handling the case in Transforms/InstCombine/cast-store-gep.ll, which
is a heavily reduced testcase from Clang on x86-64.

llvm-svn: 62904
2009-01-24 01:00:13 +00:00
Mike Stump 82221d62a9 Perform optional clang building.
llvm-svn: 62895
2009-01-24 00:00:41 +00:00
Evan Cheng 6d8970695b Refactor code. No functionality change.
llvm-svn: 62893
2009-01-23 23:27:33 +00:00
Devang Patel ccfacfff9a Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, DW_AT_APPLE_flags.
DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way.

DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by  a project, irrespective of whether the project used makefile, Xcode or something else.

llvm-gcc patch is next.

llvm-svn: 62888
2009-01-23 22:33:47 +00:00
Chris Lattner 832959536a hopefully address PR3379 by making the P modifier work in x86 inline asm.
llvm-svn: 62887
2009-01-23 22:33:40 +00:00
Devang Patel 486d309b34 Fix test case. Use valid file name and directory in global variable's debug info entry.
llvm-svn: 62883
2009-01-23 21:54:18 +00:00
Gabor Greif 59c431347f use CallSite::isCalle instead of slow getOperandNo
llvm-svn: 62877
2009-01-23 21:17:04 +00:00
Gabor Greif eb61fcf2a1 Simplify the logic of getting hold of a PHI predecessor block.
There is now a direct way from value-use-iterator to incoming block in PHINode's API.
This way we avoid the iterator->index->iterator trip, and especially the costly
getOperandNo() invocation. Additionally there is now an assertion that the iterator
really refers to one of the PHI's Uses.

llvm-svn: 62869
2009-01-23 19:40:15 +00:00
Nate Begeman 617001d842 Add support for deleting a module provider from a JIT in such a way that it does not cause the owned module to be fully materialized.
llvm-svn: 62864
2009-01-23 19:27:28 +00:00
Devang Patel dd7aa37895 Empty DIType represents void. In this case no need to construct any type DIE.
llvm-svn: 62861
2009-01-23 19:13:31 +00:00
Dan Gohman 1275e28ded Fold x-0 to x in unsafe-fp-math mode. This comes up in the
testcase from PR3376, and in fact is sufficient to completely
avoid the problem in that testcase.

There's an underlying problem though; TLI.isOperationLegal
considers Custom to be Legal, which might be ok in some
cases, but that's what DAGCombiner is using in many places
to test if something is legal when LegalOperations is true.
When DAGCombiner is running after legalize, this isn't
sufficient. I'll address this in a separate commit.

llvm-svn: 62860
2009-01-23 19:10:37 +00:00
Duncan Sands d4aae43e79 Patch to build llvm with srcdir != objdir from
llvm-top.  By Michael Schuerig, with some small
tweaks to make the "don't configure if already
configured" logic work.

llvm-svn: 62842
2009-01-23 08:42:38 +00:00
Chris Lattner 3f4591c89f fix two more cases where we could let the NLPDI cache get unsorted.
With this, sqlite3 now passes.

llvm-svn: 62839
2009-01-23 07:12:16 +00:00
Chris Lattner e3ea48c71e Unconditionally reset 'cache' to zero, even if we don't need to resort it.
This avoids using a dangling pointer.

Reset NumSortedEntries after restoring Cache to avoid extraneous sorts.
This fixes the reduced sqlite3 testcase, but apparently not the whole app.

llvm-svn: 62838
2009-01-23 06:48:41 +00:00
Evan Cheng 9db227999a Only check if coalescing is worthwhile when the result is targeting a more restrictive register class.
llvm-svn: 62837
2009-01-23 05:48:59 +00:00
Evan Cheng f347c3615b Update test to reflect command line option name change.
llvm-svn: 62836
2009-01-23 05:45:31 +00:00
Owen Anderson a2ca64a39a Stage two of fixing pre-alloc-splitting's code size issues: filter out restores that are just
going to be re-spilled again.

This also helps performance.  Pre-alloc-splitting now seems to be an overall win on SPEC.

llvm-svn: 62834
2009-01-23 03:28:53 +00:00
Evan Cheng ab7bf14fb4 Cross register class coalescing. Not yet enabled.
llvm-svn: 62832
2009-01-23 02:15:19 +00:00
Devang Patel 7d537c23c1 Code did not follow associated comment. not a good idea.
llvm-svn: 62828
2009-01-23 01:25:58 +00:00
Devang Patel 4c8f55abda Set appropriate tag for the composite type.
llvm-svn: 62827
2009-01-23 01:19:09 +00:00
Chris Lattner 706d40e662 a minor tweak to my previous patch, handle the invalidation case
when there are multiple iterations of the loop.  This fixes PR3375.

llvm-svn: 62822
2009-01-23 00:27:03 +00:00
Owen Anderson 48abf2380b Add an initial pass at dead spill/restore removal for pre alloc splitting.
llvm-svn: 62821
2009-01-23 00:23:32 +00:00
Chris Lattner 1f9053a83c do not sign extend characters input to isprint. This improves
compatibility with VC++.  Patch by Max Burke!

llvm-svn: 62813
2009-01-22 23:38:45 +00:00
Steve Naroff 0681693277 Handful of fixes to the VC project files.
llvm-svn: 62807
2009-01-22 23:05:37 +00:00
Bob Wilson c2dc7ee5d0 Fix a minor bug in DAGCombiner's folding of SELECT. Folding "select C, 0, 1"
to "C ^ 1" is only valid when C is known to be either 0 or 1.  Most of the
similar foldings in this function only handle "i1" types, but this one appears
intentionally written to handle larger integer types.  If C has an integer
type larger than "i1", this needs to check if the high bits of a boolean
are known to be zero.  I also changed the comment to describe this folding as
"C ^ 1" instead of "~C", since that is what the code does and since the latter
would only be valid for "i1" types.  The good news is that most LLVM targets
use TargetLowering::ZeroOrOneBooleanContent so this change will not disable
the optimization; the bad news is that I've been unable to come up with a
testcase to demonstrate the problem.

I have also removed a "FIXME" comment for folding "select C, X, 0" to "C & X",
since the code looks correct to me.  It could be made more aggressive by not
limiting the type to "i1", but that would then require checking for
TargetLowering::ZeroOrNegativeOneBooleanContent.  Similar changes could be
done for the other SELECT foldings, but it was decided to be not worth the
trouble and complexity (see e.g., r44663).

llvm-svn: 62790
2009-01-22 22:05:48 +00:00
Dan Gohman 1f3411de47 Don't create ISD::FNEG nodes after legalize if they aren't legal.
Simplify x+0 to x in unsafe-fp-math mode. This avoids a bunch of
redundant work in many cases, because in unsafe-fp-math mode,
ISD::FADD with a constant is considered free to negate, so the
DAGCombiner often negates x+0 to -0-x thinking it's free, when
in reality the end result is -x, which is more expensive than x.

Also, combine x*0 to 0.

This fixes PR3374.

llvm-svn: 62789
2009-01-22 21:58:43 +00:00
Gabor Greif f4013373cd introduce a useful abstraction to find out if a Use is in the call position of an instruction
llvm-svn: 62788
2009-01-22 21:35:57 +00:00
Tanya Lattner 483e12e09e Regenerated configure after backing out 62553 and r62616.
llvm-svn: 62778
2009-01-22 20:11:17 +00:00
Tanya Lattner 9a8602ce50 Revert r62553 and r62616 due to issues with portability.
llvm-svn: 62777
2009-01-22 20:09:20 +00:00
Chris Lattner aa1212271a rename methods in System/Host to be more consistent.
llvm-svn: 62776
2009-01-22 19:53:00 +00:00
Devang Patel dec7fe2e71 Do not use buggy llvm-gcc to generate testcases.
llvm-svn: 62770
2009-01-22 18:28:11 +00:00
Bob Wilson c58900504b Add SelectionDAG::getNOT method to construct bitwise NOT operations,
corresponding to the "not" and "vnot" PatFrags.  Use the new method
in some places where it seems appropriate.

llvm-svn: 62768
2009-01-22 17:39:32 +00:00