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

8791 Commits

Author SHA1 Message Date
Chris Lattner
5eb0c8a2bd pass "-fasm-verbose" into createAsmStreamer.
llvm-svn: 94165
2010-01-22 07:06:15 +00:00
Chris Lattner
276811b58a Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Evan Cheng
72dbbce547 Teach pre-regalloc scheduler to schedule loads from nearby addresses. It may improve cache locality. This is controlled by -cluster-loads for now.
llvm-svn: 94148
2010-01-22 03:36:51 +00:00
Evan Cheng
c3ad04c825 Trim unneeded includes.
llvm-svn: 94105
2010-01-21 21:44:43 +00:00
Jim Grosbach
57ca094a52 back this out for now. Growing Function is not good.
llvm-svn: 94097
2010-01-21 20:10:22 +00:00
Dan Gohman
45406404b1 Run the verifier after LSR, to help catch use-before-def errors before
they reach codegen.

llvm-svn: 94066
2010-01-21 03:51:36 +00:00
Jim Grosbach
cf6e6e1c79 Make sure that landing pad entries in the EH call site table are in the proper
order for SjLj style exception handling.

llvm-svn: 94055
2010-01-21 00:43:30 +00:00
Jim Grosbach
98eae84f2e SjLj EH introduces can introduce an additional edge to a landing pad and pad
normalization needs to take this into account.

llvm-svn: 94046
2010-01-20 23:03:55 +00:00
Dale Johannesen
e6672a5bda make findDebugLoc a class method
llvm-svn: 94032
2010-01-20 21:36:02 +00:00
David Greene
80fdc554d0 When XDEBUG is enabled, check for SelectionDAG cycles at some key
points.  This will help us find future problems like the one
described in PR6019.

llvm-svn: 94019
2010-01-20 20:13:31 +00:00
Chris Lattner
abaff06105 don't send null pointers through the constantexpr codepath unneededly.
llvm-svn: 94010
2010-01-20 17:57:50 +00:00
Chris Lattner
abdec9bcc3 eliminate some uses of AsmPrinter::EmitIntXXX
llvm-svn: 93996
2010-01-20 07:41:15 +00:00
Chris Lattner
b619c47740 inline and radically simplify printDataDirective. It will eventually
go completely away.

llvm-svn: 93994
2010-01-20 07:33:29 +00:00
Chris Lattner
e4ac42e11e emit basic block labels with mcstreamer.
llvm-svn: 93993
2010-01-20 07:24:05 +00:00
Chris Lattner
d69a9cc334 emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1,
for tidiness.

llvm-svn: 93992
2010-01-20 07:19:19 +00:00
Chris Lattner
3104fa4a71 signficant cleanups to EmitGlobalConstant (including streamerization
of int initializers), change some methods to be static functions,
use raw_ostream::write_hex instead of a smallstring dance with 
APValue::toStringUnsigned(S, 16).

llvm-svn: 93991
2010-01-20 07:11:32 +00:00
Chris Lattner
57908ea7db switch ConstantFP emission to use MCStreamer, significantly
simplifying the code.

llvm-svn: 93988
2010-01-20 06:53:37 +00:00
Chris Lattner
1d3b05933f make mcasmstreamer handle expanding 8 byte integer constants to
4-byte constants if .quad isn't supported.  Switch a bunch of
methods used by the dwarf writer to use OutStreamer.EmitIntValue.

llvm-svn: 93987
2010-01-20 06:45:39 +00:00
Chris Lattner
6ea74a85bb give createAsmStreamer an 'isLittleEndian' argument.
llvm-svn: 93986
2010-01-20 06:39:07 +00:00
Devang Patel
56de8ddd56 If a instruction belongs to another function (and not current function) as per debug info attached with the instruction then ignore the dangling lexical scope of this instruction. Such scopes are unreachable.
llvm-svn: 93967
2010-01-20 02:05:23 +00:00
David Greene
1908ff46da Add some asserts to check SelectionDAG problems earlier.
llvm-svn: 93960
2010-01-20 00:59:23 +00:00
Dale Johannesen
ac7865b75b Move findDebugLoc somewhere more central. Fix
more cases where debug declarations affect
debug line info.

