Commit Graph

44560 Commits

Author SHA1 Message Date
Evan Cheng 64fdacc27f A few more isAsCheapAsAMove.
llvm-svn: 63852
2009-02-05 08:42:55 +00:00
Evan Cheng 88ac2c76a8 Clarify comments.
llvm-svn: 63851
2009-02-05 08:41:53 +00:00
Chris Lattner 7e1d2862ca if we have a large GEP offset on a 32-bit or other target, make
sure to print the value properly sext'd to the right pointer size.
This fixes PR3481.

llvm-svn: 63843
2009-02-05 06:55:21 +00:00
Owen Anderson 7411523ee6 Pre-alloc splitting needs to be more careful to avoid inserting spills/restores
between call frame setup/restore points.  Unfortunately, this regresses 
code size a bit, but at least it's correct now!

llvm-svn: 63837
2009-02-05 05:58:41 +00:00
Chris Lattner 08aa90643e PR3485, document alignment on byref.
llvm-svn: 63836
2009-02-05 05:42:28 +00:00
Nick Lewycky 9f694e4b3b It's not obvious, but lto_module_create_from_memory doesn't need to use the
buffer after it creates the Module. Thus, we don't need to store this pointer
in claimed_file.

llvm-svn: 63834
2009-02-05 05:36:01 +00:00
Mon P Wang 3f0e0a6dea Fix a bug where we were not emitting a cvt rnd sat node for converting
between a unsigned integer and signed integer.

llvm-svn: 63831
2009-02-05 04:47:42 +00:00
Nick Lewycky 8691c47e9e Remove accidentally included debug message!
Reword a comment for clarity. Remove some extra whitespace.

llvm-svn: 63823
2009-02-05 04:14:23 +00:00
Dale Johannesen b842d529a3 Reapply 63765. Patches for clang and llvm-gcc to follow.
llvm-svn: 63812
2009-02-05 01:49:45 +00:00
Dale Johannesen 12c572b6fa Get rid of 3 non-DebugLoc getNode variants.
llvm-svn: 63808
2009-02-05 01:01:16 +00:00
Devang Patel 086b212277 Ignore dbg intrinsics while folding switch instruction.
llvm-svn: 63802
2009-02-05 00:30:42 +00:00
Dale Johannesen 7ae8c8b108 Remove non-DebugLoc versions of getMergeValues, ZeroExtendInReg.
llvm-svn: 63800
2009-02-05 00:20:09 +00:00
Dale Johannesen f08a47bb70 Remove non-DebugLoc forms of CopyToReg and CopyFromReg.
Adjust callers.

llvm-svn: 63789
2009-02-04 23:02:30 +00:00
Dale Johannesen ae616c2c61 Reverting 63765. This broke the build of both clang
and llvm-gcc.

llvm-svn: 63786
2009-02-04 22:47:25 +00:00
Devang Patel 916fdce16d Ignore dbg intrinsics.
llvm-svn: 63781
2009-02-04 21:39:48 +00:00
Mon P Wang 4cf5f3a7e5 Add test case for r63760.
llvm-svn: 63774
2009-02-04 21:10:56 +00:00
Nate Begeman 94fefbc98e Remove now-incorrect test.
llvm-svn: 63772
2009-02-04 21:07:37 +00:00
Torok Edwin a488ee0e35 Alphabetize includes. Update comment.
llvm-svn: 63771
2009-02-04 21:00:02 +00:00
Stuart Hastings 556bd92698 80 column rule.
llvm-svn: 63768
2009-02-04 20:30:10 +00:00
Dale Johannesen 021052a705 Remove non-DebugLoc versions of getLoad and getStore.
Adjust the many callers of those versions.

llvm-svn: 63767
2009-02-04 20:06:27 +00:00
Nate Begeman 6ae3aa83d0 New feature: add support for target intrinsics being defined in the
target directories themselves.  This also means that VMCore no longer
needs to know about every target's list of intrinsics.  Future work
will include converting the PowerPC target to this interface as an
example implementation.

llvm-svn: 63765
2009-02-04 19:47:21 +00:00
Mon P Wang 34650735d0 Avoids generating a legalization assert for the case where a vector type is legal
but when legalizing the operation, we split the vector type and generate a library
call whose type needs to be promoted. For example, X86 with SSE on but MMX off, 
a divide v2i64 will be scalarized to 2 calls to a library using i64.

