Commit Graph

6690 Commits

Author SHA1 Message Date
Bill Wendling
14a2e1eda0 Temporarily revert r65065. It was causing test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:57:07 +00:00
Bill Wendling
b5ef273757 Print out debug info when printing the machine instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:44:55 +00:00
Bill Wendling
490359d687 Check for -fast here too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:23:54 +00:00
Bill Wendling
dfdacee2ab Generate these labels when we're in "fast" mode, not simply when we're no in
"optimize-for-size" mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:12:54 +00:00
Devang Patel
f2ec7e4a20 The subprogram die may not exist while creating "default" scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 17:29:38 +00:00
Nate Begeman
d6b7a242d3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 08:31:02 +00:00
Dan Gohman
865f006bb4 Eliminate several more unnecessary intptr_t casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 05:09:16 +00:00
Devang Patel
13319ceffd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 22:43:44 +00:00
Scott Michel
fdc40a0a69 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.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 22:15:04 +00:00
Devang Patel
36375ee7a5 Emit debug info for bitfields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 21:23:59 +00:00
Evan Cheng
bf18939180 A couple of places where reused use operands should be marked kill. This is exposed by recent availability fallthrough changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 06:41:03 +00:00
Bill Wendling
86e6cb924b --- 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 01:04:54 +00:00
Dan Gohman
97d116346c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 23:59:32 +00:00
Evan Cheng
b599979ab5 Fix PR3522. It's not safe to sink into landing pad BB's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 08:36:12 +00:00
Cedric Venet
aff9c270de 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 16:06:42 +00:00
Bill Wendling
92c1e12647 Revert this. It was breaking stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:16:35 +00:00
Bill Wendling
54fc7d6714 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:01:04 +00:00
Dale Johannesen
78e3e521cd 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 20:58:09 +00:00
Dan Gohman
4ed76e76bb Adjust the sizes for a few SmallVectors to reflect their usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 17:29:01 +00:00
Chris Lattner
14c4c1ec0e make fast isel fall back to selectiondags for VLA llvm.declare intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 17:23:20 +00:00
Evan Cheng
8679119f4b It's (currently) not safe to keep certain physical registers live across basic blocks, e.g. x86 fp stack registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 10:32:17 +00:00
Evan Cheng
f2b14715d1 Oops. Last second clean up messed things up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 09:52:13 +00:00
Evan Cheng
6d209c413e If availability info is kept when fallthrough into a bb, add the available registers to live-in set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 09:43:23 +00:00
Evan Cheng
8182347d70 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 08:59:45 +00:00
Evan Cheng
f412f7c417 Apparently some MachineBasicBlock's don't have corresponding llvm basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 23:42:39 +00:00
Evan Cheng
ce7f5a1e50 Remove a bogus assertion. It's possible a live-in available value is used by a previous instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 23:41:57 +00:00
Dan Gohman
c7fa16f782 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 21:32:08 +00:00
Dan Gohman
c8db34cb07 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 21:29:39 +00:00
Dan Gohman
cc994ea36b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:25:59 +00:00
Dale Johannesen
85b0edec46 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 19:19:41 +00:00
Evan Cheng
752272a5e5 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64298 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 08:24:21 +00:00
Dan Gohman
47ac0f0c7c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64288 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 04:27:20 +00:00
Dan Gohman
5cffa6fe27 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 00:12:28 +00:00
Dan Gohman
bed353d016 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 23:29:38 +00:00
Dan Gohman
9e64bbb322 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 23:27:53 +00:00
Evan Cheng
f0e366a929 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 08:30:11 +00:00
Devang Patel
2303df96b0 Validate file id.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 06:04:08 +00:00
Evan Cheng
4ded02f8bd If the target cannot issue a copy for the given source and dest registers, abort instead of silently continue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 22:47:36 +00:00
Evan Cheng
65b52dffe0 Simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 21:01:06 +00:00
Evan Cheng
b1032a8a2f Make sure constant subscript is truncated to ptr size if it may not fit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 20:54:38 +00:00
Evan Cheng
8f0d99e463 Re-enable machine sinking pass now that the coalescer bugs and the AnalyzeBrnach bug are fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 08:45:39 +00:00
Evan Cheng
190424edcd Fix another case ShortenDeadCopySrcLiveRange is shortening too much. No test case possible since I don't know what to grep for. :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 08:37:45 +00:00
Evan Cheng
dc54d317e7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 07:14:22 +00:00
Evan Cheng
0a1fcce092 Fix PR3486. Fix a bug in code that manually patch physical register live interval after its sub-register is coalesced with a virtual register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 11:04:35 +00:00
Evan Cheng
86fb9fdb20 Strengthen the previous check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 08:24:28 +00:00
Evan Cheng
f18134a1ae 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 08:00:36 +00:00
Evan Cheng
77fde2cbb1 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64073 91177308-0d34-0410-b5e6-96231b3b80d8 2009-02-08 07:48:37 +00:00
Bill Wendling
7f51fd3ea9 Revert r63999. It was breaking self-hosting builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 00:58:05 +00:00
Chris Lattner
556b4a6385 Add missing break statements, fixing PR3503.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 22:37:06 +00:00
Dale Johannesen
6f38cb61a9 Use getDebugLoc forwarder instead of getNode()->getDebugLoc.
No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 19:59:05 +00:00