llvm-svn: 93953
2010-01-20 00:19:24 +00:00
Dan Gohman
34b548b94a Fold (add x, shl(0 - y, n)) -> sub(x, shl(y, n)), to simplify some code
that SCEVExpander can produce when running on behalf of LSR.

llvm-svn: 93949
2010-01-19 23:30:49 +00:00
Chris Lattner
1b0d0247b2 simplify the rest of fp constant printing.
llvm-svn: 93929
2010-01-19 22:16:33 +00:00
Chris Lattner
53a988c8f1 simplify the code for printing x86 long double, don't do work
for -fverbose-asm unless it's on.

llvm-svn: 93926
2010-01-19 22:11:05 +00:00
Jakob Stoklund Olesen
b93c3b9624 Identify predicate and optional-def operands when printing machine
instructions.

llvm-svn: 93925
2010-01-19 22:08:34 +00:00
Chris Lattner
2842ccd76f eliminate AsmPrinter::EmitZeros: just use MCStreamer directly.
llvm-svn: 93918
2010-01-19 21:51:22 +00:00
Benjamin Kramer
5ad576dacf Update CMake list.
llvm-svn: 93905
2010-01-19 20:59:04 +00:00
David Greene
fde2825063 Add some new debugging APIs to print out "raw" SelectionDAGs to make
understanding CannotYTetSelect and other errors easier.

llvm-svn: 93901
2010-01-19 20:37:34 +00:00
Chris Lattner
336c2b0d47 Generalize mcasmstreamer data emission APIs to take an address space
identifier.  There is no way to work around it.

llvm-svn: 93896
2010-01-19 19:46:13 +00:00
Evan Cheng
4b916556a5 Do not extend extension results beyond the use of a PHI instruction at the start of a use block. A PHI use is expected to kill its source values.
llvm-svn: 93895
2010-01-19 19:45:51 +00:00
Chris Lattner
a5895e4127 refactor code to be static functions instead of methods on AsmPrinter.
This fixes some bugs handling address spaces.

llvm-svn: 93891
2010-01-19 19:10:44 +00:00
Chris Lattner
b98efb6e76 mcstreamerize AsmPrinter::EmitZeros, at least when emitting to the
default address space.

llvm-svn: 93890
2010-01-19 18:58:52 +00:00
Chris Lattner
50636e0db8 remove MAI::ZeroDirectiveSuffix, which is only used by MASM,
which we don't support anymore.

llvm-svn: 93886
2010-01-19 18:37:01 +00:00
Jim Grosbach
034f69e0aa For aligned load/store instructions, it's only required to know whether a
function can support dynamic stack realignment. That's a much easier question
to answer at instruction selection stage than whether the function actually
will have dynamic alignment prologue. This allows the removal of the
stack alignment heuristic pass, and improves code quality for cases where
the heuristic would result in dynamic alignment code being generated when
it was not strictly necessary.

llvm-svn: 93885
2010-01-19 18:31:11 +00:00
Chris Lattner
405ac51ba0 mcstreamer'ize the rest of EmitGlobalVariable that is used on
darwin.  The next big piece to get global variables streamerized
is EmitGlobalConstant.

llvm-svn: 93870
2010-01-19 06:41:24 +00:00
Chris Lattner
15e2a64ec2 stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive.  Streamerize its generation.

llvm-svn: 93868
2010-01-19 06:25:51 +00:00
Devang Patel
a230047a58 MDNodes are not expected to disappear or replaced by another MDNode, so there is no need to pay the cost of WeakVH and ValueMaps.
llvm-svn: 93865
2010-01-19 06:19:05 +00:00
Devang Patel
bb63f9dd91 Avoid including DebugInfo.h in AsmPrinter.h
llvm-svn: 93864
2010-01-19 06:09:04 +00:00
Chris Lattner
e339d60351 mc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode.
llvm-svn: 93860
2010-01-19 06:01:04 +00:00
Chris Lattner
ebe63b403e factor this code better.
llvm-svn: 93859
2010-01-19 05:51:42 +00:00
Chris Lattner
377bd87849 Now that we have everything nicely factored (e.g. asmprinter is not
doing global variable classification anymore) and hookized, sink almost
all target targets global variable emission code into AsmPrinter and out
of each target.

