1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 22:12:57 +02:00
Commit Graph

6796 Commits

Author SHA1 Message Date
Evan Cheng
435dbd4665 If an available register falls through to a succ block, unset the last kill. Sorry, it's impossible to reduce a sensible test case. It basically requires the moon and stars to align in order to cause a failure.
llvm-svn: 65497
2009-02-26 02:30:42 +00:00
Evan Cheng
ec34226c2b Revert BuildVectorSDNode related patches: 65426, 65427, and 65296.
llvm-svn: 65482
2009-02-25 22:49:59 +00:00
Dale Johannesen
9a6ca304f1 Fix big-endian codegen bug. We're splitting up
overly long ints, e.g. i96, into pieces at PHIs
and the nodes that feed into them; however big-endian
reverses the order of the pieces (for some reason), and
wasn't doing it the same way on both sides, so
the pieces didn't match and runtime failures ensued.
Fixes 188.ammp and sqlite3 on ppc32.

llvm-svn: 65481
2009-02-25 22:39:13 +00:00
Devang Patel
2fd41ecef5 Print variable's display name in dwarf DIE.
llvm-svn: 65468
2009-02-25 19:41:35 +00:00
Evan Cheng
befebff8fc Clean up dwarf writer, part 1. This eliminated the horrible recursive getGlobalVariablesUsing and replaced it something readable. It eliminated use of slow UniqueVector and replaced it with StringMap, SmallVector, and DenseMap, etc. It also fixed some non-deterministic behavior.
This is a very minor compile time win.

llvm-svn: 65438
2009-02-25 07:04:34 +00:00
Scott Michel
3f273a8412 Expand tabs to spaces (overlooked in previous commit)
llvm-svn: 65427
2009-02-25 03:57:49 +00:00
Scott Michel
29d7559c09 Remove all "cached" data from BuildVectorSDNode, preferring to retrieve
results via reference parameters.

This patch also appears to fix Evan's reported problem supplied as a
reduced bugpoint test case.

llvm-svn: 65426
2009-02-25 03:12:50 +00:00
Bill Wendling
9d4eb136da Overhaul my earlier submission due to feedback. It's a large patch, but most of
them are generic changes.

- Use the "fast" flag that's already being passed into the asm printers instead
  of shoving it into the DwarfWriter.

- Instead of calling "MI->getParent()->getParent()" for every MI, set the
  machine function when calling "runOnMachineFunction" in the asm printers.

llvm-svn: 65379
2009-02-24 08:30:20 +00:00
Owen Anderson
ffcb59129f Add a debugging option for SSC DCE.
llvm-svn: 65375
2009-02-24 05:44:18 +00:00
Bill Wendling
0d8316c5e0 - Use the "Fast" flag instead of "OptimizeForSize" to determine whether to emit
a DBG_LABEL or not. We want to fall back to the original way of emitting debug
  info when we're in -O0/-fast mode.
- Add plumbing in to pass the "Fast" flag to places that need it.
- XFAIL DebugInfo/deaddebuglabel.ll. This is finding 11 labels instead of 8. I
  need to investigate still.

llvm-svn: 65367
2009-02-24 02:35:30 +00:00
Dan Gohman
1197d46ccf Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simple
ashr instcombine to help expose this code. And apply the fix to
SelectionDAG's copy of this code too.

llvm-svn: 65364
2009-02-24 02:00:40 +00:00
Devang Patel
49b26ded5d gdb uses DW_AT_prototyped to identify K&R style in C based languages.
This fixes objc.dg/dwarf-prototypes.m scan-assembler DW_AT_prototyped from llvmgcc42 test suite.

llvm-svn: 65357
2009-02-24 00:52:19 +00:00
Devang Patel
98ea831c24 If there is not any debug info available for any global variables and any subprograms then there is not any debug info to emit.
llvm-svn: 65352
2009-02-24 00:02:15 +00:00
Scott Michel
3f8637305f Introduce the BuildVectorSDNode class that encapsulates the ISD::BUILD_VECTOR
instruction. The class also consolidates the code for detecting constant
splats that's shared across PowerPC and the CellSPU backends (and might be
useful for other backends.) Also introduces SelectionDAG::getBUID_VECTOR() for
generating new BUILD_VECTOR nodes.

