1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

27213 Commits

Author SHA1 Message Date
Dale Johannesen
c405486235 Remove more non-DebugLoc versions of getNode.
llvm-svn: 63969
2009-02-06 21:50:26 +00:00
Bill Wendling
2c7f47d1d4 Record debug location information in the Dwarf writer.
A simple test program shows that debugging works. :-)

llvm-svn: 63968
2009-02-06 21:45:08 +00:00
Bill Wendling
cd6bb3e248 Clear out the CurDebugLoc info when doing a 'clear' on the SDL object.
llvm-svn: 63967
2009-02-06 21:36:23 +00:00
Dan Gohman
c264b63de6 Split the locking out of JIT::runJITOnFunction so that callers
that already hold the lock can call an entry point that doesn't
re-acquire the lock.

llvm-svn: 63965
2009-02-06 21:25:08 +00:00
Dan Gohman
a2f300f26d Use .size and .type on ELF systems; this helps tools that map
addresses to symbols.

llvm-svn: 63962
2009-02-06 21:15:52 +00:00
Dale Johannesen
7099fa18a4 Eliminate remaining non-DebugLoc version of getTargetNode.
llvm-svn: 63951
2009-02-06 19:16:40 +00:00
Dan Gohman
c097f9628e Rename SelectionDAGISel::Schedule to
SelectionDAGISel::CreateScheduler, and make it just create the
scheduler. Leave running the scheduler to the higher-level code.
This makes the higher-level code a little more explicit and
easier to follow, and will help enable some future refactoring.

llvm-svn: 63944
2009-02-06 18:26:51 +00:00
Sanjiv Gupta
90fd43f44d Print globl directive for variables with external linkage (global variables).
llvm-svn: 63943
2009-02-06 18:24:59 +00:00
Dan Gohman
2ae1006f93 Delete an unused member function.
llvm-svn: 63941
2009-02-06 18:19:52 +00:00
Evan Cheng
e00df1d39c Move getPointerRegClass from TargetInstrInfo to TargetRegisterInfo.
llvm-svn: 63938
2009-02-06 17:43:24 +00:00
Dan Gohman
5784cf7f6d Move ScheduleDAGSDNodes.h to be a private header. Front-ends
that previously included this header should include
SchedulerRegistry.h instead.

llvm-svn: 63937
2009-02-06 17:22:58 +00:00
Evan Cheng
381b2df5ff Add TargetInstrInfo::isSafeToMoveRegisterClassDefs. It returns true if it's safe to move an instruction which defines a value in the register class. Replace pre-splitting specific IgnoreRegisterClassBarriers with this new hook.
llvm-svn: 63936
2009-02-06 17:17:30 +00:00
Dan Gohman
2d402dd7cd Move ScheduleDAGInstrs.h to be a private header. Front-ends
that used this header to select a scheduling policy should
use SchedulerRegistry.h instead (llvm-gcc and clang were
updated a while ago).

llvm-svn: 63934
2009-02-06 17:12:10 +00:00
Devang Patel
85ae609834 Ignore DbgInfoIntrinsics.
llvm-svn: 63923
2009-02-06 06:19:06 +00:00
Chris Lattner
5118081112 fix PR3489, use bits instead of bytes.
llvm-svn: 63916
2009-02-06 04:34:07 +00:00
Dale Johannesen
cda84103ff get rid of some non-DebugLoc getTargetNode variants.
llvm-svn: 63909
2009-02-06 02:08:06 +00:00
Dale Johannesen
e95c76b65e Get rid of one more non-DebugLoc getNode and
its corresponding getTargetNode.  Lots of
caller changes.

llvm-svn: 63904
2009-02-06 01:31:28 +00:00
Owen Anderson
475c341202 Fix a crasher: we need to check that the function is non-null before using it!
llvm-svn: 63902
2009-02-06 00:13:43 +00:00
Owen Anderson
acbec98578 Refactor my previous change to maintain the distinction between AliasAnalysis and BasicAliasAnalysis. This involves some wider changes because it
folds away some never-used methods.