Some notes:

1. PIC16 does completely custom and crazy stuff, so it is not changed.
2. XCore has some custom handling for extra directives.  I'll look at it next.
3. This switches linux/ppc to use .globl instead of .global.  If .globl is
   actually wrong, let me know and I'll fix it.
4. This makes linux/ppc get a lot of random cases right which were obviously
   wrong before, it is probably now a bit healthier.
5. Blackfin will probably start getting .comm and other things that it didn't
   before.  If this is undesirable, it should explicitly opt out of these
   things by clearing the relevant fields of MCAsmInfo.

This leads to a nice diffstat:
 14 files changed, 127 insertions(+), 830 deletions(-)

llvm-svn: 93858
2010-01-19 05:38:33 +00:00
Chris Lattner
f904832189 hoist handling of external globals and special globals up to common code.
This makes a similar code dead in all the other targets, I'll clean it up
in a bit.

This also moves handling of lcomm up before acquisition of a section,
since lcomm never needs a section.

llvm-svn: 93851
2010-01-19 04:39:15 +00:00
Chris Lattner
3821a5f168 move production of .reference directives for static ctor/dtor list on
darwin into common code.

llvm-svn: 93849
2010-01-19 04:34:02 +00:00
Devang Patel
885bd38bfc Revert accident check-in from r93165.
llvm-svn: 93832
2010-01-19 01:26:02 +00:00
Dale Johannesen
e1ba7ecf45 Revert 93811 per request.
llvm-svn: 93818
2010-01-19 00:10:52 +00:00
Dale Johannesen
0b8b2713d3 Enable code to emit dbg.declare as DEBUG_VALUE
comments (fast isel, X86).  This doesn't seem
to break any functionality, but will introduce
cases where -g affects the generated code.  I'll
be fixing that.

llvm-svn: 93811
2010-01-18 23:34:55 +00:00
Evan Cheng
5cf9d23e4e Canonicalize -1 - x to ~x.
Instcombine does this but apparently there are situations where this pattern will escape the optimizer and / or created by isel. Here is a case that's seen in JavaScriptCore:
  %t1 = sub i32 0, %a
  %t2 = add i32 %t1, -1
The dag combiner pattern: ((c1-A)+c2) -> (c1+c2)-A
will fold it to -1 - %a.

llvm-svn: 93773
2010-01-18 21:38:44 +00:00
Bill Wendling
5678a9711b - Add a comment to the callback indicating that it's *extremely* not a good
idea, but unfortunately necessary.
- Default to using 4-bytes for the LSDA pointer encoding to agree with the
  encoded value in the CIE.

llvm-svn: 93753
2010-01-18 19:36:27 +00:00
Chris Lattner
86287085ba remove the MAI argument to MCExpr::print and switch overthing to use << when printing them.
llvm-svn: 93699
2010-01-18 00:37:40 +00:00
Chris Lattner
6f360c3c91 now that MCSymbol::print doesn't use it's MAI argument, we can
remove it and change all the code that prints MCSymbols to use 
<< instead, which is much simpler and cleaner.

llvm-svn: 93695
2010-01-17 21:43:43 +00:00
Chris Lattner
57ac0be2b5 now that mangler is in libtarget, it can use MCAsmInfo instead of clients
having to pass various fields from it in.  Simplify.