llvm-svn: 65296
2009-02-22 23:36:09 +00:00
Evan Cheng
41687ff389 If a use operand is marked isKill, don't forget to add kill to its live interval as well.
llvm-svn: 65279
2009-02-22 08:35:56 +00:00
Richard Pennington
7a2ebd7d09 bug 3610: Floating point vaarg not softened.
llvm-svn: 65239
2009-02-21 19:11:18 +00:00
Anton Korobeynikov
5df82e3e25 Drop bunch of half-working stuff in the ext_weak linkage support.
Now we're using one gross, but quite robust hack :) (previous ones
did not work, for example, when ext_weak symbol was used deep inside
constant expression in the initializer).

The proper fix of this problem will require some quite huge asmprinter
changes and that's why was postponed. This fixes PR3629 by the way :)

llvm-svn: 65230
2009-02-21 11:53:32 +00:00
Evan Cheng
d4dc06f55a If two-address def is dead and the instruction does not define other registers, and it doesn't produce side effects, just delete the instruction.
llvm-svn: 65218
2009-02-21 03:14:25 +00:00
Dan Gohman
c9cfc596a3 Fix a bug that David Greene found in the DAGCombiner's logic
that checks whether it's safe to transform a store of a bitcast
value into a store of the original value.

llvm-svn: 65201
2009-02-20 23:29:13 +00:00
Bill Wendling
9e675be841 - Early exit a nested block.
- Correct comment.
- Whitespace changes.

llvm-svn: 65149
2009-02-20 20:40:28 +00:00
Owen Anderson
8d12de1c25 Fix a crash in the pre-alloc splitter exposed by recent codegen changes.
llvm-svn: 65121
2009-02-20 10:02:23 +00:00
Owen Anderson
9268f1ec92 Add a quick pass to the stack slot colorer to eliminate some trivially redundant spills after coloring.
Ideally these would never get created in the first place, but until we enhance the spiller to have a more
global picture of what's happening, this is necessary for code quality in some circumstances.

llvm-svn: 65120
2009-02-20 09:11:36 +00:00
Bill Wendling
75751a4769 Add an accessor method to DwarfWriter to tell of debugging info should be emitted.
llvm-svn: 65092
2009-02-20 00:44:43 +00:00
Bill Wendling
983f839148 Temporarily revert r65065. It was causing test failures.
llvm-svn: 65068
2009-02-19 21:57:07 +00:00
Bill Wendling
1c0692657d Print out debug info when printing the machine instruction.
llvm-svn: 65067
2009-02-19 21:44:55 +00:00
Bill Wendling
9af8f830c0 Check for -fast here too.
llvm-svn: 65065
2009-02-19 21:23:54 +00:00
Bill Wendling
4a86875529 Generate these labels when we're in "fast" mode, not simply when we're no in
"optimize-for-size" mode.

llvm-svn: 65064
2009-02-19 21:12:54 +00:00
Devang Patel
bf7153b721 The subprogram die may not exist while creating "default" scope.
llvm-svn: 64920
2009-02-18 17:29:38 +00:00
Nate Begeman
5e78e558ff Add support to the JIT for true non-lazy operation. When a call to a function
that has not been JIT'd yet, the callee is put on a list of pending functions
to JIT.  The call is directed through a stub, which is updated with the address
of the function after it has been JIT'd.  A new interface for allocating and
updating empty stubs is provided.

Add support for removing the ModuleProvider the JIT was created with, which
would otherwise invalidate the JIT's PassManager, which is initialized with the
ModuleProvider's Module.

Add support under a new ExecutionEngine flag for emitting the infomration 
necessary to update Function and GlobalVariable stubs after JITing them, by
recording the address of the stub and the name of the GlobalValue.  This allows
code to be copied from one address space to another, where libraries may live
at different virtual addresses, and have the stubs updated with their new
correct target addresses.

llvm-svn: 64906
2009-02-18 08:31:02 +00:00
Dan Gohman
0e73582689 Eliminate several more unnecessary intptr_t casts.
llvm-svn: 64888
2009-02-18 05:09:16 +00:00
Devang Patel
25f2741ae9 The debugger sometimes lookup dynamically in the runtime to find ivar info of any Objective-C classes. It would be very helpful to debugger if the compiler encodes runtime version number in DWARF.
Add support for two additional DWARF attributes to encode Objective-C runtime version number.

llvm-svn: 64834
2009-02-17 22:43:44 +00:00
Scott Michel
4c5fa6c982 Remove trailing whitespace to reduce later commit patch noise.
(Note: Eventually, commits like this will be handled via a pre-commit hook that
 does this automagically, as well as expand tabs to spaces and look for 80-col
 violations.)