llvm-svn: 63900
2009-02-05 23:36:27 +00:00
Devang Patel
a6f77d01c7 Ignore dbg intrinsics while propagating conditional expression info. Take 2.
llvm-svn: 63898
2009-02-05 23:32:52 +00:00
Evan Cheng
6a938dd9e7 isAsCheapAsMove instructions can have register src operands. Check if they are really re-materializable.
This fixes sse.expandfft and sse.stepfft.

llvm-svn: 63890
2009-02-05 22:24:17 +00:00
Dale Johannesen
c96091a672 Remove a non-DebugLoc version of getNode.
llvm-svn: 63889
2009-02-05 22:07:54 +00:00
Devang Patel
72f5fba371 Revert rev. 63876. It is causing llvm-gcc bootstrap failure.
llvm-svn: 63888
2009-02-05 21:46:41 +00:00
Dale Johannesen
b218273a7a Remove 3 non-DebugLoc variants of getNode.
llvm-svn: 63886
2009-02-05 21:20:44 +00:00
Devang Patel
5b3fe253c5 Remove dead blocks in the end.
llvm-svn: 63880
2009-02-05 19:59:42 +00:00
Devang Patel
66eee02024 Ignore dbg intrinsics while propagating conditional expression info.
llvm-svn: 63876
2009-02-05 19:15:39 +00:00
Evan Cheng
078ac6071d Machine LICM increases register pressure and it almost always increase code size. For now, disable it for optimizing for size.
llvm-svn: 63856
2009-02-05 08:51:13 +00:00
Evan Cheng
b36e3e34e7 Turn on machine LICM in non-fast mode.
llvm-svn: 63855
2009-02-05 08:46:33 +00:00
Evan Cheng
5087dd8359 Teach machine licm to CSE hoisted instructions.
llvm-svn: 63854
2009-02-05 08:45:46 +00:00
Evan Cheng
7ed9ce65f7 ReMaterializeTrivialDef need to trim the live interval to the last kill if the copy kills the source register. This fixes uint64tof64.ll after ARM::MOVi is marked as isAsCheapAsAMove.
llvm-svn: 63853
2009-02-05 08:45:04 +00:00
Evan Cheng
87def37f67 A few more isAsCheapAsAMove.
llvm-svn: 63852
2009-02-05 08:42:55 +00:00
Chris Lattner
d8f77bbc07 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
902d570061 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
Mon P Wang
50369c6847 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
Dale Johannesen
fa28929927 Reapply 63765. Patches for clang and llvm-gcc to follow.
llvm-svn: 63812
2009-02-05 01:49:45 +00:00
Dale Johannesen
c901d013fb Get rid of 3 non-DebugLoc getNode variants.
llvm-svn: 63808
2009-02-05 01:01:16 +00:00
Devang Patel
e665f78460 Ignore dbg intrinsics while folding switch instruction.
llvm-svn: 63802
2009-02-05 00:30:42 +00:00
Dale Johannesen
c2896f9310 Remove non-DebugLoc versions of getMergeValues, ZeroExtendInReg.
llvm-svn: 63800
2009-02-05 00:20:09 +00:00
Dale Johannesen
d27bc65e74 Remove non-DebugLoc forms of CopyToReg and CopyFromReg.
Adjust callers.