llvm-svn: 93686
2010-01-17 18:22:35 +00:00
Benjamin Kramer
77e20e0bed Switch some functions to take Twines, eliminate uses of StringExtras.h.
llvm-svn: 93680
2010-01-17 07:46:39 +00:00
Nate Begeman
04da97bd5e Add a note for the macho streamer and remove a used of the mangler from the soon to be defunct machowriter pass.
llvm-svn: 93670
2010-01-17 03:49:01 +00:00
Kenneth Uildriks
d6b30baf78 When checking for sret-demotion, it needs to use legal types. When using the return value of an sret-demoted call, it needs to use possibly illegal types that match the declared Type of the callee.
llvm-svn: 93667
2010-01-16 23:37:33 +00:00
Chris Lattner
51e8abe640 move the mangler into libtarget from vmcore.
llvm-svn: 93664
2010-01-16 21:57:06 +00:00
Chris Lattner
6efe5156eb reapply the mangler gutting patch.
llvm-svn: 93656
2010-01-16 21:08:46 +00:00
Chris Lattner
98ddc4b8b0 unbreak the build.
llvm-svn: 93654
2010-01-16 20:53:11 +00:00
Rafael Espindola
d6c021a8d7 Revert 93648.
Mangler::getMangledName is used from lto
Mangler::setUseQuotes is used in the AsmPrinter
Mangler::setSymbolsCanStartWithDigit is used in the AsmPrinter

llvm-svn: 93652
2010-01-16 20:27:59 +00:00
Chris Lattner
16324d20f6 Mangler::getMangledName is now dead, remove it and all the other stuff in Mangler that is now transitively dead. woo.
llvm-svn: 93648
2010-01-16 19:08:51 +00:00
Chris Lattner
04b7c11880 Change DIEObjectLabel to take an MCSymbol instead of std::string.
llvm-svn: 93647
2010-01-16 18:50:28 +00:00
Chris Lattner
31aea3db21 rename GetPrivateGlobalValueSymbolStub -> GetSymbolWithGlobalValueBase,
and add an explicit ForcePrivate argument.

Switch FunctionEHFrameInfo to be MCSymbol based instead of string based.

llvm-svn: 93646
2010-01-16 18:37:32 +00:00
Chris Lattner
31297eb826 eliminate uses of getMangledName from AsmPrinter.cpp, last up is
dwarf emission which is going to be more invasive.

llvm-svn: 93645
2010-01-16 18:17:26 +00:00
Devang Patel
ab80d29640 No need to use WeakVH here.
llvm-svn: 93631
2010-01-16 06:17:40 +00:00
Devang Patel
3bbca51dcd Replace DebugLocTuple with DILocation.
llvm-svn: 93630
2010-01-16 06:09:35 +00:00
Chris Lattner
a00f220023 remove a couple of actively incorrect uses of getMangledName.
llvm-svn: 93627
2010-01-16 02:16:09 +00:00
Bill Wendling
d78fcdd332 Retrying r91337:
The CIE says that the LSDA point in the FDE section is an "sdata4". That's fine,
but we need it to actually be 4-bytes in the FDE for some platforms. Allow
individual platforms to decide for themselves.

llvm-svn: 93616
2010-01-16 01:40:55 +00:00
Chris Lattner
8813339969 fix inverted conditional
llvm-svn: 93614
2010-01-16 01:37:14 +00:00
Chris Lattner
61a95137c9 CurrentFnName is now dead, remove it.
llvm-svn: 93612
2010-01-16 01:24:10 +00:00
Chris Lattner
bb21a20f24 remove the string form of printVisibility.
llvm-svn: 93609
2010-01-16 01:17:26 +00:00
Bob Wilson
a7043345ee Treat indirect branches specially only during pre-regalloc tail duplication,
not during the later post-alloc tail duplication.

llvm-svn: 93600
2010-01-16 00:42:25 +00:00
Bob Wilson
3386047bdb Run the pre-register allocation tail duplication pass by default. Remove
the -pre-regalloc-taildup command-line option, and add a new
-disable-early-taildup option.

llvm-svn: 93597
2010-01-16 00:29:50 +00:00
Chris Lattner
b1b91d11db supplement CurrentFnName with CurrentFnSym, which will eventually
replace it.  Upgrade Alpha, Blackfin, and part of CellSPU to not
use mangler anymore.  CellSPU needs more invasive surgery.