llvm-svn: 63760
2009-02-04 19:38:14 +00:00
Torok Edwin c409c77817 mention that PIC is needed for libLTO and libLLVMgold
llvm-svn: 63755
2009-02-04 19:12:25 +00:00
Chris Lattner e84a7911c4 Bill implemented this.
llvm-svn: 63752
2009-02-04 19:09:07 +00:00
Chris Lattner 553fd7e1eb add a note, this is why we're faster at SciMark-MonteCarlo with
SSE disabled.

llvm-svn: 63751
2009-02-04 19:08:01 +00:00
Evan Cheng 9ec370f748 Skip over zero registers.
llvm-svn: 63748
2009-02-04 18:18:58 +00:00
Chris Lattner 370ec10dad allow main to have any integer type.
llvm-svn: 63743
2009-02-04 17:48:18 +00:00
Torok Edwin a2794dba04 remove printf - it was there only for debugging!
llvm-svn: 63742
2009-02-04 17:40:28 +00:00
Torok Edwin 4b35a81845 add support for .a files containing LLVM IR to the gold plugin
llvm-svn: 63741
2009-02-04 17:39:30 +00:00
Dan Gohman 556d14d483 Minor code cleanups; no functionality change.
llvm-svn: 63740
2009-02-04 17:28:58 +00:00
Stuart Hastings ffee3d831a Since I'm obliged to work with a development OS that currently doesn't
support GraphViz, I've been using the foo->dump() facility.  This
patch is a minor rewrite to the SelectionDAG dump() stuff to make it a
little more helpful.  The existing foo->dump() functionality does not
change; this patch adds foo->dumpr().  All of this is only useful when
running LLVM under a debugger.

llvm-svn: 63736
2009-02-04 16:46:19 +00:00
Duncan Sands e7d5479136 Allow the inverse transform x86_fp80 -> i80 (also
fires during the Ada build).

llvm-svn: 63731
2009-02-04 11:17:06 +00:00
Duncan Sands 1ea1173143 Fix PR3468: a crash when constant folding a bitcast of
i80 to x86 long double (this was presumably generated
by sroa).

llvm-svn: 63730
2009-02-04 10:17:14 +00:00
Evan Cheng 4ded601445 Don't call isInvariantLoad twice.
llvm-svn: 63729
2009-02-04 09:21:58 +00:00
Evan Cheng 1d9f7ac8cc Don't bother hoisting out a "cheap" instruction if all of its uses are PHIs. LICM "cheap" instructions are not particularly beneficial to start with. This will just end up making the copies harder to coalesce.
llvm-svn: 63728
2009-02-04 09:19:56 +00:00
Evan Cheng 0649abdfe2 For now, only hoist re-materilizable instructions. LICM will increase register pressure. We want to avoid spilling more instructions if it's possible.
llvm-svn: 63725
2009-02-04 07:17:49 +00:00
Nick Lewycky 11e9214ee6 Regenerate.
llvm-svn: 63724
2009-02-04 06:27:44 +00:00
Nick Lewycky a89ec99fa2 Reapply patch from r62553, with a fix to avoid looking for an ffi.h that isn't
there.

This changes the interpreter to use libffi. After this patch, the interpreter
will barely be able to call any external functions if built on a system without
libffi installed (just enough to pass 'make check' really). But with libffi,
we can now call any function that isn't variadic or taking a struct or vector
parameter (but pointer to struct is fine). Patch by Alexei Svitkine!

llvm-svn: 63723
2009-02-04 06:26:47 +00:00
Owen Anderson 1caf7fef8e Finish making AliasAnalysis aware of the fact that most atomic intrinsics only dereference their arguments, and enhance
BasicAA to make use of this fact when computing ModRef info.

llvm-svn: 63718
2009-02-04 05:16:46 +00:00
Dale Johannesen 679073b420 Remove non-DebugLoc forms of the exotic forms
of Lod and Sto; patch uses.

llvm-svn: 63716
2009-02-04 02:34:38 +00:00
Chris Lattner a6df124b44 fix a pretty serious bug in StringMap where GetOrCreate(strstart,strend, z)
would not set new values to Z.