llvm-svn: 63789
2009-02-04 23:02:30 +00:00
Dale Johannesen
f6e1822ccd 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
10be164b28 Ignore dbg intrinsics.
llvm-svn: 63781
2009-02-04 21:39:48 +00:00
Stuart Hastings
010b5858c1 80 column rule.
llvm-svn: 63768
2009-02-04 20:30:10 +00:00
Dale Johannesen
15a801f11d 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
66f10b55ed 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
83f8f82e8a 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
Chris Lattner
feb6b56242 Bill implemented this.
llvm-svn: 63752
2009-02-04 19:09:07 +00:00
Chris Lattner
eae4653469 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
04be5342b1 Skip over zero registers.
llvm-svn: 63748
2009-02-04 18:18:58 +00:00
Chris Lattner
9e3a296933 allow main to have any integer type.
llvm-svn: 63743
2009-02-04 17:48:18 +00:00
Dan Gohman
1cd89d625c Minor code cleanups; no functionality change.
llvm-svn: 63740
2009-02-04 17:28:58 +00:00
Stuart Hastings
9d89863489 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
6b95b76bca 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
528bb91ea8 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
ed9464bdec Don't call isInvariantLoad twice.
llvm-svn: 63729
2009-02-04 09:21:58 +00:00
Evan Cheng
d80609a7b3 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
68f918e570 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
a9c6af0bb8 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
c418b82207 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
19fc835580 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
Dale Johannesen
52d1d8d5a0 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
94df14c046 Check in file I forgot.
llvm-svn: 63704
2009-02-04 01:33:20 +00:00
Dale Johannesen
2c4af04551 Remove a few non-DebugLoc versions of node creation
functions.

llvm-svn: 63703
2009-02-04 01:17:06 +00:00
Mon P Wang
430525dc4f 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
2fac28a8c7 While folding vallue comparison terminators ignore dbg intrinsics.
llvm-svn: 63700
2009-02-04 01:06:11 +00:00
Dale Johannesen
fa244d6e2d Patch up omissions in DebugLoc propagation.
llvm-svn: 63693
2009-02-04 00:33:20 +00:00
Dale Johannesen
e8a874130f 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
224d0d60fe Constify and don't return a reference.
llvm-svn: 63689
2009-02-04 00:05:34 +00:00
Devang Patel
bc5a1a7007 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
b129ab17af DebugLoc propagation; adjustment to things omitted
from SelectionDagBuild.

llvm-svn: 63680
2009-02-03 23:04:43 +00:00
Bill Wendling
600f4ccb6c Erm. Would be nice to initialize this variable. . .
llvm-svn: 63677
2009-02-03 22:55:54 +00:00
Bill Wendling
5179b78c6b Add getDebugLocTuple to retrieve the DebugLocTuple for a given DebugLoc object.
llvm-svn: 63676
2009-02-03 22:49:58 +00:00
Dale Johannesen
f9b2746030 Need this file too.
llvm-svn: 63674
2009-02-03 22:26:34 +00:00
Dale Johannesen
b7f2857776 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
4b56b3c66e 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
ffd9b999f8 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
45009f127b DebugLoc propgation
llvm-svn: 63664
2009-02-03 21:48:12 +00:00
Bill Wendling
3543edc608 More whitespace fixin'.
llvm-svn: 63663
2009-02-03 21:38:21 +00:00
Bill Wendling
716a4f7bfe Whitespace and comment changes. No functionality change.
llvm-svn: 63660
2009-02-03 21:17:20 +00:00
Chris Lattner
4d41e7d461 teach "convert from scalar" to handle loads of fca's.
llvm-svn: 63659
2009-02-03 21:08:45 +00:00
Chris Lattner
fc79cef792 refactor the interface to ConvertUsesOfLoadToScalar,
renaming it to ConvertScalar_ExtractValue

llvm-svn: 63658
2009-02-03 21:01:03 +00:00
Dale Johannesen
358418bb3d DebugLoc propagation. done with file.
llvm-svn: 63656
2009-02-03 20:21:25 +00:00
Devang Patel
8c076d8328 Remove dead code.
llvm-svn: 63653
2009-02-03 19:46:28 +00:00
Chris Lattner
e638ec187b convert ConvertUsesOfLoadToScalar to use IRBuilder,
no functionality change.

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