llvm-svn: 93589
2010-01-15 23:55:16 +00:00
Chris Lattner
5f4c482b72 add a version of AsmPrinter::printVisibility that takes an MCSymbol.
llvm-svn: 93587
2010-01-15 23:38:51 +00:00
Chris Lattner
e293db0c8a add another helper
llvm-svn: 93577
2010-01-15 23:25:11 +00:00
Chris Lattner
ea4d444561 add a AsmPrinter::GetGlobalValueSymbol and GetExternalSymbolSymbol
helper method, use it to simplify some code.

llvm-svn: 93575
2010-01-15 23:18:17 +00:00
Ted Kremenek
0e9c12f44a Update CMake build.
llvm-svn: 93571
2010-01-15 22:59:46 +00:00
Devang Patel
dfde8cf532 Add FIXME.
llvm-svn: 93562
2010-01-15 22:08:16 +00:00
Jakob Stoklund Olesen
65bc6159f6 Don't make changes to the MBB in MachineBasicBlock::canFallThrough().
This fixes the regression for -pre-regalloc-taildup in
MultiSource/Applications/lambda-0.1.3.

llvm-svn: 93541
2010-01-15 20:00:12 +00:00
Jakob Stoklund Olesen
cf4c604899 Simplify logic. Any functional change is unintended.
llvm-svn: 93540
2010-01-15 19:59:57 +00:00
David Greene
d8faccbeab Add some debug routines to SelectionDAG to dump full DAGs.
print/dumpWithDepth allows one to dump a DAG up to N levels deep.
dump/printWithFullDepth prints the whole DAG, subject to a depth limit
on 100 in the default case (to prevent infinite recursion).

Have CannotYetSelect to a dumpWithFullDepth so it is clearer exactly
what the non-matching DAG looks like.

llvm-svn: 93538
2010-01-15 19:43:23 +00:00
Victor Hernandez
c1b5223e76 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.

llvm-svn: 93531
2010-01-15 19:04:09 +00:00
Nate Begeman
b6c8d75f62 Hook up llc's -filetype=obj to use MCStreamer if an MCCodeEmitter is available.
Remove most of old Mach-O Writer support, it has been replaced by MCMachOStreamer

Further refactoring to completely remove MachOWriter and drive the object file
writer with the AsmPrinter MCInst/MCSection logic is forthcoming.

llvm-svn: 93527
2010-01-15 18:51:18 +00:00
Victor Hernandez
97d7107d5e Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
llvm-svn: 93515
2010-01-15 17:36:47 +00:00
Bob Wilson
b9a6da20e8 Change pre-regalloc tail duplication to only duplicate indirect branch blocks.
The pre-regalloc pass caused some regressions in both compile time and
performance of the generated code, and it did not improve performance, except
for indirect branches.  I also moved the check for single-block loops to speed
up the common case when running the taildup pass before reg allocation.

llvm-svn: 93505
2010-01-15 06:29:17 +00:00
Victor Hernandez
aee71b4e81 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.

llvm-svn: 93504
2010-01-15 03:37:48 +00:00
Devang Patel
9c7b75ebb8 Do not use AT_specification die for static variables. It confuses gdb.
llvm-svn: 93494
2010-01-15 01:12:22 +00:00
Jim Grosbach
7239c4c92e fix 80-column violations
llvm-svn: 93487
2010-01-15 00:36:15 +00:00
Jim Grosbach
ed10ddd9c1 Fix 80 column violations and clean up whitespace
llvm-svn: 93484
2010-01-15 00:32:47 +00:00
Devang Patel
b41a4c332a Do not emit multiple AT_container_type attributes.
We need to find a better way to emit this info.