llvm-svn: 63707
2009-02-04 01:54:10 +00:00
Chris Lattner 21df8c95a5 add a friend needed by a stringmap change.
llvm-svn: 63706
2009-02-04 01:51:53 +00:00
Dale Johannesen f2bb6f09a3 Remove some more non-DebugLoc versions of construction
functions, with callers adjusted to fit.

llvm-svn: 63705
2009-02-04 01:48:28 +00:00
Dale Johannesen efb82cfbf2 Check in file I forgot.
llvm-svn: 63704
2009-02-04 01:33:20 +00:00
Dale Johannesen 85263882aa Remove a few non-DebugLoc versions of node creation
functions.

llvm-svn: 63703
2009-02-04 01:17:06 +00:00
Mon P Wang 4379a795fe Fixes a case where we generate an incorrect mask for pshfhw in the presence
of undefs and incorrectly determining if we have punpckldq.

llvm-svn: 63702
2009-02-04 01:16:59 +00:00
Devang Patel fd9f635103 While folding vallue comparison terminators ignore dbg intrinsics.
llvm-svn: 63700
2009-02-04 01:06:11 +00:00
Dale Johannesen bbf13f54e0 Patch up omissions in DebugLoc propagation.
llvm-svn: 63693
2009-02-04 00:33:20 +00:00
Dale Johannesen 9888edee10 Fill in more omissions in DebugLog propagation.
I think that's it for this directory.

llvm-svn: 63690
2009-02-04 00:13:36 +00:00
Bill Wendling 0b4403f9bd Constify and don't return a reference.
llvm-svn: 63689
2009-02-04 00:05:34 +00:00
Devang Patel f10e287c65 Ignore dbg intrinsics while hoisting common code in the two blocks up into the branch block.
llvm-svn: 63687
2009-02-04 00:03:08 +00:00
Dale Johannesen 3a09f5589d DebugLoc propagation; adjustment to things omitted
from SelectionDagBuild.

llvm-svn: 63680
2009-02-03 23:04:43 +00:00
Bill Wendling 77b3be8ea3 Erm. Would be nice to initialize this variable. . .
llvm-svn: 63677
2009-02-03 22:55:54 +00:00
Bill Wendling 2c0a4fe4e2 Add getDebugLocTuple to retrieve the DebugLocTuple for a given DebugLoc object.
llvm-svn: 63676
2009-02-03 22:49:58 +00:00
Bill Wendling 7798193993 Add getter for the index.
llvm-svn: 63675
2009-02-03 22:49:14 +00:00
Dale Johannesen 0404dc11af Need this file too.
llvm-svn: 63674
2009-02-03 22:26:34 +00:00
Dale Johannesen abf66b8343 Add some DL propagation to places that didn't
have it yet.  More coming.

llvm-svn: 63673
2009-02-03 22:26:09 +00:00
Devang Patel 2032cadd0f Do not let dbg intrinsic block folding of two entry phi node.
llvm-svn: 63671
2009-02-03 22:12:02 +00:00
Devang Patel 43a1161379 If "optimize for size" attribute is set then block non-trivial loop unswitches but allow trivial loop unswitches.
llvm-svn: 63670
2009-02-03 22:04:27 +00:00
Dale Johannesen 14f2d9dcbd DebugLoc propgation
llvm-svn: 63664
2009-02-03 21:48:12 +00:00
Bill Wendling dd7fa33679 More whitespace fixin'.
llvm-svn: 63663
2009-02-03 21:38:21 +00:00
Bill Wendling eaf02df7b4 Whitespace and comment changes. No functionality change.
llvm-svn: 63660
2009-02-03 21:17:20 +00:00
Chris Lattner ef37dc8511 teach "convert from scalar" to handle loads of fca's.
llvm-svn: 63659
2009-02-03 21:08:45 +00:00
Chris Lattner f5df53cb46 refactor the interface to ConvertUsesOfLoadToScalar,
renaming it to ConvertScalar_ExtractValue

llvm-svn: 63658
2009-02-03 21:01:03 +00:00
Dale Johannesen 1eb1ef2cfd DebugLoc propagation. done with file.
llvm-svn: 63656
2009-02-03 20:21:25 +00:00
Devang Patel 9c7c0db37a Remove dead code.
llvm-svn: 63653
2009-02-03 19:46:28 +00:00
Chris Lattner 576baa4adf convert ConvertUsesOfLoadToScalar to use IRBuilder,
no functionality change.