llvm-svn: 63651
2009-02-03 19:41:50 +00:00
Dale Johannesen
6c8c315519 DebugLoc propagation. 2/3 through file.
llvm-svn: 63650
2009-02-03 19:33:06 +00:00
Chris Lattner
eb3d568867 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
d6f2af1f80 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
7d19e6cd6d 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
952d8276d1 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
5f3116636b 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
Duncan Sands
87db26ad2c 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
b3da5fb3a4 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
447b5517bc add another case of undefined behavior without crashing, PR3466.
llvm-svn: 63620
2009-02-03 07:08:57 +00:00
Nick Lewycky
a676cf98e3 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
a6e31d57d3 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
cd8353b6fe Update the callgraph when replacing InvokeInst with CallInst when inlining.
llvm-svn: 63600
2009-02-03 04:34:40 +00:00
Bill Wendling
e496361cf5 Explicitly pass in debug location information to BuildMI.
llvm-svn: 63599
2009-02-03 02:29:34 +00:00
Bill Wendling
14bc9010d5 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
041b48e037 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
b47738daab 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
43479713ac Fill in some missing DL propagation in getNode()s.
llvm-svn: 63595
2009-02-03 01:55:44 +00:00
Bill Wendling
014973fd5d Use SDL->getCurDebugLoc() instead of unknown loc for landing pads.
llvm-svn: 63594
2009-02-03 01:55:42 +00:00
Bill Wendling
78decbdb9d 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
Bill Wendling
a228b0ccc0 Alphabetize includes.
llvm-svn: 63591
2009-02-03 01:32:22 +00:00
Chris Lattner
2dae393299 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
bf5427a7f0 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
Bill Wendling
29833dbc9f Propagate debug loc info during SDNode -> machine instr creation.
llvm-svn: 63585
2009-02-03 01:02:39 +00:00
Bill Wendling
5b177df8e9 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
84498c427e Propagation in TargetLowering. Includes passing a DL
into SimplifySetCC which gets called elsewhere.

llvm-svn: 63583
2009-02-03 00:47:48 +00:00
Dan Gohman
0103631cce 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
2170150035 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
0c89de8f82 Last DebugLoc propagation for this file.
llvm-svn: 63574
2009-02-02 23:46:53 +00:00
Dale Johannesen
d92b94df04 More DebugLoc propagation. This should be everything
except LegalizeOp itself.

llvm-svn: 63560
2009-02-02 22:49:46 +00:00
Mike Stump
4c8ca99bb1 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
9d2293f7ad 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
c7295f2a49 DebugLoc propagation. ExpandOp and PromoteOp,
among others.