llvm-svn: 93481
2010-01-15 00:26:31 +00:00
Dale Johannesen
7b7109e16e Fix a comment.
llvm-svn: 93463
2010-01-14 21:50:17 +00:00
Jim Grosbach
fb10749b6d Add comment explaining the necessity of r93456
llvm-svn: 93459
2010-01-14 21:38:31 +00:00
Jim Grosbach
d3d283dc19 Dwarf EH prepare needs to be run after SjLj prepare. Otherwise,
catch info can get misplaced when a selector ends up more than one block
removed from the parent invoke(s). This could happen when a landing pad is
shared by multiple invokes and is also a target of a normal edge from
elsewhere.

llvm-svn: 93456
2010-01-14 21:22:16 +00:00
Dan Gohman
7c596d2b00 Fix a codegen abort seen in 483.xalancbmk.
llvm-svn: 93417
2010-01-14 03:08:49 +00:00
Evan Cheng
0fa1e2d063 Commit some changes I had managed to lose last night while refactoring the code. Avoid change use of PHI instructions because it's not legal to insert any instructions before them.
This fixes PR6027.

llvm-svn: 93335
2010-01-13 19:16:39 +00:00
Evan Cheng
2afc417122 Re-enable extension optimization pass.
llvm-svn: 93313
2010-01-13 08:45:40 +00:00
Evan Cheng
f6f274ef64 Add comment; refactor; avoid pulling in DT if it's not used.
llvm-svn: 93306
2010-01-13 07:59:13 +00:00
Chris Lattner
1b6c061cd0 remove uses of deprecated functions, this generates slightly
different BlockAddress labels, but nothing semantically important.

Add a FIXME that BlockAddress codegen is broken if the LLVM BB has 
an empty name (e.g. strip was run).

llvm-svn: 93303
2010-01-13 07:30:49 +00:00
Chris Lattner
086d0d1a2b use the new form of getNameWithPrefix, not makeNameProper.
Among other things, this would do very weird things if the 
basic block name had (e.g.) a space in it on darwin:
makeNameProper would add quotes, then the mcsymbol would 
escape the quotes.

llvm-svn: 93302
2010-01-13 07:16:53 +00:00
Chris Lattner
3c2fad1fc6 change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string.  Based on this change:

1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
   making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
   prefixes, not use temporary std::strings, and to avoid other crimes.

llvm-svn: 93298
2010-01-13 06:38:18 +00:00
Chris Lattner
e8e56916d1 fix assert in AsmPrinter::EmitGlobalConstantLargeInt to match reality.
llvm-svn: 93293
2010-01-13 04:39:46 +00:00
Chris Lattner
633c7a95c5 reduce nesting and code duplication in AsmPrinter::EmitGlobalConstantLargeInt.
llvm-svn: 93292
2010-01-13 04:38:16 +00:00
Chris Lattner
4e95cbcd12 reduce indentation and add a fast-path to EmitGlobalConstant for 8-byte
integers on 64-bit systems.

llvm-svn: 93291
2010-01-13 04:34:19 +00:00
Chris Lattner
452f5ad8f2 reduce indentation and use early exits in AsmPrinter::EmitConstantValueOnly
llvm-svn: 93290
2010-01-13 04:29:19 +00:00
Evan Cheng
973fceab0c Disable opt-ext pass to unbreak the build for now.
llvm-svn: 93286
2010-01-13 01:51:43 +00:00
Evan Cheng
7fcebf982c Remove debug option I accidentally left in.
llvm-svn: 93285
2010-01-13 01:43:20 +00:00
Ted Kremenek
2d9c86e98b Update CMake file.
llvm-svn: 93283
2010-01-13 01:02:47 +00:00
Evan Cheng
76db3bb18e Add a quick pass to optimize sign / zero extension instructions. For targets where the pre-extension values are available in the subreg of the result of the extension, replace the uses of the pre-extension value with the result + extract_subreg.
For now, this pass is fairly conservative. It only perform the replacement when both the pre- and post- extension values are used in the block. It will miss cases where the post-extension values are live, but not used.

llvm-svn: 93278
2010-01-13 00:30:23 +00:00
Dale Johannesen
1738d7d11a Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.