llvm-svn: 63652
2009-02-03 19:45:44 +00:00
Chris Lattner c1fb96d347 switch ConvertScalar_InsertValue to use an IRBuilder, no
functionality change.

llvm-svn: 63651
2009-02-03 19:41:50 +00:00
Dale Johannesen 66e03e6f7b DebugLoc propagation. 2/3 through file.
llvm-svn: 63650
2009-02-03 19:33:06 +00:00
Chris Lattner 18f56c295c make scalar conversion handle stores of first class
aggregate values.  loads are not yet handled (coming
soon to an sroa near you).

llvm-svn: 63649
2009-02-03 19:30:11 +00:00
Dan Gohman d564353193 Change the post-RA scheduler to iterate through the
basic-block segments bottom-up instead of top down. This
is the first step in a general restructuring of the way
register liveness is tracked in the post-RA scheduler.

llvm-svn: 63643
2009-02-03 18:57:45 +00:00
Dan Gohman 561d1226b6 Tevert part of the x86 subtarget logic changes: when -march=x86-64
is given, override the subtarget settings and enable 64-bit support.
This restores the earlier behavior, and fixes regressions on
Non-64-bit-capable x86-32 hosts.

This isn't necessarily the best approach, but the most obvious
alternative is to require -mcpu=x86-64 or -mattr=+64bit to be used
with -march=x86-64 when the host doesn't have 64-bit support. This
makes things little more consistent, but it's less convenient, and
it has the practical drawback of requiring lots of test changes, so
I opted for the above approach for now.

llvm-svn: 63642
2009-02-03 18:53:21 +00:00
Devang Patel 70da8e8425 First initialize DAG otherwise dwarf writer is used uninitialized.
Duncan spotted this. Thanks!

llvm-svn: 63641
2009-02-03 18:46:32 +00:00
Chris Lattner 73eff2e6e8 Make SROA produce a vector only when the alloca is actually
accessed at least once as a vector.  This prevents it from
compiling the example in not-a-vector into:

define double @test(double %A, double %B) {
	%tmp4 = insertelement <7 x double> undef, double %A, i32 0
	%tmp = insertelement <7 x double> %tmp4, double %B, i32 4
	%tmp2 = extractelement <7 x double> %tmp, i32 4
	ret double %tmp2
}

instead, producing the integer code.  Producing vectors when they
aren't otherwise in the program is dangerous because a lot of other
code treats them carefully and doesn't want to break them down.
OTOH, many things want to break down tasty i448's.

llvm-svn: 63638
2009-02-03 18:15:05 +00:00
Chris Lattner 8fc6561993 this produces an undefined result, just check that the alloca is gone
and that sroa doesn't crash.

llvm-svn: 63637
2009-02-03 18:13:00 +00:00
Duncan Sands a77c5f758c Fix PR3411. When replacing values, nodes are analyzed
in any old order.  Since analyzing a node analyzes its
operands also, this can mean that when we pop a node
off the list of nodes to be analyzed, it may already
have been analyzed.

llvm-svn: 63632
2009-02-03 10:23:33 +00:00
Evan Cheng 8542caa3f7 APInt'fy SimplifyDemandedVectorElts so it can analyze vectors with more than 64 elements.
llvm-svn: 63631
2009-02-03 10:05:09 +00:00
Chris Lattner ed8903e45a add a method to BumpPtrAllocator that allows allocating elements
with a specified alignment.

llvm-svn: 63629
2009-02-03 07:39:50 +00:00
Nick Lewycky fb643e4d9f Add LLVM plugin for gold.
llvm-svn: 63623
2009-02-03 07:13:24 +00:00
Nick Lewycky a2cf0ed2c7 Regenerate configure.
llvm-svn: 63622
2009-02-03 07:10:30 +00:00
Nick Lewycky edd8946bec Add the ability to pass the path to binutils source to configure. This is
needed to build the LLVM gold plugin.