llvm-svn: 63555
2009-02-02 22:12:50 +00:00
Torok Edwin
2bc41a36ba 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
Dale Johannesen
5b1a213918 Commit missing files.
llvm-svn: 63545
2009-02-02 20:47:48 +00:00
Chris Lattner
7ce69dfa56 inline SROA::ConvertToScalar, no functionality change.
llvm-svn: 63544
2009-02-02 20:44:45 +00:00
Dale Johannesen
8883285060 More DebugLoc propagation.
llvm-svn: 63543
2009-02-02 20:41:04 +00:00
Torok Edwin
c1017185a5 remove #if 0 code on Bill's request.
llvm-svn: 63542
2009-02-02 20:23:02 +00:00
Duncan Sands
0ecadc3e36 Remove trailing spaces.
llvm-svn: 63540
2009-02-02 19:46:41 +00:00
Dale Johannesen
d0e894212e DebugLoc propagation for int<->fp conversions.
llvm-svn: 63537
2009-02-02 19:03:57 +00:00
Evan Cheng
95c4b28646 Refactor PerformPHIConstruction, no functionality changes.
llvm-svn: 63536
2009-02-02 18:33:18 +00:00
Chris Lattner
ce09ac0c3d 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
7f2ea2d067 Do not add redundant arguments in a method definition DIE.
llvm-svn: 63527
2009-02-02 17:51:41 +00:00
Sanjiv Gupta
9e53b9526e 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
c47a19b23e 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
b469789780 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
3d56fe0ca0 Fix an obvious thinko.
llvm-svn: 63510
2009-02-02 09:53:14 +00:00
Evan Cheng
16c8f917fb ADD / SUB / SMUL / UMUL with overflow second result top bits must be zero.
llvm-svn: 63509
2009-02-02 09:15:04 +00:00
Evan Cheng
e8dfbb5884 Add comment.
llvm-svn: 63506
2009-02-02 08:19:07 +00:00
Evan Cheng
483bbd1643 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
e15f499f9d reject things like: zext <4 x i32> %tmp to i256
llvm-svn: 63504
2009-02-02 07:40:17 +00:00
Chris Lattner
11cfab6d5b Fix PR3372
llvm-svn: 63501
2009-02-02 07:24:28 +00:00
Chris Lattner
6402178a04 reduce indentation, (~XorCST->getValue()).isSignBit() -> isMaxSignedValue()
llvm-svn: 63500
2009-02-02 07:15:30 +00:00
Mon P Wang
82e6b51c19 Preserve more SourceValue information.
llvm-svn: 63498
2009-02-02 06:37:55 +00:00
Torok Edwin
b4c9a6097f 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
cac6cf74f9 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
518ecfa97c Forgot some more DebugLoc propagations.
llvm-svn: 63493
2009-02-01 11:19:36 +00:00
Owen Anderson
e7080fe2a9 Fix test failures causes by my previous commit.
llvm-svn: 63492
2009-02-01 08:41:54 +00:00
Owen Anderson
f403ec470e 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
d650c9ecd7 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
4956419c77 DebugLoc propagation.
llvm-svn: 63488
2009-01-31 22:04:51 +00:00
Nick Lewycky
e25b96473e 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
98a9d2534b DebugLoc propagation. Done with file.
llvm-svn: 63486
2009-01-31 21:04:24 +00:00
Dale Johannesen
fe9622a384 DebugLoc propagation. Done with file.
llvm-svn: 63485
2009-01-31 20:01:02 +00:00
Chris Lattner
26698a600e 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
74179a9dde 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
c4729610fc 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
85ecfee7f3 simplify/clarify control flow and improve comments, no functionality change.
llvm-svn: 63480
2009-01-31 08:24:16 +00:00
Chris Lattner
a899f8b75d 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
95fe6579dd minor cleanups
llvm-svn: 63477
2009-01-31 07:26:06 +00:00
Chris Lattner
abf34563ec 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
2a0cce6b1c 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
679d743429 Don't use DebugLoc::getUnknownLoc(). Default to something hopefully sensible.
llvm-svn: 63473
2009-01-31 03:12:48 +00:00
Chris Lattner
235913be77 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
067e8ef08f Move CurDebugLoc into SelectionDAGLowering.
llvm-svn: 63468
2009-01-31 02:22:37 +00:00
Gabor Greif
414be71cd6 back out my previous change, it exposes a latent bug. investigating
llvm-svn: 63463
2009-01-31 01:31:59 +00:00
Gabor Greif
90bf8d1c4b use precise accessors
llvm-svn: 63459
2009-01-31 00:58:14 +00:00
Dale Johannesen
58ff487b47 Propagate debug info in LegalizeFloatTypes.
Complete (modulo bugs).

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