llvm-svn: 93272
2010-01-13 00:00:24 +00:00
Bob Wilson
0ec53edad3 Fix a comment typo.
llvm-svn: 93261
2010-01-12 22:18:56 +00:00
Dan Gohman
2cd1b789c7 Update a partially obsolete comment.
llvm-svn: 93228
2010-01-12 04:32:35 +00:00
Dan Gohman
da0bcb49b5 Fix a typo in a comment.
llvm-svn: 93227
2010-01-12 04:30:26 +00:00
Jakob Stoklund Olesen
f1c71ef6ba Avoid adding PHI arguments for a predecessor that has gone away when a BRCOND was constant folded.
This fixes PR5980.

llvm-svn: 93184
2010-01-11 21:02:33 +00:00
Mon P Wang
e8470bbcc4 Disable transformation of select of two loads to a select of address and then a load if the
loads are not in the default address space because the transformation discards src value info.

llvm-svn: 93180
2010-01-11 20:12:49 +00:00
Devang Patel
9874d72976 s/NextValueNo/NextMDValueNo while processing metadata.
llvm-svn: 93165
2010-01-11 18:52:33 +00:00
Dan Gohman
3708af1c59 Revert an earlier change to SIGN_EXTEND_INREG for vectors. The VTSDNode
really does need to be a vector type, because
TargetLowering::getOperationAction for SIGN_EXTEND_INREG uses that type,
and it needs to be able to distinguish between vectors and scalars.

Also, fix some more issues with legalization of vector casts.

llvm-svn: 93043
2010-01-09 02:13:55 +00:00
Evan Cheng
afa00d14db Dan pointed out checking whether a node is dead by comparing its opcode to ISD::DELETED_NODE is not safe. Use a DAGUpdateListener to remove dead nodes from work list instead.
llvm-svn: 93031
2010-01-09 00:21:08 +00:00
Evan Cheng
f96a9ec02b ReplaceAllUsesOfValueWith may delete other nodes that the one being replaced. Do not delete dead nodes again.
llvm-svn: 92988
2010-01-08 02:36:12 +00:00
Chris Lattner
e0199dff81 Fix rdar://7517201, a regression introduced by r92849.
When folding a and(any_ext(load)) both the any_ext and the
load have to have only a single use.

This removes the anyext-uses.ll testcase which started failing
because it is unreduced and unclear what it is testing.

llvm-svn: 92950
2010-01-07 21:59:23 +00:00
Chris Lattner
f68e328a99 factor this code better and reduce nesting at the same
time, no functionality change.

llvm-svn: 92948
2010-01-07 21:53:27 +00:00
Evan Cheng
4523041394 APInt'fy TargetLowering::SimplifySetCC to fix PR5963.
llvm-svn: 92943
2010-01-07 20:58:44 +00:00
Benjamin Kramer
bbaf8cac38 Simplify code. No intended functionality/performance change.
llvm-svn: 92938
2010-01-07 19:46:15 +00:00
Benjamin Kramer
badb9914d2 Kill dead store.
llvm-svn: 92920
2010-01-07 17:50:57 +00:00
Benjamin Kramer
a97aab4995 Remove dead variable.
llvm-svn: 92919
2010-01-07 17:29:08 +00:00
Benjamin Kramer
22ec2524fd Use pop_back_val instead of back()+pop_back.
llvm-svn: 92918
2010-01-07 17:27:56 +00:00
Jakob Stoklund Olesen
b90023e707 Allow double defs after tail duplication.
llvm-svn: 92874
2010-01-06 23:52:46 +00:00
Jakob Stoklund Olesen
a63aa4e54b Add Target hook to duplicate machine instructions.
Some instructions refer to unique labels, and so cannot be trivially cloned
with CloneMachineInstr.

llvm-svn: 92873
2010-01-06 23:47:07 +00:00
Jim Grosbach
0beaad246d Anti-dependency breaking needs to be careful regarding instructions with
multiple register definitions.

llvm-svn: 92864
2010-01-06 22:21:25 +00:00
Evan Cheng
f9dade0634 Comment.
llvm-svn: 92850
2010-01-06 19:43:21 +00:00
Evan Cheng
25dcf9b830 Teach dag combine to fold the following transformation more aggressively:
(OP (trunc x), (trunc y)) -> (trunc (OP x, y))

Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel.