llvm-svn: 63621
2009-02-03 07:10:08 +00:00
Chris Lattner 80810b4c2d add another case of undefined behavior without crashing, PR3466.
llvm-svn: 63620
2009-02-03 07:08:57 +00:00
Nick Lewycky 05daea5d32 Revert r63600. It didn't fix the bug, it just moved it a bit.
llvm-svn: 63618
2009-02-03 06:30:37 +00:00
Owen Anderson f755c2b7a4 Teach AliasAnalysis that a bunch of the atomic intrinsics only dereference their arguments.
llvm-svn: 63616
2009-02-03 06:27:22 +00:00
Nick Lewycky 12a130bd06 Update the callgraph when replacing InvokeInst with CallInst when inlining.
llvm-svn: 63600
2009-02-03 04:34:40 +00:00
Bill Wendling 67cd395d45 Explicitly pass in debug location information to BuildMI.
llvm-svn: 63599
2009-02-03 02:29:34 +00:00
Bill Wendling 135227a060 Pass in something sensible for the debug location information when creating the
initial PHI nodes of the machine function.

llvm-svn: 63598
2009-02-03 02:20:52 +00:00
Chris Lattner fa4e35aca7 fix a bitcode reader bug where it can't handle extractelement correctly:
the index of the value being extracted is always an i32.  This fixes PR3465

llvm-svn: 63597
2009-02-03 02:11:28 +00:00
Chris Lattner 6aa6b1f263 Teach ConvertUsesToScalar to handle memset, allowing it to handle
crazy cases like:

struct f {  int A, B, C, D, E, F; };
short test4() {
  struct f A;
  A.A = 1;
  memset(&A.B, 2, 12);
  return A.C;
}

llvm-svn: 63596
2009-02-03 02:01:43 +00:00
Dale Johannesen db39362c90 Fill in some missing DL propagation in getNode()s.
llvm-svn: 63595
2009-02-03 01:55:44 +00:00
Bill Wendling 143a2c3470 Use SDL->getCurDebugLoc() instead of unknown loc for landing pads.
llvm-svn: 63594
2009-02-03 01:55:42 +00:00
Bill Wendling fa50a23f8a Explicitly pass in the "unknown" debug location. This is probably not
correct. We need more infrastructure before we can get the DebugLoc info for
these instructions.

llvm-svn: 63593
2009-02-03 01:33:28 +00:00
Dan Gohman 7aa0c17cff Delete these two tests. They are specific to x86-64, and there's no
reliable way to do this with the current dejagnu infrastructure.
If someone can figure out how to fix these tests so that they test
what they are intended to test without spuriously failing on any
popular platforms, they are invited to reinstate them.

llvm-svn: 63592
2009-02-03 01:33:26 +00:00
Bill Wendling 9862a64419 Alphabetize includes.
llvm-svn: 63591
2009-02-03 01:32:22 +00:00
Chris Lattner 09b65ab288 rearrange how SRoA handles promotion of allocas to vectors.
With the new world order, it can handle cases where the first
store into the alloca is an element of the vector, instead of
requiring the first analyzed store to have the vector type 
itself.  This allows us to un-xfail 
test/CodeGen/X86/vec_ins_extract.ll.

llvm-svn: 63590
2009-02-03 01:30:09 +00:00
Dan Gohman fb306c0a10 Move isIdentifiedObject and isNoAliasCall into AliasAnalysis.cpp since
they are useful to analyses other than BasicAliasAnalysis.cpp. Include
the full comment for isIdentifiedObject in the header file. Thanks to
Chris for suggeseting this.

llvm-svn: 63589
2009-02-03 01:28:32 +00:00
Chris Lattner a0ce5f060d this test produces an undefined value, we don't care
what it is, but we do want the alloca promoted.

llvm-svn: 63587
2009-02-03 01:13:52 +00:00
Bill Wendling 17450acc3b Propagate debug loc info during SDNode -> machine instr creation.
llvm-svn: 63585
2009-02-03 01:02:39 +00:00
Bill Wendling e3c78361d3 Create DebugLoc information in FastISel. Several temporary methods were
created. Specifically, those BuildMIs which use
"DebugLoc::getUnknownLoc()". I'll remove them soon.

llvm-svn: 63584
2009-02-03 00:55:04 +00:00
Dale Johannesen f1163e9a4d Propagation in TargetLowering. Includes passing a DL
into SimplifySetCC which gets called elsewhere.

llvm-svn: 63583
2009-02-03 00:47:48 +00:00
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