llvm-svn: 64827
2009-02-17 22:15:04 +00:00
Devang Patel
1d4e0292fb Emit debug info for bitfields.
llvm-svn: 64815
2009-02-17 21:23:59 +00:00
Evan Cheng
2e0cf05ad2 A couple of places where reused use operands should be marked kill. This is exposed by recent availability fallthrough changes.
llvm-svn: 64745
2009-02-17 06:41:03 +00:00
Bill Wendling
266c8bc98f --- Merging (from foreign repository) r64714 into '.':
U    include/llvm/CodeGen/DebugLoc.h
U    lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp

Enable debug location generation at -Os. This goes with the reapplication of the
r63639 patch.

llvm-svn: 64715
2009-02-17 01:04:54 +00:00
Dan Gohman
c47d143107 Don't assume that a left-shift of a value with one bit set will have
one bit set, because the bit may be shifted off the end. Instead,
just check for a constant 1 being shifted. This is still sufficient
to handle all the cases in test/CodeGen/X86/bt.ll. This fixes PR3583.

llvm-svn: 64622
2009-02-15 23:59:32 +00:00
Evan Cheng
9428fd271c Fix PR3522. It's not safe to sink into landing pad BB's.
llvm-svn: 64582
2009-02-15 08:36:12 +00:00
Cedric Venet
48be6b5e15 Unbreak the build on win32.
Cleanup some warning.

Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.

Only tested with VS2008. hope it does not break anything. feel free to revert.

llvm-svn: 64554
2009-02-14 16:06:42 +00:00
Bill Wendling
40e4b271af Revert this. It was breaking stuff.
llvm-svn: 64428
2009-02-13 02:16:35 +00:00
Bill Wendling
83b6edd760 Turn off the old way of handling debug information in the code generator. Use
the new way, where all of the information is passed on SDNodes and machine
instructions.

llvm-svn: 64427
2009-02-13 02:01:04 +00:00
Dale Johannesen
47321cf01f Arrange to print constants that match "n" and "i" constraints
in inline asm as signed (what gcc does).  Add partial support
for x86-specific "e" and "Z" constraints, with appropriate
signedness for printing.

llvm-svn: 64400
2009-02-12 20:58:09 +00:00
Dan Gohman
3c296f6bd0 Adjust the sizes for a few SmallVectors to reflect their usage.
llvm-svn: 64381
2009-02-12 17:29:01 +00:00
Chris Lattner
4e2ed3e5e7 make fast isel fall back to selectiondags for VLA llvm.declare intrinsics.
llvm-svn: 64379
2009-02-12 17:23:20 +00:00
Evan Cheng
91c27ec711 It's (currently) not safe to keep certain physical registers live across basic blocks, e.g. x86 fp stack registers.
llvm-svn: 64374
2009-02-12 10:32:17 +00:00
Evan Cheng
521b8b5ef3 Oops. Last second clean up messed things up.
llvm-svn: 64373
2009-02-12 09:52:13 +00:00
Evan Cheng
04558ecc90 If availability info is kept when fallthrough into a bb, add the available registers to live-in set.
llvm-svn: 64372
2009-02-12 09:43:23 +00:00
Evan Cheng
19a1ba3680 Replace one of burr scheduling heuristic with something more sensible. Now calcMaxScratches simply compute the number of true data dependencies. This actually improve a couple of tests in dejagnu suite as many tests in llvm nightly test suite.
llvm-svn: 64369
2009-02-12 08:59:45 +00:00
Evan Cheng
66989a9108 Apparently some MachineBasicBlock's don't have corresponding llvm basic blocks.
llvm-svn: 64340
2009-02-11 23:42:39 +00:00
Evan Cheng
a34255f910 Remove a bogus assertion. It's possible a live-in available value is used by a previous instruction.
llvm-svn: 64339
2009-02-11 23:41:57 +00:00
Dan Gohman
c4f5d4d35d Fix a comment.
llvm-svn: 64328
2009-02-11 21:32:08 +00:00
Dan Gohman
d252329703 Don't use special heuristics for nodes with no data predecessors
unless they actually have data successors, and likewise for nodes
with no data successors unless they actually have data precessors.

llvm-svn: 64327
2009-02-11 21:29:39 +00:00
Dan Gohman
35db81715f Delete the heuristic for non-livein CopyFromReg nodes. Non-liveinness
is determined by whether the node has a Flag operand. However, if the
node does have a Flag operand, it will be glued to its register's
def, so the heuristic would end up spuriously applying to whatever
node is the def.