This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places.

llvm-svn: 92849
2010-01-06 19:38:29 +00:00
Jim Grosbach
2101815d36 80 column and whitespace cleanup
llvm-svn: 92837
2010-01-06 16:48:02 +00:00
Lang Hames
3e8519b563 Fixed malformed -*- lines in PBQP headers.
llvm-svn: 92830
2010-01-06 08:53:34 +00:00
Jakob Stoklund Olesen
03dea01d94 Add <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and kills.
An instruction like this:

  %reg1097:1<def> = VMOVSR %R3<kill>, 14, %reg0

Must be replaced with this when substituting physical registers:

  %S0<def> = VMOVSR %R3<kill>, 14, %reg0, %D0<imp-def>

llvm-svn: 92812
2010-01-06 00:29:28 +00:00
Bill Wendling
b4f0d6e3b6 The previous code could potentially cause a cycle. Allow ordering w.r.t. a 0 order.
llvm-svn: 92810
2010-01-06 00:23:35 +00:00
Bill Wendling
41e18c3512 Only check the ordering if there is an ordering for each nodes.
llvm-svn: 92807
2010-01-06 00:09:23 +00:00
Bill Wendling
b7d6746476 Add a semi-primitive form of scheduling via the "SDNode ordering" to the
bottom-up scheduler. We prefer the lower order number.

llvm-svn: 92806
2010-01-05 23:48:12 +00:00
Bill Wendling
7e9607ab56 Don't assign the shift the same type as the variable being shifted. This could
result in illegal types for the SHL operator.

llvm-svn: 92797
2010-01-05 22:39:10 +00:00
Dan Gohman
9ef9e2c758 Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
uses several kinds of opcode values which are not declared within
that enum. This fixes PR5946.

llvm-svn: 92794
2010-01-05 22:26:32 +00:00
Dan Gohman
b4e120e7a7 Restore dump() methods to Loop and MachineLoop.
llvm-svn: 92772
2010-01-05 21:08:02 +00:00
Benjamin Kramer
0ba7479f2c Move remaining stuff to the isInteger predicate.
llvm-svn: 92771
2010-01-05 21:05:54 +00:00
Jakob Stoklund Olesen
0277c4cd0b Remove livein checks from machine code verifier.
A phi operand that is implicitly defined in a predecessor becomes an undefined
register after phi elimination. This causes a lot of false positives when the
verifier is checking if live-in registers are live-out from all predecessors.

Removing the verifier checks seems like a better solution than insisting on
IMPLICIT_DEF instructions in predecessor blocks.

llvm-svn: 92769
2010-01-05 20:59:36 +00:00
Devang Patel
eb75073664 If a scope has only one instruction then first instruction is also the last instruction.
llvm-svn: 92736
2010-01-05 16:59:17 +00:00
Benjamin Kramer
e90a3c66c4 Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
Devang Patel
9c02d20409 Delete renaming use of dead dbg intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start
 Intrinsic::dbg_region_end
 Intrinsic::dbg_func_start

llvm-svn: 92672
2010-01-05 01:47:06 +00:00
Devang Patel
e6e1c93fb9 Use StringRef.startswith().
llvm-svn: 92671
2010-01-05 01:46:14 +00:00
David Greene
e5bee4794b Change errs() to dbgs().
llvm-svn: 92597
2010-01-05 01:26:11 +00:00
David Greene
9fab20f5d2 Change errs() to dbgs().
llvm-svn: 92596
2010-01-05 01:26:09 +00:00
David Greene
9564dbcc2a Change errs() to dbgs().
llvm-svn: 92595
2010-01-05 01:26:05 +00:00
David Greene
e121e605f7 Change errs() to dbgs().
llvm-svn: 92594
2010-01-05 01:26:01 +00:00
David Greene
51c811205c Change errs() to dbgs().
llvm-svn: 92593
2010-01-05 01:26:00 +00:00