llvm-svn: 63457
2009-01-31 00:20:43 +00:00
Dale Johannesen
7231c1ead7 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
33e437d960 More DebugLoc propagation.
llvm-svn: 63454
2009-01-30 23:59:18 +00:00
Bill Wendling
191c1bcb0c More DebugLoc propagation.
llvm-svn: 63452
2009-01-30 23:36:47 +00:00
Bill Wendling
061530382c More DebugLoc propagation in LOAD etc. methods.
llvm-svn: 63451
2009-01-30 23:27:35 +00:00
Bill Wendling
8038d99071 More DebugLoc propagation in floating-point methods.
llvm-svn: 63446
2009-01-30 23:15:49 +00:00
Dale Johannesen
39738b1ff8 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
cebc5ac36d Standardize comments about folding xforms.
llvm-svn: 63443
2009-01-30 23:10:18 +00:00
Bill Wendling
67737da99b Get rid of the non-DebugLoc-ified getNOT() method.
llvm-svn: 63442
2009-01-30 23:03:19 +00:00
Bill Wendling
b3ece8cc6f Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63441
2009-01-30 22:57:07 +00:00
Bill Wendling
00f0882476 Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63440
2009-01-30 22:53:48 +00:00
Bill Wendling
bfa7cfd7c7 Propagate debug loc info for BIT_CONVERT.
llvm-svn: 63439
2009-01-30 22:44:24 +00:00
Bill Wendling
c05f48a66d Propagate debug loc info for more *_EXTEND methods.
llvm-svn: 63437
2009-01-30 22:33:24 +00:00
Bill Wendling
ca9c42acf5 Propagate debug loc info for ANY_EXTEND.
llvm-svn: 63436
2009-01-30 22:27:33 +00:00
Bill Wendling
5c326f6512 Propagate debug loc info for some of the *_EXTEND functions.
llvm-svn: 63434
2009-01-30 22:23:15 +00:00
Bill Wendling
211088dc71 DebugLoc form of getNOT().
llvm-svn: 63433
2009-01-30 22:11:22 +00:00
Bill Wendling
de0da1da41 - 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
18aa03303b Propagate debug loc info for Shifts.
llvm-svn: 63424
2009-01-30 21:37:17 +00:00
Bill Wendling
8f8bb57472 Propagate debug loc info for XOR and MatchRotate.
llvm-svn: 63420
2009-01-30 21:14:50 +00:00
Bill Wendling
d62cec3ba3 Propagate debug loc info for OR. Also clean up some comments.
llvm-svn: 63419
2009-01-30 20:59:34 +00:00
Bill Wendling
e74546802d Perform obvious constant arithmetic folding.
llvm-svn: 63417
2009-01-30 20:50:00 +00:00
Bill Wendling
4f61644d4c Propagate debug loc info for AND. Also clean up some comments.
llvm-svn: 63416
2009-01-30 20:43:18 +00:00
Bill Wendling
79d8e31a5a Propagate debug loc info in SimplifyBinOpWithSameOpcodeHands.
llvm-svn: 63411
2009-01-30 19:25:47 +00:00
Gabor Greif
8fd8e81e6e use precise getters
llvm-svn: 63403
2009-01-30 18:27:21 +00:00
Gabor Greif
690930270b use precise getters
llvm-svn: 63402
2009-01-30 18:21:13 +00:00
Devang Patel
58511a356b 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
28df5b583e 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
efe5611195 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
11d082d56e Fixed the comment. No functionality change.
llvm-svn: 63387
2009-01-30 09:01:44 +00:00
Mike Stump
a0b25f92ce 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
b4cf873468 Use sublw for comparison with literals instead of subwf.
llvm-svn: 63382
2009-01-30 07:55:25 +00:00
Mon P Wang
5db99442e4 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
e442452ade 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
4d923185fc Propagate debug loc info in SimplifyNodeWithTwoResults.
llvm-svn: 63376
2009-01-30 03:08:40 +00:00
Bill Wendling
7067a571ce Propagate debug loc info for MULHS.
llvm-svn: 63375
2009-01-30 03:00:18 +00:00
Bill Wendling
031d7dcfe2 Propagate debug loc info for SREM and UREM.
llvm-svn: 63374
2009-01-30 02:57:00 +00:00
Bill Wendling
f4506379ae Propagate debug loc info for UDIV.
llvm-svn: 63373
2009-01-30 02:55:25 +00:00
Bill Wendling
532bb33a10 Propagate debug loc info for SDIV.
llvm-svn: 63372
2009-01-30 02:52:17 +00:00
Bill Wendling
577589aa4a Forgot to propagate debug loc info here.
llvm-svn: 63371
2009-01-30 02:49:26 +00:00