llvm-svn: 64319
2009-02-11 20:25:59 +00:00
Dale Johannesen
f367ef04af Make a transformation added in 63266 a bit less aggressive.
It was transforming (x&y)==y to (x&y)!=0 in the case where
y is variable and known to have at most one bit set (e.g. z&1).
This is not correct; the expressions are not equivalent when y==0.
I believe this patch salvages what can be salvaged, including
all the cases in bt.ll.  Dan, please review.
Fixes gcc.c-torture/execute/20040709-[12].c

llvm-svn: 64314
2009-02-11 19:19:41 +00:00
Evan Cheng
cfa084930b Implement PR3495: local spiller optimization. The local spiller can now keep availability information over BB boundaries. It visits BB's in depth first order. After visiting a BB if it find a successor which has a single predecessor it visits the successor next without clearing the availability information. This allows the successor to omit reloads or change them into copies.
llvm-svn: 64298
2009-02-11 08:24:21 +00:00
Dan Gohman
7e48e82adb When scheduling a block in parts, keep track of the overall
instruction index across each part. Instruction indices are used
to make live range queries, and live ranges can extend beyond
scheduling region boundaries.

Refactor the ScheduleDAGSDNodes class some more so that it
doesn't have to worry about this additional information.

llvm-svn: 64288
2009-02-11 04:27:20 +00:00
Dan Gohman
d5561e2f28 Use iterators to iterate through the Preds array instead of
an index. This code is on the hot-path because the current
way SDep edges are uniqued has quadratic complexity.

llvm-svn: 64262
2009-02-11 00:12:28 +00:00
Dan Gohman
0da8292c67 Consider any instruction that modifies the stack pointer to be
a scheduling region boundary.  This isn't necessary for
correctness; it helps with compile time, as it avoids the need
for data- and anti-dependencies from all spills and reloads on
the stack-pointer modification.

llvm-svn: 64255
2009-02-10 23:29:38 +00:00
Dan Gohman
f2b9543ee5 Factor out more code for computing register live-range informationfor
scheduling, and generalize is so that preserves state across
scheduling regions. This fixes incorrect live-range information around
terminators and labels, which are effective region boundaries.

In place of looking for terminators to anchor inter-block dependencies,
introduce special entry and exit scheduling units for this purpose.

llvm-svn: 64254
2009-02-10 23:27:53 +00:00
Evan Cheng
5be1afd928 Fix PR3457: Ignore control successors when looking for closest scheduled successor. A control successor doesn't read result(s) produced by the scheduling unit being evaluated.
llvm-svn: 64210
2009-02-10 08:30:11 +00:00
Devang Patel
0cb3e1c047 Validate file id.
llvm-svn: 64204
2009-02-10 06:04:08 +00:00
Evan Cheng
acd0fd545d If the target cannot issue a copy for the given source and dest registers, abort instead of silently continue.
llvm-svn: 64184
2009-02-09 22:47:36 +00:00
Evan Cheng
773303a763 Simplify code.
llvm-svn: 64164
2009-02-09 21:01:06 +00:00
Evan Cheng
44e58653af Make sure constant subscript is truncated to ptr size if it may not fit.
llvm-svn: 64163
2009-02-09 20:54:38 +00:00
Evan Cheng
3f98669da2 Re-enable machine sinking pass now that the coalescer bugs and the AnalyzeBrnach bug are fixed.
llvm-svn: 64126
2009-02-09 08:45:39 +00:00
Evan Cheng
2a6fc3cd40 Fix another case ShortenDeadCopySrcLiveRange is shortening too much. No test case possible since I don't know what to grep for. :-(
llvm-svn: 64125
2009-02-09 08:37:45 +00:00
Evan Cheng
9dc1507838 Turns out AnalyzeBranch can modify the mbb being analyzed. This is a nasty
suprise to some callers, e.g. register coalescer. For now, add an parameter
that tells AnalyzeBranch whether it's safe to modify the mbb. A better
solution is out there, but I don't have time to deal with it right now.

llvm-svn: 64124
2009-02-09 07:14:22 +00:00
Evan Cheng
a7287a61fb Fix PR3486. Fix a bug in code that manually patch physical register live interval after its sub-register is coalesced with a virtual register.
llvm-svn: 64082
2009-02-08 11:04:35 +00:00
Evan Cheng
b5792305b3 Strengthen the previous check.
llvm-svn: 64076
2009-02-08 08:24:28 +00:00
Evan Cheng
d5f5c0660b r64073 commit message is lost. Here it is:
Right now if the coalesced copy def is dead and its src is a kill, and that
there are now other uses within the live range, the coalescer would mark the
def of the source register as dead. But it should also check if there are
other kills which means the value has other uses not in the live range.

llvm-svn: 64075
2009-02-08 08:00:36 +00:00
Evan Cheng
7d46312873 (no commit message)
llvm-svn: 64073
2009-02-08 07:48:37 +00:00
Bill Wendling
4ed0306d6f Revert r63999. It was breaking self-hosting builds.
llvm-svn: 64062
2009-02-08 00:58:05 +00:00
Chris Lattner
eb06f05949 Add missing break statements, fixing PR3503.
llvm-svn: 64040
2009-02-07 22:37:06 +00:00
Dale Johannesen
b22cb23f6f Use getDebugLoc forwarder instead of getNode()->getDebugLoc.
No functional change.

llvm-svn: 64026
2009-02-07 19:59:05 +00:00
Dan Gohman
4105a38248 Constify TargetInstrInfo::EmitInstrWithCustomInserter, allowing
ScheduleDAG's TLI member to use const.

llvm-svn: 64018
2009-02-07 16:15:20 +00:00
Dale Johannesen
4fc8a5c0b5 Make SDNode constructors take a DebugLoc always.
Adjust derived classes to pass UnknownLoc where
a DebugLoc does not make sense.  Pick one of
DebugLoc and non-DebugLoc variants to survive
for all such classes.

llvm-svn: 64000
2009-02-07 02:15:05 +00:00
Evan Cheng
62694a52fe Enable machine sinking pass in non-fast mode.
llvm-svn: 63999
2009-02-07 01:57:46 +00:00
Dale Johannesen
71d758eead Remove now-unused constructors.
llvm-svn: 63995
2009-02-07 01:27:09 +00:00
Evan Cheng
cf71da05b0 Don't sink the instruction if TargetRegisterInfo::isSafeToMoveRegClassDefs doesn't think it's safe. This works around PR1911.
llvm-svn: 63994
2009-02-07 01:21:47 +00:00
Dale Johannesen
a259483aae Get rid of the last non-DebugLoc versions of getNode!
Many targets build placeholder nodes for special operands, e.g.
GlobalBaseReg on X86 and PPC for the PIC base.  There's no
sensible way to associate debug info with these.  I've left
them built with getNode calls with explicit DebugLoc::getUnknownLoc operands. 
I'm not too happy about this but don't see a good improvement;
I considered adding a getPseudoOperand or something, but it
seems to me that'll just make it harder to read.

llvm-svn: 63992
2009-02-07 00:55:49 +00:00
Dale Johannesen
1580ab6b7f Remove more non-DebugLoc getNode variants. Use
getCALLSEQ_{END,START} to permit passing no DebugLoc
there.  UNDEF doesn't logically have DebugLoc; add
getUNDEF to encapsulate this.

llvm-svn: 63978
2009-02-06 23:05:02 +00:00
Dale Johannesen
f9268f8523 And one more file.
llvm-svn: 63971
2009-02-06 21:55:48 +00:00
Dale Johannesen
c405486235 Remove more non-DebugLoc versions of getNode.
llvm-svn: 63969
2009-02-06 21:50:26 +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
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
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
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
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
Dale Johannesen
b218273a7a Remove 3 non-DebugLoc variants of getNode.
llvm-svn: 63886
2009-02-05 21:20:44 +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
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
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
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
Evan Cheng
04be5342b1 Skip over zero registers.
llvm-svn: 63748
2009-02-04 18:18: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
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
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
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
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
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
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
Devang Patel
8c076d8328 Remove dead code.
llvm-svn: 63653
2009-02-03 19:46:28 +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
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
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
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
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
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
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
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
Dale Johannesen
5b1a213918 Commit missing files.
llvm-svn: 63545
2009-02-02 20:47:48 +00:00
Dale Johannesen
8883285060 More DebugLoc propagation.
llvm-svn: 63543
2009-02-02 20:41:04 +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
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
Mon P Wang
82e6b51c19 Preserve more SourceValue information.
llvm-svn: 63498
2009-02-02 06:37:55 +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
Dale Johannesen
4956419c77 DebugLoc propagation.
llvm-svn: 63488
2009-01-31 22:04:51 +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
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
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
Dale Johannesen
067e8ef08f Move CurDebugLoc into SelectionDAGLowering.
llvm-svn: 63468
2009-01-31 02:22:37 +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
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
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
Dan Gohman
50283ce80b Fix a post-RA scheduling dependency bug.
If a MachineInstr doesn't have a memoperand but has an opcode that
is known to load or store, assume its memory reference may alias
*anything*, including stack slots which the compiler completely
controls.

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

llvm-svn: 63370
2009-01-30 02:49:14 +00:00